rails-interactive 0.1.8 → 0.1.9

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: 603090ac1b9b8c849321c7cba9861f54577c33ca2140fba83f06ba898c229a0a
4
- data.tar.gz: 8cd7ce670ce1806e6039486aa0a6d26a3b237c571cea9ce501306a3ab5a795c5
3
+ metadata.gz: 75d2314dfc92d4b4b435a0d460ead1cdd929c4a38a4b1e7d61ac4c6348153865
4
+ data.tar.gz: caa1efa0259cbdb5390235f10e13d280b126e3b179b2063fab5754a52949b7b7
5
5
  SHA512:
6
- metadata.gz: bd590968411d6381d448f0466d3afd4fb2b43e2599ef51142c22a80d921b317523f943d57f3baa6ec5a89bf4370af0766fb36622ac44bd81cfd088926edd15aa
7
- data.tar.gz: a11ed5e1d003b4aa98ba0584da41dd6a270735b324c76690632ab627b93ec387f6ae8b354e007145a06ed3dc222efe9b086672af49e9413fa96dd2f5db841a86
6
+ metadata.gz: 60eed5fe9853045e1b5b56ab5345ca5d4ab56709eed27a11473de6d9661e95e70a4ab42aeca75ca0df2bc13378291458a23449a1b5afbe7acf384f9ed35436cd
7
+ data.tar.gz: af53d57979c6a78ac62dbc1e7571d0db39e491a6c3c6582c2c048e5287a6db96a20725b464aa596f58848b681592e7f02632b53e22f76e049e7b312e8968adce
@@ -0,0 +1,9 @@
1
+ ## What's up?
2
+
3
+ In this PR, Rails interactive have `gem` integration. In this way, when users select `gem` to install their rails project, CLI will install `gem` to the related project with the use of rails templates
4
+
5
+ ## Issue
6
+ Related Issue: `issue_link`
7
+
8
+ ## Closed Issue
9
+ Closes `issue_link`
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [0.1.9](https://www.github.com/oguzsh/rails-interactive/compare/v0.1.8...v0.1.9) (2022-04-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * file name typo ([#60](https://www.github.com/oguzsh/rails-interactive/issues/60)) ([542c76f](https://www.github.com/oguzsh/rails-interactive/commit/542c76fa57fd37cf583a7238b2a9b527aeba1778))
9
+
3
10
  ## [0.1.0] - 2022-03-11
4
11
 
5
12
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-interactive (0.1.8)
4
+ rails-interactive (0.1.9)
5
5
  tty-prompt
6
6
 
7
7
  GEM
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ run 'bundle add awesome_print --group "development"'
4
+ Bundler.with_unbundled_env { run "bundle install" }
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ gem_group :development do
4
+ gem "better_errors"
5
+ gem "binding_of_caller"
6
+ end
7
+
8
+ Bundler.with_unbundled_env { run "bundle install" }
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ run "bundle add bullet --group 'development'"
4
+
5
+ Bundler.with_unbundled_env { run "bundle install" }
6
+
7
+ run "bundle exec rails g bullet:install"
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ run "bundle add faker --group 'development' 'test'"
4
+
5
+ Bundler.with_unbundled_env { run "bundle install" }
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ def ask_with_default(prompt, default)
4
+ value = ask("#{prompt} (default: #{default})")
5
+ value.present? ? value : default
6
+ end
7
+
8
+ run "bundle add 'friendly_id'"
9
+
10
+ rails_command "generate friendly_id"
11
+
12
+ while yes?("Do you want to use Friendly ID with an existing model? (y/n)")
13
+ model_name = ask_with_default("Model Name:", "Postr")
14
+ attribute = ask_with_default("Attribute:", "name")
15
+ next unless model_name && attribute
16
+
17
+ # We generate a migration to add the friendly id slug column.
18
+ generate(:migration, "AddSlugTo#{model_name.titleize.pluralize}", "slug:uniq")
19
+ string = <<~RUBY
20
+ extend FriendlyId
21
+ friendly_id :#{attribute}, use: :slugged
22
+ RUBY
23
+ # Inject the friendly id methods into the class.
24
+ inject_into_file "app/models/#{model_name.downcase}.rb", string,
25
+ after: "class #{model_name.titleize} < ApplicationRecord\n"
26
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ run 'bundle add letter_opener --group "development"'
4
+
5
+ Bundler.with_unbundled_env { run "bundle install" }
6
+
7
+ inject_into_file "config/environments/development.rb", after: "config.action_mailer.perform_caching = false\n" do
8
+ <<-RUBY
9
+
10
+ config.action_mailer.delivery_method = :letter_opener
11
+ config.action_mailer.perform_deliveries = true
12
+ RUBY
13
+ end
14
+
15
+ puts "Letter Opener is now installed!"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsInteractive
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
@@ -32,10 +32,12 @@ module RailsInteractive
32
32
  template_engines
33
33
  admin_panel
34
34
  testing_tools
35
+ development_tools
35
36
 
36
37
  create
37
38
  end
38
39
 
40
+ # rubocop:disable Metrics/MethodLength
39
41
  def create
40
42
  # Install gems
41
43
  system("bin/setup")
@@ -62,9 +64,14 @@ module RailsInteractive
62
64
  # Testing tools Template
63
65
  handle_multi_options(key: :testing_tools)
64
66
 
67
+ # Development tools Template
68
+ handle_multi_options(key: :development_tools)
69
+
65
70
  # Prepare project requirements and give instructions
71
+ sign_project
66
72
  Message.prepare
67
73
  end
74
+ # rubocop:enable Metrics/MethodLength
68
75
 
69
76
  def setup
70
77
  base = "rails new"
@@ -135,5 +142,18 @@ module RailsInteractive
135
142
  @inputs[:template_engine] =
136
143
  Prompt.new("Choose project's template engine: ", "select", template_engines).perform
137
144
  end
145
+
146
+ def development_tools
147
+ development_tools = %w[bullet faker friendly_id better_errors letter_opener awesome_print]
148
+
149
+ @inputs[:development_tools] =
150
+ Prompt.new("Choose project's development tools: ", "multi_select", development_tools).perform
151
+ end
152
+
153
+ def sign_project
154
+ file = "README.md"
155
+ msg = "\n> This project was generated by [Rails Interactive CLI](https://github.com/oguzsh/rails-interactive)"
156
+ File.write(file, msg, mode: "a+")
157
+ end
138
158
  end
139
159
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-interactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oguzhan Ince
@@ -119,6 +119,7 @@ extensions: []
119
119
  extra_rdoc_files: []
120
120
  files:
121
121
  - ".github/FUNDING.yml"
122
+ - ".github/PULL_REQUEST_TEMPLATE/pull_request_template.md"
122
123
  - ".github/workflows/main.yml"
123
124
  - ".github/workflows/rspec_rubocop.yml"
124
125
  - ".gitignore"
@@ -138,12 +139,18 @@ files:
138
139
  - lib/rails_interactive/message.rb
139
140
  - lib/rails_interactive/prompt.rb
140
141
  - lib/rails_interactive/templates/setup_avo.rb
142
+ - lib/rails_interactive/templates/setup_awesome_print.rb
143
+ - lib/rails_interactive/templates/setup_better_errors.rb
141
144
  - lib/rails_interactive/templates/setup_brakeman.rb
145
+ - lib/rails_interactive/templates/setup_bullet.rb
142
146
  - lib/rails_interactive/templates/setup_cancancan.rb
143
147
  - lib/rails_interactive/templates/setup_devise.rb
148
+ - lib/rails_interactive/templates/setup_faker.rb
149
+ - lib/rails_interactive/templates/setup_friendly_id.rb
144
150
  - lib/rails_interactive/templates/setup_graphql.rb
145
151
  - lib/rails_interactive/templates/setup_haml.rb
146
152
  - lib/rails_interactive/templates/setup_kaminari.rb
153
+ - lib/rails_interactive/templates/setup_letter_opener.rb
147
154
  - lib/rails_interactive/templates/setup_omniauth.rb
148
155
  - lib/rails_interactive/templates/setup_pundit.rb
149
156
  - lib/rails_interactive/templates/setup_rails_admin.rb