Class: Ing::Commands::Setup

Inherits:
Generator show all
Defined in:
lib/ing/commands/setup.rb

Instance Attribute Summary

Attributes inherited from Task

#options, #shell

Instance Method Summary collapse

Methods inherited from Generator

#destination_root, #initialize, #source_root

Methods included from Files

#action, #append_to_file, #chmod, #comment_lines, #copy_file, #create_file, #create_link, #current_destination, #directory, #empty_directory, #find_in_source_paths, #force?, #get, #gsub_file, #in_root, #inject_into_class, #insert_into_file, #inside, #link_file, #prepend_to_file, #pretend?, #quiet?, #relative_to_original_destination_root, #remove_file, #revoke?, #skip?, #template, #uncomment_lines, #verbose?

Methods inherited from Task

all_options, #ask_unless_given, #ask_unless_given!, default, desc, desc_lines, inherited, inherited_option?, #initialize, modify_option, opt, option?, options, specify_options, usage, usage_lines, #validate_option, #validate_option_exists

Constructor Details

This class inherits a constructor from Ing::Generator

Instance Method Details

#callObject

note manual shell setup because ‘ing setup` is not routed through `ing implicit` (boot)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ing/commands/setup.rb', line 18

def call
  setup_shell unless shell
  in_root do
    create_file     'ing.rb', <<_____
# Ing tasks
# Store your tasks in ./tasks and they will be available to `ing`.
# Or simply overwrite this file.

Dir[File.expand_path("tasks/**/*.rb", File.dirname(__FILE__))].each do |rb|
  load rb
end

_____
    empty_directory 'tasks'
  end
end

#initial_options(given) ⇒ Object



9
10
11
12
13
# File 'lib/ing/commands/setup.rb', line 9

def initial_options(given)
  given[:dest]   ||= Dir.pwd
  given[:source] ||= File.dirname(__FILE__)
  given
end