Class: ErpDevSvcs::Commands::BuildGems
- Inherits:
-
Object
- Object
- ErpDevSvcs::Commands::BuildGems
- Defined in:
- lib/erp_dev_svcs/commands/build_gems.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ BuildGems
constructor
A new instance of BuildGems.
Constructor Details
#initialize ⇒ BuildGems
Returns a new instance of BuildGems.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/erp_dev_svcs/commands/build_gems.rb', line 12 def initialize = {:install => false, :gems => nil} opt_parser = OptionParser.new do |opt| opt. = "Usage: compass-util build_gems [OPTIONS]" opt.on("-g", "--gems [GEMLIST]", Array, "List of gems to build; defaults to all") {|gem| [:gems] = gem} opt.on("-i", "--install",nil, "Install the gem locally after it's built") do |x| [:install] = true end opt.on("-n", "--no-docs",nil, "Use --no-ri --no-rdoc") do |x| [:no_docs] = true end opt.on_tail("-h", "--help", "Show this message") do puts opt exit end end opt_parser.parse! ErpDevSvcs::Commands::Helper.exec_in_engines([:gems]) do |engine_name| old_gem_files = Dir.glob("*.gem") old_gem_files.each {|x| File.delete(x); puts "\nDeleting old gem: #{x}"} puts "Starting build of #{engine_name}" build_result = %x[gem build #{engine_name}.gemspec] puts build_result if [:install] gem_file = Dir.glob("*.gem") puts "Installing #{gem_file[0]}..." install_result = if [:no_docs] %x[gem install #{gem_file[0]} --no-ri --no-rdoc] else %x[gem install #{gem_file[0]}] end puts install_result end puts "\n" end end |
Class Method Details
.execute ⇒ Object
8 9 10 |
# File 'lib/erp_dev_svcs/commands/build_gems.rb', line 8 def self.execute new() end |