rails_app_generator 0.1.10 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/after_templates/addons/honeybadger/_.rb +46 -0
  4. data/after_templates/addons/honeybadger/app/controllers/application_controller.rb +9 -0
  5. data/after_templates/addons/honeybadger/app/controllers/errors_controller.rb +17 -0
  6. data/after_templates/addons/honeybadger/app/controllers/products_controller.rb +72 -0
  7. data/after_templates/addons/honeybadger/app/views/home/index.html.erb +49 -0
  8. data/after_templates/addons/honeybadger/public/404.html +69 -0
  9. data/after_templates/addons/honeybadger/public/500.html +68 -0
  10. data/after_templates/addons/rails_html_sanitizer/_.rb +15 -0
  11. data/after_templates/addons/rails_html_sanitizer/home/index.html.erb +31 -0
  12. data/after_templates/addons/{rails_html_sanitizer → rails_html_sanitizer_xxx/home}/index.html.erb +0 -0
  13. data/lib/rails_app_generator/add_on.rb +36 -0
  14. data/lib/rails_app_generator/addons/honeybadger.rb +19 -0
  15. data/lib/rails_app_generator/app_generator.rb +58 -32
  16. data/lib/rails_app_generator/options/rails_options.rb +1 -0
  17. data/lib/rails_app_generator/version.rb +1 -1
  18. data/package-lock.json +2 -2
  19. data/package.json +1 -1
  20. data/profiles/addons/honeybadger.json +12 -0
  21. data/profiles/addons/rails-html-sanitizer.json +2 -2
  22. data/tasks/addon.thor +48 -24
  23. data/tasks/profile.thor +88 -9
  24. data/templates/addons/honeybadger/en.yml +10 -0
  25. data/templates/addons/honeybadger/honeybadger.sample.yml +37 -0
  26. data/templates/thor_task/addon/addon.tt +13 -6
  27. data/templates/thor_task/profile/after_template.rb.tt +44 -0
  28. data/templates/thor_task/profile/home/index.html.erb.tt +7 -0
  29. data/templates/thor_task/profile/profile.json.tt +12 -0
  30. metadata +33 -19
  31. data/after_templates/addons/rails_html_sanitizer.rb +0 -15
  32. data/templates/app_x/controllers/authorized_controller.rb.erb +0 -10
  33. data/templates/app_x/controllers/errors_controller.rb.erb +0 -24
  34. data/templates/app_x/javascript/images/checkmark.svg +0 -1
  35. data/templates/app_x/javascript/images/logo.svg +0 -1
  36. data/templates/app_x/javascript/stylesheets/components.scss +0 -206
  37. data/templates/app_x/views/errors/internal_error.html.erb +0 -14
  38. data/templates/app_x/views/errors/not_found.html.erb +0 -14
  39. data/templates/app_x/views/errors/unacceptable.html.erb +0 -14
  40. data/templates/app_x/views/layouts/application.html.erb.tt +0 -30
  41. data/templates/app_x/views/pages/home.html.erb.tt +0 -20
  42. data/templates/app_x/views/shared/_flashes.html.erb.tt +0 -12
  43. data/templates/app_x/views/shared/_footer.html.erb.tt +0 -21
  44. data/templates/app_x/views/shared/_navbar.html.erb.tt +0 -55
  45. data/templates/app_x/workers/application_worker.rb +0 -5
  46. data/templates/thor_task/profile/after_template.tt +0 -15
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.1.10",
9
+ "version": "0.1.13",
10
10
  "dependencies": {
11
11
  "daisyui": "^2.20.0"
12
12
  },
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "description": "Create new Rails Application with custom opinions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "honeybadger",
4
+ "destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/addons"
5
+ },
6
+ "opts": {
7
+ "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/honeybadger/_.rb",
10
+ "add_honeybadger": true
11
+ }
12
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "args": {
3
- "app_path": "rails-html-sanitizer",
3
+ "app_path": "rails_html_sanitizer",
4
4
  "destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/addons"
5
5
  },
6
6
  "opts": {
7
7
  "skip_git": true,
8
8
  "skip_test": true,
9
- "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/rails_html_sanitizer.rb",
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/rails_html_sanitizer/_.rb",
10
10
  "add_rails_html_sanitizer": true
11
11
  }
12
12
  }
data/tasks/addon.thor CHANGED
@@ -12,10 +12,19 @@ class AddOn < Thor
12
12
 
13
13
  source_root(File.expand_path('../templates/thor_task', File.dirname(__FILE__)))
