Sha256: e24122870612882e8e5b6511fb27a7bfbe3d0f67789ae7e8cebfeab5ad8eb722

Contents?: true

Size: 1.12 KB

Versions: 52

Compression:

Stored size: 1.12 KB

Contents

# -*- encoding : utf-8 -*-
require "optparse"

module Decko
  module Commands
    class RakeCommand
      class Parser < OptionParser
        def initialize command, opts
          super() do |parser|
            parser.banner = "Usage: decko #{command} [options]\n\n" \
                          "Run decko:#{command} task on the production "\
                          " database specified in config/database.yml\n\n"
            parser.on("--production", "-p",
                      "#{command} production database (default)") do
              opts[:envs] = ["production"]
            end
            parser.on("--test", "-t",
                      "#{command} test database") do
              opts[:envs] = ["test"]
            end
            parser.on("--development", "-d",
                      "#{command} development database") do
              opts[:envs] = ["development"]
            end
            parser.on("--all", "-a",
                      "#{command} production, test, and development database") do
              opts[:envs] = %w(production development test)
            end
          end
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
decko-0.11.4 lib/decko/commands/rake_command/parser.rb
decko-0.11.3 lib/decko/commands/rake_command/parser.rb
decko-0.11.2 lib/decko/commands/rake_command/parser.rb
decko-0.11.1 lib/decko/commands/rake_command/parser.rb
decko-0.11.0 lib/decko/commands/rake_command/parser.rb
decko-0.10.0 lib/decko/commands/rake_command/parser.rb
decko-0.9.6 lib/decko/commands/rake_command/parser.rb
decko-0.9.5 lib/decko/commands/rake_command/parser.rb
decko-0.9.4 lib/decko/commands/rake_command/parser.rb
decko-0.9.3 lib/decko/commands/rake_command/parser.rb
decko-0.9.2 lib/decko/commands/rake_command/parser.rb
decko-0.9.1 lib/decko/commands/rake_command/parser.rb
decko-0.9.0 lib/decko/commands/rake_command/parser.rb
decko-0.8.3 lib/decko/commands/rake_command/parser.rb
decko-0.8.2 lib/decko/commands/rake_command/parser.rb
decko-0.8.1 lib/decko/commands/rake_command/parser.rb
decko-0.8.0 lib/decko/commands/rake_command/parser.rb
decko-0.7.0 lib/decko/commands/rake_command/parser.rb
decko-0.7.0.pre lib/decko/commands/rake_command/parser.rb
decko-0.6.8 lib/decko/commands/rake_command/parser.rb