cells-rails 0.0.9 → 0.1.5

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: aa3ea94e1736e966b7e4c6c806a5d365f2b867db223e8983977e7b072ab946cf
4
- data.tar.gz: 8d30523f1e3d94e39ba6e7f232a244e90806ba8f54882a59ac2ebeeba504cbca
3
+ metadata.gz: 4916833ae2d2693dd38e78c444121139136b2da8c4d75966d6702de6dabd0dc6
4
+ data.tar.gz: e5e398a471b93a9209bf6c9c71a63ff82a10b5b6b4625f49590c10e55adb48fd
5
5
  SHA512:
6
- metadata.gz: df3193f4b68ffb810f0eb43d49309a76b9f37e194c61e5ea5509834eac38bf5d2378fd353eaf0646abb4edec4dd8adf015ea91ff87229633f5619fce0b5bbfff
7
- data.tar.gz: 9212656c2c365cb2d37bb3b0a4b4c82bde2cce86fa5e0af70d4ff97c11a9fd86c3b57376f894a6971b7c854c5edf69599e7d98101026d695e8fe38d0e36ea664
6
+ metadata.gz: ca9dee1a60f406e65a8f98cf23e997a1bfab14a8c0c9c70fc7410f776fa55d08ae63968ee07af266e1936abe0caa02a72e4101e5b98543e411bb7b1e9e410ae1
7
+ data.tar.gz: a8cc10e77263454e6f209036de44b782b4064c46d651536b6a0f1af1b56dcd5e8feb8915febd9c21324323affde7871cf89b4e3f08a1aa100cfd3597485c6726
@@ -0,0 +1,40 @@
1
+ name: CI
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
9
+ ruby: [2.5, 2.6, 2.7, '3.0', 3.1, head]
10
+ gemfile:
11
+ - gemfiles/7.0.gemfile
12
+ - gemfiles/6.0.gemfile
13
+ - gemfiles/5.2.gemfile
14
+ exclude:
15
+ - ruby: 2.5
16
+ gemfile: gemfiles/7.0.gemfile
17
+ - ruby: 2.6
18
+ gemfile: gemfiles/7.0.gemfile
19
+ - ruby: 3.0
20
+ gemfile: gemfiles/5.2.gemfile
21
+ - ruby: 3.1
22
+ gemfile: gemfiles/5.2.gemfile
23
+ - ruby: 3.1
24
+ gemfile: gemfiles/6.0.gemfile
25
+ - ruby: head
26
+ gemfile: gemfiles/5.2.gemfile
27
+ - ruby: head
28
+ gemfile: gemfiles/6.0.gemfile
29
+
30
+ runs-on: ubuntu-latest
31
+ env:
32
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
33
+
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+ - uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: ${{ matrix.ruby }}
39
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
40
+ - run: bundle exec rake
data/.gitignore CHANGED
@@ -1,4 +1,4 @@
1
- /.bundle/
1
+ .bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
4
  /_yardoc/
@@ -6,6 +6,9 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
- /tmp/
10
9
  /log
11
- /test/tmp
10
+ tmp
11
+ .DS_Store
12
+ log/
13
+ *.iml
14
+ .idea
data/Appraisals ADDED
@@ -0,0 +1,23 @@
1
+ appraise "6.0" do
2
+ gem "railties", "~> 6.0"
3
+ gem "activerecord", "~> 6.0"
4
+ gem "my_engine", path: "test/rails6.0/engines/my_engine"
5
+ end
6
+
7
+ appraise "5.2" do
8
+ gem "railties", "~> 5.2"
9
+ gem "activerecord", "~> 5.2"
10
+ gem "my_engine", path: "test/rails5.2/engines/my_engine"
11
+ end
12
+
13
+ appraise "5.1" do
14
+ gem "railties", "~> 5.1.0"
15
+ gem "activerecord", "~> 5.1.0"
16
+ gem "my_engine", path: "test/rails5.1/engines/my_engine"
17
+ end
18
+
19
+ appraise "5.0" do
20
+ gem "railties", "~> 5.0.0"
21
+ gem "activerecord", "~> 5.0.0"
22
+ gem "my_engine", path: "test/rails5.0/engines/my_engine"
23
+ end
data/CHANGES.md CHANGED
@@ -1,3 +1,28 @@
1
+ ## 0.1.5
2
+
3
+ * Support for Rails 7.
4
+ * Migrate CI to Github Actions
5
+
6
+ ## 0.1.4
7
+
8
+ * Support Ruby 3.0.
9
+
10
+ ## 0.1.3
11
+
12
+ * Fix previous fixes.
13
+
14
+ ## 0.1.2
15
+
16
+ * Fix `LocalJumpError` from our Railtie.
17
+
18
+ ## 0.1.1
19
+
20
+ * The `Cell.view_paths` are now set automatically for `Trailblazer::Cell`s, too, if the gem is present. This allows starting Rails in daemon mode `rails s -d` and cells finding its views.
21
+
22
+ ## 0.1.0
23
+
24
+ * Support for Rails 6.0 Thank to @Szeliga
25
+
1
26
  ## 0.0.9