14
14
 
15
+ Data = Struct.new(
16
+ :name,
17
+ :name_dash,
18
+ :name_snake,
19
+ :name_human,
20
+ :name_camel,
21
+ :addon_config_code,
22
+ keyword_init: true
23
+ )
15
24
  GemInfo = Struct.new(:name, :version, :description, keyword_init: true)
16
25
 
17
26
  attr_accessor :name
18
- attr_accessor :addon_config_code
27
+ attr_accessor :data
19
28
 
20
29
  # method_option :from, :required => true
21
30
  desc 'new', 'Create a new Addon for Rails App Generator'
@@ -24,14 +33,12 @@ class AddOn < Thor
24
33
  method_option :depends_on, type: :string, desc: 'This AddOn depends on another AddOn/Gem. active_record is a common dependency'
25
34
  def new(name)
26
35
  self.name = name
27
-
28
- code = [build_depends_on_code, build_required_gem_code].compact
29
- code << '' if code.any?
30
- self.addon_config_code = code.join("\n")
36
+ self.data = build_data(name)
31
37
 
32
38
  template('addon/addon', "lib/rails_app_generator/addons/#{name}.rb", force: options[:force])
33
39
  end
34
40
 
41
+ # rubocop:disable Metrics/BlockLength
35
42
  no_commands do
36
43
  def build_depends_on_code
37
44
  return nil unless options[:depends_on]
@@ -40,32 +47,49 @@ class AddOn < Thor
40
47
  end
41
48
 
42
49
  def build_required_gem_code
50
+ info = gem_info
51
+
52
+ " required_gem gem.version('#{info.name}', '#{info.version}', '#{info.description}')"
53
+ end
54
+
55
+ # example: 'https://rubygems.org/api/v1/gems/draper.json'
56
+ def gem_info
43
57
  return nil unless options[:gem]
44
58
 
45
59
  gem_name = options[:gem] == 'gem' ? name : options[:gem]
46
60
 
47
- info = gem_info(gem_name)
48
-
49
- " required_gem gem.version('#{info.name}', '#{info.version}', '#{info.description}')"
61
+ ::GemInfo.get(gem_name)
50
62
  end
51
63
 
