rails_app_generator 0.1.20 → 0.1.23

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: 762ce2221102a50e1655b6a5ac52ffa63f634498805ea0eb9a8dc6acd1c00f7a
4
- data.tar.gz: 101ecc7a434790cc4c41aa5d145acebef7760bd39c2dd9422e28bab03067eed4
3
+ metadata.gz: ba0cc1a6eadd97f297d8480dac50f0b81c6bdceb92f2b79f543b69ed0bf652a0
4
+ data.tar.gz: 7d5055a9172139f0239ab1c75af57608d088b43462b051c6f6a36c7615020a1d
5
5
  SHA512:
6
- metadata.gz: 693e1d67210ad67ee688b4953922a497a213c1393d3ebd6586089c9b4ee1e11b5299e6f42a06c46fe468ef1323f612ad5acf46ba85ab10e8f43c8877fea86608
7
- data.tar.gz: e86d08f581e52252a4c053240ce3dec48467fe1f5d23dbbd0e5be1d9352568ba282e45fbc931901566194d3a43747a4473dcd279835c7419c846272dec3b7931
6
+ metadata.gz: 3825d87925de317d52dae026874b8021db4a2d8ae4756c2d56f6657b609fc3417954c254ac38287d9507306adf2b27b056e4db72d0504ef59f8358472a689dd3
7
+ data.tar.gz: 155b9a62e8edb8e19c875e9918d5822e82b26a29c592884985ed8fbd3ab8261c11218143a3173c56659ccdb441497dd39ffc6e0cf8e415afc317350c73908a92
data/28: ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [0.1.22](https://github.com/klueless-io/rails_app_generator/compare/v0.1.21...v0.1.22) (2022-08-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * addon hexapdf ([0b99dde](https://github.com/klueless-io/rails_app_generator/commit/0b99dde1e2609c12c1235b4a9c73e683785c3eb6))
7
+ * addon rest-client ([ed3a426](https://github.com/klueless-io/rails_app_generator/commit/ed3a42669ae9707fa2713f767fcda990346bed5e))
8
+
9
+ ## [0.1.21](https://github.com/klueless-io/rails_app_generator/compare/v0.1.20...v0.1.21) (2022-08-06)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * addon hexapdf progress ([631e589](https://github.com/klueless-io/rails_app_generator/commit/631e5897c9dd7bcdbb9a8c857b9a62c251213fa6))
15
+ * addon hexapdf progress ([b2bb9e5](https://github.com/klueless-io/rails_app_generator/commit/b2bb9e5855a24a41fdddcd553ce970481bc57e66))
16
+
17
+ ## [0.1.20](https://github.com/klueless-io/rails_app_generator/compare/v0.1.19...v0.1.20) (2022-08-06)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * addon chartkick and groupdate ([2bef1f1](https://github.com/klueless-io/rails_app_generator/commit/2bef1f1948d6ea7c2245e42bbb84308e201c35d5))
23
+
1
24
  ## [0.1.19](https://github.com/klueless-io/rails_app_generator/compare/v0.1.18...v0.1.19) (2022-08-06)
2
25
 
3
26
 
@@ -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
@@ -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)
@@ -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.20'
4
+ VERSION = '0.1.23'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.20",
3
+ "version": "0.1.23",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.1.20",
9
+ "version": "0.1.23",
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.20",
3
+ "version": "0.1.23",
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.20
4
+ version: 0.1.23
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
@@ -407,6 +417,7 @@ files:
407
417
  - profiles/addons/browser.json
408
418
  - profiles/addons/chartkick.json
409
419
  - profiles/addons/faker.json
420
+ - profiles/addons/hexapdf.json
410
421
  - profiles/addons/honeybadger.json
411
422
  - profiles/addons/rails-html-sanitizer.json
412
423
  - profiles/addons/twilio_ruby.json
@@ -479,7 +490,6 @@ files:
479
490
  - templates/thor_task/profile/app/views/layouts/_footer.html.erb.tt
480
491
  - templates/thor_task/profile/app/views/layouts/_navbar.html.erb
481
492
  - templates/thor_task/profile/app/views/layouts/application.html.erb.tt
482
- - templates/thor_task/profile/config/initializers/addon_name.rb
483
493
  - templates/thor_task/profile/db/seeds.rb
484
494
  - templates/thor_task/profile/profile.json.tt
485
495
  homepage: http://appydave.com/gems/rails_app_generator
@@ -1 +0,0 @@
1
- # Custom initializer for rails application