boring_generators 0.2.0 → 0.3.0
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 +9 -1
- data/README.md +8 -3
- data/lib/boring_generators/version.rb +1 -1
- data/lib/generators/boring/active_storage/aws/install/install_generator.rb +48 -0
- data/lib/generators/boring/active_storage/azure/install/install_generator.rb +48 -0
- data/lib/generators/boring/active_storage/google/install/install_generator.rb +48 -0
- data/lib/generators/boring/audit/install/install_generator.rb +22 -0
- data/lib/generators/boring/bullet/install/install_generator.rb +31 -0
- data/lib/generators/boring/bullet/install/templates/bullet.rb +8 -0
- data/lib/generators/boring/pry/install/install_generator.rb +29 -0
- data/lib/generators/boring/pry/install/templates/pryrc +24 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f53cde2e0fe1d3ac3886bda90938684dfb8a042b3a4af31029db3b4fbf1ff6c9
|
4
|
+
data.tar.gz: 6742553d35e0db7f76de45b7c72b26a5816019e53dae5337535b127598b956be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa6c23aad5cafcb0d73df98d0169312503f6e603b51daf70e40fe11bba24c2a22d96867f127f075dfff6ebcf5d218485ba9e05c73f04e9d6f4b92c138c2bb5e
|
7
|
+
data.tar.gz: 44a4df93e880cdeb55f2de27a1442348403616f0238309999223a336ced1de9908b54e14a81519b395b379dc55c89fcdb0d4bce50b849ffe4cd0667255e5bd9d
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,15 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
-
## 0.
|
5
|
+
## 0.3.0 (September 19th, 2020)
|
6
|
+
* Adds Bullet install generator. ([@abhaynikam][])
|
7
|
+
* Adds Audit gems(bundler-audit, ruby_audit) install generator. ([@abhaynikam][])
|
8
|
+
* Adds Pry install generator. ([@abhaynikam][])
|
9
|
+
* Adds Active Storage Google install generator. ([@abhaynikam][])
|
10
|
+
* Adds Active Storage AWS install generator. ([@abhaynikam][])
|
11
|
+
* Adds Active Storage Microsoft Azure install generator. ([@abhaynikam][])
|
12
|
+
|
13
|
+
## 0.2.0 (September 16th, 2020)
|
6
14
|
* Adds JQuery install generator. ([@abhaynikam][])
|
7
15
|
* Adds Bootstrap install generator. ([@abhaynikam][])
|
8
16
|
* Adds FontAwesome install generator via Yarn. ([@abhaynikam][])
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# BoringGenerators
|
2
2
|
|
3
|
-
|
3
|
+
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.
|
4
4
|
|
5
|
-
|
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
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -28,6 +28,12 @@ The boring generator introduces following generators:
|
|
28
28
|
- Install JQuery: `rails generate boring:jquery:install`
|
29
29
|
- Install FontAwesome via Yarn: `rails generate boring:font_awesome:yarn:install`
|
30
30
|
- Install FontAwesome via RubyGems: `rails generate boring:font_awesome:ruby_gem:install`
|
31
|
+
- Install Bullet: `rails generate boring:bullet:install`
|
32
|
+
- Install Audit gems(bundler-audit, ruby_audit): `rails generate boring:audit:install`
|
33
|
+
- Install Pry gems for easy debugging: `rails generate boring:pry:install`
|
34
|
+
- Install Active Storage for Google Cloud Service: `rails generate boring:active_storage:google:install`
|
35
|
+
- Install Active Storage for AWS: `rails generate boring:active_storage:aws:install`
|
36
|
+
- Install Active Storage for Azure: `rails generate boring:active_storage:azure:install`
|
31
37
|
|
32
38
|
## Development
|
33
39
|
|
@@ -39,7 +45,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
39
45
|
|
40
46
|
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).
|
41
47
|
|
42
|
-
|
43
48
|
## License
|
44
49
|
|
45
50
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Boring
|
2
|
+
module ActiveStorage
|
3
|
+
module Aws
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
desc "Adds ActiveStorage AWS service the application"
|
6
|
+
|
7
|
+
class_option :skip_active_storage, type: :boolean, aliases: "-s",
|
8
|
+
desc: "Skips running ActiveStorage installer"
|
9
|
+
|
10
|
+
def add_active_storage
|
11
|
+
unless options[:skip_active_storage]
|
12
|
+
say "Adding ActiveStorage", :green
|
13
|
+
run "bin/rails active_storage:install"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_aws_to_the_application
|
18
|
+
say "Adding AWS gem", :green
|
19
|
+
aws_gem_content = <<~RUBY
|
20
|
+
\n
|
21
|
+
# for AWS Service
|
22
|
+
gem "aws-sdk-s3", require: false
|
23
|
+
RUBY
|
24
|
+
append_to_file "Gemfile", aws_gem_content
|
25
|
+
run "bundle install"
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_configuration_to_production
|
29
|
+
gsub_file "config/environments/production.rb",
|
30
|
+
"config.active_storage.service = :local",
|
31
|
+
"config.active_storage.service = :amazon"
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_aws_storage_configuration
|
35
|
+
aws_storage_config_content = <<~RUBY
|
36
|
+
amazon:
|
37
|
+
service: S3
|
38
|
+
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
39
|
+
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
40
|
+
region: us-east-1
|
41
|
+
bucket: your_own_bucket
|
42
|
+
RUBY
|
43
|
+
append_to_file "config/storage.yml", aws_storage_config_content
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Boring
|
2
|
+
module ActiveStorage
|
3
|
+
module Azure
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
desc "Adds ActiveStorage Mircosoft Azure the application"
|
6
|
+
|
7
|
+
class_option :skip_active_storage, type: :boolean, aliases: "-s",
|
8
|
+
desc: "Skips running ActiveStorage installer"
|
9
|
+
|
10
|
+
def add_active_storage
|
11
|
+
unless options[:skip_active_storage]
|
12
|
+
say "Adding ActiveStorage", :green
|
13
|
+
run "bin/rails active_storage:install"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_azure_to_the_application
|
18
|
+
say "Adding mircosoft azure gem", :green
|
19
|
+
azure_gem_content = <<~RUBY
|
20
|
+
\n
|
21
|
+
# for Azure Service
|
22
|
+
gem "azure-storage-blob", require: false
|
23
|
+
RUBY
|
24
|
+
append_to_file "Gemfile", azure_gem_content
|
25
|
+
run "bundle install"
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_configuration_to_production
|
29
|
+
gsub_file "config/environments/production.rb",
|
30
|
+
"config.active_storage.service = :local",
|
31
|
+
"config.active_storage.service = :microsoft"
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_azure_storage_configuration
|
35
|
+
microsoft_storage_config_content = <<~RUBY
|
36
|
+
microsoft:
|
37
|
+
service: AzureStorage
|
38
|
+
storage_account_name: your_account_name
|
39
|
+
storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
40
|
+
container: your_container_name
|
41
|
+
RUBY
|
42
|
+
|
43
|
+
append_to_file "config/storage.yml", microsoft_storage_config_content
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Boring
|
2
|
+
module ActiveStorage
|
3
|
+
module Google
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
desc "Adds ActiveStorage google cloud service the application"
|
6
|
+
|
7
|
+
class_option :skip_active_storage, type: :boolean, aliases: "-s",
|
8
|
+
desc: "Skips running ActiveStorage installer"
|
9
|
+
|
10
|
+
def add_active_storage
|
11
|
+
unless options[:skip_active_storage]
|
12
|
+
say "Adding ActiveStorage", :green
|
13
|
+
run "bin/rails active_storage:install"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_google_cloud_storage_to_the_application
|
18
|
+
say "Adding google cloud storage gem", :green
|
19
|
+
google_cloud_storage_gem_content = <<~RUBY
|
20
|
+
\n
|
21
|
+
# for Google Cloud Storage Service
|
22
|
+
gem "google-cloud-storage", require: false
|
23
|
+
RUBY
|
24
|
+
append_to_file "Gemfile", google_cloud_storage_gem_content
|
25
|
+
run "bundle install"
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_configuration_to_production
|
29
|
+
gsub_file "config/environments/production.rb",
|
30
|
+
"config.active_storage.service = :local",
|
31
|
+
"config.active_storage.service = :google"
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_google_storage_configuration
|
35
|
+
google_storage_config_content = <<~RUBY
|
36
|
+
google:
|
37
|
+
service: GCS
|
38
|
+
project: your_project
|
39
|
+
credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
40
|
+
bucket: your_own_bucket
|
41
|
+
RUBY
|
42
|
+
|
43
|
+
append_to_file "config/storage.yml", google_storage_config_content
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Boring
|
4
|
+
module Audit
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
desc "Adds Audit gems to the application"
|
7
|
+
|
8
|
+
def add_bullet_gem
|
9
|
+
say "Adding audit gems", :green
|
10
|
+
audit_gems_content = <<~RUBY
|
11
|
+
\n
|
12
|
+
\t# Patch-level verification for Bundler. https://github.com/rubysec/bundler-audit
|
13
|
+
\tgem "bundler-audit", require: false
|
14
|
+
\t# vulnerabity checker for Ruby itself. https://github.com/civisanalytics/ruby_audit
|
15
|
+
\tgem "ruby_audit", require: false
|
16
|
+
RUBY
|
17
|
+
insert_into_file "Gemfile", audit_gems_content, after: /group :development do/
|
18
|
+
run "bundle install"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Boring
|
4
|
+
module Bullet
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
desc "Adds Bullet gem to the application"
|
7
|
+
source_root File.expand_path("templates", __dir__)
|
8
|
+
|
9
|
+
class_option :skip_configuration, type: :boolean, aliases: "-s",
|
10
|
+
desc: "Skips adding bullet development configuration"
|
11
|
+
|
12
|
+
def add_bullet_gem
|
13
|
+
say "Adding Bullet gem", :green
|
14
|
+
bullet_gem_content = <<~RUBY
|
15
|
+
\n
|
16
|
+
\t# reports N+1 queries
|
17
|
+
\tgem "bullet"
|
18
|
+
RUBY
|
19
|
+
insert_into_file "Gemfile", bullet_gem_content, after: /group :development do/
|
20
|
+
run "bundle install"
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_bullet_gem_configuration
|
24
|
+
return if options[:skip_configuration]
|
25
|
+
|
26
|
+
say "Copying bullet.rb configuration to the initializer", :green
|
27
|
+
template("bullet.rb", "config/initializers/bullet.rb")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Boring
|
4
|
+
module Pry
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
desc "Adds pry to the application"
|
7
|
+
source_root File.expand_path("templates", __dir__)
|
8
|
+
|
9
|
+
def add_bullet_gem
|
10
|
+
say "Adding Bullet gem", :green
|
11
|
+
pry_gem_content = <<~RUBY
|
12
|
+
\n
|
13
|
+
# for using pry as Rails console
|
14
|
+
gem "pry"
|
15
|
+
gem "pry-rails"
|
16
|
+
RUBY
|
17
|
+
append_to_file "Gemfile", pry_gem_content
|
18
|
+
run "bundle install"
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_pryrc_configuration
|
22
|
+
return if options[:skip_configuration]
|
23
|
+
|
24
|
+
say "Copying pryrc configuration", :green
|
25
|
+
template("pryrc", ".pryrc")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
if defined?(Rails)
|
6
|
+
# https://wiki.hackzine.org/development/misc/readline-color-prompt.html
|
7
|
+
Pry.config.prompt_name = if Rails.env.production?
|
8
|
+
"\001\e[0m\002PROD"
|
9
|
+
else
|
10
|
+
"\001\e[0m\002dev"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
Pry.config.pager = false
|
14
|
+
|
15
|
+
def define_byebug_aliases!
|
16
|
+
if defined?(PryByebug)
|
17
|
+
Pry.commands.alias_command "c", "continue"
|
18
|
+
Pry.commands.alias_command "s", "step"
|
19
|
+
Pry.commands.alias_command "n", "next"
|
20
|
+
Pry.commands.alias_command "f", "finish"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
extend Rails::ConsoleMethods if defined?(Rails::ConsoleMethods)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boring_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abhay Nikam
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Every new project or hobby project of yours needs to setup simple things.
|
14
14
|
Boring generators aims to make your development faster by delegating boring setups
|
@@ -34,12 +34,20 @@ files:
|
|
34
34
|
- boring_generators.gemspec
|
35
35
|
- lib/boring_generators.rb
|
36
36
|
- lib/boring_generators/version.rb
|
37
|
+
- lib/generators/boring/active_storage/aws/install/install_generator.rb
|
38
|
+
- lib/generators/boring/active_storage/azure/install/install_generator.rb
|
39
|
+
- lib/generators/boring/active_storage/google/install/install_generator.rb
|
40
|
+
- lib/generators/boring/audit/install/install_generator.rb
|
37
41
|
- lib/generators/boring/bootstrap/install/install_generator.rb
|
38
42
|
- lib/generators/boring/bootstrap/install/templates/application.scss
|
43
|
+
- lib/generators/boring/bullet/install/install_generator.rb
|
44
|
+
- lib/generators/boring/bullet/install/templates/bullet.rb
|
39
45
|
- lib/generators/boring/font_awesome/ruby_gem/install/install_generator.rb
|
40
46
|
- lib/generators/boring/font_awesome/yarn/install/install_generator.rb
|
41
47
|
- lib/generators/boring/font_awesome/yarn/install/templates/application.scss
|
42
48
|
- lib/generators/boring/jquery/install/install_generator.rb
|
49
|
+
- lib/generators/boring/pry/install/install_generator.rb
|
50
|
+
- lib/generators/boring/pry/install/templates/pryrc
|
43
51
|
- lib/generators/boring/tailwind/install/install_generator.rb
|
44
52
|
- lib/generators/boring/tailwind/install/templates/application.scss
|
45
53
|
homepage: https://github.com/abhaynikam/boring_generators
|