52
- # example: 'https://rubygems.org/api/v1/gems/draper.json'
53
- def gem_info(name)
54
- link = "https://rubygems.org/api/v1/gems/#{name.downcase}.json"
55
- info = Net::HTTP.get(URI.parse(link))
56
- json = JSON.parse(info)
57
-
58
- GemInfo.new(
59
- name: json['name'],
60
- version: json['version'],
61
- description: json['info']
64
+ def build_data(name)
65
+ code = [build_depends_on_code, build_required_gem_code].compact
66
+ code << '' if code.any?
67
+
68
+ Data.new(
69
+ name: name,
70
+ name_dash: dash(name),
71
+ name_snake: snake(name),
72
+ name_human: human(name),
73
+ name_camel: camel(name),
74
+ addon_config_code: code.join("\n")
62
75
  )
63
- rescue SocketError
64
- abort 'Internet connection cannot be established to RubyGems.org'
65
- rescue JSON::ParserError
66
- abort "Check you have entered the right Gem name\n#{link}"
76
+ end
77
+
78
+ def human(value)
79
+ Cmdlet::Case::Human.new.call(value)
80
+ end
81
+
82
+ def dash(value)
83
+ Cmdlet::Case::Dash.new.call(value)
84
+ end
85
+
86
+ def snake(value)
87
+ Cmdlet::Case::Snake.new.call(value)
88
+ end
89
+
90
+ def camel(value)
91
+ Cmdlet::Case::Camel.new.call(value)
67
92
  end
68
93
  end
94
+ # rubocop:enable Metrics/BlockLength
69
95
  end
70
- # /Users/davidcruwys/dev/kgems/rails_app_generator/templates/thor/addon
71
- # /Users/davidcruwys/dev/kgems/rails_app_generator/lib/templates/thor
data/tasks/profile.thor CHANGED
@@ -3,37 +3,116 @@
3
3
  # https://codecrate.com/2014/01/replace-rake-with-thor.html
4
4
 
5
5
  require 'pry'
6
+ require_relative 'gem_info'
7
+ require 'cmdlet'
8
+
6
9
  # Thor task to create a new Profile for Rails App Generator
7
10
  class Profile < Thor
8
11
  include Thor::Actions
9
12
 
10
13
  source_root(File.expand_path('../templates/thor_task', File.dirname(__FILE__)))
11
14
 
12
- attr_accessor :name
15
+ Data = Struct.new(
16
+ :name,
17
+ :name_dash,
18
+ :name_snake,
19
+ :name_human,
20
+ :name_camel,
21
+ :description,
22
+ :destination_root,
23
+ :template_file,
24
+ keyword_init: true
25
+ )
26
+
27
+ attr_accessor :data
13
28
 
14
29
  desc 'new', 'Create a new Profile for testing Rails App Generator settings'
15
- method_option :variant, type: :string, default: 'default', desc: 'Profile variant to create, valid values are (default, addon)'
30
+ method_option :variant, type: :string, default: 'default', desc: 'Profile variant to create, valid values are (nil, addons)'
16
31
  method_option :gem, type: :string, default: nil, desc: 'Gem name is looked up to find version and description'
17
32
  method_option :force, type: :boolean, default: false, desc: 'Overwrite existing files'
33
+ # rubocop:disable Metrics/AbcSize
18
34
  def new(name)
19
- self.name = name
35
+ @data = build_data(name)
20
36
 
21
37
  say "Creating profile #{name}"
22
38
  puts "Variant: #{options[:variant]}"
23
39
 
24
- gi = gem_info
25
- gi&.debug
26
-
27
- # template('profile/profile', "lib/rails_app_generator/profiles/#{name}.rb", force: options[:force])
40
+ template('profile/profile.json', profile_path("#{data.name_dash}.json"), force: options[:force])
41
+ template('profile/after_template.rb', after_template_path('_.rb'), force: options[:force])
42
+ template('profile/home/index.html.erb', after_template_path('home/index.html.erb'), force: options[:force])
28
43
  end
44
+ # rubocop:enable Metrics/AbcSize
29
45
 
46
+ # rubocop:disable Metrics/BlockLength
30
47
  no_commands do
31
- def gem_info
48
+ def profile_path(file)
49
+ path = 'profiles'
50
+ path = File.join(path, options[:variant]) if options[:variant]
51
+ File.join(path, file)
52
+ end
53
+
54
+ def after_template_path(file)
55
+ path = 'after_templates'
56
+ path = File.join(path, options[:variant]) if options[:variant]
57
+ path = File.join(path, data.name_snake)
58
+ File.join(path, file)
59
+ end
60
+
61
+ def build_data(name)
62
+ gi = gem_info(name)
63
+
64
+ description = gi ? gi.description : 'Description goes here'
65
+
66
+ Data.new(
67
+ name: name,
68
+ name_dash: dash(name),
69
+ name_snake: snake(name),
70
+ name_human: human(name),
71
+ name_camel: camel(name),
72
+ description: description,
73
+ destination_root: build_destination_root,
74
+ template_file: build_template_file(snake(name))
75
+ )
76
+ end
77
+
78
+ def build_template_file(name_snake)
79
+ path = '~/dev/kgems/rails_app_generator/after_templates/'
80
+ path = File.join(path, options[:variant]) if options[:variant]
81
+ path = File.join(path, "#{name_snake}/_.rb")
82
+ File.expand_path(path)
83
+ end
84
+
85
+ def build_destination_root
86
+ # Do not use destination_root as the method name because it already exists on Thor::Actions
87
+ path = '~/dev/kgems/rails_app_generator/a/'
88
+ path = File.join(path, options[:variant]) if options[:variant]
89
+ File.expand_path(path)
90
+ end
91
+
92
+ # example: 'https://rubygems.org/api/v1/gems/draper.json'
93
+ def gem_info(name)
32
94
  return nil unless options[:gem]
33
95
 
34
96
  gem_name = options[:gem] == 'gem' ? name : options[:gem]
35
97
 
36
- GemInfo.create(gem_name)
98
+ GemInfo.get(gem_name)
99
+ end
100
+
101
+ def human(value)
102
+ Cmdlet::Case::Human.new.call(value)
103
+ end
104
+
105
+ def dash(value)
106
+ Cmdlet::Case::Dash.new.call(value)
107
+ end
108
+
109
+ def snake(value)
110
+ Cmdlet::Case::Snake.new.call(value)
111
+ end
112
+
113
+ def camel(value)
114
+ Cmdlet::Case::Camel.new.call(value)
37
115
  end
38
116
  end
117
+ # rubocop:enable Metrics/BlockLength
39
118
  end
@@ -0,0 +1,10 @@
1
+ honeybadger:
2
+ feedback:
3
+ heading: "Care to help us fix this?"
4
+ explanation: "Any information you can provide will help us fix the problem."
5
+ submit: "Send"
6
+ thanks: "Thanks for the feedback!"
7
+ labels:
8
+ name: "Your name"
9
+ email: "Your email address"
10
+ comment: "Comment (required)"
@@ -0,0 +1,37 @@
1
+ ---
2
+ # For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
3
+
4
+ api_key: 'hbp_f56DVeEaIvMMjqbMJAT7haJpQ7qfLP1ezvc0'
5
+
6
+ # The environment your app is running in.
7
+ env: "<%= Rails.env %>"
8
+
9
+ # The absolute path to your project folder.
10
+ root: "<%= Rails.root.to_s %>"
11
+
12
+ # Honeybadger won't report errors in these environments.
13
+ development_environments:
14
+ - test
15
+ - development
16
+ - cucumber
17
+
18
+ # By default, Honeybadger won't report errors in the development_environments.
19
+ # You can override this by explicitly setting report_data to true or false.
20
+ # report_data: true
21
+
22
+ # The current Git revision of your project. Defaults to the last commit hash.
23
+ # revision: null
24
+
25
+ # Enable verbose debug logging (useful for troubleshooting).
26
+ debug: false
27
+
28
+ # Displaying the Error ID
29
+ # Add to your html: <!-- HONEYBADGER ERROR -->
30
+ user_informer:
31
+ enabled: true
32
+ info: "Error ID: {{error_id}}"
33
+
34
+ # Displaying a Feedback Form
35
+ # Add to your html: <!-- HONEYBADGER FEEDBACK -->
36
+ feedback:
37
+ enabled: true
@@ -1,16 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # NEW GEM ADDONS
4
+ # lib/rails_app_generator/app_generator.rb
5
+ # class_option :add_<%= data.name_snake %>, type: :boolean, default: false
6
+ # add_if(:<%= data.name_snake %>)
7
+ # lib/rails_app_generator/options/rails_options.rb
8
+ # register_option :add_<%= data.name_snake %>, type: :boolean, default: false
9
+
3
10
  module RailsAppGenerator
4
11
  # Custom add-ons for RailsAppGenerator
5
12
  module AddOns
6
- # Add <%= Thor::Util.camel_case(name) %> to rails application
7
- class <%= Thor::Util.camel_case(name) %> < AddOn
8
- <%= addon_config_code %>
13
+ # Add <%= data.name_camel %> to rails application
14
+ class <%= data.name_camel %> < AddOn
15
+ <%= data.addon_config_code %>
9
16
  def apply
10
- # say 'Setting up <%= Thor::Util.camel_case(name)%>'
11
- # template('<%= Thor::Util.snake_case(name)%>_template.rb', 'target/<%= Thor::Util.snake_case(name)%>.rb', force: true)
17
+ # say 'Setting up <%= data.name_camel %>'
18
+ # template('<%= data.name_snake%>_template.rb', 'target/<%= data.name_snake%>.rb', force: true)
12
19
  # template('app/javascript/stylesheets/components.scss')
13
- # create_file('target/<%= Thor::Util.snake_case(name)%>.rb', 'put your content here')
20
+ # create_file('target/<%= data.name_snake%>.rb', 'put your content here')
14
21
  # directory 'app/template', 'app/target', force: true
15
22
  # empty_directory 'app/target'
16
23
  # inject_into_file('app/application.js', "some content")
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # require 'pry'
4
+
5
+ # <%= data.description %>
6
+ #
7
+ # exe/rag addons/<%= data.name_snake %>
8
+
9
+ self.local_template_path = File.dirname(__FILE__)
10
+
11
+ gac 'base rails 7 image created'
12
+
13
+ add_controller('home', 'index')
14
+ route("root 'home#index'")
15
+
16
+ force_copy
17
+
18
+ copy_file 'home/index.html.erb', 'app/views/home/index.html.erb'
19
+
20
+ after_bundle do
21
+ setup_db
22
+ end
23
+
24
+ def setup_db
25
+ # add_scaffold('post', 'title', 'body:text')
26
+ # add_scaffold('people', 'first_name', 'last_name', 'age:integer', 'address:text')
27
+ # add_scaffold('product', 'name', 'price:integer')
28
+
29
+ # db_migrate
30
+ end
31
+
32
+ # Other template command examples
33
+ # css_install('tailwind')
34
+ # rails_command('db:migrate')
35
+ # bundle_add('hotwire-rails')
36
+ # rails_command('hotwire:install')
37
+ # run('bin/importmap pin sortablejs')
38
+ # run('npm install daisyui')
39
+ # create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
40
+ # append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
41
+ # insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
42
+ # before: %( <%%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
43
+ # gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
44
+ # template 'home.css', 'app/assets/stylesheets/home.css'
@@ -0,0 +1,7 @@
1
+ <h1><%= data.name_human %></h1>
2
+
3
+ <h2><%= data.description %></h2>
4
+
5
+ <%%= link_to 'Products', products_path %> |
6
+ <%%= link_to 'Posts', posts_path %> |
7
+ <%%= link_to 'People', people_path %>
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "<%= data.name_snake %>",
4
+ "destination_root": "<%= data.destination_root %>"
5
+ },
6
+ "opts": {
7
+ "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "<%= data.template_file %>",
10
+ "add_<%= data.name_snake %>": true
11
+ }
12
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_app_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-02 00:00:00.000000000 Z
11
+ date: 2022-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootsnap
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: cmdlet
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: " Create new Rails Application with custom opinions\n"
126
140
  email:
