1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

feature #450: new Gemfile and installation helper script

This commit is contained in:
Javi Fontan 2011-07-12 15:22:17 +02:00
parent c24b90f200
commit 439df29713
2 changed files with 95 additions and 1 deletions

View File

@ -29,6 +29,35 @@ group :cloud do
gem 'thin', '1.2.7'
gem 'uuid'
gem 'curb'
gem 'sqlite3-ruby'
end
group :ozones_client do
gem 'json', '= 1.5.1'
end
group :ozones_server do
gem 'json', '= 1.5.1'
gem 'datamapper'
gem 'dm-sqlite-adapter'
gem 'dm-mysql-adapter'
end
group :ozones_server_mysql do
gem 'json', '= 1.5.1'
gem 'datamapper'
gem 'dm-mysql-adapter'
end
group :ozones_server_sqlite do
gem 'json', '= 1.5.1'
gem 'datamapper'
gem 'dm-sqlite-adapter'
end
group :dummy do
gem 'rake'
end

65
share/bundler/install_gems Executable file
View File

@ -0,0 +1,65 @@
#!/usr/bin/env ruby
PACKAGES=%w{optional sunstone quota cloud ozones_client ozones_server
ozones_server_mysql ozones_server_sqlite}
DEFAULT=%w{optional sunstone quota cloud ozones_server}
class String
def unindent(spaces=4)
self.gsub!(/^ {#{spaces}}/, '')
end
end
def try_library(name, error_message)
begin
require name.to_s
rescue LoadError
STDERR.puts error_message
exit -1
end
end
try_library :rubygems, <<-EOT.unindent
rubygems required to use this tool
Use one of these methods:
* Debian/Ubuntu
apt-get install rubygems libopenssl-ruby
* RHEL/CENTOS
yum install rubygems
* Specific rubygems package for your distro
* Follow the instructions from http://rubygems.org/pages/download
EOT
try_library :bundler, <<-EOT.unindent
bundler needed to install gems
execute this to install it:
[sudo] gem install bundler
EOT
if ARGV.length>0
packages=ARGV
else
packages=DEFAULT
end
no_packages=PACKAGES-packages
no_packages<<'dummy'
without="--without #{no_packages.join(' ')}"
command_string = "bundle #{without}"
puts command_string
#system command_string