boring_generators 0.3.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +12 -0
- data/.github/workflows/ci.yml +23 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +150 -0
- data/README.md +47 -7
- data/Rakefile +1 -0
- data/boring_generators.gemspec +2 -0
- data/exe/boring +5 -0
- data/lib/boring_generators.rb +1 -0
- data/lib/boring_generators/cli.rb +26 -0
- data/lib/boring_generators/version.rb +1 -1
- data/lib/generators/boring/bootstrap/install/install_generator.rb +2 -2
- data/lib/generators/boring/ci/circleci/install/install_generator.rb +31 -0
- data/lib/generators/boring/ci/circleci/install/templates/config.psql.yml.tt +48 -0
- data/lib/generators/boring/ci/circleci/install/templates/config.sql.yml.tt +48 -0
- data/lib/generators/boring/ci/circleci/install/templates/database.yml.ci.tt +14 -0
- data/lib/generators/boring/ci/github_action/install/install_generator.rb +45 -0
- data/lib/generators/boring/ci/github_action/install/templates/ci.yml.tt +49 -0
- data/lib/generators/boring/ci/travisci/install/install_generator.rb +23 -0
- data/lib/generators/boring/ci/travisci/install/templates/.travis.yml.tt +35 -0
- data/lib/generators/boring/devise/install/install_generator.rb +75 -0
- data/lib/generators/boring/favicon/build/build_generator.rb +120 -0
- data/lib/generators/boring/favicon/build/templates/favicon.html.erb.tt +19 -0
- data/lib/generators/boring/graphql/install/install_generator.rb +51 -0
- data/lib/generators/boring/graphql/install/templates/base_resolver.rb +2 -0
- data/lib/generators/boring/graphql/install/templates/hello_world_resolver.rb +11 -0
- data/lib/generators/boring/oauth/base_generator.rb +63 -0
- data/lib/generators/boring/oauth/facebook/install/install_generator.rb +42 -0
- data/lib/generators/boring/oauth/facebook/install/templates/README +20 -0
- data/lib/generators/boring/oauth/facebook/install/templates/omniauth.rb +3 -0
- data/lib/generators/boring/oauth/facebook/install/templates/omniauth_callbacks_controller.rb +21 -0
- data/lib/generators/boring/oauth/github/install/install_generator.rb +42 -0
- data/lib/generators/boring/oauth/github/install/templates/README +20 -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 +20 -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 +20 -0
- data/lib/generators/boring/oauth/twitter/install/templates/omniauth_callbacks_controller.rb +21 -0
- data/lib/generators/boring/pundit/install/install_generator.rb +85 -0
- data/lib/generators/boring/rubocop/install/install_generator.rb +37 -0
- data/lib/generators/boring/rubocop/install/templates/.rubocop.yml.tt +262 -0
- data/lib/generators/boring/simple_form/install/install_generator.rb +44 -0
- data/lib/generators/boring/tailwind/install/install_generator.rb +13 -12
- data/lib/generators/boring/tailwind/install/templates/README +13 -0
- data/lib/generators/boring/twilio/install/install_generator.rb +30 -0
- data/lib/generators/boring/twilio/install/templates/README +11 -0
- data/lib/generators/boring/twilio/install/templates/twilio.rb +4 -0
- metadata +2525 -5
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cac88ca9c5967e3109166aab566f0ec75936e5aee8b752c0c48602eda974b9c
|
4
|
+
data.tar.gz: 968a3f0761e84fa8caf64c2e23acba3e82e09c2b7c85d342a9e3c872c8a11d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be7b2ef1596240670290b4088a7d75a82a5a525b837fa7eeaff3b713e3b974f5eb26f81d5132259bedf1eb5af3d90aba279e992d7f69571fb85406c995a62f80
|
7
|
+
data.tar.gz: 72b7998e2cf8f42f4c4f77c956ebccf702872e3f32b98e99266ddf1a0d94be312c9bef3e4d48f94b854d3a0ed93776576620964a9883b259f64847fb306bc751
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# These are supported funding model platforms
|
2
|
+
|
3
|
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
+
patreon: # Replace with a single Patreon username
|
5
|
+
open_collective: boring_generators
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
11
|
+
otechie: # Replace with a single Otechie username
|
12
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
name: Tests
|
6
|
+
runs-on: ubuntu-latest
|
7
|
+
steps:
|
8
|
+
- name: Checkout code
|
9
|
+
uses: actions/checkout@v2
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
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
|
20
|
+
- name: Install gems
|
21
|
+
run: bundle install --jobs 4 --retry 3
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake test --trace
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,34 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.8.0 (February 28th, 2021)
|
6
|
+
* Adds Devise Google Omniauth generator. ([@abhaynikam][])
|
7
|
+
* Adds Devise Twitter Omniauth generator. ([@abhaynikam][])
|
8
|
+
* Adds Twilio generator. ([@abhaynikam][])
|
9
|
+
|
10
|
+
## 0.7.0 (January 30th, 2021)
|
11
|
+
* Upgrade the Tailwind CSS generator to support Tailwind V2.0. ([@abhaynikam][])
|
12
|
+
* Adds Devise GitHub Omniauth generator. ([@abhaynikam][])
|
13
|
+
|
14
|
+
## 0.6.0 (January 10th, 2021)
|
15
|
+
* Updates default ruby version of GitHub Actions install generator. ([@jamesglover][])
|
16
|
+
* Simplify generated GitHub Actions install ([@jamesglover][])
|
17
|
+
* Adds boring generator CLI ([@luathn][])
|
18
|
+
* Adds Devise Facebook Omniauth generator. ([@abhaynikam][])
|
19
|
+
|
20
|
+
## 0.5.0 (December 20th, 2020)
|
21
|
+
* Adds favicon build generator. ([@abhaynikam][])
|
22
|
+
* Adds Pundit install generator. ([@CiTroNaK][])
|
23
|
+
* Adds GraphQL generator. ([@abhaynikam][])
|
24
|
+
* Adds SimpleForm generator. ([@abhaynikam][])
|
25
|
+
* Adds Devise generator. ([@abhaynikam][])
|
26
|
+
|
27
|
+
## 0.4.0 (October 23rd, 2020)
|
28
|
+
* Adds CircleCI install generator. ([@abhaynikam][])
|
29
|
+
* Adds GitHub Actions install generator. ([@abhaynikam][])
|
30
|
+
* Adds Travis CI install generator. ([@abhaynikam][])
|
31
|
+
* Adds Rubocop install generator. ([@abhaynikam][])
|
32
|
+
|
5
33
|
## 0.3.0 (September 19th, 2020)
|
6
34
|
* Adds Bullet install generator. ([@abhaynikam][])
|
7
35
|
* Adds Audit gems(bundler-audit, ruby_audit) install generator. ([@abhaynikam][])
|
@@ -22,3 +50,6 @@
|
|
22
50
|
* Initial release. ([@abhaynikam][])
|
23
51
|
|
24
52
|
[@abhaynikam]: https://github.com/abhaynikam
|
53
|
+
[@CiTroNaK]: https://github.com/CiTroNaK
|
54
|
+
[@jamesglover]: https://github.com/JamesGlover
|
55
|
+
[@luathn]: https://github.com/luathn
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
boring_generators (0.8.0)
|
5
|
+
railties
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actioncable (6.0.3.4)
|
11
|
+
actionpack (= 6.0.3.4)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailbox (6.0.3.4)
|
15
|
+
actionpack (= 6.0.3.4)
|
16
|
+
activejob (= 6.0.3.4)
|
17
|
+
activerecord (= 6.0.3.4)
|
18
|
+
activestorage (= 6.0.3.4)
|
19
|
+
activesupport (= 6.0.3.4)
|
20
|
+
mail (>= 2.7.1)
|
21
|
+
actionmailer (6.0.3.4)
|
22
|
+
actionpack (= 6.0.3.4)
|
23
|
+
actionview (= 6.0.3.4)
|
24
|
+
activejob (= 6.0.3.4)
|
25
|
+
mail (~> 2.5, >= 2.5.4)
|
26
|
+
rails-dom-testing (~> 2.0)
|
27
|
+
actionpack (6.0.3.4)
|
28
|
+
actionview (= 6.0.3.4)
|
29
|
+
activesupport (= 6.0.3.4)
|
30
|
+
rack (~> 2.0, >= 2.0.8)
|
31
|
+
rack-test (>= 0.6.3)
|
32
|
+
rails-dom-testing (~> 2.0)
|
33
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
34
|
+
actiontext (6.0.3.4)
|
35
|
+
actionpack (= 6.0.3.4)
|
36
|
+
activerecord (= 6.0.3.4)
|
37
|
+
activestorage (= 6.0.3.4)
|
38
|
+
activesupport (= 6.0.3.4)
|
39
|
+
nokogiri (>= 1.8.5)
|
40
|
+
actionview (6.0.3.4)
|
41
|
+
activesupport (= 6.0.3.4)
|
42
|
+
builder (~> 3.1)
|
43
|
+
erubi (~> 1.4)
|
44
|
+
rails-dom-testing (~> 2.0)
|
45
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
46
|
+
activejob (6.0.3.4)
|
47
|
+
activesupport (= 6.0.3.4)
|
48
|
+
globalid (>= 0.3.6)
|
49
|
+
activemodel (6.0.3.4)
|
50
|
+
activesupport (= 6.0.3.4)
|
51
|
+
activerecord (6.0.3.4)
|
52
|
+
activemodel (= 6.0.3.4)
|
53
|
+
activesupport (= 6.0.3.4)
|
54
|
+
activestorage (6.0.3.4)
|
55
|
+
actionpack (= 6.0.3.4)
|
56
|
+
activejob (= 6.0.3.4)
|
57
|
+
activerecord (= 6.0.3.4)
|
58
|
+
marcel (~> 0.3.1)
|
59
|
+
activesupport (6.0.3.4)
|
60
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
61
|
+
i18n (>= 0.7, < 2)
|
62
|
+
minitest (~> 5.1)
|
63
|
+
tzinfo (~> 1.1)
|
64
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
65
|
+
builder (3.2.4)
|
66
|
+
byebug (11.1.3)
|
67
|
+
concurrent-ruby (1.1.7)
|
68
|
+
crass (1.0.6)
|
69
|
+
erubi (1.10.0)
|
70
|
+
globalid (0.4.2)
|
71
|
+
activesupport (>= 4.2.0)
|
72
|
+
i18n (1.8.5)
|
73
|
+
concurrent-ruby (~> 1.0)
|
74
|
+
loofah (2.8.0)
|
75
|
+
crass (~> 1.0.2)
|
76
|
+
nokogiri (>= 1.5.9)
|
77
|
+
mail (2.7.1)
|
78
|
+
mini_mime (>= 0.1.1)
|
79
|
+
marcel (0.3.3)
|
80
|
+
mimemagic (~> 0.3.2)
|
81
|
+
method_source (1.0.0)
|
82
|
+
mimemagic (0.3.5)
|
83
|
+
mini_mime (1.0.2)
|
84
|
+
mini_portile2 (2.5.0)
|
85
|
+
minitest (5.14.2)
|
86
|
+
nio4r (2.5.4)
|
87
|
+
nokogiri (1.11.1)
|
88
|
+
mini_portile2 (~> 2.5.0)
|
89
|
+
racc (~> 1.4)
|
90
|
+
racc (1.5.2)
|
91
|
+
rack (2.2.3)
|
92
|
+
rack-test (1.1.0)
|
93
|
+
rack (>= 1.0, < 3)
|
94
|
+
rails (6.0.3.4)
|
95
|
+
actioncable (= 6.0.3.4)
|
96
|
+
actionmailbox (= 6.0.3.4)
|
97
|
+
actionmailer (= 6.0.3.4)
|
98
|
+
actionpack (= 6.0.3.4)
|
99
|
+
actiontext (= 6.0.3.4)
|
100
|
+
actionview (= 6.0.3.4)
|
101
|
+
activejob (= 6.0.3.4)
|
102
|
+
activemodel (= 6.0.3.4)
|
103
|
+
activerecord (= 6.0.3.4)
|
104
|
+
activestorage (= 6.0.3.4)
|
105
|
+
activesupport (= 6.0.3.4)
|
106
|
+
bundler (>= 1.3.0)
|
107
|
+
railties (= 6.0.3.4)
|
108
|
+
sprockets-rails (>= 2.0.0)
|
109
|
+
rails-dom-testing (2.0.3)
|
110
|
+
activesupport (>= 4.2.0)
|
111
|
+
nokogiri (>= 1.6)
|
112
|
+
rails-html-sanitizer (1.3.0)
|
113
|
+
loofah (~> 2.3)
|
114
|
+
railties (6.0.3.4)
|
115
|
+
actionpack (= 6.0.3.4)
|
116
|
+
activesupport (= 6.0.3.4)
|
117
|
+
method_source
|
118
|
+
rake (>= 0.8.7)
|
119
|
+
thor (>= 0.20.3, < 2.0)
|
120
|
+
rake (12.3.3)
|
121
|
+
sprockets (4.0.2)
|
122
|
+
concurrent-ruby (~> 1.0)
|
123
|
+
rack (> 1, < 3)
|
124
|
+
sprockets-rails (3.2.2)
|
125
|
+
actionpack (>= 4.0)
|
126
|
+
activesupport (>= 4.0)
|
127
|
+
sprockets (>= 3.0.0)
|
128
|
+
sqlite3 (1.4.2)
|
129
|
+
thor (1.0.1)
|
130
|
+
thread_safe (0.3.6)
|
131
|
+
tzinfo (1.2.9)
|
132
|
+
thread_safe (~> 0.1)
|
133
|
+
websocket-driver (0.7.3)
|
134
|
+
websocket-extensions (>= 0.1.0)
|
135
|
+
websocket-extensions (0.1.5)
|
136
|
+
zeitwerk (2.4.2)
|
137
|
+
|
138
|
+
PLATFORMS
|
139
|
+
ruby
|
140
|
+
|
141
|
+
DEPENDENCIES
|
142
|
+
boring_generators!
|
143
|
+
byebug
|
144
|
+
minitest (~> 5.0)
|
145
|
+
rails (~> 6.0.3.4)
|
146
|
+
rake (~> 12.0)
|
147
|
+
sqlite3 (~> 1.4)
|
148
|
+
|
149
|
+
BUNDLED WITH
|
150
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
|
-
|
1
|
+
<h3 align="center">
|
2
|
+
Boring Generators
|
3
|
+
</h3>
|
2
4
|
|
3
|
-
|
5
|
+
<p align="center">
|
6
|
+
<a href="https://rubygems.org/gems/boring_generators"><img alt="Gem" src="https://img.shields.io/gem/dt/boring_generators?style=flat-square"></a>
|
7
|
+
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/abhaynikam/boring_generators/CI?style=flat-square">
|
8
|
+
</p>
|
9
|
+
|
10
|
+
<p>
|
11
|
+
Have you ever started a new adventure/hobby project of your and instead of spending time in solving the actual problem statement with the website ended up configuring the application and put a lot of effort into it. Yeah, We felt that too. Boring generator tries to resolve the painful same redundant configuration you do in every application by adding generators to easily configure it.
|
12
|
+
</p>
|
13
|
+
|
14
|
+
<p>
|
15
|
+
Check out the generator we support right now. We are planning to add support to most of the mostly used and required gems. We are open to any idea of yours, feel free to raise a discussion by opening up an issue or try contributing.
|
16
|
+
</p>
|
4
17
|
|
5
|
-
Check out the generator we support right now. We are planning to add support to most of the mostly used and required gems. We are open to any idea of yours, feel free to raise a discussion by opening up an issue or try contributing.
|
6
18
|
|
7
19
|
## Installation
|
8
20
|
|
@@ -20,31 +32,59 @@ Or install it yourself as:
|
|
20
32
|
|
21
33
|
$ gem install boring_generators
|
22
34
|
|
35
|
+
And then you can use it this way:
|
36
|
+
|
37
|
+
$ boring generate boring:simple_form:install --css_framework=<css_framework>
|
38
|
+
$ boring g boring:pry:install
|
39
|
+
|
23
40
|
## Usage
|
24
41
|
|
25
42
|
The boring generator introduces following generators:
|
26
|
-
- Install Tailwind CSS: `rails generate boring:tailwind:install`
|
27
|
-
- Install Bootstrap: `rails generate boring:bootstrap:install`
|
43
|
+
- [Install Tailwind CSS: `rails generate boring:tailwind:install`](https://www.boringgenerators.com/blog/2020-10-18-install-tailwind/)
|
44
|
+
- [Install Bootstrap: `rails generate boring:bootstrap:install`](https://www.boringgenerators.com/blog/2020-11-15-install-bootstrap/)
|
28
45
|
- Install JQuery: `rails generate boring:jquery:install`
|
29
|
-
- Install FontAwesome via Yarn: `rails generate boring:font_awesome:yarn:install`
|
30
|
-
- Install FontAwesome via RubyGems: `rails generate boring:font_awesome:ruby_gem:install`
|
46
|
+
- [Install FontAwesome via Yarn: `rails generate boring:font_awesome:yarn:install`](https://www.boringgenerators.com/blog/2021-02-28-install-fontawesome-yarn/)
|
47
|
+
- [Install FontAwesome via RubyGems: `rails generate boring:font_awesome:ruby_gem:install`](https://www.boringgenerators.com/blog/2021-02-23-install-fontawesome/)
|
31
48
|
- Install Bullet: `rails generate boring:bullet:install`
|
32
49
|
- Install Audit gems(bundler-audit, ruby_audit): `rails generate boring:audit:install`
|
33
50
|
- Install Pry gems for easy debugging: `rails generate boring:pry:install`
|
34
51
|
- Install Active Storage for Google Cloud Service: `rails generate boring:active_storage:google:install`
|
35
52
|
- Install Active Storage for AWS: `rails generate boring:active_storage:aws:install`
|
36
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>`](https://www.boringgenerators.com/blog/2021-01-02-configure-circleci/)
|
55
|
+
- [Install GitHub Actions: `rails generate boring:ci:github_action:install --repository_name=<name> --ruby_version=<version>`](https://www.boringgenerators.com/blog/2020-12-17-configure-github-actions/)
|
56
|
+
- Install Travis CI: `rails generate boring:ci:travisci:install --ruby_version=<version>`
|
57
|
+
- Install Rubocop: `rails generate boring:rubocop:install --ruby_version=<version>`
|
58
|
+
- Build Favicon: `rails generate boring:favicon:build --application_name=<application_name> --favico_letter=<favico_letter> --primary_color=<color>`
|
59
|
+
- Install Pundit: `rails generate boring:pundit:install`
|
60
|
+
- Install GraphQL: `rails generate boring:graphql:install`
|
61
|
+
- Install SimpleForm: `rails generate boring:simple_form:install --css_framework=<css_framework>`
|
62
|
+
- Install Devise: `rails generate boring:devise:install`
|
63
|
+
- [Install Devise Facebook Omniauth: `rails generate boring:oauth:facebook:install`](https://www.boringgenerators.com/blog/2021-02-07-install-oauth-facbook/)
|
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`
|
37
68
|
|
38
69
|
## Development
|
39
70
|
|
40
71
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
41
72
|
|
73
|
+
You can also run specific test cases using following commands:
|
74
|
+
```
|
75
|
+
bundle exec ruby -w -Itest test/generators/tailwind_install_generator_test.rb
|
76
|
+
```
|
77
|
+
|
42
78
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
43
79
|
|
44
80
|
## Contributing
|
45
81
|
|
46
82
|
Bug reports and pull requests are welcome on GitHub at https://github.com/abhaynikam/boring_generators. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/abhaynikam/boring_generators/blob/master/CODE_OF_CONDUCT.md).
|
47
83
|
|
84
|
+
## Changelog
|
85
|
+
|
86
|
+
Boring Generators changelog is available [here](https://github.com/abhaynikam/boring_generators/blob/master/CHANGELOG.md).
|
87
|
+
|
48
88
|
## License
|
49
89
|
|
50
90
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
data/boring_generators.gemspec
CHANGED
data/exe/boring
ADDED
data/lib/boring_generators.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "rails/generators"
|
3
|
+
require_relative "../boring_generators"
|
4
|
+
|
5
|
+
module BoringGenerators
|
6
|
+
class CLI < Thor
|
7
|
+
map "g" => :generate
|
8
|
+
map %w(--version -v) => :__print_version
|
9
|
+
|
10
|
+
desc "generate GENERATOR [options]", "Add gem to the application"
|
11
|
+
def generate(generator, *options)
|
12
|
+
Rails::Generators.invoke(generator, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "--version, -v", "Print gem version"
|
16
|
+
def __print_version
|
17
|
+
puts "Boring generators #{BoringGenerators::VERSION}"
|
18
|
+
end
|
19
|
+
|
20
|
+
class << self
|
21
|
+
def exit_on_failure?
|
22
|
+
true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -12,7 +12,7 @@ module Boring
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def add_jquery_plugin_provider_to_webpack_environment
|
15
|
-
say "
|
15
|
+
say "Adding jQuery and popper JS plugin in the webpack", :green
|
16
16
|
if File.exist?("config/webpack/environment.js")
|
17
17
|
insert_into_file "config/webpack/environment.js", <<~RUBY, after: /@rails\/webpacker.*\n/
|
18
18
|
const webpack = require("webpack")
|
@@ -37,7 +37,7 @@ module Boring
|
|
37
37
|
'@import "~bootstrap/scss/bootstrap";'
|
38
38
|
end
|
39
39
|
else
|
40
|
-
say "Copying application.scss with
|
40
|
+
say "Copying application.scss with bootstrap imports", :green
|
41
41
|
template("application.scss", "app/javascript/stylesheets/application.scss")
|
42
42
|
end
|
43
43
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Boring
|
4
|
+
module Ci
|
5
|
+
module Circleci
|
6
|
+
class InstallGenerator < Rails::Generators::Base
|
7
|
+
desc "Adds Circle CI to the application"
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
DEFAULT_RUBY_VERSION = "2.7.1"
|
11
|
+
DEFAULT_REPOSITORY_NAME = "boring_generators"
|
12
|
+
|
13
|
+
class_option :ruby_version, type: :string, aliases: "-v",
|
14
|
+
desc: "Tell us the ruby version to which you use for the application. Default to Ruby #{DEFAULT_RUBY_VERSION}"
|
15
|
+
class_option :skip_node, type: :boolean, aliases: "-sn",
|
16
|
+
desc: "Skips the node configuration required for webpacker based Rails application."
|
17
|
+
class_option :repository_name, type: :string, aliases: "-rn",
|
18
|
+
desc: "Tell us the repository name to be used as database name on circleci. Defaults to #{DEFAULT_REPOSITORY_NAME}"
|
19
|
+
|
20
|
+
def add_circle_ci_configuration
|
21
|
+
@skip_node = options[:skip_node]
|
22
|
+
@ruby_version = options[:ruby_version] ? options[:ruby_version] : DEFAULT_RUBY_VERSION
|
23
|
+
@repository_name = options[:repository_name] ? options[:repository_name] : DEFAULT_REPOSITORY_NAME
|
24
|
+
|
25
|
+
template("config.psql.yml", ".circleci/config.yml")
|
26
|
+
template("database.yml.ci", "config/database.yml.ci")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|