rails-interactive 2.1.0 → 2.1.1

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: 482ad6f26a28d35ab5a4d58ea8f0f56bfe977bd1096bfc25a26bed05cf318b1f
4
- data.tar.gz: fad72c7fec9fe01a3e28ba23e370f1c200155ad2207dc32e8c57b969c0b4e882
3
+ metadata.gz: 36127c97610fe0006be084e612ef004be19a5c028895125714b54972c005a109
4
+ data.tar.gz: 3aeee57f6fa0eef511e6bb54c3f5a28c876c69135664a2cfde532e89e19a0c53
5
5
  SHA512:
6
- metadata.gz: 4a91c4823bd9b5322c5e72b3fb402edba3d8d90f951aeb5c9b4e7762ea14a50bb91669995b2171a6a478d70b2e4234f5b55870d7c3eaa1ef159535cdd08c3a3f
7
- data.tar.gz: 17c8c28bfa9286d09bb0e72a56372f40438a68ff594836fbca9e1146a7709f443ae37ccfeddce8e4cd842ac83025018b1171f98a8a6799b4d5918aed384bc2b1
6
+ metadata.gz: ad5734bb977bf9f6ad5adad7be9bab11d3a251cee2d7a86a2b4b7b65f7bf5079279ef696c55979746b746836a67d7a8e7d25b38a1e82b5830f67ccf59a4abf10
7
+ data.tar.gz: 8f881c5a4c8043675575349c1a84eb0531958233c86ba5c6db2f31ea7e20659ec6791400a0a0f2a36a90978fe5b0f488b754bad20604de2f2f60f1a5e4da1181
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ mkmf.log
16
16
  *.gem
17
17
  # rspec failure tracking
18
18
  .rspec_status
19
+ .idea
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-interactive (2.1.0)
4
+ rails-interactive (2.1.1)
5
5
  tty-prompt
6
6
 
7
7
  GEM
@@ -9,24 +9,42 @@ module RailsInteractive
9
9
  class CommandHandler
10
10
  def initialize
11
11
  @commands = Command.new.all
12
+ @installed_commands = []
13
+ @installed_dependencies = []
12
14
  end
13
15
 
14
16
  def handle_multi_options(options, dependencies = nil)
15
17
  handle_dependencies(dependencies)
16
- options.each { |option| system("bin/rails app:template LOCATION=templates/setup_#{option}.rb") }
18
+
19
+ options.each do |option|
20
+ @installed_commands << option
21
+ system("bin/rails app:template LOCATION=templates/setup_#{option}.rb")
22
+ end
17
23
  end
18
24
 
19
25
  def handle_option(option, dependencies = nil)
26
+ @installed_commands << option
20
27
  handle_dependencies(dependencies)
28
+
21
29
  system("bin/rails app:template LOCATION=templates/setup_#{option}.rb")
22
30
  end
23
31
 
24
32
  def handle_dependencies(dependencies)
25
33
  dependencies&.each do |dependency|
34
+ next if duplicated_gem?(dependency)
35
+
26
36
  puts ">> Dependency Detected: #{dependency} "
37
+ @installed_dependencies << dependency
38
+
27
39
  system("bin/rails app:template LOCATION=templates/setup_#{dependency}.rb")
28
40
  end
29
41
  end
42
+
43
+ private
44
+
45
+ def duplicated_gem?(option)
46
+ @installed_commands.include?(option) || @installed_dependencies.include?(option)
47
+ end
30
48
  end
31
49
  end
32
50
  end
@@ -125,4 +125,18 @@
125
125
  name: StandartRB
126
126
  category: code_quality
127
127
  description: " Ruby Style Guide, with linter & automatic code fixer. For details: https://github.com/testdouble/standard"
128
- dependencies: null
128
+ dependencies: null
129
+ -
130
+ identifier: sassc_rails
131
+ name: Saasc Rails
132
+ category: development
133
+ description: "Integrate SassC-Ruby with Rails! For details: https://github.com/sass/sassc-rails"
134
+ dependencies: null
135
+ -
136
+ identifier: active_admin
137
+ name: ActiveAdmin
138
+ category: admin_panel
139
+ description: "The administration framework for Ruby on Rails applications. For details: https://github.com/activeadmin/activeadmin"
140
+ dependencies:
141
+ - sassc_rails
142
+ - devise
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ run "bundle add activeadmin"
4
+ run "bundle add bcrypt"
5
+ Bundler.with_unbundled_env { run "bundle" }
6
+
7
+ rails_command "generate active_admin:install"
8
+ rails_command "db:migrate"
@@ -6,5 +6,5 @@ Bundler.with_unbundled_env { run "bundle install" }
6
6
  rails_command "generate devise:install"
7
7
 
8
8
  run "rails generate devise User"
9
- run "rails db:create"
9
+ run "rails db:prepare"
10
10
  run "rails db:migrate"
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ run "bundle add sassc-rails"
4
+ Bundler.with_unbundled_env { run "bundle" }
data/lib/cli/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RailsInteractive
4
4
  class CLI
5
- VERSION = "2.1.0"
5
+ VERSION = "2.1.1"
6
6
  end
7
7
  end
@@ -126,5 +126,12 @@ module RailsInteractive
126
126
 
127
127
  @inputs[:database] = Prompt.new("Database: ", "select", database_types, required: true).perform
128
128
  end
129
+
130
+ def admin_panel
131
+ admin_panel = { "ActiveAdmin" => "active_admin" }
132
+
133
+ @inputs[:admin_panel] =
134
+ Prompt.new("Choose project admin panel: ", "select", admin_panel).perform
135
+ end
129
136
  end
130
137
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-interactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oguzhan Ince
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-30 00:00:00.000000000 Z
11
+ date: 2022-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -170,6 +170,7 @@ files:
170
170
  - lib/cli/config/commands.yml
171
171
  - lib/cli/message.rb
172
172
  - lib/cli/prompt.rb
173
+ - lib/cli/templates/setup_active_admin.rb
173
174
  - lib/cli/templates/setup_avo.rb
174
175
  - lib/cli/templates/setup_awesome_print.rb
175
176
  - lib/cli/templates/setup_better_errors.rb
@@ -188,6 +189,7 @@ files:
188
189
  - lib/cli/templates/setup_rails_admin.rb
189
190
  - lib/cli/templates/setup_rspec.rb
190
191
  - lib/cli/templates/setup_rubocop.rb
192
+ - lib/cli/templates/setup_sassc_rails.rb
191
193
  - lib/cli/templates/setup_sidekiq.rb
192
194
  - lib/cli/templates/setup_slim.rb
193
195
  - lib/cli/templates/setup_standardrb.rb