127
141
  - david@ideasmen.com.au
@@ -146,8 +160,16 @@ files:
146
160
  - README.md
147
161
  - Rakefile
148
162
  - after_templates/README.md
149
- - after_templates/addons/rails_html_sanitizer.rb
150
- - after_templates/addons/rails_html_sanitizer/index.html.erb
163
+ - after_templates/addons/honeybadger/_.rb
164
+ - after_templates/addons/honeybadger/app/controllers/application_controller.rb
165
+ - after_templates/addons/honeybadger/app/controllers/errors_controller.rb
166
+ - after_templates/addons/honeybadger/app/controllers/products_controller.rb
167
+ - after_templates/addons/honeybadger/app/views/home/index.html.erb
168
+ - after_templates/addons/honeybadger/public/404.html
169
+ - after_templates/addons/honeybadger/public/500.html
170
+ - after_templates/addons/rails_html_sanitizer/_.rb
171
+ - after_templates/addons/rails_html_sanitizer/home/index.html.erb
172
+ - after_templates/addons/rails_html_sanitizer_xxx/home/index.html.erb
151
173
  - after_templates/rag_bootstrap.rb
152
174
  - after_templates/rag_bootstrap/application-yield.html.erb
153
175
  - after_templates/rag_bootstrap/application.html.erb
