Sha256: 25d19ff54c7ae51f739053500465988570defb9578866e4254763a57cccc98bb

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

module Depengine
  module CLI
    class << self

      def run(args, input = $stdin, output = $stdout, error = $stderr) #:nodoc:

        @deploy_home = '.'
        @recipe_name = 'recipe/deploy.rb'

        args.options do |o|
          o.banner = "Usage: #{File.basename($0)} [options]"
          o.separator ""
          o.on('-h', '--deployhome [DIRNAME]', 'Home of deployments.') do |dname|
            set :deploy_home, dname
          end
          o.on('-r', '--recipe [FILENAME]', 'Filename of the recipe.') do |fname|
            @recipe_name = fname
          end
          o.on('-e', '--env [ENVNAME]', 'Environment name.') do |ename|
            set :env, ename
          end
          o.on('-v', '--version [VERSION]', 'Version.') do |vname|
            set :version, vname
          end
          o.parse!
        end
        # unless args.size == 2
        #   error << args.options
        #   return 127
        # end

        recipe_filename = File.join($recipe_config[:deploy_home],  @recipe_name)
        puts "Using recipe #{recipe_filename}"
        eval(File.new(recipe_filename).read)
        return 0
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
depengine-0.0.18 lib/depengine/cli.rb
depengine-0.0.17 lib/depengine/cli.rb
depengine-0.0.16 lib/depengine/cli.rb
depengine-0.0.15 lib/depengine/cli.rb
depengine-0.0.14 lib/depengine/cli.rb
depengine-0.0.13 lib/depengine/cli.rb
depengine-0.0.12 lib/depengine/cli.rb
depengine-0.0.11 lib/depengine/cli.rb
depengine-0.0.10 lib/depengine/cli.rb
depengine-0.0.9 lib/depengine/cli.rb