rails_app_generator 0.1.19 → 0.1.22

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58eda777a093e8b1984c349173a33adb87df19b61c0b09413ae9aad098fb2c1b
4
- data.tar.gz: 2eda255d5d1d296a6828b10196c50e9be59221d364d80cf5a4b4bf72f889141e
3
+ metadata.gz: 34c5e4b8336b9be125630767b2e7ccf7662b32d57ded62deaca07524689559a7
4
+ data.tar.gz: 1d58dcc0f7c16e237022cf4aa72f4f1155dff7165f21f7ce72ef319df25b82fb
5
5
  SHA512:
6
- metadata.gz: 5d514deb8bd877567f1e071398df52d2bf7f96cb2fc349d709319ebd1475278008ff12c28b1624b5ea8502522e82174f9d49e6c06cb01e8e0b0ae9580be81fe8
7
- data.tar.gz: 8778a30c75cee4daa2eb5af29cc37d89c3a02b3cd94f824fb5dbc14431d8a50d3adea81f76f30cf020f21d242337b69ca8ecf39d58740225cdb610e77dcb1e99
6
+ metadata.gz: c1e57300dce95fca59e8718e63ea0f7a1634ba7fc5fcc3bbcf312b4ab0d28589f7d893eda88cd98c188576b87aa386c917c8cdab3349ab8d0a68f8272ad72339
7
+ data.tar.gz: 9400b06fb4446b83d803f0e9a32b9db3026abc87d4786f672634d01a81231afbbe3310422afb8552875ff93511031c2c4d9bed8ee221c5dec4eae00ab7ce44e2
data/28: ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [0.1.21](https://github.com/klueless-io/rails_app_generator/compare/v0.1.20...v0.1.21) (2022-08-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * addon hexapdf progress ([631e589](https://github.com/klueless-io/rails_app_generator/commit/631e5897c9dd7bcdbb9a8c857b9a62c251213fa6))
7
+ * addon hexapdf progress ([b2bb9e5](https://github.com/klueless-io/rails_app_generator/commit/b2bb9e5855a24a41fdddcd553ce970481bc57e66))
8
+
9
+ ## [0.1.20](https://github.com/klueless-io/rails_app_generator/compare/v0.1.19...v0.1.20) (2022-08-06)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * addon chartkick and groupdate ([2bef1f1](https://github.com/klueless-io/rails_app_generator/commit/2bef1f1948d6ea7c2245e42bbb84308e201c35d5))
15
+
16
+ ## [0.1.19](https://github.com/klueless-io/rails_app_generator/compare/v0.1.18...v0.1.19) (2022-08-06)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * update project plan documentation ([b311a21](https://github.com/klueless-io/rails_app_generator/commit/b311a215328c13917265a91885f4eb5e3393bf15))
22
+
1
23
  ## [0.1.18](https://github.com/klueless-io/rails_app_generator/compare/v0.1.17...v0.1.18) (2022-08-06)
2
24
 
3
25
 
@@ -34,25 +34,8 @@ end
34
34
 
35
35
  def setup_db
36
36
  add_scaffold('yogurt', 'flavour')
37
- # add_scaffold('post', 'title', 'body:text')
38
37
  add_scaffold('people', 'name')
39
38
  copy_file 'app/views/people/_person.html.erb' , 'app/views/people/_person.html.erb'
40
39
 
41
- # add_scaffold('product', 'name', 'price:integer')
42
-
43
40
  db_migrate
44
41
  end
45
-
46
- # Other template command examples
47
- # css_install('tailwind')
48
- # rails_command('db:migrate')
49
- # bundle_add('hotwire-rails')
50
- # rails_command('hotwire:install')
51
- # run('bin/importmap pin sortablejs')
52
- # run('npm install daisyui')
53
- # create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
54
- # append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
55
- # insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
56
- # before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
57
- # gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
58
- # template 'home.css', 'app/assets/stylesheets/home.css'
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # require 'pry'
4
+
5
+ # HexaPDF is a pure Ruby library with an accompanying application for working with PDF files.
6
+
7
+ #
8
+ # exe/rag addons/hexapdf
9
+
10
+ self.local_template_path = File.dirname(__FILE__)
11
+
12
+ gac 'base rails 7 image created'
13
+
14
+ add_controller('home', 'index')
15
+ route("root 'home#index'")
16
+ route("get 'home/make_pdf'")
17
+
18
+ force_copy
19
+
20
+ copy_file 'app/controllers/home_controller.rb' , 'app/controllers/home_controller.rb'
21
+ copy_file 'app/views/home/index.html.erb' , 'app/views/home/index.html.erb'
22
+
23
+ copy_file 'app/views/layouts/_alerts.html.erb' , 'app/views/layouts/_alerts.html.erb'
24
+ copy_file 'app/views/layouts/_navbar.html.erb' , 'app/views/layouts/_navbar.html.erb'
25
+ copy_file 'app/views/layouts/_footer.html.erb' , 'app/views/layouts/_footer.html.erb'
26
+ template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
@@ -0,0 +1,17 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def make_pdf
6
+ doc = HexaPDF::Document.new
7
+ canvas = doc.pages.add.canvas
8
+ canvas.font('Helvetica', size: 40)
9
+ name = Faker::Name.name
10
+ canvas.text("Hello #{name}", at: [20, 400])
11
+ doc.write("hello-sean.pdf")
12
+
13
+ flash.notice = "PDF Created!"
14
+
15
+ render :index
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ <style>
2
+ .alert { color: red; }
3
+ .notice { color: green; }
4
+ </style>
5
+
6
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
7
+ <% if flash.any? %><hr /><% end %>
8
+
9
+ <h1>Hexapdf</h1>
10
+
11
+ <h2>HexaPDF is a pure Ruby library with an accompanying application for working with PDF files.</h2>
@@ -0,0 +1,2 @@
1
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
2
+ <% if flash.any? %><hr /><% end %>
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <hr />
3
+ </footer>
@@ -0,0 +1,5 @@
1
+ <header>
2
+ <%= link_to 'Home', root_path %> |
3
+ <%= link_to 'Create PDF', home_make_pdf_path %> |
4
+ <hr />
5
+ </header>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= camelized %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%%= csrf_meta_tags %>
7
+ <%%= csp_meta_tag %>
8
+
9
+ <%- if options[:skip_hotwire] || options[:skip_javascript] -%>
10
+ <%%= stylesheet_link_tag "application" %>
11
+ <%- else -%>
12
+ <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
13
+ <%- end -%>
14
+ <style>
15
+ .alert { color: red; }
16
+ .notice { color: green; }
17
+ </style>
18
+ </head>
19
+
20
+ <body>
21
+ <%%= render 'layouts/navbar' %>
22
+ <main>
23
+ <%%= render 'layouts/alerts' %>
24
+ <%%= yield %>
25
+ </main>
26
+ <%%= render 'layouts/footer' %>
27
+ </body>
28
+ </html>
data/app:template ADDED
File without changes
@@ -7,24 +7,9 @@ module RailsAppGenerator
7
7
  class Chartkick < AddOn
8
8
  required_gem gem.version('chartkick', '4.2.1', 'Create beautiful JavaScript charts with one line of Ruby')
9
9
 
10
- def apply
11
- puts 'Applying Chartkick'
12
- # say 'Setting up Chartkick'
13
- # template('chartkick_template.rb', 'target/chartkick.rb', force: true)
14
- # template('app/javascript/stylesheets/components.scss')
15
- # create_file('target/chartkick.rb', 'put your content here')
16
- # directory 'app/template', 'app/target', force: true
17
- # empty_directory 'app/target'
18
- # inject_into_file('app/application.js', "some content")
19
- # rails_command('tailwindcss:install')
20
- end
21
-
22
- def before_bundle
23
- puts 'Setting up Chartkick (before bundle)'
24
- end
10
+ def apply; end
25
11
 
26
12
  def after_bundle
27
- puts 'Setting up Chartkick (after bundle)'
28
13
  append_to_file('config/importmap.rb', <<~RUBY)
29
14
  pin "chartkick", to: "chartkick.js"
30
15
  pin "Chart.bundle", to: "Chart.bundle.js"
@@ -8,24 +8,7 @@ module RailsAppGenerator
8
8
  required_gem gem.version('groupdate', '6.1.0', 'The simplest way to group temporal data')
9
9
 
10
10
  # NOTE: in the examples, the Groupdate gem is used in conjunction with Chartkick.
11
- def apply
12
- say 'Setting up Groupdate'
13
- # template('groupdate_template.rb', 'target/groupdate.rb', force: true)
14
- # template('app/javascript/stylesheets/components.scss')
15
- # create_file('target/groupdate.rb', 'put your content here')
16
- # directory 'app/template', 'app/target', force: true
17
- # empty_directory 'app/target'
18
- # inject_into_file('app/application.js', "some content")
19
- # rails_command('tailwindcss:install')
20
- end
21
-
22
- def before_bundle
23
- say 'Setting up Groupdate - before bundle install'
24
- end
25
-
26
- def after_bundle
27
- say 'Setting up Groupdate - after bundle install'
28
- end
11
+ def apply; end
29
12
  end
30
13
  end
31
14
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAppGenerator
4
+ # Custom add-ons for RailsAppGenerator
5
+ module AddOns
6
+ # Add Hexapdf to rails application
7
+ class Hexapdf < AddOn
8
+ required_gem gem.version('hexapdf', '0.24.0', 'HexaPDF is a pure Ruby library with an accompanying application for working with PDF files.')
9
+
10
+ def apply; end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAppGenerator
4
+ # Custom add-ons for RailsAppGenerator
5
+ module AddOns
6
+ # Add RestClient to rails application
7
+ class RestClient < AddOn
8
+ required_gem gem.version('rest-client', '2.1.0', 'A simple HTTP and REST client for Ruby, inspired by the Sinatra microframework style of specifying actions: get, put, post, delete.')
9
+
10
+ def apply; end
11
+ end
12
+ end
13
+ end
@@ -8,30 +8,18 @@ module RailsAppGenerator
8
8
  class_option :test , type: :string , default: 'rspec'
9
9
 
10
10
  # Gem Current Latest Requested Groups
11
- # aws-partitions 1.613.0 1.614.0
12
- # aws-sdk-cognitoidentityprovider 1.67.0 1.68.0
13
- # aws-sdk-core 3.131.5 3.131.6
14
- # aws-sdk-personalize 1.42.0 1.43.0
15
- # aws-sdk-resources 3.136.0 3.137.0
16
- # aws-sdk-wafv2 1.40.0 1.41.0
11
+ # aws-sdk
17
12
  # capistrano-bundler 1.6.0 2.1.0 ~> 1.2 development, test
18
13
  # capybara 3.33.0 3.37.1 = 3.33.0 development, test
19
- # chartkick 2.3.5 4.2.1 ~> 2.3 default
20
- # childprocess 3.0.0 4.1.0
21
14
  # clamby 1.6.6 1.6.8 = 1.6.6 default
22
15
  # createsend 5.1.1 6.0.0 ~> 5.1 default
23
16
  # database_cleaner 1.7.0 2.0.1 = 1.7.0 development, test
24
17
  # erubi 1.10.0 1.11.0
25
18
  # factory_bot 5.2.0 6.2.1
26
19
  # factory_bot_rails 5.2.0 6.2.0 = 5.2.0 development, test
27
- # faker 1.9.6 2.22.0 ~> 1.7 default
28
- # groupdate 4.3.0 6.1.0 ~> 4.1 default
29
20
  # guard-bundler 2.2.1 3.0.0 = 2.2.1 development, test
30
21
  # guard-rubocop 1.4.0 1.5.0 = 1.4.0 development, test
31
- # hashie 3.6.0 5.0.0
32
- # hexapdf 0.23.0 0.24.0 ~> 0.5 default
33
22
  # http-accept 1.7.0 2.2.0
34
- # k_log 0.0.18 0.0.33 = 0.0.18 development, test
35
23
  # net-ssh 6.1.0 7.0.1
36
24
  # oauth2 1.4.10 2.0.6
37
25
  # omniauth-oauth2 1.7.3 1.8.0
@@ -162,8 +150,10 @@ module RailsAppGenerator
162
150
  class_option :add_chartkick , type: :boolean, default: false
163
151
  class_option :add_groupdate , type: :boolean, default: false
164
152
  class_option :add_faker , type: :boolean, default: false
153
+ class_option :add_hexapdf , type: :boolean, default: false
165
154
  class_option :add_honeybadger , type: :boolean, default: false
166
155
  class_option :add_rails_html_sanitizer , type: :boolean, default: false
156
+ class_option :add_rest_client , type: :boolean, default: false
167
157
  class_option :add_twilio_ruby , type: :boolean, default: false
168
158
 
169
159
  class << self
@@ -314,11 +304,13 @@ module RailsAppGenerator
314
304
  add_if(:factory_bot)
315
305
  add_if(:faker)
316
306
  add_if(:generators)
307
+ add_if(:hexapdf)
317
308
  add_if(:high_voltage)
318
309
  add_if(:honeybadger)
319
310
  add_if(:lograge)
320
311
  add_if(:pundit)
321
312
  add_if(:rails_app_generator)
313
+ add_if(:rest_client)
322
314
  add_if(:services)
323
315
  add_if(:shoulda)
324
316
  add_if(:sidekiq)
@@ -557,14 +549,6 @@ module RailsAppGenerator
557
549
  def addon_gemfile_entries
558
550
  active_addon_classes.flat_map(&:gem_entries)
559
551
  end
560
-
561
- # def addon_before_bundle_callbacks
562
- # active_addon_classes.flat_map(&:before_bundle_callback).compact
563
- # end
564
-
565
- # def addon_after_bundle_callbacks
566
- # active_addon_classes.flat_map(&:after_bundle_callback).compact
567
- # end
568
552
  end
569
553
 
570
554
  protected
@@ -64,8 +64,10 @@ module RailsAppGenerator
64
64
  register_option :add_chartkick , type: :boolean, default: false
65
65
  register_option :add_faker , type: :boolean, default: false
66
66
  register_option :add_groupdate , type: :boolean, default: false
67
+ register_option :add_hexapdf , type: :boolean, default: false
67
68
  register_option :add_honeybadger , type: :boolean, default: false
68
69
  register_option :add_rails_html_sanitizer , type: :boolean, default: false
70
+ register_option :add_rest_client , type: :boolean, default: false
69
71
  register_option :add_twilio_ruby , type: :boolean, default: false
70
72
 
71
73
  # if options[:minimal]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAppGenerator
4
- VERSION = '0.1.19'
4
+ VERSION = '0.1.22'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.19",
3
+ "version": "0.1.22",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.1.19",
9
+ "version": "0.1.22",
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.19",
3
+ "version": "0.1.22",
4
4
  "description": "Create new Rails Application with custom opinions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -0,0 +1,13 @@
1
+ {
2
+ "args": {
3
+ "app_path": "hexapdf",
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/hexapdf/_.rb",
10
+ "add_hexapdf": true,
11
+ "add_faker": true
12
+ }
13
+ }
data/tasks/profile.thor CHANGED
@@ -50,8 +50,6 @@ class Profile < Thor
50
50
  copy_file('profile/app/views/layouts/application.html.erb' , after_template_path('app/views/layouts/application.html.erb') , force: options[:force])
51
51
 
52
52
  copy_file('profile/db/seeds.rb' , after_template_path('db/seeds.rb') , force: options[:force])
53
-
54
- copy_file('profile/config/initializers/addon_name.rb' , after_template_path("config/initializers/#{name}.rb") , force: options[:force])
55
53
  end
56
54
 
57
55
  # rubocop:enable Metrics/AbcSize
@@ -25,8 +25,6 @@ template 'app/views/layouts/application.html.erb' , 'app/views/layouts/a
25
25
 
26
26
  template 'db/seeds.rb' , 'db/seeds.rb'
27
27
 
28
- copy_file 'config/initializers/<%= data.name_snake %>.rb' , 'config/initializers/<%= data.name_snake %>.rb'
29
-
30
28
  after_bundle do
31
29
  setup_db
32
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_app_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -152,6 +152,7 @@ files:
152
152
  - ".rspec"
153
153
  - ".rubocop.yml"
154
154
  - ".vscode/settings.json"
155
+ - '28:'
155
156
  - CHANGELOG.md
156
157
  - CODE_OF_CONDUCT.md
157
158
  - Gemfile
@@ -194,6 +195,13 @@ files:
194
195
  - after_templates/addons/faker/app/views/layouts/_footer.html.erb
195
196
  - after_templates/addons/faker/app/views/layouts/_navbar.html.erb
196
197
  - after_templates/addons/faker/app/views/layouts/application.html.erb
198
+ - after_templates/addons/hexapdf/_.rb
199
+ - after_templates/addons/hexapdf/app/controllers/home_controller.rb
200
+ - after_templates/addons/hexapdf/app/views/home/index.html.erb
201
+ - after_templates/addons/hexapdf/app/views/layouts/_alerts.html.erb
202
+ - after_templates/addons/hexapdf/app/views/layouts/_footer.html.erb
203
+ - after_templates/addons/hexapdf/app/views/layouts/_navbar.html.erb
204
+ - after_templates/addons/hexapdf/app/views/layouts/application.html.erb
197
205
  - after_templates/addons/honeybadger/_.rb
198
206
  - after_templates/addons/honeybadger/app/controllers/application_controller.rb
199
207
  - after_templates/addons/honeybadger/app/controllers/errors_controller.rb
@@ -321,6 +329,7 @@ files:
321
329
  - after_templates/rag_tailwind_hotwire_form_search/show.html.erb
322
330
  - after_templates/rag_tailwind_hotwire_form_search/theme_changer_controller.js
323
331
  - after_templates/rag_tailwind_hotwire_form_search/update.turbo_stream.erb
332
+ - app:template
324
333
  - bin/console
325
334
  - bin/setup
326
335
  - docs/images/tailwind.png
@@ -352,6 +361,7 @@ files:
352
361
  - lib/rails_app_generator/addons/foreman.rb
353
362
  - lib/rails_app_generator/addons/generators.rb
354
363
  - lib/rails_app_generator/addons/groupdate.rb
364
+ - lib/rails_app_generator/addons/hexapdf.rb
355
365
  - lib/rails_app_generator/addons/high_voltage.rb
356
366
  - lib/rails_app_generator/addons/honeybadger.rb
357
367
  - lib/rails_app_generator/addons/inline_svg.rb
@@ -359,6 +369,7 @@ files:
359
369
  - lib/rails_app_generator/addons/lograge.rb
360
370
  - lib/rails_app_generator/addons/pundit.rb
361
371
  - lib/rails_app_generator/addons/rails_html_sanitizer.rb
372
+ - lib/rails_app_generator/addons/rest_client.rb
362
373
  - lib/rails_app_generator/addons/rspec.rb
363
374
  - lib/rails_app_generator/addons/rubocop.rb
364
375
  - lib/rails_app_generator/addons/scaffold.rb
@@ -407,6 +418,7 @@ files:
407
418
  - profiles/addons/browser.json
408
419
  - profiles/addons/chartkick.json
409
420
  - profiles/addons/faker.json
421
+ - profiles/addons/hexapdf.json
410
422
  - profiles/addons/honeybadger.json
411
423
  - profiles/addons/rails-html-sanitizer.json
412
424
  - profiles/addons/twilio_ruby.json
@@ -479,7 +491,6 @@ files:
479
491
  - templates/thor_task/profile/app/views/layouts/_footer.html.erb.tt
480
492
  - templates/thor_task/profile/app/views/layouts/_navbar.html.erb
481
493
  - templates/thor_task/profile/app/views/layouts/application.html.erb.tt
482
- - templates/thor_task/profile/config/initializers/addon_name.rb
483
494
  - templates/thor_task/profile/db/seeds.rb
484
495
  - templates/thor_task/profile/profile.json.tt
485
496
  homepage: http://appydave.com/gems/rails_app_generator
@@ -1 +0,0 @@
1
- # Custom initializer for rails application