rails_app_generator 0.1.13 → 0.1.14
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/after_templates/addons/twilio_ruby/_.rb +23 -0
- data/after_templates/addons/twilio_ruby/app/controllers/home_controller.rb +54 -0
- data/after_templates/addons/twilio_ruby/app/views/home/index.html.erb +27 -0
- data/after_templates/addons/twilio_ruby/config/initializers/twilio.rb +4 -0
- data/lib/rails_app_generator/app_generator.rb +81 -88
- data/lib/rails_app_generator/options/rails_options.rb +3 -1
- data/lib/rails_app_generator/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/profiles/addons/twilio_ruby.json +12 -0
- data/tasks/addon.thor +4 -5
- data/tasks/profile.thor +6 -4
- data/templates/thor_task/profile/home/index.html.erb.tt +9 -3
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75a314b07d31b22d3aa8c2249efa2884d59f4d6ec2aa13966e52ded99aa8aa79
|
|
4
|
+
data.tar.gz: ee79c7ebb7828f2cc5fe27ae226f107f841947185d3c21ba4f4a0e6fcb7b3323
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7011a7def931cb0ca1e5e7502372cad5da9f9887e2195b6f708963f1a34205cd74cd6812f877c77fa98faf3dc590d15f256319085af79416f98fd67480ddf0af
|
|
7
|
+
data.tar.gz: 6ee2229ccce12d2dcba53b841125ac72cc2a07dfe6432b21029395460efb704e8621697c833fdc77fbaaf9520347aac08562adf16de6e17b86cd31284de678ce
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [0.1.13](https://github.com/klueless-io/rails_app_generator/compare/v0.1.12...v0.1.13) (2022-08-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add honeybadger addon ([5118957](https://github.com/klueless-io/rails_app_generator/commit/511895750056a8eff7bc41c0cc902ff81cfcd7d3))
|
|
7
|
+
* add honeybadger addon + cops ([e105b47](https://github.com/klueless-io/rails_app_generator/commit/e105b47790c2a91a0a9ec0224f8a7aecb75067a9))
|
|
8
|
+
|
|
1
9
|
## [0.1.12](https://github.com/klueless-io/rails_app_generator/compare/v0.1.11...v0.1.12) (2022-08-02)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# require 'pry'
|
|
4
|
+
|
|
5
|
+
# The official library for communicating with the Twilio REST API, building TwiML, and generating Twilio JWT Capability Tokens
|
|
6
|
+
#
|
|
7
|
+
# exe/rag addons/twilio_ruby
|
|
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
|
+
route("get 'home/send_sms'")
|
|
16
|
+
|
|
17
|
+
# route("root 'home#index'")
|
|
18
|
+
|
|
19
|
+
force_copy
|
|
20
|
+
|
|
21
|
+
copy_file 'app/controllers/home_controller.rb', 'app/controllers/home_controller.rb'
|
|
22
|
+
copy_file 'app/views/home/index.html.erb', 'app/views/home/index.html.erb'
|
|
23
|
+
copy_file 'config/initializers/twilio.rb', 'config/initializers/twilio.rb'
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
class HomeController < ApplicationController
|
|
2
|
+
after_action -> { flash.discard }, if: -> { request.xhr? }
|
|
3
|
+
|
|
4
|
+
def index
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def send_sms
|
|
8
|
+
client = Twilio::REST::Client.new
|
|
9
|
+
|
|
10
|
+
message = client.messages.create(
|
|
11
|
+
to: ENV['TWILIO_MY_PHONE'],
|
|
12
|
+
body: "#{Time.now.strftime("%I:%M %p")} - #{random_message}",
|
|
13
|
+
messaging_service_sid: ENV['TWILIO_MESSAGING_SERVICE_SID']
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
flash.notice = "Message sent to #{message.to} with ID #{message.sid}<br />#{message.body}".html_safe
|
|
17
|
+
|
|
18
|
+
render 'home/index'
|
|
19
|
+
rescue Twilio::REST::RestError => error
|
|
20
|
+
error_message = "#{error.code} - #{error.message}"
|
|
21
|
+
error_message = "Invalid 'To' Phone Number" if error.code == 21211
|
|
22
|
+
error_message = "Not found" if error.code == 20404
|
|
23
|
+
flash.alert = error_message
|
|
24
|
+
puts '22222222222'
|
|
25
|
+
render 'home/index'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def random_message
|
|
31
|
+
[
|
|
32
|
+
"The changing of down comforters to cotton bedspreads always meant the squirrels had returned.",
|
|
33
|
+
"The father died during childbirth.",
|
|
34
|
+
"It's much more difficult to play tennis with a bowling ball than it is to bowl with a tennis ball.",
|
|
35
|
+
"Jason lived his life by the motto, 'Anything worth doing is worth doing poorly.'",
|
|
36
|
+
"It was difficult for Mary to admit that most of her workout consisted of exercising poor judgment.",
|
|
37
|
+
"Their argument could be heard across the parking lot.",
|
|
38
|
+
"The mysterious diary records the voice.",
|
|
39
|
+
"My secretary is the only person who truly understands my stamp-collecting obsession.",
|
|
40
|
+
"They did nothing as the raccoon attacked the lady’s bag of food.",
|
|
41
|
+
"It was the first time he had ever seen someone cook dinner on an elephant.",
|
|
42
|
+
"I had a friend in high school named Rick Shaw, but he was fairly useless as a mode of transport.",
|
|
43
|
+
"She was amazed by the large chunks of ice washing up on the beach.",
|
|
44
|
+
"On each full moon",
|
|
45
|
+
"Check back tomorrow; I will see if the book has arrived.",
|
|
46
|
+
"A good example of a useful vegetable is medicinal rhubarb.",
|
|
47
|
+
"Beach-combing replaced wine tasting as his new obsession.",
|
|
48
|
+
"While on the first date he accidentally hit his head on the beam.",
|
|
49
|
+
"The balloons floated away along with all my hopes and dreams.",
|
|
50
|
+
"For the 216th time, he said he would quit drinking soda after this last Coke.",
|
|
51
|
+
"The swirled lollipop had issues with the pop rock candy."
|
|
52
|
+
].sample
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.alert { color: red; }
|
|
3
|
+
.notice { color: green; }
|
|
4
|
+
</style>
|
|
5
|
+
|
|
6
|
+
<% flash.each do |type, msg| %>
|
|
7
|
+
<div class="<%= type%>"><%= msg %></div>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% if flash.any? %>
|
|
10
|
+
<hr />
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
<h1>Twilio ruby</h1>
|
|
14
|
+
|
|
15
|
+
<h2>The official library for communicating with the Twilio REST API, building TwiML, and generating Twilio JWT Capability Tokens</h2>
|
|
16
|
+
|
|
17
|
+
<%= link_to 'Send SMS', home_send_sms_path %>
|
|
18
|
+
<!--
|
|
19
|
+
Add/Remove as needed
|
|
20
|
+
-->
|
|
21
|
+
|
|
22
|
+
<!--
|
|
23
|
+
<= link_to 'Products', products_path %> |
|
|
24
|
+
<= link_to 'Posts', posts_path %> |
|
|
25
|
+
<= link_to 'People', people_path %>
|
|
26
|
+
-->
|
|
27
|
+
|
|
@@ -7,6 +7,77 @@ module RailsAppGenerator
|
|
|
7
7
|
class AppGenerator < Rails::Generators::AppGenerator
|
|
8
8
|
class_option :test , type: :string , default: 'rspec'
|
|
9
9
|
|
|
10
|
+
# Gem Current Latest Requested Groups
|
|
11
|
+
# acts_as_list 0.9.19 1.0.4 ~> 0.9 default
|
|
12
|
+
# arel 7.1.4 9.0.0
|
|
13
|
+
# aws-partitions 1.613.0 1.614.0
|
|
14
|
+
# aws-sdk-cognitoidentityprovider 1.67.0 1.68.0
|
|
15
|
+
# aws-sdk-core 3.131.5 3.131.6
|
|
16
|
+
# aws-sdk-personalize 1.42.0 1.43.0
|
|
17
|
+
# aws-sdk-resources 3.136.0 3.137.0
|
|
18
|
+
# aws-sdk-wafv2 1.40.0 1.41.0
|
|
19
|
+
# bigdecimal 1.4.4 3.1.2 ~> 1.4 development, test
|
|
20
|
+
# binding_of_caller 0.8.0 1.0.0 ~> 0.8 default
|
|
21
|
+
# browser 2.7.1 5.3.1 ~> 2.3 default
|
|
22
|
+
# capistrano-bundler 1.6.0 2.1.0 ~> 1.2 development, test
|
|
23
|
+
# capybara 3.33.0 3.37.1 = 3.33.0 development, test
|
|
24
|
+
# chartkick 2.3.5 4.2.1 ~> 2.3 default
|
|
25
|
+
# childprocess 3.0.0 4.1.0
|
|
26
|
+
# clamby 1.6.6 1.6.8 = 1.6.6 default
|
|
27
|
+
# createsend 5.1.1 6.0.0 ~> 5.1 default
|
|
28
|
+
# database_cleaner 1.7.0 2.0.1 = 1.7.0 development, test
|
|
29
|
+
# erubi 1.10.0 1.11.0
|
|
30
|
+
# factory_bot 5.2.0 6.2.1
|
|
31
|
+
# factory_bot_rails 5.2.0 6.2.0 = 5.2.0 development, test
|
|
32
|
+
# faker 1.9.6 2.22.0 ~> 1.7 default
|
|
33
|
+
# groupdate 4.3.0 6.1.0 ~> 4.1 default
|
|
34
|
+
# guard-bundler 2.2.1 3.0.0 = 2.2.1 development, test
|
|
35
|
+
# guard-rubocop 1.4.0 1.5.0 = 1.4.0 development, test
|
|
36
|
+
# hashie 3.6.0 5.0.0
|
|
37
|
+
# hexapdf 0.23.0 0.24.0 ~> 0.5 default
|
|
38
|
+
# http-accept 1.7.0 2.2.0
|
|
39
|
+
# k_log 0.0.18 0.0.33 = 0.0.18 development, test
|
|
40
|
+
# net-ssh 6.1.0 7.0.1
|
|
41
|
+
# oauth2 1.4.10 2.0.6
|
|
42
|
+
# omniauth-oauth2 1.7.3 1.8.0
|
|
43
|
+
# paper_trail 10.3.1 12.3.0 ~> 10.3 default
|
|
44
|
+
# pg 0.21.0 1.4.2 ~> 0.20 default
|
|
45
|
+
# pg_search 2.3.0 2.3.6 ~> 2.0 default
|
|
46
|
+
# pry 0.13.1 0.14.1
|
|
47
|
+
# public_suffix 2.0.5 5.0.0 ~> 2.0 default
|
|
48
|
+
# pusher 1.4.3 2.0.2 ~> 1.3 default
|
|
49
|
+
# rack-mini-profiler 0.10.7 3.0.0 ~> 0.10 default
|
|
50
|
+
# rack-test 0.6.3 2.0.2
|
|
51
|
+
# rails 5.0.7.2 7.0.3.1 = 5.0.7.2 default
|
|
52
|
+
# railties 5.0.7.2 7.0.3.1
|
|
53
|
+
# ransack 1.8.10 3.2.1 ~> 1.8 default
|
|
54
|
+
# redis 3.3.5 4.7.1 ~> 3.3 default
|
|
55
|
+
# redis-store 1.6.0 1.9.1
|
|
56
|
+
# regexp_parser 1.8.2 2.5.0
|
|
57
|
+
# rspec 3.10.0 3.11.0
|
|
58
|
+
# rspec-core 3.10.1 3.11.0 = 3.10.1 development, test
|
|
59
|
+
# rspec-expectations 3.10.1 3.11.0 = 3.10.1 development, test
|
|
60
|
+
# rspec-mocks 3.10.2 3.11.1 = 3.10.2 development, test
|
|
61
|
+
# rspec-rails 4.1.2 5.1.2 = 4.1.2 development, test
|
|
62
|
+
# rspec-support 3.10.2 3.11.0 = 3.10.2 development, test
|
|
63
|
+
# rubyzip 1.3.0 2.3.2 ~> 1.3 default
|
|
64
|
+
# scenic 1.5.4 1.6.0 = 1.5.4 default
|
|
65
|
+
# scout_apm 4.1.2 5.2.0 ~> 4.1 default
|
|
66
|
+
# selenium-webdriver 3.142.7 4.3.0 = 3.142.7 development, test
|
|
67
|
+
# shoulda-matchers 4.0.1 5.1.0 = 4.0.1 development, test
|
|
68
|
+
# sidekiq 4.2.10 6.5.1 ~> 4.2 default
|
|
69
|
+
# sidekiq-pool 1.9.3 2.0.1 ~> 1.8 default
|
|
70
|
+
# sidekiq-unique-jobs 6.0.25 7.1.27 ~> 6.0 default
|
|
71
|
+
# spring 2.1.1 4.0.0 ~> 2.0 development, test
|
|
72
|
+
# sprockets 3.7.2 4.1.1 ~> 3.7 default
|
|
73
|
+
# sprockets-rails 3.2.2 3.4.2
|
|
74
|
+
# timecop 0.8.1 0.9.5 = 0.8.1 development, test
|
|
75
|
+
# tzinfo 1.2.10 2.0.5
|
|
76
|
+
# uglifier 3.2.0 4.2.0 ~> 3.2 default
|
|
77
|
+
# unicorn 5.8.0 6.1.0 ~> 5.3 default
|
|
78
|
+
# webmock 3.13.0 3.16.0 = 3.13.0 development, test
|
|
79
|
+
# websocket-driver 0.6.5 0.7.5
|
|
80
|
+
|
|
10
81
|
# acts_as_list 0.9.19 1.0.4 ~> 0.9 default
|
|
11
82
|
# arel 7.1.4 9.0.0
|
|
12
83
|
# bigdecimal 1.4.4 3.1.2 ~> 1.4 development, test
|
|
@@ -69,88 +140,6 @@ module RailsAppGenerator
|
|
|
69
140
|
# webmock 3.13.0 3.14.0 = 3.13.0 development, test
|
|
70
141
|
# websocket-driver 0.6.5 0.7.5
|
|
71
142
|
|
|
72
|
-
# gem "honeybadger", "4.6.0"
|
|
73
|
-
# gem "pg", "0.20.0"
|
|
74
|
-
# gem "redis", "3.3.3"
|
|
75
|
-
# gem "redis-namespace", "1.5.3"
|
|
76
|
-
# gem "redis-rails", "5.0.2"
|
|
77
|
-
# gem "devise", "4.7.1"
|
|
78
|
-
# gem "twilio-ruby", "5.23.0"
|
|
79
|
-
# gem "google-api-client", "0.9"
|
|
80
|
-
# gem "sinatra", "1.4.8", require: nil # used for the /sidekiq admin screen
|
|
81
|
-
# gem "sidekiq", "4.2.10"
|
|
82
|
-
# gem "sidekiq-unique-jobs", "6.0.25"
|
|
83
|
-
# gem "sidekiq-pool", "1.8.1"
|
|
84
|
-
# gem "faker", "1.7.3"
|
|
85
|
-
# gem "clearbit", "0.2.8"
|
|
86
|
-
# gem "groupdate", "4.1.2"
|
|
87
|
-
# gem "acts_as_commentable", "4.0.2"
|
|
88
|
-
# gem "acts_as_list", "0.9.5"
|
|
89
|
-
# gem "kaminari", "1.2.1"
|
|
90
|
-
# gem "chartkick", "4.1.2"
|
|
91
|
-
# gem "jbuilder", "2.6.3"
|
|
92
|
-
# gem "rest-client", "2.0.1"
|
|
93
|
-
# gem "json", "2.3.0"
|
|
94
|
-
# gem "httparty", "0.14.0"
|
|
95
|
-
# gem "mini_magick", "4.9.4"
|
|
96
|
-
# gem "skeptick", "0.2.1"
|
|
97
|
-
# gem "aws-sdk", "3.0.2"
|
|
98
|
-
# gem "phony_rails", "0.14.11"
|
|
99
|
-
# gem "pg_search", "2.0.1"
|
|
100
|
-
# gem "omniauth", "1.8.1", group: %i[development staging production worker]
|
|
101
|
-
# gem "omniauth-google-oauth2", "0.3.0"
|
|
102
|
-
# gem "redcarpet", "3.5.1"
|
|
103
|
-
# gem "binding_of_caller", "0.8.0"
|
|
104
|
-
# gem "bcrypt-ruby", "3.1.5"
|
|
105
|
-
# gem "rb-readline", "0.5.5"
|
|
106
|
-
# gem "has_secure_token", "1.0.0"
|
|
107
|
-
# gem "stackprof", "0.2.10"
|
|
108
|
-
# gem "createsend", "5.1.0"
|
|
109
|
-
# gem "rubyzip", "1.3.0"
|
|
110
|
-
# gem "chronic", "0.10.2"
|
|
111
|
-
# gem "unread", "0.9.0"
|
|
112
|
-
# gem "browser", "2.3.0"
|
|
113
|
-
# gem "public_suffix", "2.0.5"
|
|
114
|
-
# gem "sassc-rails", "2.1.0"
|
|
115
|
-
# gem "bootstrap-sass", "3.4.1"
|
|
116
|
-
# gem "sprockets", "3.7.2"
|
|
117
|
-
# gem "uglifier", "3.2.0"
|
|
118
|
-
# gem "jquery-rails", "4.1.1"
|
|
119
|
-
# gem "remotipart", "1.3.1"
|
|
120
|
-
# gem "rack-mini-profiler", "0.10.2", require: false
|
|
121
|
-
# gem "flamegraph", "0.9.5"
|
|
122
|
-
# gem "activerecord-import", "0.18.1"
|
|
123
|
-
# gem "parallel", "1.11.1"
|
|
124
|
-
# gem "ruby-progressbar", "1.8.1"
|
|
125
|
-
# gem "css_parser", "1.5.0"
|
|
126
|
-
# gem "guess", "0.1.1"
|
|
127
|
-
# gem "fastimage", "2.1.0"
|
|
128
|
-
# gem "thread", "0.2.2"
|
|
129
|
-
# gem "parse-cron", "0.1.4"
|
|
130
|
-
# gem "thread-parent", "1.0.4"
|
|
131
|
-
# gem "hexapdf", "0.5.0"
|
|
132
|
-
# gem "geocoder", "1.6.1"
|
|
133
|
-
# gem "sd_notify", "0.1.1"
|
|
134
|
-
# gem "attr_encrypted", "3.1.0"
|
|
135
|
-
# gem "clamby", "1.6.6"
|
|
136
|
-
# gem "scout_apm", "5.1.0"
|
|
137
|
-
# gem "pusher", "1.3.0"
|
|
138
|
-
# gem "phony", "2.18.18"
|
|
139
|
-
# gem "recaptcha", "5.7.0"
|
|
140
|
-
# gem "ransack", "1.8.10"
|
|
141
|
-
# gem "configatron", "4.5.1"
|
|
142
|
-
# gem "fuzzy-string-match", "1.0.1"
|
|
143
|
-
# gem "jwt", "1.5.6"
|
|
144
|
-
# gem "htmlentities", "4.3.4"
|
|
145
|
-
# gem "scenic", "1.5.4"
|
|
146
|
-
# gem "rack-cors", "1.0.6"
|
|
147
|
-
# gem "rails_same_site_cookie", "0.1.8"
|
|
148
|
-
# gem "paper_trail", "10.3.0"
|
|
149
|
-
# gem "net-sftp", "3.0.0"
|
|
150
|
-
# gem "prawn", "2.4.0"
|
|
151
|
-
# gem "prawn-table", "0.2.2"
|
|
152
|
-
# gem "appraisal"
|
|
153
|
-
|
|
154
143
|
class_option :add_irbrc , type: :boolean, default: false
|
|
155
144
|
class_option :add_foreman , type: :boolean, default: false
|
|
156
145
|
class_option :add_devise , type: :boolean, default: false
|
|
@@ -173,8 +162,10 @@ module RailsAppGenerator
|
|
|
173
162
|
class_option :add_shoulda , type: :boolean, default: false
|
|
174
163
|
|
|
175
164
|
# NEW GEM ADDONS
|
|
176
|
-
class_option :
|
|
165
|
+
class_option :add_acts_as_list , type: :boolean, default: false
|
|
177
166
|
class_option :add_honeybadger , type: :boolean, default: false
|
|
167
|
+
class_option :add_rails_html_sanitizer , type: :boolean, default: false
|
|
168
|
+
class_option :add_twilio_ruby , type: :boolean, default: false
|
|
178
169
|
|
|
179
170
|
class << self
|
|
180
171
|
# points to the original rails templates
|
|
@@ -306,20 +297,22 @@ module RailsAppGenerator
|
|
|
306
297
|
def finish_template
|
|
307
298
|
puts 'finish template'
|
|
308
299
|
|
|
300
|
+
add_if(:acts_as_list)
|
|
309
301
|
add_if(:annotate)
|
|
310
302
|
add_if(:devise)
|
|
311
303
|
add_if(:continuous_integration)
|
|
304
|
+
add_if(:factory_bot)
|
|
312
305
|
add_if(:high_voltage)
|
|
306
|
+
add_if(:honeybadger)
|
|
313
307
|
add_if(:generators)
|
|
314
308
|
add_if(:lograge)
|
|
315
309
|
add_if(:pundit)
|
|
310
|
+
add_if(:rails_app_generator)
|
|
316
311
|
add_if(:services)
|
|
317
|
-
add_if(:sidekiq)
|
|
318
|
-
add(:views, :errors, :scaffold) if options[:add_views]
|
|
319
|
-
add_if(:factory_bot)
|
|
320
312
|
add_if(:shoulda)
|
|
321
|
-
add_if(:
|
|
322
|
-
add_if(:
|
|
313
|
+
add_if(:sidekiq)
|
|
314
|
+
add_if(:twilio_ruby)
|
|
315
|
+
add(:views, :errors, :scaffold) if active?(:views)
|
|
323
316
|
|
|
324
317
|
# invoke :rails_customization
|
|
325
318
|
super
|
|
@@ -59,8 +59,10 @@ module RailsAppGenerator
|
|
|
59
59
|
register_option :add_shoulda , type: :boolean, default: false
|
|
60
60
|
|
|
61
61
|
# NEW GEM ADDONS
|
|
62
|
-
register_option :
|
|
62
|
+
register_option :add_acts_as_list , type: :boolean, default: false
|
|
63
63
|
register_option :add_honeybadger , type: :boolean, default: false
|
|
64
|
+
register_option :add_rails_html_sanitizer , type: :boolean, default: false
|
|
65
|
+
register_option :add_twilio_ruby , type: :boolean, default: false
|
|
64
66
|
|
|
65
67
|
# if options[:minimal]
|
|
66
68
|
# self.options = options.merge(
|
data/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rails_app_generator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "rails_app_generator",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.14",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"daisyui": "^2.20.0"
|
|
12
12
|
},
|
data/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"args": {
|
|
3
|
+
"app_path": "twilio_ruby",
|
|
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/twilio_ruby/_.rb",
|
|
10
|
+
"add_twilio_ruby": true
|
|
11
|
+
}
|
|
12
|
+
}
|
data/tasks/addon.thor
CHANGED
|
@@ -21,7 +21,6 @@ class AddOn < Thor
|
|
|
21
21
|
:addon_config_code,
|
|
22
22
|
keyword_init: true
|
|
23
23
|
)
|
|
24
|
-
GemInfo = Struct.new(:name, :version, :description, keyword_init: true)
|
|
25
24
|
|
|
26
25
|
attr_accessor :name
|
|
27
26
|
attr_accessor :data
|
|
@@ -32,10 +31,10 @@ class AddOn < Thor
|
|
|
32
31
|
method_option :force, type: :boolean, default: false, desc: 'Overwrite existing files'
|
|
33
32
|
method_option :depends_on, type: :string, desc: 'This AddOn depends on another AddOn/Gem. active_record is a common dependency'
|
|
34
33
|
def new(name)
|
|
35
|
-
self.name = name
|
|
36
|
-
self.data = build_data
|
|
34
|
+
self.name = snake(name)
|
|
35
|
+
self.data = build_data
|
|
37
36
|
|
|
38
|
-
template('addon/addon', "lib/rails_app_generator/addons/#{name}.rb", force: options[:force])
|
|
37
|
+
template('addon/addon', "lib/rails_app_generator/addons/#{self.name}.rb", force: options[:force])
|
|
39
38
|
end
|
|
40
39
|
|
|
41
40
|
# rubocop:disable Metrics/BlockLength
|
|
@@ -61,7 +60,7 @@ class AddOn < Thor
|
|
|
61
60
|
::GemInfo.get(gem_name)
|
|
62
61
|
end
|
|
63
62
|
|
|
64
|
-
def build_data
|
|
63
|
+
def build_data
|
|
65
64
|
code = [build_depends_on_code, build_required_gem_code].compact
|
|
66
65
|
code << '' if code.any?
|
|
67
66
|
|
data/tasks/profile.thor
CHANGED
|
@@ -24,6 +24,7 @@ class Profile < Thor
|
|
|
24
24
|
keyword_init: true
|
|
25
25
|
)
|
|
26
26
|
|
|
27
|
+
attr_accessor :name
|
|
27
28
|
attr_accessor :data
|
|
28
29
|
|
|
29
30
|
desc 'new', 'Create a new Profile for testing Rails App Generator settings'
|
|
@@ -32,7 +33,8 @@ class Profile < Thor
|
|
|
32
33
|
method_option :force, type: :boolean, default: false, desc: 'Overwrite existing files'
|
|
33
34
|
# rubocop:disable Metrics/AbcSize
|
|
34
35
|
def new(name)
|
|
35
|
-
|
|
36
|
+
self.name = snake(name)
|
|
37
|
+
self.data = build_data
|
|
36
38
|
|
|
37
39
|
say "Creating profile #{name}"
|
|
38
40
|
puts "Variant: #{options[:variant]}"
|
|
@@ -58,7 +60,7 @@ class Profile < Thor
|
|
|
58
60
|
File.join(path, file)
|
|
59
61
|
end
|
|
60
62
|
|
|
61
|
-
def build_data
|
|
63
|
+
def build_data
|
|
62
64
|
gi = gem_info(name)
|
|
63
65
|
|
|
64
66
|
description = gi ? gi.description : 'Description goes here'
|
|
@@ -66,12 +68,12 @@ class Profile < Thor
|
|
|
66
68
|
Data.new(
|
|
67
69
|
name: name,
|
|
68
70
|
name_dash: dash(name),
|
|
69
|
-
name_snake:
|
|
71
|
+
name_snake: name,
|
|
70
72
|
name_human: human(name),
|
|
71
73
|
name_camel: camel(name),
|
|
72
74
|
description: description,
|
|
73
75
|
destination_root: build_destination_root,
|
|
74
|
-
template_file: build_template_file(
|
|
76
|
+
template_file: build_template_file(name)
|
|
75
77
|
)
|
|
76
78
|
end
|
|
77
79
|
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<h2><%= data.description %></h2>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<!--
|
|
6
|
+
Add/Remove as needed
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
<= link_to 'Products', products_path %> |
|
|
11
|
+
<= link_to 'Posts', posts_path %> |
|
|
12
|
+
<= link_to 'People', people_path %>
|
|
13
|
+
-->
|
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.
|
|
4
|
+
version: 0.1.14
|
|
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-
|
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bootsnap
|
|
@@ -170,6 +170,10 @@ files:
|
|
|
170
170
|
- after_templates/addons/rails_html_sanitizer/_.rb
|
|
171
171
|
- after_templates/addons/rails_html_sanitizer/home/index.html.erb
|
|
172
172
|
- after_templates/addons/rails_html_sanitizer_xxx/home/index.html.erb
|
|
173
|
+
- after_templates/addons/twilio_ruby/_.rb
|
|
174
|
+
- after_templates/addons/twilio_ruby/app/controllers/home_controller.rb
|
|
175
|
+
- after_templates/addons/twilio_ruby/app/views/home/index.html.erb
|
|
176
|
+
- after_templates/addons/twilio_ruby/config/initializers/twilio.rb
|
|
173
177
|
- after_templates/rag_bootstrap.rb
|
|
174
178
|
- after_templates/rag_bootstrap/application-yield.html.erb
|
|
175
179
|
- after_templates/rag_bootstrap/application.html.erb
|
|
@@ -363,6 +367,7 @@ files:
|
|
|
363
367
|
- package.json
|
|
364
368
|
- profiles/addons/honeybadger.json
|
|
365
369
|
- profiles/addons/rails-html-sanitizer.json
|
|
370
|
+
- profiles/addons/twilio_ruby.json
|
|
366
371
|
- profiles/rag-add-some-pages.json
|
|
367
372
|
- profiles/rag-bootstrap.json
|
|
368
373
|
- profiles/rag-devise.json
|