@@ -289,6 +311,7 @@ files:
289
311
  - lib/rails_app_generator/addons/foreman.rb
290
312
  - lib/rails_app_generator/addons/generators.rb
291
313
  - lib/rails_app_generator/addons/high_voltage.rb
314
+ - lib/rails_app_generator/addons/honeybadger.rb
292
315
  - lib/rails_app_generator/addons/inline_svg.rb
293
316
  - lib/rails_app_generator/addons/irbrc.rb
294
317
  - lib/rails_app_generator/addons/lograge.rb
@@ -338,6 +361,7 @@ files:
338
361
  - lib/rails_app_generator/version.rb
339
362
  - package-lock.json
340
363
  - package.json
364
+ - profiles/addons/honeybadger.json
341
365
  - profiles/addons/rails-html-sanitizer.json
342
366
  - profiles/rag-add-some-pages.json
343
367
  - profiles/rag-bootstrap.json
@@ -385,6 +409,8 @@ files:
385
409
  - templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
386
410
  - templates/addons/generators/lib/generators/rails/scaffold_controller_generator.rb
387
411
  - templates/addons/high_voltage/config/initializers/high_voltage.rb
412
+ - templates/addons/honeybadger/en.yml
413
+ - templates/addons/honeybadger/honeybadger.sample.yml
388
414
  - templates/addons/irbrc/.irbrc.erb
389
415
  - templates/addons/lograge/config/initializers/lograge.rb
390
416
  - templates/addons/pundit/app/controllers/authorized_controller.rb.erb
@@ -398,22 +424,10 @@ files:
398
424
  - templates/addons/scaffold/lib/templates/erb/scaffold/new.html.erb
399
425
  - templates/addons/scaffold/lib/templates/erb/scaffold/show.html.erb
400
426
  - templates/addons/services/app/services/application_service.rb