2
27
 
3
28
  * Prevent Forwardable from printing warnings in Ruby 2.4+
data/Gemfile CHANGED
@@ -5,14 +5,7 @@ gemspec
5
5
 
6
6
  # gem "my_engine", path: "engines/my_engine"
7
7
 
8
- # gem 'sass-rails', "~> 4.0.3"#, " ~> 3.1.0"
9
- # gem "sprockets", "~> 2.12.3"
10
-
11
- rails_version = ENV['RAILS_VERSION'] || '5.0'
12
- gem "railties", "~> #{rails_version}"
13
- gem "activerecord", "~> #{rails_version}"
14
-
15
- gem "my_engine", path: "test/rails#{rails_version}/engines/my_engine"
8
+ gem 'sass-rails', "~> 6.0.0"
16
9
 
17
10
  group :development, :test do
18
11
  gem "minitest-spec-rails"
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Cells::Rails
2
+ ![CI](https://github.com/trailblazer/cells-rails/actions/workflows/ci.yml/badge.svg)
2
3
 
3
4
  [Cells](https://github.com/apotonick/cells) is a generic view model implementation for Ruby. Cells-rails brings Rails-specific bindings.
4
5
 
@@ -21,4 +22,4 @@ gem 'cells-rails'
21
22
 
22
23
  ## License
23
24
 
24
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
25
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -1,12 +1,13 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
+ require 'rails'
3
4
 
4
- RAILS_VERSION = ENV['RAILS_VERSION'] || '5.0'
5
+ test_folder = Rails.version[0..2]
5
6
 
6
7
  Rake::TestTask.new(:test) do |t|
7
8
  t.libs << "test"
8
9
  t.libs << "lib"
9
- t.test_files = FileList["test/rails#{RAILS_VERSION}/**/*_test.rb"]
10
+ t.test_files = FileList["test/rails#{test_folder}/**/*_test.rb"]
10
11
  end
11
12
 
12
13
  task :default => :test
data/cells-rails.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "cells", ">= 4.1.6", "< 5.0.0"
21
- spec.add_dependency "actionpack", ">= 3.0"
21
+ spec.add_dependency "actionpack", ">= 5.0"
22
22
 
23
23
 
24
24
  spec.add_development_dependency "bundler"
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "rails"
28
28
  spec.add_development_dependency "cells-erb"
29
29
  spec.add_development_dependency "sass-rails"
30
+ spec.add_development_dependency "appraisal"
30
31
  end
@@ -0,0 +1,17 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sass-rails", "~> 6.0.0"
6
+ gem "simple_form"
7
+ gem "formtastic"
8
+ gem "railties", "~> 5.0.0"
9
+ gem "activerecord", "~> 5.0.0"
10
+ gem "my_engine", path: "../test/rails5.0/engines/my_engine"
11
+
12
+ group :development, :test do
13
+ gem "minitest-spec-rails"
14
+ gem "capybara_minitest_spec"
15
+ end
16
+
17
+ gemspec path: "../"
@@ -0,0 +1,17 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sass-rails", "~> 6.0.0"
6
+ gem "simple_form"
7
+ gem "formtastic"
8
+ gem "railties", "~> 5.1.0"
9
+ gem "activerecord", "~> 5.1.0"
10
+ gem "my_engine", path: "../test/rails5.1/engines/my_engine"
11
+
12
+ group :development, :test do
13
+ gem "minitest-spec-rails"
14
+ gem "capybara_minitest_spec"
15
+ end
16
+
17
+ gemspec path: "../"
@@ -0,0 +1,17 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sass-rails", "~> 6.0.0"
6
+ gem "simple_form"
7
+ gem "formtastic"
8
+ gem "railties", "~> 5.2"
9
+ gem "activerecord", "~> 5.2"
10
+ gem "my_engine", path: "../test/rails5.2/engines/my_engine"
11
+
12
+ group :development, :test do
13
+ gem "minitest-spec-rails"
14
+ gem "capybara_minitest_spec"
15
+ end
16
+
17
+ gemspec path: "../"
@@ -0,0 +1,17 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sass-rails", "~> 6.0.0"
6
+ gem "simple_form"
7
+ gem "formtastic"
8
+ gem "railties", "~> 6.0.0"
9
+ gem "activerecord", "~> 6.0.0"
10
+ gem "my_engine", path: "../test/rails6.0/engines/my_engine"
11
+
12
+ group :development, :test do
13
+ gem "minitest-spec-rails"
14
+ gem "capybara_minitest_spec"
15
+ end
16
+
17
+ gemspec path: "../"
@@ -0,0 +1,17 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sass-rails", "~> 6.0"
6
+ gem "simple_form"
7
+ gem "formtastic"
8
+ gem "railties", "~> 7.0.0"
9
+ gem "activerecord", "~> 7.0.0"
10
+ gem "my_engine", path: "../test/rails7.0/engines/my_engine"
11
+
12
+ group :development, :test do
13
+ gem "minitest-spec-rails"
14
+ gem "capybara_minitest_spec"
15
+ end
16
+
17
+ gemspec path: "../"
@@ -2,6 +2,10 @@ module Cell
2
2
  module RailsExtensions
3
3
  # This modules overrides Cell::Testing#controller_for and provides Rails-specific logic.
4
4
  module Testing
5
+ RAILS_8_0 = Gem::Version.new("8.0.0")
6
+ RAILS_5_1 = Gem::Version.new("5.1.0")
7
+ RAILS_5_0 = Gem::Version.new("5.0.0")
8
+
5
9
  def controller_for(controller_class)
6
10
  return unless controller_class
7
11
 
@@ -12,13 +16,13 @@ module Cell
12
16
  end
13
17
 
14
18
  def action_controller_test_request(controller_class)
15
- if ::Rails::VERSION::MAJOR >= 5
16
- if ::Rails::VERSION::MINOR >= 1 # ~> 5.1
17
- ::ActionController::TestRequest.create(controller_class)
18
- else # 5.0
19
- ::ActionController::TestRequest.create
20
- end
21
- else #< 5
19
+ version = ::Rails.gem_version
20
+
21
+ if version >= RAILS_5_1 && version < RAILS_8_0
22
+ ::ActionController::TestRequest.create(controller_class)
23
+ elsif version >= RAILS_5_0 && version < RAILS_5_1
24
+ ::ActionController::TestRequest.create
25
+ else
22
26
  ::ActionController::TestRequest.new
23
27
  end
24
28
  end
data/lib/cell/rails.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'active_support'
2
+ require 'active_support/concern'
1
3
  module Cell
2
4
  def self.rails_version
3
5
  Gem::Version.new(ActionPack::VERSION::STRING)
@@ -77,8 +79,8 @@ module Cell
77
79
  controller.send(:protect_against_forgery?)
78
80
  end
79
81
 
80
- def form_authenticity_token(*args)
81
- controller.send(:form_authenticity_token, *args)
82
+ def form_authenticity_token(**options)
83
+ controller.send(:form_authenticity_token, **options)
82
84
  end
83
85
 
84
86
  module ClassMethods
data/lib/cell/railtie.rb CHANGED
@@ -12,13 +12,13 @@ module Cell
12
12
  end
13
13
  end
14
14
 
15
- # ruthlessly stolen from the zurb-foundation gem.
16
- initializer "cells.update_asset_paths" do |app|
15
+ initializer "cells.update_view_paths" do |app|
17
16
  # Add Rails.root to view_paths
18
17
  Cell::ViewModel.view_paths = [Rails.root.join("app", "cells")]
18
+ end
19
19
 
20
+ config.after_initialize do |app|
20
21
  Array(app.config.cells.with_assets).each do |cell_class|
21
- # puts "@@@@@ #{cell_class.camelize.constantize.prefixes}"
22
22
  app.config.assets.paths += cell_class.camelize.constantize.prefixes # Song::Cell.prefixes
23
23
  end
24
24
  end
@@ -76,6 +76,13 @@ module Cell
76
76
  end
77
77
  end
78
78
 
79
+ initializer "trailblazer.cells.update_view_paths" do |app|
80
+ if Object.const_defined?(:Trailblazer) && Trailblazer.const_defined?(:Cell, false)
81
+ # Add Rails.root to view_paths
82
+ Trailblazer::Cell.view_paths = [Rails.root.join("app", "concepts")]
83
+ end
84
+ end
85
+
79
86
  rake_tasks do
80
87
  load "tasks/cells.rake"
81
88
  end
@@ -1,5 +1,5 @@
1
1
  module Cells
2
2
  module Rails
3
- VERSION = "0.0.9"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
data/lib/cells/rails.rb CHANGED
@@ -1,9 +1,6 @@
1
- require "cells/rails/version"
2
1
  require "cells"
3
-
4
- require "cell/caching/notification"
5
- require "cell/rails"
6
2
  require "cell/railtie"
3
+ require "cell/caching/notification"
7
4
  require "cell/rails/testing"
8
5
 
9
6
  module Cell
data/lib/cells-rails.rb CHANGED
@@ -1 +1,2 @@
1
+ require "cells/rails/version"
1
2
  require "cells/rails"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cells-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cells
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '3.0'
39
+ version: '5.0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '3.0'
46
+ version: '5.0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: appraisal
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
131
145
  description:
132
146
  email:
133
147
  - apotonick@gmail.com
@@ -135,14 +149,20 @@ executables: []
135
149
  extensions: []
136
150
  extra_rdoc_files: []
137
151
  files:
152
+ - ".github/workflows/ci.yml"
138
153
  - ".gitignore"
139
- - ".travis.yml"
154
+ - Appraisals
140
155
  - CHANGES.md
141
156
  - Gemfile
142
157
  - LICENSE.txt
143
158
  - README.md
144
159
  - Rakefile
145
160
  - cells-rails.gemspec
161
+ - gemfiles/5.0.gemfile
162
+ - gemfiles/5.1.gemfile
163
+ - gemfiles/5.2.gemfile
164
+ - gemfiles/6.0.gemfile
165
+ - gemfiles/7.0.gemfile
146
166
  - lib/cell/caching/notification.rb
147
167
  - lib/cell/helper/asset_helper.rb
148
168
  - lib/cell/rails.rb
@@ -188,8 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
208
  - !ruby/object:Gem::Version
189
209
  version: '0'
190
210
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.7.3
211
+ rubygems_version: 3.0.3.1
193
212
  signing_key:
194
213
  specification_version: 4
195
214
  summary: Convenient Rails support for Cells.
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5.0
4
- - 2.4.3
5
- - 2.3
6
- - 2.2
7
- - 2.1
8
- - 2.0.0
9
- - 1.9.3
10
- - jruby-19mode
11
- env:
12
- - "RAILS_VERSION=4.2"
13
- - "RAILS_VERSION=5.0"
14
- matrix:
15
- fast_finish: true
16
- exclude:
17
- - rvm: 2.1.10
18
- env: "RAILS_VERSION=5.0"
19
- - rvm: 2.4.0
20
- env: "RAILS_VERSION=4.2"