Class: Muwu::Controller
- Inherits:
-
Object
show all
- Includes:
- Muwu
- Defined in:
- lib/muwu/controller/controller.rb
Constant Summary
Constants included
from Muwu
GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION
Instance Method Summary
collapse
Methods included from Muwu
debug, read
Constructor Details
#initialize(current_working_directory) ⇒ Controller
Returns a new instance of Controller.
8
9
10
11
|
# File 'lib/muwu/controller/controller.rb', line 8
def initialize(current_working_directory)
@current_working_directory = File.absolute_path(current_working_directory)
@project = nil
end
|
Instance Method Details
#compile ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/muwu/controller/controller.rb', line 18
def compile
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderHtml.new(@project).render_all
end
end
|
#compile_css ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/muwu/controller/controller.rb', line 28
def compile_css
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderHtml.new(@project).render_css_only
end
end
|
#compile_html ⇒ Object
48
49
50
51
52
53
54
55
|
# File 'lib/muwu/controller/controller.rb', line 48
def compile_html
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderHtml.new(@project).render_html_only
end
end
|
#compile_html_by_index(index) ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'lib/muwu/controller/controller.rb', line 38
def compile_html_by_index(index)
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderHtml.new(@project).render_html_by_index(index)
end
end
|
#compile_js ⇒ Object
58
59
60
61
62
63
64
65
|
# File 'lib/muwu/controller/controller.rb', line 58
def compile_js
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderHtml.new(@project).render_js_only
end
end
|
#concat ⇒ Object
68
69
70
71
72
73
74
75
|
# File 'lib/muwu/controller/controller.rb', line 68
def concat
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderConcat.new(@project).render
end
end
|
#inspect ⇒ Object
78
79
80
81
82
83
84
85
|
# File 'lib/muwu/controller/controller.rb', line 78
def inspect
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
RenderInspector.new(@project).render_inspector
end
end
|
#publish(args) ⇒ Object
95
96
97
98
99
100
101
102
|
# File 'lib/muwu/controller/controller.rb', line 95
def publish(args)
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
Publish.new(@project, args: args).up
end
end
|
#reset_css ⇒ Object
117
118
119
120
121
122
123
124
|
# File 'lib/muwu/controller/controller.rb', line 117
def reset_css
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
elsif ControllerInteraction.new.confirm_reset_css(@project)
ProjectResetCss.new(@project).reset_css
end
end
|
#sync_pull(args) ⇒ Object
127
128
129
130
131
132
133
134
|
# File 'lib/muwu/controller/controller.rb', line 127
def sync_pull(args)
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
Sync.new(@project, args: args).pull
end
end
|
#sync_push(args) ⇒ Object
137
138
139
140
141
142
143
144
|
# File 'lib/muwu/controller/controller.rb', line 137
def sync_push(args)
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
Sync.new(@project, args: args).push
end
end
|
#view ⇒ Object
147
148
149
150
151
152
153
154
|
# File 'lib/muwu/controller/controller.rb', line 147
def view
@project = read_project_from_current_working_directory
if @project.does_not_have_crucial_files
reply_folder_does_not_have_valid_project
else
Viewer.new(@project)
end
end
|