401
- - templates/app_x/controllers/authorized_controller.rb.erb
402
- - templates/app_x/controllers/errors_controller.rb.erb
403
- - templates/app_x/javascript/images/checkmark.svg
404
- - templates/app_x/javascript/images/logo.svg
405
- - templates/app_x/javascript/stylesheets/components.scss
406
- - templates/app_x/views/errors/internal_error.html.erb
407
- - templates/app_x/views/errors/not_found.html.erb
408
- - templates/app_x/views/errors/unacceptable.html.erb
409
- - templates/app_x/views/layouts/application.html.erb.tt
410
- - templates/app_x/views/pages/home.html.erb.tt
411
- - templates/app_x/views/shared/_flashes.html.erb.tt
412
- - templates/app_x/views/shared/_footer.html.erb.tt
413
- - templates/app_x/views/shared/_navbar.html.erb.tt
414
- - templates/app_x/workers/application_worker.rb
415
427
  - templates/thor_task/addon/addon.tt
416
- - templates/thor_task/profile/after_template.tt
428
+ - templates/thor_task/profile/after_template.rb.tt
429
+ - templates/thor_task/profile/home/index.html.erb.tt
430
+ - templates/thor_task/profile/profile.json.tt
417
431
  homepage: http://appydave.com/gems/rails_app_generator
418
432
  licenses:
419
433
  - MIT
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Rails HTML Sanitizer is responsible for sanitizing HTML fragments in Rails applications, i.e. in the sanitize, sanitize_css, strip_tags and strip_links methods.
4
- require 'pry'
5
-
6
- self.local_template_path = local_template_base(__FILE__)
7
-
8
- gac 'base rails 7 image created'
9
-
10
- add_controller('home', 'index')
11
- route("root 'home#index'")
12
-
13
- force_copy
14
-
15
- copy_file 'index.html.erb', 'app/views/home/index.html.erb'
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class AuthorizedController < ApplicationController
4
- include Pundit
5
-
6
- before_action :authenticate_user!
7
-
8
- after_action :verify_authorized, except: :index
9
- after_action :verify_policy_scoped, only: :index
10
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ErrorsController < ApplicationController
4
- def not_found
5
- respond_to do |format|
6
- format.html { render status: 404 }
7
- format.json { render json: { error: 'Resource not found' }, status: 404 }
8
- end
9
- end
10
-
11
- def unacceptable
12
- respond_to do |format|
13
- format.html { render status: 422 }
14
- format.json { render json: { error: 'Params unacceptable' }, status: 422 }
15
- end
16
- end
17
-
18
- def internal_error
19
- respond_to do |format|
20
- format.html { render status: 500 }
21
- format.json { render json: { error: 'Internal server error' }, status: 500 }
22
- end
23
- end
24
- end
@@ -1 +0,0 @@
1
- <svg fill="#fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 92.81 122.88" style="enable-background:new 0 0 92.81 122.88" xml:space="preserve"><style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;}</style><g><path class="st0" d="M66.69,101.35H26.68l-4.7,6.94h49.24L66.69,101.35L66.69,101.35z M17.56,114.81l-5.47,8.07H0l19.64-29.46 h-3.49c-4.76,0-8.66-3.9-8.66-8.66V8.66C7.5,3.9,11.39,0,16.15,0h61.22c4.76,0,8.66,3.9,8.66,8.66v76.1c0,4.76-3.9,8.66-8.66,8.66 h-3.4l18.83,29.04H80.45l-4.99-7.65H17.56L17.56,114.81z M62.97,67.66h10.48c1.14,0,2.07,0.93,2.07,2.07V80.2 c0,1.14-0.93,2.07-2.07,2.07H62.97c-1.14,0-2.07-0.93-2.07-2.07V69.72C60.9,68.59,61.83,67.66,62.97,67.66L62.97,67.66z M18.98,67.66h10.48c1.14,0,2.07,0.93,2.07,2.07V80.2c0,1.14-0.93,2.07-2.07,2.07H18.98c-1.14,0-2.07-0.93-2.07-2.07V69.72 C16.91,68.59,17.84,67.66,18.98,67.66L18.98,67.66z M25.1,16.7h42.81c4.6,0,8.36,3.76,8.36,8.37v13.17c0,4.6-3.76,8.36-8.36,8.36 H25.1c-4.6,0-8.36-3.76-8.36-8.36V25.07C16.74,20.47,20.5,16.7,25.1,16.7L25.1,16.7z M38.33,3.8h16.2C55.34,3.8,56,4.46,56,5.27 v6.38c0,0.81-0.66,1.47-1.47,1.47h-16.2c-0.81,0-1.47-0.66-1.47-1.47V5.27C36.85,4.46,37.51,3.8,38.33,3.8L38.33,3.8z"/></g></svg>