katapult 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +34 -12
  4. data/README.md +154 -114
  5. data/Rakefile +3 -3
  6. data/bin/katapult +34 -8
  7. data/features/application_model.feature +8 -44
  8. data/features/authenticate.feature +21 -4
  9. data/features/basics.feature +16 -89
  10. data/features/binary.feature +37 -4
  11. data/features/model.feature +40 -24
  12. data/features/navigation.feature +2 -0
  13. data/features/step_definitions/katapult_steps.rb +48 -16
  14. data/features/step_definitions/test_steps.rb +2 -0
  15. data/features/templates.feature +74 -0
  16. data/lib/generators/katapult/app_model/templates/lib/katapult/application_model.rb +2 -2
  17. data/lib/generators/katapult/basics/basics_generator.rb +12 -1
  18. data/lib/generators/katapult/basics/templates/Capfile +5 -0
  19. data/lib/generators/katapult/basics/templates/Gemfile +3 -1
  20. data/lib/generators/katapult/basics/templates/Gemfile.lock +376 -0
  21. data/lib/generators/katapult/basics/templates/app/models/application_record.rb +28 -0
  22. data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/bootstrap.js +2 -2
  23. data/lib/generators/katapult/basics/templates/config/deploy.rb +2 -3
  24. data/lib/generators/katapult/basics/templates/config/deploy/production.rb +2 -2
  25. data/lib/generators/katapult/basics/templates/config/deploy/staging.rb +1 -1
  26. data/lib/generators/katapult/basics/templates/lib/capistrano/tasks/deploy.rake +1 -4
  27. data/lib/generators/katapult/clearance/clearance_generator.rb +13 -4
  28. data/lib/generators/katapult/clearance/templates/features/authentication.feature +3 -3
  29. data/lib/generators/katapult/model/model_generator.rb +14 -4
  30. data/lib/generators/katapult/templates/templates_generator.rb +35 -0
  31. data/lib/generators/katapult/transform/transform_generator.rb +3 -3
  32. data/lib/generators/katapult/views/views_generator.rb +1 -1
  33. data/lib/generators/katapult/web_ui/web_ui_generator.rb +1 -1
  34. data/lib/katapult/application_model.rb +7 -7
  35. data/lib/katapult/elements/attribute.rb +16 -0
  36. data/lib/katapult/elements/authentication.rb +9 -6
  37. data/lib/katapult/elements/model.rb +8 -4
  38. data/lib/katapult/elements/navigation.rb +2 -2
  39. data/lib/katapult/elements/web_ui.rb +2 -2
  40. data/lib/katapult/generator.rb +12 -2
  41. data/lib/katapult/support/generator_goodies.rb +14 -0
  42. data/lib/katapult/version.rb +1 -1
  43. data/script/update +5 -1
  44. metadata +8 -8
  45. data/features/configuration.feature +0 -24
  46. data/lib/generators/katapult/basics/templates/lib/capistrano/tasks/passenger.rake +0 -8
  47. data/lib/generators/katapult/basics/templates/lib/ext/active_record/find_by_anything.rb +0 -20
  48. data/lib/generators/katapult/basics/templates/lib/ext/active_record/these.rb +0 -7
@@ -1,7 +1,7 @@
1
1
  module Katapult
2
2
  ruby_version_path = File.expand_path('../../.ruby-version', __dir__)
3
3
 
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.0'
5
5
  RUBY_VERSION = File.read(ruby_version_path).strip
6
6
  RAILS_VERSION = '5.1.4'
7
7
  end
data/script/update CHANGED
@@ -67,7 +67,11 @@ end
67
67
  sleep 1
68
68
  puts <<-DEBUG
69
69
 
70
- This script is done. Now you need to fix whatever was broken by the updates.
70
+ This script is done. You'll probably want to update
71
+ lib/generators/katapult/basics/templates/Gemfile.lock
72
+ with recent versions.
73
+
74
+ Next, you need to fix whatever was broken by the updates.
71
75
 
72
76
  The suggested way is to run the following features one by one, fixing issues as
73
77
  they occur:
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.4.1
4
+ version: 0.5.0
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: 2018-02-16 00:00:00.000000000 Z
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -63,7 +63,6 @@ files:
63
63
  - features/authenticate.feature
64
64
  - features/basics.feature
65
65
  - features/binary.feature
66
- - features/configuration.feature
67
66
  - features/model.feature
68
67
  - features/navigation.feature
69
68
  - features/step_definitions/aruba_steps.rb
@@ -74,6 +73,7 @@ files:
74
73
  - features/step_definitions/test_steps.rb
75
74
  - features/step_definitions/version_steps.rb
76
75
  - features/support/env.rb
76
+ - features/templates.feature
77
77
  - features/web_ui.feature
78
78
  - katapult.gemspec
79
79
  - katapult.png
@@ -86,10 +86,12 @@ files:
86
86
  - lib/generators/katapult/basics/templates/.ruby-version
87
87
  - lib/generators/katapult/basics/templates/Capfile
88
88
  - lib/generators/katapult/basics/templates/Gemfile
89
+ - lib/generators/katapult/basics/templates/Gemfile.lock
89
90
  - lib/generators/katapult/basics/templates/Guardfile
90
91
  - lib/generators/katapult/basics/templates/README.md.tt
91
92
  - lib/generators/katapult/basics/templates/app/controllers/errors_controller.rb
