nextgen 0.37.0 → 0.38.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0547fc9946683f3753ce175848f7a7a5b0e96e9212e21d8cdd1f69430fecea05
4
- data.tar.gz: 72fa1da52395f08d06291dc3c43b6cf38f932b3073dc0b17476780dba2b6ceb0
3
+ metadata.gz: 7c220f677e85be4d7743b5d4dbb09ae9d0d7f97d1373458f7ee1c1a2d371e9e7
4
+ data.tar.gz: 79073932f4c22dbf2fbd8819e73fc2186d8ba1fdaa48f833ce925b513ff34a0e
5
5
  SHA512:
6
- metadata.gz: f455f1ee06e99bab86cab8dee4ccc955279bb7de8ae2261e5724f36ee01afa59813b20509de74a745cbe15253d465f92311c00df0d4f42928cde202a903bddd2
7
- data.tar.gz: 11ff219399baaebe36d497109b0b150f52681087fdfdcc52761ce12e78f33a05936f71e01500cf159e0ac528fe536342f08285fd16eb14f075a77fd31d1d19a3
6
+ metadata.gz: b9e400966014de7e998e9cf8da63858310a57bc2568dd8e6e54b7a9002971d2bd86eaeffb14441337ee827c6a326d681221fd1ebc4602cbeaa47bd247ff93c22
7
+ data.tar.gz: 3f95b74419456f3c631060d8b9fe30e1dcbac165596bfbbb02cc39ad7b39d82e2fbb4bdfd749090f977b88359ce4f7fd110cc5947c4c56972883e15869462b4f
@@ -14,6 +14,8 @@ module Nextgen
14
14
  class Commands::Create # rubocop:disable Metrics/ClassLength
15
15
  extend Forwardable
16
16
 
17
+ RESERVED_NAMES = %w[application destroy plugin runner test].freeze
18
+
17
19
  def self.run(app_path, options)
18
20
  new(app_path, options).run
19
21
  end
@@ -24,6 +26,8 @@ module Nextgen
24
26
  end
25
27
 
26
28
  def run # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
29
+ reserved_word_message if app_name_is_reserved_word?
30
+
27
31
  say <<~BANNER
28
32
  Welcome to nextgen, the interactive Rails app generator!
29
33
 
@@ -106,6 +110,17 @@ module Nextgen
106
110
 
107
111
  def_delegators :shell, :say
108
112
 
113
+ def app_name_is_reserved_word?
114
+ RESERVED_NAMES.include?(app_name.downcase)
115
+ end
116
+
117
+ def reserved_word_message
118
+ say <<~APP_NAME
119
+ Your Rails app name: "#{cyan(app_name)}", is a reserved word. Please rerun the initial command with an unreserved word instead.
120
+ APP_NAME
121
+ exit(false)
122
+ end
123
+
109
124
  def continue_if(question)
110
125
  if prompt.yes?(question)
111
126
  say
@@ -32,7 +32,7 @@ append_to_file "Rakefile", <<~RUBY
32
32
  end
33
33
  RUBY
34
34
 
35
- if File.exist?("test/application_system_test_case.rb")
35
+ if File.read("Gemfile").match?(/^\s*gem ['"]capybara['"]/)
36
36
  say_git "Configure system tests"
37
37
  copy_test_support_file "capybara.rb.tt"
38
38
  copy_file "test/application_system_test_case.rb", force: true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nextgen
4
- VERSION = "0.37.0"
4
+ VERSION = "0.38.0"
5
5
  end
@@ -16,7 +16,7 @@ On macOS, these [Homebrew](http://brew.sh) packages are recommended:
16
16
  ```
17
17
  brew install rbenv
18
18
  <% if postgres -%>
19
- brew install postgresql@17
19
+ brew install postgresql@18
20
20
  <% end -%>
21
21
  ```
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nextgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
- rubygems_version: 3.7.2
227
+ rubygems_version: 3.6.9
228
228
  specification_version: 4
229
229
  summary: Generate your next Rails app interactively!
230
230
  test_files: []