boring_generators 0.6.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +7 -1
- data/CHANGELOG.md +23 -0
- data/Gemfile.lock +65 -65
- data/README.md +20 -7
- data/Rakefile +1 -0
- data/lib/boring_generators/version.rb +1 -1
- data/lib/generators/boring/active_storage/aws/install/install_generator.rb +10 -8
- data/lib/generators/boring/active_storage/azure/install/install_generator.rb +9 -7
- data/lib/generators/boring/active_storage/google/install/install_generator.rb +9 -7
- data/lib/generators/boring/ahoy/install/install_generator.rb +31 -0
- data/lib/generators/boring/ahoy/install/templates/README +10 -0
- data/lib/generators/boring/audit/install/install_generator.rb +12 -9
- data/lib/generators/boring/bullet/install/install_generator.rb +4 -8
- data/lib/generators/boring/ci/github_action/install/install_generator.rb +1 -1
- data/lib/generators/boring/ci/github_action/install/templates/ci.yml.tt +15 -2
- data/lib/generators/boring/devise/install/install_generator.rb +1 -7
- data/lib/generators/boring/font_awesome/ruby_gem/install/install_generator.rb +3 -8
- data/lib/generators/boring/graphql/install/install_generator.rb +3 -7
- data/lib/generators/boring/oauth/base_generator.rb +63 -0
- data/lib/generators/boring/oauth/facebook/install/install_generator.rb +12 -67
- data/lib/generators/boring/oauth/facebook/install/templates/README +2 -3
- data/lib/generators/boring/oauth/github/install/install_generator.rb +36 -0
- data/lib/generators/boring/oauth/github/install/templates/README +23 -0
- data/lib/generators/boring/oauth/github/install/templates/omniauth_callbacks_controller.rb +21 -0
- data/lib/generators/boring/oauth/google/install/install_generator.rb +36 -0
- data/lib/generators/boring/oauth/google/install/templates/README +23 -0
- data/lib/generators/boring/oauth/google/install/templates/omniauth_callbacks_controller.rb +21 -0
- data/lib/generators/boring/oauth/twitter/install/install_generator.rb +36 -0
- data/lib/generators/boring/oauth/twitter/install/templates/README +23 -0
- data/lib/generators/boring/oauth/twitter/install/templates/omniauth_callbacks_controller.rb +21 -0
- data/lib/generators/boring/paper_trail/install/install_generator.rb +40 -0
- data/lib/generators/boring/payments/stripe/install/install_generator.rb +43 -0
- data/lib/generators/boring/payments/stripe/install/templates/README +21 -0
- data/lib/generators/boring/payments/stripe/install/templates/controllers/stripe/checkouts_controller.rb +63 -0
- data/lib/generators/boring/payments/stripe/install/templates/stripe.rb +1 -0
- data/lib/generators/boring/payments/stripe/install/templates/views/stripe/checkouts/create.js.erb +13 -0
- data/lib/generators/boring/payments/stripe/install/templates/views/stripe/checkouts/show.html.erb +8 -0
- data/lib/generators/boring/pry/install/install_generator.rb +4 -9
- data/lib/generators/boring/pundit/install/install_generator.rb +1 -7
- data/lib/generators/boring/rails_admin/install/install_generator.rb +36 -0
- data/lib/generators/boring/rubocop/install/install_generator.rb +3 -1
- data/lib/generators/boring/simple_form/install/install_generator.rb +4 -8
- data/lib/generators/boring/stimulus/install/install_generator.rb +24 -0
- data/lib/generators/boring/tailwind/install/install_generator.rb +11 -10
- data/lib/generators/boring/tailwind/install/templates/README +13 -0
- data/lib/generators/boring/twilio/install/install_generator.rb +26 -0
- data/lib/generators/boring/twilio/install/templates/README +11 -0
- data/lib/generators/boring/twilio/install/templates/twilio.rb +4 -0
- metadata +27 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee57d89d7ab8e0ffa351d54ae30a52a5d8adeb1a2fdfd7c99910be78599c104e
|
4
|
+
data.tar.gz: 759e5b5f00ec406743075950bdb5637274c1364d9f74674b92408dc49aa7c193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db02ff1b7c2503b3cbc61a525d8c22557ea703c50821a7c62de5a807d0d9778aaaca9bfc816884576c593d076a681c7d14aa4f185034c740da41596be5f61df7
|
7
|
+
data.tar.gz: 935f71b5e4ed6ba413698addf56884b473458966a4350fbb071fa2667d4c99240d9ead01936236a585b2e70bace03cdab94b85212bdeb3e0e95d9e70e8b75602
|
data/.github/workflows/ci.yml
CHANGED
@@ -11,7 +11,13 @@ jobs:
|
|
11
11
|
uses: ruby/setup-ruby@v1
|
12
12
|
with:
|
13
13
|
ruby-version: 2.7.0
|
14
|
+
bundler-cache: true
|
15
|
+
- name: Install Imagemagick
|
16
|
+
run: |
|
17
|
+
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-imagemagick
|
18
|
+
chmod +x install-imagemagick
|
19
|
+
sudo ./install-imagemagick
|
14
20
|
- name: Install gems
|
15
21
|
run: bundle install --jobs 4 --retry 3
|
16
22
|
- name: Run tests
|
17
|
-
run: bundle exec rake test
|
23
|
+
run: bundle exec rake test --trace
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,29 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.11.0 (June 23rd, 2021)
|
6
|
+
* Adds Stimulus generator. ([@abhaynikam][])
|
7
|
+
* Adds Rails Admin generator. ([@abhaynikam][])
|
8
|
+
* Adds Paper Trail generator. ([@abhaynikam][])
|
9
|
+
* Update default node-version for GitHub Action generator and fixes PG setup issues. ([@abhaynikam][])
|
10
|
+
|
11
|
+
## 0.10.0 (May 26th, 2021)
|
12
|
+
* Updates Stripe payment generator. ([@abhaynikam][])
|
13
|
+
* Fixes many generators which install ruby gems to not hardcode gem version. ([@abhaynikam][])
|
14
|
+
|
15
|
+
## 0.9.0 (April 14th, 2021)
|
16
|
+
* Adds Ahoy generator. ([@abhaynikam][])
|
17
|
+
* Adds Stripe payment generator. ([@abhaynikam][])
|
18
|
+
|
19
|
+
## 0.8.0 (February 28th, 2021)
|
20
|
+
* Adds Devise Google Omniauth generator. ([@abhaynikam][])
|
21
|
+
* Adds Devise Twitter Omniauth generator. ([@abhaynikam][])
|
22
|
+
* Adds Twilio generator. ([@abhaynikam][])
|
23
|
+
|
24
|
+
## 0.7.0 (January 30th, 2021)
|
25
|
+
* Upgrade the Tailwind CSS generator to support Tailwind V2.0. ([@abhaynikam][])
|
26
|
+
* Adds Devise GitHub Omniauth generator. ([@abhaynikam][])
|
27
|
+
|
5
28
|
## 0.6.0 (January 10th, 2021)
|
6
29
|
* Updates default ruby version of GitHub Actions install generator. ([@jamesglover][])
|
7
30
|
* Simplify generated GitHub Actions install ([@jamesglover][])
|
data/Gemfile.lock
CHANGED
@@ -1,62 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
boring_generators (0.
|
4
|
+
boring_generators (0.10.0)
|
5
5
|
railties
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (6.0.3.
|
11
|
-
actionpack (= 6.0.3.
|
10
|
+
actioncable (6.0.3.6)
|
11
|
+
actionpack (= 6.0.3.6)
|
12
12
|
nio4r (~> 2.0)
|
13
13
|
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailbox (6.0.3.
|
15
|
-
actionpack (= 6.0.3.
|
16
|
-
activejob (= 6.0.3.
|
17
|
-
activerecord (= 6.0.3.
|
18
|
-
activestorage (= 6.0.3.
|
19
|
-
activesupport (= 6.0.3.
|
14
|
+
actionmailbox (6.0.3.6)
|
15
|
+
actionpack (= 6.0.3.6)
|
16
|
+
activejob (= 6.0.3.6)
|
17
|
+
activerecord (= 6.0.3.6)
|
18
|
+
activestorage (= 6.0.3.6)
|
19
|
+
activesupport (= 6.0.3.6)
|
20
20
|
mail (>= 2.7.1)
|
21
|
-
actionmailer (6.0.3.
|
22
|
-
actionpack (= 6.0.3.
|
23
|
-
actionview (= 6.0.3.
|
24
|
-
activejob (= 6.0.3.
|
21
|
+
actionmailer (6.0.3.6)
|
22
|
+
actionpack (= 6.0.3.6)
|
23
|
+
actionview (= 6.0.3.6)
|
24
|
+
activejob (= 6.0.3.6)
|
25
25
|
mail (~> 2.5, >= 2.5.4)
|
26
26
|
rails-dom-testing (~> 2.0)
|
27
|
-
actionpack (6.0.3.
|
28
|
-
actionview (= 6.0.3.
|
29
|
-
activesupport (= 6.0.3.
|
27
|
+
actionpack (6.0.3.6)
|
28
|
+
actionview (= 6.0.3.6)
|
29
|
+
activesupport (= 6.0.3.6)
|
30
30
|
rack (~> 2.0, >= 2.0.8)
|
31
31
|
rack-test (>= 0.6.3)
|
32
32
|
rails-dom-testing (~> 2.0)
|
33
33
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
34
|
-
actiontext (6.0.3.
|
35
|
-
actionpack (= 6.0.3.
|
36
|
-
activerecord (= 6.0.3.
|
37
|
-
activestorage (= 6.0.3.
|
38
|
-
activesupport (= 6.0.3.
|
34
|
+
actiontext (6.0.3.6)
|
35
|
+
actionpack (= 6.0.3.6)
|
36
|
+
activerecord (= 6.0.3.6)
|
37
|
+
activestorage (= 6.0.3.6)
|
38
|
+
activesupport (= 6.0.3.6)
|
39
39
|
nokogiri (>= 1.8.5)
|
40
|
-
actionview (6.0.3.
|
41
|
-
activesupport (= 6.0.3.
|
40
|
+
actionview (6.0.3.6)
|
41
|
+
activesupport (= 6.0.3.6)
|
42
42
|
builder (~> 3.1)
|
43
43
|
erubi (~> 1.4)
|
44
44
|
rails-dom-testing (~> 2.0)
|
45
45
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
46
|
-
activejob (6.0.3.
|
47
|
-
activesupport (= 6.0.3.
|
46
|
+
activejob (6.0.3.6)
|
47
|
+
activesupport (= 6.0.3.6)
|
48
48
|
globalid (>= 0.3.6)
|
49
|
-
activemodel (6.0.3.
|
50
|
-
activesupport (= 6.0.3.
|
51
|
-
activerecord (6.0.3.
|
52
|
-
activemodel (= 6.0.3.
|
53
|
-
activesupport (= 6.0.3.
|
54
|
-
activestorage (6.0.3.
|
55
|
-
actionpack (= 6.0.3.
|
56
|
-
activejob (= 6.0.3.
|
57
|
-
activerecord (= 6.0.3.
|
58
|
-
marcel (~> 0.
|
59
|
-
activesupport (6.0.3.
|
49
|
+
activemodel (6.0.3.6)
|
50
|
+
activesupport (= 6.0.3.6)
|
51
|
+
activerecord (6.0.3.6)
|
52
|
+
activemodel (= 6.0.3.6)
|
53
|
+
activesupport (= 6.0.3.6)
|
54
|
+
activestorage (6.0.3.6)
|
55
|
+
actionpack (= 6.0.3.6)
|
56
|
+
activejob (= 6.0.3.6)
|
57
|
+
activerecord (= 6.0.3.6)
|
58
|
+
marcel (~> 1.0.0)
|
59
|
+
activesupport (6.0.3.6)
|
60
60
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
61
61
|
i18n (>= 0.7, < 2)
|
62
62
|
minitest (~> 5.1)
|
@@ -64,54 +64,54 @@ GEM
|
|
64
64
|
zeitwerk (~> 2.2, >= 2.2.2)
|
65
65
|
builder (3.2.4)
|
66
66
|
byebug (11.1.3)
|
67
|
-
concurrent-ruby (1.1.
|
67
|
+
concurrent-ruby (1.1.8)
|
68
68
|
crass (1.0.6)
|
69
69
|
erubi (1.10.0)
|
70
70
|
globalid (0.4.2)
|
71
71
|
activesupport (>= 4.2.0)
|
72
|
-
i18n (1.8.
|
72
|
+
i18n (1.8.10)
|
73
73
|
concurrent-ruby (~> 1.0)
|
74
|
-
loofah (2.
|
74
|
+
loofah (2.9.1)
|
75
75
|
crass (~> 1.0.2)
|
76
76
|
nokogiri (>= 1.5.9)
|
77
77
|
mail (2.7.1)
|
78
78
|
mini_mime (>= 0.1.1)
|
79
|
-
marcel (0.
|
80
|
-
mimemagic (~> 0.3.2)
|
79
|
+
marcel (1.0.1)
|
81
80
|
method_source (1.0.0)
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
81
|
+
mini_mime (1.1.0)
|
82
|
+
mini_portile2 (2.5.0)
|
83
|
+
minitest (5.14.4)
|
84
|
+
nio4r (2.5.7)
|
85
|
+
nokogiri (1.11.3)
|
86
|
+
mini_portile2 (~> 2.5.0)
|
87
|
+
racc (~> 1.4)
|
88
|
+
racc (1.5.2)
|
89
89
|
rack (2.2.3)
|
90
90
|
rack-test (1.1.0)
|
91
91
|
rack (>= 1.0, < 3)
|
92
|
-
rails (6.0.3.
|
93
|
-
actioncable (= 6.0.3.
|
94
|
-
actionmailbox (= 6.0.3.
|
95
|
-
actionmailer (= 6.0.3.
|
96
|
-
actionpack (= 6.0.3.
|
97
|
-
actiontext (= 6.0.3.
|
98
|
-
actionview (= 6.0.3.
|
99
|
-
activejob (= 6.0.3.
|
100
|
-
activemodel (= 6.0.3.
|
101
|
-
activerecord (= 6.0.3.
|
102
|
-
activestorage (= 6.0.3.
|
103
|
-
activesupport (= 6.0.3.
|
92
|
+
rails (6.0.3.6)
|
93
|
+
actioncable (= 6.0.3.6)
|
94
|
+
actionmailbox (= 6.0.3.6)
|
95
|
+
actionmailer (= 6.0.3.6)
|
96
|
+
actionpack (= 6.0.3.6)
|
97
|
+
actiontext (= 6.0.3.6)
|
98
|
+
actionview (= 6.0.3.6)
|
99
|
+
activejob (= 6.0.3.6)
|
100
|
+
activemodel (= 6.0.3.6)
|
101
|
+
activerecord (= 6.0.3.6)
|
102
|
+
activestorage (= 6.0.3.6)
|
103
|
+
activesupport (= 6.0.3.6)
|
104
104
|
bundler (>= 1.3.0)
|
105
|
-
railties (= 6.0.3.
|
105
|
+
railties (= 6.0.3.6)
|
106
106
|
sprockets-rails (>= 2.0.0)
|
107
107
|
rails-dom-testing (2.0.3)
|
108
108
|
activesupport (>= 4.2.0)
|
109
109
|
nokogiri (>= 1.6)
|
110
110
|
rails-html-sanitizer (1.3.0)
|
111
111
|
loofah (~> 2.3)
|
112
|
-
railties (6.0.3.
|
113
|
-
actionpack (= 6.0.3.
|
114
|
-
activesupport (= 6.0.3.
|
112
|
+
railties (6.0.3.6)
|
113
|
+
actionpack (= 6.0.3.6)
|
114
|
+
activesupport (= 6.0.3.6)
|
115
115
|
method_source
|
116
116
|
rake (>= 0.8.7)
|
117
117
|
thor (>= 0.20.3, < 2.0)
|
@@ -124,7 +124,7 @@ GEM
|
|
124
124
|
activesupport (>= 4.0)
|
125
125
|
sprockets (>= 3.0.0)
|
126
126
|
sqlite3 (1.4.2)
|
127
|
-
thor (1.0
|
127
|
+
thor (1.1.0)
|
128
128
|
thread_safe (0.3.6)
|
129
129
|
tzinfo (1.2.9)
|
130
130
|
thread_safe (~> 0.1)
|
data/README.md
CHANGED
@@ -40,19 +40,19 @@ And then you can use it this way:
|
|
40
40
|
## Usage
|
41
41
|
|
42
42
|
The boring generator introduces following generators:
|
43
|
-
- Install Tailwind CSS: `rails generate boring:tailwind:install`
|
44
|
-
- Install Bootstrap: `rails generate boring:bootstrap:install`
|
43
|
+
- [Install Tailwind CSS](https://www.boringgenerators.com/blog/2020-10-18-install-tailwind/): `rails generate boring:tailwind:install`
|
44
|
+
- [Install Bootstrap](https://www.boringgenerators.com/blog/2020-11-15-install-bootstrap/): `rails generate boring:bootstrap:install`
|
45
45
|
- Install JQuery: `rails generate boring:jquery:install`
|
46
|
-
- Install FontAwesome via Yarn: `rails generate boring:font_awesome:yarn:install`
|
47
|
-
- Install FontAwesome via RubyGems: `rails generate boring:font_awesome:ruby_gem:install`
|
46
|
+
- [Install FontAwesome via Yarn](https://www.boringgenerators.com/blog/2021-02-28-install-fontawesome-yarn/): `rails generate boring:font_awesome:yarn:install`
|
47
|
+
- [Install FontAwesome via RubyGems](https://www.boringgenerators.com/blog/2021-02-23-install-fontawesome/): `rails generate boring:font_awesome:ruby_gem:install`
|
48
48
|
- Install Bullet: `rails generate boring:bullet:install`
|
49
49
|
- Install Audit gems(bundler-audit, ruby_audit): `rails generate boring:audit:install`
|
50
50
|
- Install Pry gems for easy debugging: `rails generate boring:pry:install`
|
51
51
|
- Install Active Storage for Google Cloud Service: `rails generate boring:active_storage:google:install`
|
52
52
|
- Install Active Storage for AWS: `rails generate boring:active_storage:aws:install`
|
53
53
|
- Install Active Storage for Azure: `rails generate boring:active_storage:azure:install`
|
54
|
-
- Install CircleCI: `rails generate boring:ci:circleci:install --repository_name=<name> --ruby_version=<version>`
|
55
|
-
- Install GitHub Actions: `rails generate boring:ci:github_action:install --repository_name=<name> --ruby_version=<version>`
|
54
|
+
- [Install CircleCI](https://www.boringgenerators.com/blog/2021-01-02-configure-circleci/): `rails generate boring:ci:circleci:install --repository_name=<name> --ruby_version=<version>`
|
55
|
+
- [Install GitHub Actions](https://www.boringgenerators.com/blog/2020-12-17-configure-github-actions/): `rails generate boring:ci:github_action:install --repository_name=<name> --ruby_version=<version>`
|
56
56
|
- Install Travis CI: `rails generate boring:ci:travisci:install --ruby_version=<version>`
|
57
57
|
- Install Rubocop: `rails generate boring:rubocop:install --ruby_version=<version>`
|
58
58
|
- Build Favicon: `rails generate boring:favicon:build --application_name=<application_name> --favico_letter=<favico_letter> --primary_color=<color>`
|
@@ -60,7 +60,20 @@ The boring generator introduces following generators:
|
|
60
60
|
- Install GraphQL: `rails generate boring:graphql:install`
|
61
61
|
- Install SimpleForm: `rails generate boring:simple_form:install --css_framework=<css_framework>`
|
62
62
|
- Install Devise: `rails generate boring:devise:install`
|
63
|
-
- Install Devise Facebook Omniauth: `rails generate boring:oauth:facebook:install`
|
63
|
+
- [Install Devise Facebook Omniauth](https://www.boringgenerators.com/blog/2021-02-07-install-oauth-facbook/): `rails generate boring:oauth:facebook:install`
|
64
|
+
- Install Devise GitHub Omniauth: `rails generate boring:oauth:github:install`
|
65
|
+
- Install Devise Google Omniauth: `rails generate boring:oauth:google:install`
|
66
|
+
- Install Devise Twitter Omniauth: `rails generate boring:oauth:twitter:install`
|
67
|
+
- Install Twilio: `rails generate boring:twilio:install`
|
68
|
+
- Install Ahoy: `rails generate boring:ahoy:install`
|
69
|
+
- Install Stripe: `rails generate boring:payments:stripe:install`
|
70
|
+
- Install Stimulus: `rails generate boring:stimulus:install`
|
71
|
+
- Install Rails Admin: `rails generate boring:rails_admin:install`
|
72
|
+
- Install Paper Trail: `rails generate boring:paper_trail:install`
|
73
|
+
|
74
|
+
## Screencasts
|
75
|
+
|
76
|
+
- [How to use Boring Generators](https://www.youtube.com/watch?v=9vaK9nDMbU8) by [Yaroslav Shmarov](https://twitter.com/yarotheslav)
|
64
77
|
|
65
78
|
## Development
|
66
79
|
|
data/Rakefile
CHANGED
@@ -15,14 +15,16 @@ module Boring
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def add_aws_to_the_application
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
Bundler.with_unbundled_env do
|
19
|
+
say "Adding AWS gem", :green
|
20
|
+
aws_gem_content = <<~RUBY
|
21
|
+
\n
|
22
|
+
# for AWS Service
|
23
|
+
gem "aws-sdk-s3", require: false
|
24
|
+
RUBY
|
25
|
+
append_to_file "Gemfile", aws_gem_content
|
26
|
+
run "bundle install"
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
def add_configuration_to_production
|
@@ -16,13 +16,15 @@ module Boring
|
|
16
16
|
|
17
17
|
def add_azure_to_the_application
|
18
18
|
say "Adding mircosoft azure gem", :green
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
Bundler.with_unbundled_env do
|
20
|
+
azure_gem_content = <<~RUBY
|
21
|
+
\n
|
22
|
+
# for Azure Service
|
23
|
+
gem "azure-storage-blob", require: false
|
24
|
+
RUBY
|
25
|
+
append_to_file "Gemfile", azure_gem_content
|
26
|
+
run "bundle install"
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
def add_configuration_to_production
|
@@ -16,13 +16,15 @@ module Boring
|
|
16
16
|
|
17
17
|
def add_google_cloud_storage_to_the_application
|
18
18
|
say "Adding google cloud storage gem", :green
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
Bundler.with_unbundled_env do
|
20
|
+
google_cloud_storage_gem_content = <<~RUBY
|
21
|
+
\n
|
22
|
+
# for Google Cloud Storage Service
|
23
|
+
gem "google-cloud-storage", require: false
|
24
|
+
RUBY
|
25
|
+
append_to_file "Gemfile", google_cloud_storage_gem_content
|
26
|
+
run "bundle install"
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
def add_configuration_to_production
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler'
|
4
|
+
|
5
|
+
module Boring
|
6
|
+
module Ahoy
|
7
|
+
class InstallGenerator < Rails::Generators::Base
|
8
|
+
desc "Adds Ahoy to the application"
|
9
|
+
source_root File.expand_path("templates", __dir__)
|
10
|
+
|
11
|
+
def add_twitter_omniauth_gem
|
12
|
+
say "Adding Ahoy gem", :green
|
13
|
+
Bundler.with_unbundled_env do
|
14
|
+
run "bundle add ahoy_matey"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def run_ahoy_generator
|
19
|
+
say "Running Ahoy generator", :green
|
20
|
+
Bundler.with_unbundled_env do
|
21
|
+
run "bundle exec rails generate ahoy:install"
|
22
|
+
run "bundle exec rails db:migrate"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def show_readme
|
27
|
+
readme "README"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
===============================================================================
|
2
|
+
|
3
|
+
Some setup you must do manually based on your project requirement:
|
4
|
+
|
5
|
+
1. To prevent Rails actions from tracking visits: `skip_before_action :track_ahoy_visit`
|
6
|
+
2. To associate and add association in the model with ahoy. Add `visitable :ahoy_visit` in the model.
|
7
|
+
|
8
|
+
You could find more configuration options on Ahoy documentation: https://github.com/ankane/ahoy
|
9
|
+
|
10
|
+
===============================================================================
|
@@ -7,15 +7,18 @@ module Boring
|
|
7
7
|
|
8
8
|
def add_bullet_gem
|
9
9
|
say "Adding audit gems", :green
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
|
11
|
+
Bundler.with_unbundled_env do
|
12
|
+
audit_gems_content = <<~RUBY
|
13
|
+
\n
|
14
|
+
\t# Patch-level verification for Bundler. https://github.com/rubysec/bundler-audit
|
15
|
+
\tgem "bundler-audit", require: false
|
16
|
+
\t# vulnerabity checker for Ruby itself. https://github.com/civisanalytics/ruby_audit
|
17
|
+
\tgem "ruby_audit", require: false
|
18
|
+
RUBY
|
19
|
+
insert_into_file "Gemfile", audit_gems_content, after: /group :development do/
|
20
|
+
run "bundle install"
|
21
|
+
end
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|