Class: Starter
- Inherits:
-
Thor
show all
- Includes:
- Odin, Thor::Actions
- Defined in:
- lib/r4/starter.rb
Instance Method Summary
collapse
Methods included from Odin
#bundle, #concat, #content, #cp, #cp_template, #file, #git, #gsub, #rails, #rake, #rm, #sub
Constructor Details
#initialize(*args) ⇒ Starter
Returns a new instance of Starter.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/r4/starter.rb', line 9
def initialize(*args)
super
if ARGV[0] =~ /new/
@dir = `pwd`.gsub("\n", '')
elsif ARGV[0] =~ /add/
if yes? 'Are you in right folder of your app?'
@project_path = `pwd`.gsub("\n", '')
@project_name = @project_path.split('/').last
@project_label = @project_name.capitalize.gsub('_', ' ')
else
say 'Get to proper directory', :red
abort
end
end
end
|
Instance Method Details
#add_best_in_place ⇒ Object
83
84
85
86
|
# File 'lib/r4/starter.rb', line 83
def add_best_in_place
say 'Not ready yet!', :red
end
|
#add_datatables ⇒ Object
66
67
68
69
|
# File 'lib/r4/starter.rb', line 66
def add_datatables
say 'Not ready yet!', :red
end
|
#add_exception_notification ⇒ Object
72
73
74
|
# File 'lib/r4/starter.rb', line 72
def add_exception_notification
apply 'recipes/exception_notification.rb'
end
|
#add_lazy_charts ⇒ Object
61
62
63
|
# File 'lib/r4/starter.rb', line 61
def add_lazy_charts
apply 'recipes/lazy_high_charts.rb'
end
|
#add_mail_gem ⇒ Object
89
90
91
92
|
# File 'lib/r4/starter.rb', line 89
def add_mail_gem
say 'Not ready yet!', :red
end
|
#add_skylight ⇒ Object
77
78
79
80
|
# File 'lib/r4/starter.rb', line 77
def add_skylight
say 'Not ready yet!', :red
end
|
#add_wicked_pdf ⇒ Object
51
52
53
|
# File 'lib/r4/starter.rb', line 51
def add_wicked_pdf
apply 'recipes/wicked_pdf.rb'
end
|
#add_xlsx_support ⇒ Object
56
57
58
|
# File 'lib/r4/starter.rb', line 56
def add_xlsx_support
apply 'recipes/xlsx_support.rb'
end
|
#new(project_name) ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/r4/starter.rb', line 33
def new project_name
@project_name = project_name
run "rails new #{@project_name} -T --skip-bundle"
@project_path = "#{@dir}/#{@project_name}"
@project_label = @project_name.capitalize.gsub('_', ' ')
Dir.chdir @project_path
unless options[:type]
apply 'installations/default.rb'
else
apply "installations/#{options[:type]}.rb"
end
end
|