gnarails 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dff35b5d3dcc542270769b94c2098901c821cfc8a4d78e019cc8c36e991a6db1
4
- data.tar.gz: 321d3c26a186e509ca4b2ea6c236ee4ddbab4de8743725d4c5301e9a9f6ad5fc
3
+ metadata.gz: bcec698aaecf93c40f68ea946ba13d7c1e77b7b4f04777140e357bb5747b4cb8
4
+ data.tar.gz: 42ea439ed01f6e1bfaaca76b5da52cfd192f3c222c838b359dab243f1f35bb64
5
5
  SHA512:
6
- metadata.gz: 3d5170e4d563873701f345bc71e31f33f10840fa76dce10f1a8e8474ed728f3480d42c4a3e372c172c2763bd3688d09281e122aa45f7f2897889fbf31826f17a
7
- data.tar.gz: 1564b285aba6cd8ad0350251b0733d5b61cdc28ce87617b2a4a7f42b27d26fa3d8f222d5f97675da20579b7f5e621d7d1f7d1d43685eb353267da29b39e2a12f
6
+ metadata.gz: 21f2124f80a2f1fc524dde2c0adc6baa1e22797ee5b3ad77bdcce94544804013a520a31c4fb7f476929a4939af8597362e2ce9fd19f7031e775389e543932d03
7
+ data.tar.gz: 305ec626115f832937b23335838c5fe47c1148996536636630d28e91d5ca5f1631c696d4ece0fb95d67149972bcef347d7dca5bb53e28c996fc4a33caa6f1dc2
@@ -0,0 +1,27 @@
1
+ name: 'Test Rails - The Gnar Way'
2
+ description: 'Setup and run the tests for your Rails app'
3
+ runs:
4
+ using: "composite"
5
+ steps:
6
+ - name: Setup Ruby
7
+ uses: ruby/setup-ruby@v1
8
+ with:
9
+ bundler-cache: true
10
+
11
+ - name: Setup Node
12
+ uses: actions/setup-node@v3
13
+ with:
14
+ node-version: 16
15
+ cache: 'yarn'
16
+
17
+ - name: Setup App Dependencies
18
+ shell: bash
19
+ run: bin/setup
20
+
21
+ - name: Generate Assets
22
+ shell: bash
23
+ run: bin/rails assets:precompile
24
+
25
+ - name: Run tests
26
+ shell: bash
27
+ run: bin/rspec
@@ -0,0 +1,19 @@
1
+ name: Bundler Audit
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ audit:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+
11
+ - name: Setup Ruby
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ bundler-cache: true
15
+
16
+ - run: |
17
+ gem install bundle-audit
18
+ bundle-audit update
19
+ bundle-audit check
@@ -0,0 +1,30 @@
1
+ name: Pronto
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize]
5
+
6
+ jobs:
7
+ pronto:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ pull-requests: write
11
+ statuses: write
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0
16
+ - run: |
17
+ git fetch --no-tags --prune --depth=10 origin +refs/heads/*:refs/remotes/origin/*
18
+
19
+ - name: Setup Ruby and install gems
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ bundler-cache: true
23
+
24
+ - name: Run Pronto
25
+ env:
26
+ PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
27
+ PRONTO_GITHUB_SLUG: ${{ github.repository }}
28
+ PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}"
29
+ run: |
30
+ bin/pronto run -c origin/${{ github.base_ref }} -f text github_pr_review github_status
@@ -0,0 +1,87 @@
1
+ name: Test Generated App
2
+ on: [push]
3
+
4
+ jobs:
5
+ build-app:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - name: Checkout code
9
+ uses: actions/checkout@v3
10
+
11
+ - name: Setup Ruby
12
+ uses: ruby/setup-ruby@v1
13
+
14
+ # We have to rely on an additional bundle install for
15
+ # the local gnarails script to run properly.
16
+ - name: Install Ruby Dependencies
17
+ run: bundle install
18
+
19
+ - name: Setup Node
20
+ uses: actions/setup-node@v3
21
+ with:
22
+ node-version: 16
23
+
24
+ - name: Generate Test App
25
+ run: |
26
+ bundle exec exe/gnarails new rails-test-app
27
+
28
+ mkdir rails-test-app/app/views/job_postings
29
+ mkdir rails-test-app/db/migrate
30
+ mkdir rails-test-app/spec/factories
31
+ mkdir rails-test-app/spec/models
32
+ mkdir rails-test-app/spec/system
33
+ mkdir rails-test-app/spec/requests
34
+
35
+ cp test-app/app/controllers/job_postings_controller.rb rails-test-app/app/controllers/job_postings_controller.rb
36
+ cp test-app/app/models/job_posting.rb rails-test-app/app/models/job_posting.rb
37
+ cp test-app/app/models/comment.rb rails-test-app/app/models/comment.rb
38
+ cp test-app/app/views/job_postings/index.html.erb rails-test-app/app/views/job_postings/index.html.erb
39
+ yes | cp test-app/app/views/layouts/application.html.erb rails-test-app/app/views/layouts/application.html.erb
40
+ yes | cp test-app/config/routes.rb rails-test-app/config/routes.rb
41
+ cp test-app/db/migrate/20170918002433_create_job_postings.rb rails-test-app/db/migrate/20170918002433_create_job_postings.rb
42
+ cp test-app/db/migrate/20170918002455_create_comments.rb rails-test-app/db/migrate/20170918002455_create_comments.rb
43
+ cp test-app/spec/factories/job_postings.rb rails-test-app/spec/factories/job_postings.rb
44
+ cp test-app/spec/models/job_posting_spec.rb rails-test-app/spec/models/job_posting_spec.rb
45
+ cp test-app/spec/system/viewing_all_job_postings_spec.rb rails-test-app/spec/system/viewing_all_job_postings_spec.rb
46
+ cp test-app/spec/requests/status_spec.rb rails-test-app/spec/requests/status_spec.rb
47
+
48
+ - name: Tar files
49
+ run: tar -czvf rails_test_app.tar -C rails-test-app .
50
+
51
+ - uses: actions/upload-artifact@v2
52
+ with:
53
+ name: rails-test-app
54
+ path: ./rails_test_app.tar
55
+
56
+ rails-test-app:
57
+ runs-on: ubuntu-latest
58
+ needs: build-app
59
+ env:
60
+ RAILS_ENV: test
61
+ DATABASE_PASSWORD: password
62
+ services:
63
+ postgres:
64
+ image: postgres:14
65
+ env:
66
+ POSTGRES_PASSWORD: password
67
+ ports: ["5432:5432"]
68
+ options:
69
+ --health-cmd pg_isready
70
+ --health-interval 10s
71
+ --health-timeout 5s
72
+ --health-retries 5
73
+ steps:
74
+ # Do not checkout the repo here - this is intentionally running of of the generated app!
75
+ - uses: actions/download-artifact@v2
76
+ with:
77
+ name: rails-test-app
78
+
79
+ - name: Un-Tar files
80
+ run: tar -xvf rails_test_app.tar
81
+
82
+ # running this from the generated app, not the Gem
83
+ - name: Run Tests
84
+ uses: ./.github/actions/test-rails
85
+
86
+ - name: Ensure app has no rubocop warnings
87
+ run: bin/rubocop --fail-level warning
@@ -0,0 +1,17 @@
1
+ name: Unit Test
2
+ on: [push]
3
+
4
+ jobs:
5
+ run-unit-test:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - name: Checkout code
9
+ uses: actions/checkout@v3
10
+
11
+ - name: Setup Ruby and install gems
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ bundler-cache: true
15
+
16
+ - name: Run Tests
17
+ run: bin/rspec
data/.railsrc CHANGED
@@ -1,2 +1,5 @@
1
+ --asset-pipeline=propshaft
1
2
  --skip-test-unit
3
+ --css=sass
4
+ --javascript=esbuild
2
5
  --database=postgresql
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ 2.7.4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Current release (in development)
2
2
 
3
+ * Upgrade to Ruby 2.6.5 [#148](https://github.com/TheGnarCo/gnarails/pull/149)
4
+
5
+ [Dan Frenette](https://github.com/danfrenette)
6
+
3
7
  ## 3.0.0 - 2019-09-20
4
8
 
5
9
  * Downgrade to Ruby 2.6.3 [#148](https://github.com/TheGnarCo/gnarails/pull/148)
data/CONTRIBUTING.md CHANGED
@@ -31,7 +31,7 @@ are expected to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md).
31
31
  4. Include tests to verify the change performs as expected.
32
32
  5. Run the test suite locally to ensure the change doesn't affect other
33
33
  functionality.
34
- * `bundle exec rspec`
34
+ * `bin/rspec`
35
35
  6. Commit progress in [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit).
36
36
  * `git commit -am "A message with an informative title, and detailed description
37
37
  in subsequent paragraphs"`
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ # This Gem has been Deprecated
2
+
3
+ If you are looking to build rails apps with Gnarly Opinions, check out the `init` command of [`gnar-cli`](https://www.github.com/theGnarCo/gnar-cli).
4
+
1
5
  # Gnarails
2
6
 
3
7
  Create a gnarly rails app, ready to go with all the base functionality you can
@@ -92,7 +96,8 @@ end
92
96
  ## Running the Application
93
97
 
94
98
  ```sh
95
- $ bin/rails s
99
+ $ bin/setup
100
+ $ bin/dev
96
101
  ```
97
102
 
98
103
  Visit `localhost:3000` in your browser
data/RELEASE_PROCESS.md CHANGED
@@ -1,8 +1,7 @@
1
- * Checkout master: `git checkout master`.
2
- * Get latest: `git pull --rebase origin master`
3
- * Bump version number in `lib/gnarails/version.rb`.
4
- * Update the [CHANGELOG](CHANGELOG.md), moving the current release work to under the version number.
5
- * Create a commit, including the version number in the commit message: `git add
6
- --all && git commit -m "Version x.y.z"`.
7
- * Push the release to RubyGems: `rake release`.
8
- * Check the RubyGems [twitter account](https://twitter.com/rubygems) to publicize the release.
1
+ - Checkout master: `git checkout main`.
2
+ - Get latest: `git pull --rebase origin main`
3
+ - Bump version number in `lib/gnarails/version.rb`.
4
+ - Update the [CHANGELOG](CHANGELOG.md), moving the current release work to under the version number.
5
+ - Create a commit, including the version number in the commit message: `git add --all && git commit -m "Version x.y.z"`.
6
+ - Push the release to RubyGems: `rake release`.
7
+ - Check the RubyGems [twitter account](https://twitter.com/rubygems) to publicize the release.
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
data/bin/bundle ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+
28
+ bundler_version = nil
29
+ update_index = nil
30
+ ARGV.each_with_index do |a, i|
31
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
32
+ bundler_version = a
33
+ end
34
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o
35
+
36
+ bundler_version = Regexp.last_match(1)
37
+ update_index = i
38
+ end
39
+ bundler_version
40
+ end
41
+
42
+ def gemfile
43
+ gemfile = ENV["BUNDLE_GEMFILE"]
44
+ return gemfile if gemfile && !gemfile.empty?
45
+
46
+ File.expand_path("../Gemfile", __dir__)
47
+ end
48
+
49
+ def lockfile
50
+ lockfile =
51
+ case File.basename(gemfile)
52
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
53
+ else "#{gemfile}.lock"
54
+ end
55
+ File.expand_path(lockfile)
56
+ end
57
+
58
+ def lockfile_version
59
+ return unless File.file?(lockfile)
60
+
61
+ lockfile_contents = File.read(lockfile)
62
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o
63
+
64
+ Regexp.last_match(1)
65
+ end
66
+
67
+ def bundler_version
68
+ @bundler_version ||=
69
+ env_var_version || cli_arg_version ||
70
+ lockfile_version
71
+ end
72
+
73
+ def bundler_requirement
74
+ return "#{Gem::Requirement.default}.a" unless bundler_version
75
+
76
+ bundler_gem_version = Gem::Version.new(bundler_version)
77
+
78
+ requirement = bundler_gem_version.approximate_recommendation
79
+
80
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
81
+
82
+ requirement += ".a" if bundler_gem_version.prerelease?
83
+
84
+ requirement
85
+ end
86
+
87
+ def load_bundler!
88
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
89
+
90
+ activate_bundler
91
+ end
92
+
93
+ def activate_bundler
94
+ gem_error = activation_error_handling do
95
+ gem "bundler", bundler_requirement
96
+ end
97
+ return if gem_error.nil?
98
+
99
+ require_error = activation_error_handling do
100
+ require "bundler/version"
101
+ end
102
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
103
+
104
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
105
+ exit 42
106
+ end
107
+
108
+ def activation_error_handling
109
+ yield
110
+ nil
111
+ rescue StandardError, LoadError => e
112
+ e
113
+ end
114
+ end
115
+
116
+ m.load_bundler!
117
+
118
+ if m.invoked_as_script?
119
+ load Gem.bin_path("bundler", "bundle")
120
+ end
data/bin/pronto ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'pronto' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("bundle", __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("pronto", "pronto")
data/bin/rspec ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("bundle", __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rspec-core", "rspec")
data/bin/rubocop ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("bundle", __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rubocop", "rubocop")
data/gnarails.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require "gnarails/version"
4
4
 
@@ -19,15 +19,26 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.required_ruby_version = ">= 2.6.3"
22
+ spec.required_ruby_version = ">= 2.7.4"
23
23
 
24
- spec.add_dependency "rails", "~> 6.0.0"
24
+ spec.add_dependency "rails", "~> 7.0.0"
25
25
  spec.add_dependency "thor"
26
26
 
27
27
  spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
28
28
  spec.add_development_dependency "gnar-style"
29
29
  spec.add_development_dependency "pronto"
30
30
  spec.add_development_dependency "pronto-rubocop"
31
- spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rake", "~> 13.0"
32
32
  spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.metadata["rubygems_mfa_required"] = "true"
34
+ spec.post_install_message = %(
35
+ ==============================
36
+ THIS GEM HAS BEEN DEPRECATED!
37
+ ==============================
38
+ If you are looking to initialize
39
+ Rails apps with Gnarly Opinions,
40
+ check out Gnar-CLI:
41
+
42
+ https://www.github.com/theGnarCo/gnar-cli
43
+ )
33
44
  end