Class: RubyRaider

Inherits:
Thor
  • Object
show all
Defined in:
lib/ruby_raider.rb

Instance Method Summary collapse

Instance Method Details

#browser(default_browser) ⇒ Object



77
78
79
# File 'lib/ruby_raider.rb', line 77

def browser(default_browser)
  Utilities.new.browser = default_browser
end

#feature(name) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/ruby_raider.rb', line 35

def feature(name)
  path = options[:path].nil? ? load_config_path('feature') : options[:path]
  if options[:delete]
    Scaffolding.new([name, path]).delete_feature
  else
    Scaffolding.new([name, path]).generate_feature
  end
end

#new(project_name) ⇒ Object



10
11
12
# File 'lib/ruby_raider.rb', line 10

def new(project_name)
  MenuGenerator.generate_choice_menu(project_name)
end

#page(name) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/ruby_raider.rb', line 20

def page(name)
  path = options[:path].nil? ? load_config_path('page') : options[:path]
  if options[:delete]
    Scaffolding.new([name, path]).delete_class
  else
    Scaffolding.new([name, path]).generate_class
  end
end

#path(default_path) ⇒ Object



64
65
66
67
# File 'lib/ruby_raider.rb', line 64

def path(default_path)
  type = options.empty? ? 'page' : options.keys.first
  Utilities.new.send("#{type}_path=", default_path)
end

#raidObject



83
84
85
# File 'lib/ruby_raider.rb', line 83

def raid
  Utilities.new.run
end

#spec(name) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/ruby_raider.rb', line 50

def spec(name)
  path = options[:path].nil? ? load_config_path('spec') : options[:path]
  if options[:delete]
    Scaffolding.new([name, path]).delete_spec
  else
    Scaffolding.new([name, path]).generate_spec
  end
end

#url(default_url) ⇒ Object



71
72
73
# File 'lib/ruby_raider.rb', line 71

def url(default_url)
  Utilities.new.url = default_url
end