Sha256: 30750e7e8e54b1c3fe0f4c8df3c507e86c6c4ca1c0a3124eaf54ff0a445fadca

Contents?: true

Size: 949 Bytes

Versions: 14

Compression:

Stored size: 949 Bytes

Contents

module Bones
class App

class UpdateCommand < Command

  def run( args )
    parse args

    raise "'#{output_dir}' does not exist" unless test(?e, output_dir)
    copy_tasks(File.join(output_dir, 'tasks'))

    msg = "Updated tasks in directory '#{output_dir}'"
    @out.puts msg
  end

  def parse( args )
    std_opts = standard_options

    opts = OptionParser.new
    opts.banner = 'Usage: bones update <directory>'

    opts.separator ''
    opts.separator '  Copy the Mr Bones rake tasks into the project directory'

    opts.separator ''
    opts.separator '  Common Options:'
    opts.on_tail( '-h', '--help', 'show this message' ) {
      @out.puts opts
      exit
    }

    # parse the command line arguments
    opts.parse! args
    options[:output_dir] = args.empty? ? nil : args.join('_')

    if output_dir.nil?
      @out.puts opts
      exit 1
    end
  end

end  # class CreateCommand
end  # class App
end  # module Bones

# EOF

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
TwP-bones-2.3.0 lib/bones/app/update_command.rb
TwP-bones-2.4.0 lib/bones/app/update_command.rb
TwP-bones-2.4.1 lib/bones/app/update_command.rb
TwP-bones-2.4.2 lib/bones/app/update_command.rb
TwP-bones-2.5.0 lib/bones/app/update_command.rb
TwP-bones-2.5.1 lib/bones/app/update_command.rb
bones-2.3.0 lib/bones/app/update_command.rb
bones-2.3.1 lib/bones/app/update_command.rb
bones-2.2.0 lib/bones/app/update_command.rb
bones-2.4.2 lib/bones/app/update_command.rb
bones-2.5.0 lib/bones/app/update_command.rb
bones-2.4.1 lib/bones/app/update_command.rb
bones-2.5.1 lib/bones/app/update_command.rb
bones-2.4.0 lib/bones/app/update_command.rb