katapult 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +121 -30
- data/bin/katapult +59 -21
- data/features/binary.feature +29 -16
- data/features/katapult.feature +91 -21
- data/features/model.feature +46 -2
- data/features/step_definitions/file_steps.rb +13 -2
- data/features/step_definitions/katapult_steps.rb +9 -3
- data/features/step_definitions/rails_steps.rb +5 -4
- data/features/step_definitions/test_steps.rb +8 -4
- data/features/support/env.rb +6 -4
- data/features/wui.feature +16 -1
- data/katapult.gemspec +3 -3
- data/lib/generators/katapult/basics/basics_generator.rb +51 -26
- data/lib/generators/katapult/basics/templates/.gitignore +27 -0
- data/lib/generators/katapult/basics/templates/Gemfile +3 -2
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/{_all.css.sass → _all.sass} +0 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/{_items.css.sass → _items.sass} +0 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/{_layout.css.sass → _layout.sass} +0 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/{_navigation.css.sass → _navigation.sass} +0 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/{_tools.css.sass → _tools.sass} +0 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/{application.css.sass → application.sass} +0 -0
- data/lib/generators/katapult/basics/templates/config/cucumber.yml +10 -0
- data/lib/generators/katapult/basics/templates/config/database.sample.yml +1 -4
- data/lib/generators/katapult/basics/templates/config/database.yml +2 -2
- data/lib/generators/katapult/basics/templates/config/initializers/exception_notification.rb.tt +16 -0
- data/lib/generators/katapult/basics/templates/config/initializers/find_by_anything.rb +19 -0
- data/lib/generators/katapult/basics/templates/config/initializers/form_for_with_development_errors.rb +45 -0
- data/lib/generators/katapult/basics/templates/features/support/capybara_screenshot.rb +4 -0
- data/lib/generators/katapult/basics/templates/features/support/cucumber_factory.rb +1 -0
- data/lib/generators/katapult/basics/templates/features/support/database_cleaner.rb +3 -0
- data/lib/generators/katapult/basics/templates/features/support/selectors.rb +56 -0
- data/lib/generators/katapult/basics/templates/spec/support/shoulda_matchers.rb +8 -0
- data/lib/generators/katapult/haml/templates/app/views/layouts/application.html.haml +2 -0
- data/lib/generators/katapult/transform/transform_generator.rb +13 -18
- data/lib/generators/katapult/w_u_i/w_u_i_generator.rb +14 -1
- data/lib/katapult/version.rb +1 -1
- metadata +28 -18
@@ -14,7 +14,6 @@ module Katapult
|
|
14
14
|
argument :path, required: true, type: :string,
|
15
15
|
description: 'The path to the application model file'
|
16
16
|
|
17
|
-
|
18
17
|
def transform_application_model
|
19
18
|
say_status :parse, path
|
20
19
|
@app_model = Katapult::Parser.new.parse(path)
|
@@ -24,32 +23,28 @@ module Katapult
|
|
24
23
|
end
|
25
24
|
|
26
25
|
def write_root_route
|
27
|
-
|
28
|
-
|
26
|
+
unless File.read('config/routes.rb').include? ' root'
|
27
|
+
root_wui = @app_model.wuis.find { |w| w.find_action :index }
|
28
|
+
route "root '#{ root_wui.model_name(:variables) }#index'" if root_wui
|
29
29
|
end
|
30
|
-
|
31
|
-
route "root '#{ root_wui.model_name(:variables) }#index'" if root_wui
|
32
|
-
end
|
33
|
-
|
34
|
-
def migrate
|
35
|
-
run 'bin/rake db:drop:all &> /dev/null'
|
36
|
-
run 'bin/rake db:create db:migrate RAILS_ENV=development'
|
37
|
-
run 'bin/rake db:create db:migrate RAILS_ENV=test'
|
38
30
|
end
|
39
31
|
|
40
|
-
def
|
41
|
-
|
42
|
-
|
43
|
-
You're done! Now boot up your development server (e.g. with `rails server`)
|
44
|
-
and try your kickstarted application in the browser.
|
45
|
-
INSTRUCTIONS
|
32
|
+
def remigrate_all_databases
|
33
|
+
run 'spring stop' # parallel_tests does not work together with Spring
|
34
|
+
run 'rake db:drop:all db:create:all db:migrate parallel:create parallel:prepare'
|
46
35
|
end
|
47
36
|
|
48
|
-
|
37
|
+
private
|
49
38
|
|
50
39
|
def application_name
|
51
40
|
File.basename(Dir.pwd)
|
52
41
|
end
|
53
42
|
|
43
|
+
def run(*)
|
44
|
+
Bundler.with_clean_env do
|
45
|
+
super
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
54
49
|
end
|
55
50
|
end
|
@@ -18,7 +18,20 @@ module Katapult
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def add_route
|
21
|
-
route
|
21
|
+
route = model_name(:symbols)
|
22
|
+
routes = File.read('config/routes.rb')
|
23
|
+
|
24
|
+
if routes.include? "resources #{ route }"
|
25
|
+
say_status :warn, <<MESSAGE, :red
|
26
|
+
Routes for #{ route } already exist! Not updated.
|
27
|
+
|
28
|
+
In order to keep existing routes created by the user, the config/routes.rb file
|
29
|
+
is not wiped on model transformation. To have Katapult update the #{ route}
|
30
|
+
route for you, delete it before transforming the application model.
|
31
|
+
MESSAGE
|
32
|
+
else
|
33
|
+
route render_partial('_route.rb')
|
34
|
+
end
|
22
35
|
end
|
23
36
|
|
24
37
|
def generate_views
|
data/lib/katapult/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katapult
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Schöler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: aruba
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.10.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.10.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: guard-cucumber
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,16 +112,16 @@ dependencies:
|
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 3.4.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 3.4.0
|
125
125
|
description: Katapult is a framework for generating base code
|
126
126
|
email:
|
127
127
|
- dominik.schoeler@makandra.de
|
@@ -154,19 +154,29 @@ files:
|
|
154
154
|
- katapult.gemspec
|
155
155
|
- katapult.png
|
156
156
|
- lib/generators/katapult/basics/basics_generator.rb
|
157
|
+
- lib/generators/katapult/basics/templates/.gitignore
|
157
158
|
- lib/generators/katapult/basics/templates/.ruby-version
|
158
159
|
- lib/generators/katapult/basics/templates/Gemfile
|
159
|
-
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application.
|
160
|
-
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_all.
|
161
|
-
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_items.
|
162
|
-
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_layout.
|
163
|
-
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_navigation.
|
164
|
-
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_tools.
|
160
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application.sass
|
161
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_all.sass
|
162
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_items.sass
|
163
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_layout.sass
|
164
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_navigation.sass
|
165
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_tools.sass
|
166
|
+
- lib/generators/katapult/basics/templates/config/cucumber.yml
|
165
167
|
- lib/generators/katapult/basics/templates/config/database.sample.yml
|
166
168
|
- lib/generators/katapult/basics/templates/config/database.yml
|
169
|
+
- lib/generators/katapult/basics/templates/config/initializers/exception_notification.rb.tt
|
170
|
+
- lib/generators/katapult/basics/templates/config/initializers/find_by_anything.rb
|
171
|
+
- lib/generators/katapult/basics/templates/config/initializers/form_for_with_development_errors.rb
|
167
172
|
- lib/generators/katapult/basics/templates/config/spring.rb
|
173
|
+
- lib/generators/katapult/basics/templates/features/support/capybara_screenshot.rb
|
174
|
+
- lib/generators/katapult/basics/templates/features/support/cucumber_factory.rb
|
175
|
+
- lib/generators/katapult/basics/templates/features/support/database_cleaner.rb
|
168
176
|
- lib/generators/katapult/basics/templates/features/support/env-custom.rb
|
169
177
|
- lib/generators/katapult/basics/templates/features/support/paths.rb
|
178
|
+
- lib/generators/katapult/basics/templates/features/support/selectors.rb
|
179
|
+
- lib/generators/katapult/basics/templates/spec/support/shoulda_matchers.rb
|
170
180
|
- lib/generators/katapult/cucumber_features/cucumber_features_generator.rb
|
171
181
|
- lib/generators/katapult/cucumber_features/templates/feature.feature
|
172
182
|
- lib/generators/katapult/haml/haml_generator.rb
|
@@ -220,7 +230,7 @@ require_paths:
|
|
220
230
|
- lib
|
221
231
|
required_ruby_version: !ruby/object:Gem::Requirement
|
222
232
|
requirements:
|
223
|
-
- - "
|
233
|
+
- - "~>"
|
224
234
|
- !ruby/object:Gem::Version
|
225
235
|
version: '2.0'
|
226
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -230,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
240
|
version: '0'
|
231
241
|
requirements: []
|
232
242
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.4.
|
243
|
+
rubygems_version: 2.4.8
|
234
244
|
signing_key:
|
235
245
|
specification_version: 4
|
236
246
|
summary: Kickstart Rails development
|