isomorfeus-installer 1.0.0.delta1 → 1.0.0.delta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/bin/isomorfeus +8 -122
- data/lib/isomorfeus/installer/cli.rb +26 -0
- data/lib/isomorfeus/installer/databases/arangodb.rb +4 -1
- data/lib/isomorfeus/installer/databases/mysql.rb +18 -2
- data/lib/isomorfeus/installer/databases/neo4j.rb +7 -2
- data/lib/isomorfeus/installer/databases/postgresql.rb +18 -2
- data/lib/isomorfeus/installer/databases/sqlite.rb +22 -0
- data/lib/isomorfeus/installer/new_project.rb +56 -0
- data/lib/isomorfeus/installer/options_mangler.rb +49 -0
- data/lib/isomorfeus/installer/other_modules.rb +11 -0
- data/lib/isomorfeus/installer/rack_servers.rb +19 -0
- data/{Gemfile → lib/isomorfeus/installer/templates/.gitkeep.erb} +0 -0
- data/lib/isomorfeus/installer/templates/Gemfile.erb +18 -8
- data/lib/isomorfeus/installer/templates/Procfile.erb +2 -2
- data/lib/isomorfeus/installer/templates/ProcfileDebug.erb +2 -0
- data/lib/isomorfeus/installer/templates/actioncable/actioncable_ru.erb +3 -0
- data/lib/isomorfeus/installer/templates/app.rb.erb +35 -0
- data/lib/isomorfeus/installer/templates/app_loader.rb.erb +13 -0
- data/lib/isomorfeus/installer/{spectre.rb → templates/application.css.erb} +0 -0
- data/lib/isomorfeus/installer/templates/application.js.erb +15 -23
- data/lib/isomorfeus/installer/templates/application_common.js.erb +23 -0
- data/lib/isomorfeus/installer/templates/application_debug.js.erb +9 -0
- data/lib/isomorfeus/installer/templates/application_ssr.js.erb +18 -0
- data/lib/isomorfeus/installer/templates/application_web_worker.js.erb +5 -0
- data/lib/isomorfeus/installer/templates/config_ru.erb +3 -0
- data/lib/isomorfeus/installer/templates/isomorfeus_loader.rb.erb +11 -2
- data/lib/isomorfeus/installer/templates/isomorfeus_web_worker_loader.rb.erb +2 -0
- data/lib/isomorfeus/installer/templates/my_app.rb.erb +1 -1
- data/lib/isomorfeus/installer/templates/package.json.erb +20 -6
- data/lib/isomorfeus/installer/templates/spec_helper.rb.erb +19 -0
- data/lib/isomorfeus/installer/templates/test_spec.rb.erb +13 -0
- data/lib/isomorfeus/installer/transport_stores/redis.rb +14 -0
- data/lib/isomorfeus/installer/transports/actioncable.rb +33 -1
- data/lib/isomorfeus/installer.rb +250 -130
- data/readme.md +2 -5
- metadata +125 -30
- data/isomorfeus-installer.gemspec +0 -19
- data/lib/isomorfeus/installer/asset_bundlers/opal_webpack_loader.rb +0 -103
- data/lib/isomorfeus/installer/databases/none.rb +0 -11
- data/lib/isomorfeus/installer/frameworks/cuba.rb +0 -26
- data/lib/isomorfeus/installer/frameworks/rails.rb +0 -78
- data/lib/isomorfeus/installer/frameworks/roda.rb +0 -26
- data/lib/isomorfeus/installer/frameworks/sinatra.rb +0 -26
- data/lib/isomorfeus/installer/templates/cuba/config_ru.erb +0 -48
- data/lib/isomorfeus/installer/templates/owl/development.js.erb +0 -145
- data/lib/isomorfeus/installer/templates/owl/production.js.erb +0 -93
- data/lib/isomorfeus/installer/templates/owl/test.js.erb +0 -0
- data/lib/isomorfeus/installer/templates/rails/application.html.erb.head +0 -6
- data/lib/isomorfeus/installer/templates/rails/application.html.erb.tail +0 -6
- data/lib/isomorfeus/installer/templates/rails/application_controller.rb +0 -5
- data/lib/isomorfeus/installer/templates/rails/application_helper.rb.erb +0 -3
- data/lib/isomorfeus/installer/templates/rails/assets.rb.erb +0 -1
- data/lib/isomorfeus/installer/templates/rails/basic-react.rb +0 -453
- data/lib/isomorfeus/installer/templates/rails/index.html +0 -1
- data/lib/isomorfeus/installer/templates/rails/routes.rb +0 -5
- data/lib/isomorfeus/installer/templates/roda/config_ru.erb +0 -39
- data/lib/isomorfeus/installer/templates/sinatra/config_ru.erb +0 -38
- data/lib/isomorfeus/installer/transport.rb +0 -0
- data/lib/isomorfeus/installer/transport_store.rb +0 -0
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-installer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.delta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,6 +24,104 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: oj
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.6.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.6.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: opal-webpack-loader
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.8.3
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.8.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: thor
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.19.4
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.19.4
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: roda
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 3.19.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 3.19.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 3.8.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 3.8.0
|
27
125
|
description: Create new isomorfeus-framework applications with ease.
|
28
126
|
email: jan@kursator.de
|
29
127
|
executables:
|
@@ -31,48 +129,46 @@ executables:
|
|
31
129
|
extensions: []
|
32
130
|
extra_rdoc_files: []
|
33
131
|
files:
|
34
|
-
-
|
132
|
+
- LICENSE
|
35
133
|
- bin/isomorfeus
|
36
|
-
- isomorfeus-installer.gemspec
|
37
134
|
- lib/isomorfeus/installer.rb
|
38
|
-
- lib/isomorfeus/installer/
|
135
|
+
- lib/isomorfeus/installer/cli.rb
|
39
136
|
- lib/isomorfeus/installer/databases/arangodb.rb
|
40
137
|
- lib/isomorfeus/installer/databases/mysql.rb
|
41
138
|
- lib/isomorfeus/installer/databases/neo4j.rb
|
42
|
-
- lib/isomorfeus/installer/databases/none.rb
|
43
139
|
- lib/isomorfeus/installer/databases/postgresql.rb
|
44
|
-
- lib/isomorfeus/installer/
|
45
|
-
- lib/isomorfeus/installer/
|
46
|
-
- lib/isomorfeus/installer/
|
47
|
-
- lib/isomorfeus/installer/
|
48
|
-
- lib/isomorfeus/installer/
|
140
|
+
- lib/isomorfeus/installer/databases/sqlite.rb
|
141
|
+
- lib/isomorfeus/installer/new_project.rb
|
142
|
+
- lib/isomorfeus/installer/options_mangler.rb
|
143
|
+
- lib/isomorfeus/installer/other_modules.rb
|
144
|
+
- lib/isomorfeus/installer/rack_servers.rb
|
145
|
+
- lib/isomorfeus/installer/templates/.gitkeep.erb
|
49
146
|
- lib/isomorfeus/installer/templates/Gemfile.erb
|
50
147
|
- lib/isomorfeus/installer/templates/Procfile.erb
|
148
|
+
- lib/isomorfeus/installer/templates/ProcfileDebug.erb
|
149
|
+
- lib/isomorfeus/installer/templates/actioncable/actioncable_ru.erb
|
150
|
+
- lib/isomorfeus/installer/templates/app.rb.erb
|
151
|
+
- lib/isomorfeus/installer/templates/app_loader.rb.erb
|
152
|
+
- lib/isomorfeus/installer/templates/application.css.erb
|
51
153
|
- lib/isomorfeus/installer/templates/application.js.erb
|
52
|
-
- lib/isomorfeus/installer/templates/
|
154
|
+
- lib/isomorfeus/installer/templates/application_common.js.erb
|
155
|
+
- lib/isomorfeus/installer/templates/application_debug.js.erb
|
156
|
+
- lib/isomorfeus/installer/templates/application_ssr.js.erb
|
157
|
+
- lib/isomorfeus/installer/templates/application_web_worker.js.erb
|
158
|
+
- lib/isomorfeus/installer/templates/config_ru.erb
|
53
159
|
- lib/isomorfeus/installer/templates/isomorfeus_loader.rb.erb
|
160
|
+
- lib/isomorfeus/installer/templates/isomorfeus_web_worker_loader.rb.erb
|
54
161
|
- lib/isomorfeus/installer/templates/my_app.rb.erb
|
55
162
|
- lib/isomorfeus/installer/templates/my_component.rb.erb
|
56
|
-
- lib/isomorfeus/installer/templates/owl/development.js.erb
|
57
|
-
- lib/isomorfeus/installer/templates/owl/production.js.erb
|
58
|
-
- lib/isomorfeus/installer/templates/owl/test.js.erb
|
59
163
|
- lib/isomorfeus/installer/templates/package.json.erb
|
60
|
-
- lib/isomorfeus/installer/templates/
|
61
|
-
- lib/isomorfeus/installer/templates/
|
62
|
-
- lib/isomorfeus/installer/
|
63
|
-
- lib/isomorfeus/installer/templates/rails/application_helper.rb.erb
|
64
|
-
- lib/isomorfeus/installer/templates/rails/assets.rb.erb
|
65
|
-
- lib/isomorfeus/installer/templates/rails/basic-react.rb
|
66
|
-
- lib/isomorfeus/installer/templates/rails/index.html
|
67
|
-
- lib/isomorfeus/installer/templates/rails/routes.rb
|
68
|
-
- lib/isomorfeus/installer/templates/roda/config_ru.erb
|
69
|
-
- lib/isomorfeus/installer/templates/sinatra/config_ru.erb
|
70
|
-
- lib/isomorfeus/installer/transport.rb
|
71
|
-
- lib/isomorfeus/installer/transport_store.rb
|
164
|
+
- lib/isomorfeus/installer/templates/spec_helper.rb.erb
|
165
|
+
- lib/isomorfeus/installer/templates/test_spec.rb.erb
|
166
|
+
- lib/isomorfeus/installer/transport_stores/redis.rb
|
72
167
|
- lib/isomorfeus/installer/transports/actioncable.rb
|
73
168
|
- readme.md
|
74
169
|
homepage: http://isomorfeus.com
|
75
|
-
licenses:
|
170
|
+
licenses:
|
171
|
+
- MIT
|
76
172
|
metadata: {}
|
77
173
|
post_install_message:
|
78
174
|
rdoc_options: []
|
@@ -89,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
185
|
- !ruby/object:Gem::Version
|
90
186
|
version: 1.3.1
|
91
187
|
requirements: []
|
92
|
-
|
93
|
-
rubygems_version: 2.7.6
|
188
|
+
rubygems_version: 3.0.3
|
94
189
|
signing_key:
|
95
190
|
specification_version: 4
|
96
191
|
summary: Create new isomorfeus-framework applications with ease.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require '../version.rb'
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = 'isomorfeus-installer'
|
5
|
-
s.version = Isomorfeus::VERSION
|
6
|
-
s.author = 'Jan Biedermann'
|
7
|
-
s.email = 'jan@kursator.de'
|
8
|
-
s.homepage = 'http://isomorfeus.com'
|
9
|
-
s.summary = 'Create new isomorfeus-framework applications with ease.'
|
10
|
-
s.description = 'Create new isomorfeus-framework applications with ease.'
|
11
|
-
|
12
|
-
s.bindir = 'bin'
|
13
|
-
s.executables << 'isomorfeus'
|
14
|
-
s.files = `git ls-files`.split("\n")
|
15
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
-
s.require_paths = ['lib']
|
17
|
-
|
18
|
-
s.add_runtime_dependency 'activesupport', '~> 5.0'
|
19
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Installer
|
3
|
-
module AssetBundlers
|
4
|
-
module OpalWebpackLoader
|
5
|
-
TARGETS = %w[development.js production.js]
|
6
|
-
|
7
|
-
def self.start_command
|
8
|
-
'yarn run start'
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.script_tag(path)
|
12
|
-
"owl_script_tag('#{path}')"
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.package_scripts
|
16
|
-
<<~SCRIPTS
|
17
|
-
"scripts": {
|
18
|
-
"start": "bundle exec opal-webpack-compile-server start webpack-dev-server --config #{development_js_path}",
|
19
|
-
"build": "bundle exec opal-webpack-compile-server start webpack --config=#{production_js_path}"
|
20
|
-
},
|
21
|
-
SCRIPTS
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.development_js_path
|
25
|
-
if Isomorfeus::Installer.structure == :app_iso
|
26
|
-
File.join('config', 'webpack', 'development.js')
|
27
|
-
else
|
28
|
-
'development.js'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.production_js_path
|
33
|
-
if Isomorfeus::Installer.structure == :app_iso
|
34
|
-
File.join('config', 'webpack', 'production.js')
|
35
|
-
else
|
36
|
-
'production.js'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.asset_bundler_config
|
41
|
-
<<~CONFIG
|
42
|
-
# OpalWebpackLoader.manifest_path = File.join( 'public', 'assets', 'manifest.json')
|
43
|
-
if ENV['PROJECT_ENV'] && ENV['PROJECT_ENV'] != 'development'
|
44
|
-
OpalWebpackLoader.client_asset_path = '' # the full path is in the manifest already, like: /packs/website_packs-97fd9c2b7e7bdb112fc1.js
|
45
|
-
OpalWebpackLoader.use_manifest = true
|
46
|
-
else
|
47
|
-
OpalWebpackLoader.client_asset_path = 'http://localhost:3035/assets/'
|
48
|
-
OpalWebpackLoader.use_manifest = false
|
49
|
-
end
|
50
|
-
CONFIG
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.asset_bundler_includes(rails_style = false)
|
54
|
-
if rails_style
|
55
|
-
"include OpalWebpackLoader::RailsViewHelper"
|
56
|
-
else
|
57
|
-
"include OpalWebpackLoader::ViewHelper"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.install(root)
|
62
|
-
if Isomorfeus::Installer.structure == :iso
|
63
|
-
entrypoint_path = Isomorfeus::Installer.entrypoint_path
|
64
|
-
asset_output_path = Isomorfeus::Installer.asset_output_path
|
65
|
-
isomorfeus_path = Isomorfeus::Installer.isomorfeus_path
|
66
|
-
stylesheets_path = Isomorfeus::Installer.stylesheets_path
|
67
|
-
else
|
68
|
-
entrypoint_path = File.join('..', '..', Isomorfeus::Installer.entrypoint_path)
|
69
|
-
asset_output_path = File.join('..', '..', Isomorfeus::Installer.asset_output_path)
|
70
|
-
isomorfeus_path = File.join('..', '..', Isomorfeus::Installer.isomorfeus_path)
|
71
|
-
stylesheets_path = File.join('..', '..', Isomorfeus::Installer.stylesheets_path)
|
72
|
-
end
|
73
|
-
|
74
|
-
data_hash = { isomorfeus_path: isomorfeus_path,
|
75
|
-
asset_output_path: asset_output_path,
|
76
|
-
stylesheets_path: stylesheets_path,
|
77
|
-
entrypoint_path: entrypoint_path}
|
78
|
-
|
79
|
-
if Isomorfeus::Installer.structure == :app_iso
|
80
|
-
Dir.mkdir('config') unless Dir.exist?('config')
|
81
|
-
Dir.mkdir(File.join('config','webpack')) unless Dir.exist?(File.join('config', 'webpack'))
|
82
|
-
TARGETS.each do |target|
|
83
|
-
Isomorfeus::Installer.create_file_from_template(File.join('owl', target + '.erb'),
|
84
|
-
File.join('config', 'webpack', target), data_hash)
|
85
|
-
end
|
86
|
-
else
|
87
|
-
TARGETS.each do |target_path|
|
88
|
-
Isomorfeus::Installer.create_file_from_template(File.join('owl', target_path + '.erb'),
|
89
|
-
target_path, data_hash)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
Isomorfeus::Installer.add_asset_bundler('owl', {
|
99
|
-
gems: [ { name: 'opal-webpack-loader', version: '~> 0.5.0' } ],
|
100
|
-
npms: [ { name: 'opal-webpack-loader', version: '^0.5.0' } ],
|
101
|
-
installer: Isomorfeus::Installer::AssetBundlers::OpalWebpackLoader,
|
102
|
-
structure: :iso
|
103
|
-
})
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Installer
|
3
|
-
module Frameworks
|
4
|
-
module Cuba
|
5
|
-
def self.start_command
|
6
|
-
'bundle exec puma'
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.install(root)
|
10
|
-
data_hash = { requires: Isomorfeus::Installer.create_requires,
|
11
|
-
script_tag: Isomorfeus::Installer.asset_bundler&.script_tag(Isomorfeus::Installer.entrypoint),
|
12
|
-
asset_bundler_includes: Isomorfeus::Installer.asset_bundler&.asset_bundler_includes,
|
13
|
-
asset_bundler_config: Isomorfeus::Installer.asset_bundler&.asset_bundler_config }
|
14
|
-
|
15
|
-
Isomorfeus::Installer.create_file_from_template(File.join('cuba', 'config_ru.erb'), 'config.ru', data_hash)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
Isomorfeus::Installer.add_framework('cuba', {
|
23
|
-
gems: [ { name: 'cuba', version: '~> 3.9.2' }, { name: 'puma', version: '~> 3.12.0' } ],
|
24
|
-
installer: Isomorfeus::Installer::Frameworks::Cuba,
|
25
|
-
structure: :iso
|
26
|
-
})
|
@@ -1,78 +0,0 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Installer
|
3
|
-
module Frameworks
|
4
|
-
module Rails
|
5
|
-
VERSION = '~> 5.2.2'
|
6
|
-
|
7
|
-
def self.start_command
|
8
|
-
'bundle exec rails s'
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.create_project(name)
|
12
|
-
# make sure rails gem is installed, install if not
|
13
|
-
gem_dependency = Gem::Dependency.new('rails', VERSION)
|
14
|
-
rails_gem = gem_dependency.matching_specs.max_by(&:version)
|
15
|
-
unless rails_gem
|
16
|
-
puts "Installing rails"
|
17
|
-
result = system('gem', 'install', 'rails', '-v', VERSION)
|
18
|
-
unless result
|
19
|
-
puts "Installation of rails failed! Exiting."
|
20
|
-
exit 1
|
21
|
-
end
|
22
|
-
end
|
23
|
-
# create new rails project
|
24
|
-
result = system('rails', 'new', name, '--skip-sprockets', '--skip-bundle', '--skip-yarn')
|
25
|
-
unless result
|
26
|
-
puts "Creation of rails project failed! Exiting."
|
27
|
-
exit 1
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.install(root)
|
32
|
-
# config/routes.rb
|
33
|
-
File.delete(File.join('config', 'routes.rb'))
|
34
|
-
result = File.read(File.join(Isomorfeus::Installer.templates_path, 'rails', 'routes.rb'))
|
35
|
-
File.write(File.join('config', 'routes.rb'), result)
|
36
|
-
|
37
|
-
# config/initializers/assets.rb
|
38
|
-
data_hash = { asset_bundler_config: Isomorfeus::Installer.asset_bundler&.asset_bundler_config }
|
39
|
-
Isomorfeus::Installer.create_file_from_template(File.join('rails', 'assets.rb.erb'),
|
40
|
-
File.join('config', 'initializers', 'assets.rb'), data_hash)
|
41
|
-
|
42
|
-
# app/helpers/application_helper.rb
|
43
|
-
File.delete(File.join('app','helpers', 'application_helper.rb'))
|
44
|
-
data_hash = { asset_bundler_includes: Isomorfeus::Installer.asset_bundler&.asset_bundler_includes(true) }
|
45
|
-
Isomorfeus::Installer.create_file_from_template(File.join('rails', 'application_helper.rb.erb'),
|
46
|
-
File.join('app', 'helpers', 'application_helper.rb'), data_hash)
|
47
|
-
|
48
|
-
# app/views/layouts/application.html.erb
|
49
|
-
File.delete(File.join('app','views', 'layouts', 'application.html.erb'))
|
50
|
-
result = File.read(File.join(Isomorfeus::Installer.templates_path, 'rails', 'application.html.erb.head'))
|
51
|
-
result << " <%= #{Isomorfeus::Installer.asset_bundler.script_tag('application.js')} %>\n"
|
52
|
-
result << File.read(File.join(Isomorfeus::Installer.templates_path, 'rails', 'application.html.erb.tail'))
|
53
|
-
File.write(File.join('app','views', 'layouts', 'application.html.erb'), result)
|
54
|
-
|
55
|
-
# app/controllers/application_controller.rb
|
56
|
-
File.delete(File.join('app', 'controllers', 'application_controller.rb'))
|
57
|
-
result = File.read(File.join(Isomorfeus::Installer.templates_path, 'rails', 'application_controller.rb'))
|
58
|
-
File.write(File.join('app', 'controllers' , 'application_controller.rb'), result)
|
59
|
-
|
60
|
-
# app/views/application/index.html
|
61
|
-
Dir.mkdir(File.join('app', 'views', 'application'))
|
62
|
-
result = File.read(File.join(Isomorfeus::Installer.templates_path, 'rails', 'index.html'))
|
63
|
-
File.write(File.join('app', 'views', 'application', 'index.html'), result)
|
64
|
-
|
65
|
-
# app/assets/javascript/application.js
|
66
|
-
File.rename(File.join('app', 'assets', 'javascripts', 'application.js'),
|
67
|
-
File.join('app', 'assets', 'javascripts', 'application.js_orig'))
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
Isomorfeus::Installer.add_framework('rails', {
|
75
|
-
gems: :has_gemfile,
|
76
|
-
installer: Isomorfeus::Installer::Frameworks::Rails,
|
77
|
-
structure: :app_iso
|
78
|
-
})
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Installer
|
3
|
-
module Frameworks
|
4
|
-
module Roda
|
5
|
-
def self.start_command
|
6
|
-
'bundle exec puma'
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.install(root)
|
10
|
-
data_hash = { requires: Isomorfeus::Installer.create_requires,
|
11
|
-
script_tag: Isomorfeus::Installer.asset_bundler&.script_tag(Isomorfeus::Installer.entrypoint),
|
12
|
-
asset_bundler_includes: Isomorfeus::Installer.asset_bundler&.asset_bundler_includes,
|
13
|
-
asset_bundler_config: Isomorfeus::Installer.asset_bundler&.asset_bundler_config }
|
14
|
-
|
15
|
-
Isomorfeus::Installer.create_file_from_template(File.join('roda', 'config_ru.erb'), 'config.ru', data_hash)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
Isomorfeus::Installer.add_framework('roda', {
|
23
|
-
gems: [ { name: 'roda', version: '~> 3.15.0' }, { name: 'puma', version: '~> 3.12.0' } ],
|
24
|
-
installer: Isomorfeus::Installer::Frameworks::Roda,
|
25
|
-
structure: :iso
|
26
|
-
})
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Installer
|
3
|
-
module Frameworks
|
4
|
-
module Sinatra
|
5
|
-
def self.start_command
|
6
|
-
'bundle exec puma'
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.install(root)
|
10
|
-
data_hash = { requires: Isomorfeus::Installer.create_requires,
|
11
|
-
script_tag: Isomorfeus::Installer.asset_bundler&.script_tag(Isomorfeus::Installer.entrypoint),
|
12
|
-
asset_bundler_includes: Isomorfeus::Installer.asset_bundler&.asset_bundler_includes,
|
13
|
-
asset_bundler_config: Isomorfeus::Installer.asset_bundler&.asset_bundler_config }
|
14
|
-
|
15
|
-
Isomorfeus::Installer.create_file_from_template(File.join('sinatra', 'config_ru.erb'), 'config.ru', data_hash)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
Isomorfeus::Installer.add_framework('sinatra', {
|
23
|
-
gems: [ { name: 'sinatra', version: '~> 2.0.4' }, { name: 'puma', version: '~> 3.12.0' } ],
|
24
|
-
installer: Isomorfeus::Installer::Frameworks::Sinatra,
|
25
|
-
structure: :iso
|
26
|
-
})
|
@@ -1,48 +0,0 @@
|
|
1
|
-
<%= requires %>
|
2
|
-
|
3
|
-
<%= asset_bundler_config %>
|
4
|
-
|
5
|
-
require 'cuba/safe'
|
6
|
-
|
7
|
-
Cuba.plugin Cuba::Safe
|
8
|
-
|
9
|
-
class Cuba
|
10
|
-
<%= asset_bundler_includes %>
|
11
|
-
end
|
12
|
-
|
13
|
-
Cuba.define do
|
14
|
-
on get do
|
15
|
-
on root do
|
16
|
-
html = <<~HTML
|
17
|
-
<html>
|
18
|
-
<head>
|
19
|
-
<title>Welcome</title>
|
20
|
-
#{<%= script_tag %>}
|
21
|
-
</head>
|
22
|
-
<body>
|
23
|
-
<div></div>
|
24
|
-
</body>
|
25
|
-
</html>
|
26
|
-
HTML
|
27
|
-
res.write html
|
28
|
-
end
|
29
|
-
|
30
|
-
on /.*/ do |path|
|
31
|
-
# wildcard to access any component
|
32
|
-
html = <<~HTML
|
33
|
-
<html>
|
34
|
-
<head>
|
35
|
-
<title>Welcome</title>
|
36
|
-
#{<%= script_tag %>}
|
37
|
-
</head>
|
38
|
-
<body>
|
39
|
-
<div></div>
|
40
|
-
</body>
|
41
|
-
</html>
|
42
|
-
HTML
|
43
|
-
res.write html
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
run Cuba
|