18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/rails/generators/opalla/install_generator.rb', line 18
def create_basic_files
create_file js('application.rb'), <<~APPLICATION
require 'opalla'
require_tree './lib'
require_tree './models'
require_tree './collections'
require_tree './components'
require_tree './controllers'
require_tree './views'
Document.ready? do
Opalla::Router.start
end
APPLICATION
delete_appjs = ask %q{
I've just created the main app file (application.rb)
Should I just delete your application.js, since you won't need it anymore?
(If you say no, please be sure to remove it later, ok?)
[Y/n]
}
remove_file(js('application.js')) if delete_appjs == 'Y'
create_file js('components/application_component.rb'), <<~COMPONENT
class ApplicationComponent < Opalla::Component
# Code shared between all components go here
end
COMPONENT
create_file js('controllers/application_controller.rb'), <<~CONTROLLER
class ApplicationController < Opalla::Controller
# Code shared between all controllers go here
end
CONTROLLER
end
|