92
93
  - lib/generators/katapult/basics/templates/app/helpers/unpoly_helper.rb
94
+ - lib/generators/katapult/basics/templates/app/models/application_record.rb
93
95
  - lib/generators/katapult/basics/templates/app/views/layouts/_flashes.html.haml
94
96
  - lib/generators/katapult/basics/templates/app/views/layouts/_menu_bar.html.haml.tt
95
97
  - lib/generators/katapult/basics/templates/app/views/layouts/application.html.haml.tt
@@ -134,11 +136,8 @@ files:
134
136
  - lib/generators/katapult/basics/templates/features/support/webpacker.rb
135
137
  - lib/generators/katapult/basics/templates/lib/capistrano/tasks/db.rake
136
138
  - lib/generators/katapult/basics/templates/lib/capistrano/tasks/deploy.rake
137
- - lib/generators/katapult/basics/templates/lib/capistrano/tasks/passenger.rake
138
139
  - lib/generators/katapult/basics/templates/lib/ext/action_view/form_for_with_development_errors.rb
139
140
  - lib/generators/katapult/basics/templates/lib/ext/action_view/spec_label.rb
140
- - lib/generators/katapult/basics/templates/lib/ext/active_record/find_by_anything.rb
141
- - lib/generators/katapult/basics/templates/lib/ext/active_record/these.rb
142
141
  - lib/generators/katapult/basics/templates/lib/ext/array/xss_aware_join.rb
143
142
  - lib/generators/katapult/basics/templates/lib/ext/enumerable/natural_sort.rb
144
143
  - lib/generators/katapult/basics/templates/lib/ext/hash/infinite.rb
@@ -176,6 +175,7 @@ files:
176
175
  - lib/generators/katapult/model_specs/templates/model_spec.rb
177
176
  - lib/generators/katapult/navigation/navigation_generator.rb
178
177
  - lib/generators/katapult/navigation/templates/app/views/layouts/_navigation.html.haml
178
+ - lib/generators/katapult/templates/templates_generator.rb
179
179
  - lib/generators/katapult/transform/transform_generator.rb
180
180
  - lib/generators/katapult/views/templates/_form.html.haml
181
181
  - lib/generators/katapult/views/templates/app/helpers/table_helper.rb
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  requirements: []
238
238
  rubyforge_project:
239
- rubygems_version: 2.7.3
239
+ rubygems_version: 2.7.6
240
240
  signing_key:
241
241
  specification_version: 4
242
242
  summary: Kickstart Rails development
@@ -245,7 +245,6 @@ test_files:
245
245
  - features/authenticate.feature
246
246
  - features/basics.feature
247
247
  - features/binary.feature
248
- - features/configuration.feature
249
248
  - features/model.feature
250
249
  - features/navigation.feature
251
250
  - features/step_definitions/aruba_steps.rb
@@ -256,6 +255,7 @@ test_files:
256
255
  - features/step_definitions/test_steps.rb
257
256
  - features/step_definitions/version_steps.rb
258
257
  - features/support/env.rb
258
+ - features/templates.feature
259
259
  - features/web_ui.feature
260
260
  - spec/action_spec.rb
261
261
  - spec/application_model_spec.rb
@@ -1,24 +0,0 @@
1
- #@announce-output
2
- #@announce-stderr
3
- Feature: Configure katapult
4
-
5
- Background:
6
- Given a new Rails application with Katapult basics installed
7
-
8
-
9
- Scenario: Custom model template
10
- When I write to "lib/katapult/application_model.rb" with:
11
- """
12
- model 'Car'
13
- """
14
- And a file named "lib/templates/katapult/model/model.rb" with:
15
- """
16
- # custom model template for <%= class_name %>
17
-
18
- """
19
- And I successfully transform the application model
20
- Then the file "app/models/car.rb" should contain exactly:
21
- """
22
- # custom model template for Car
23
-
24
- """
@@ -1,8 +0,0 @@
1
- namespace :passenger do
2
- desc 'Restart Application'
3
- task :restart do
4
- on roles :app do
5
- execute "sudo passenger-config restart-app --ignore-app-not-running #{ fetch(:deploy_to) }"
6
- end
7
- end
8
- end
@@ -1,20 +0,0 @@
1
- ActiveRecord::Base.class_eval do
2
-
3
- def self.find_by_anything(identifier)
4
- matchable_columns = columns.reject { |column| [:binary, :boolean].include?(column.type) }
5
- query_clauses = matchable_columns.collect do |column|
6
- qualified_column_name = "#{table_name}.#{column.name}"
7
- is_mysql = connection.class.name =~ /mysql/i
8
- target_type = is_mysql ? 'CHAR' : 'TEXT' # CHAR is only 1 character in PostgreSQL
9
- column_as_string = "CAST(#{qualified_column_name} AS #{target_type})"
10
- "#{column_as_string} = ?"
11
- end
12
- bindings = [identifier] * query_clauses.size
13
- where([query_clauses.join(' OR '), *bindings]).first
14
- end
15
-
16
- def self.find_by_anything!(identifier)
17
- find_by_anything(identifier) or raise ActiveRecord::RecordNotFound, "No column equals \"#{identifier}\""
18
- end
19
-
20
- end
@@ -1,7 +0,0 @@
1
- ActiveRecord::Base.class_eval do
2
-
3
- def self.these(arg)
4
- where(id: arg.collect_ids)
5
- end
6
-
7
- end