-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from collectiveidea/updates!
Updates for newer versions of Ruby and Rails
- Loading branch information
Showing
15 changed files
with
224 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
spec: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
ruby_version: | ||
- "3.1" | ||
- "3.2" | ||
- "3.3" | ||
gemfile: | ||
- "rails70" | ||
- "rails71" | ||
- "rails72" | ||
- "rails80" | ||
exclude: | ||
- ruby_version: "3.1" | ||
gemfile: "rails80" | ||
include: | ||
- ruby_version: "head" | ||
gemfile: "rails-main" | ||
|
||
env: | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby_version }} | ||
bundler-cache: true | ||
|
||
- name: Run Tests | ||
run: bundle exec rake |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
module Interactor | ||
class Generator < ::Rails::Generators::NamedBase | ||
def self.source_root | ||
File.expand_path("../templates", __FILE__) | ||
File.expand_path("templates", __dir__) | ||
end | ||
|
||
def generate | ||
template "#{self.class.generator_name}.erb", File.join("app/interactors", class_path, "#{file_name}.rb") | ||
template "spec.erb", File.join("spec/interactors", class_path, "#{file_name}_spec.rb") | ||
|
||
if use_test_unit? | ||
template "test.erb", File.join("test/interactors", class_path, "#{file_name}_test.rb") | ||
else | ||
template "spec.erb", File.join("spec/interactors", class_path, "#{file_name}_spec.rb") | ||
end | ||
end | ||
|
||
def use_test_unit? | ||
::Rails.application.config.generators.options[:rails][:test_framework] == :test_unit | ||
end | ||
|
||
def rspec_helper_file | ||
if File.exist?("spec/rails_helper.rb") | ||
"rails_helper" | ||
else | ||
"spec_helper" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "test_helper" | ||
|
||
class <%= class_name %>Test < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
end |
Oops, something went wrong.