cells-rails 0.1.0 → 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: 58c933bc2bd80b6dd44a21992f6537ee1f25140977c570f4ab28f84af99a2bcc
4
- data.tar.gz: 9afe72dcd4a5b44b134e35198959b9c89f0f11c423219bd9bb312255ae7429e6
3
+ metadata.gz: 4916833ae2d2693dd38e78c444121139136b2da8c4d75966d6702de6dabd0dc6
4
+ data.tar.gz: e5e398a471b93a9209bf6c9c71a63ff82a10b5b6b4625f49590c10e55adb48fd
5
5
  SHA512:
6
- metadata.gz: 8929b9360d079e42059d8830c5ab5165a73afb59057efe8f6adf0976513c7106acf33725a1e1725efe09f40b861c8cdaa6201ac34e20567630cb4665ab04e1ec
7
- data.tar.gz: 621cdc22d14d661bb79c6172d21bab249e3aac585ff6356c17efae794ce5bb4fa76eac29c626ee34ed4f4aaba3355b405c75f298271cbda5231b728eaf332bdb
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/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,24 @@
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
+
1
22
  ## 0.1.0
2
23
 
3
24
  * Support for Rails 6.0 Thank to @Szeliga
data/Gemfile CHANGED
@@ -6,13 +6,6 @@ gemspec
6
6
  # gem "my_engine", path: "engines/my_engine"
7
7
 
8
8
  gem 'sass-rails', "~> 6.0.0"
9
- # gem "sprockets", "~> 2.12.3"
10
-
11
- rails_version = ENV.fetch('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"
16
9
 
17
10
  group :development, :test do
18
11
  gem "minitest-spec-rails"
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Cells::Rails
2
- [![Build Status](https://travis-ci.org/trailblazer/cells-rails.svg?branch=master)](https://travis-ci.org/trailblazer/cells-rails)
2
+ ![CI](https://github.com/trailblazer/cells-rails/actions/workflows/ci.yml/badge.svg)
3
3
 
4
4
  [Cells](https://github.com/apotonick/cells) is a generic view model implementation for Ruby. Cells-rails brings Rails-specific bindings.
5
5
 
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.fetch('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
@@ -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,7 +2,7 @@ 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_7_0 = Gem::Version.new("7.0.0")
5
+ RAILS_8_0 = Gem::Version.new("8.0.0")
6
6
  RAILS_5_1 = Gem::Version.new("5.1.0")
7
7
  RAILS_5_0 = Gem::Version.new("5.0.0")
8
8
 
@@ -18,7 +18,7 @@ module Cell
18
18
  def action_controller_test_request(controller_class)
19
19
  version = ::Rails.gem_version
20
20
 
21
- if version >= RAILS_5_1 && version < RAILS_7_0
21
+ if version >= RAILS_5_1 && version < RAILS_8_0
22
22
  ::ActionController::TestRequest.create(controller_class)
23
23
  elsif version >= RAILS_5_0 && version < RAILS_5_1
24
24
  ::ActionController::TestRequest.create
data/lib/cell/rails.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/concern'
2
3
  module Cell
3
4
  def self.rails_version
@@ -78,8 +79,8 @@ module Cell
78
79
  controller.send(:protect_against_forgery?)
79
80
  end
80
81
 
81
- def form_authenticity_token(*args)
82
- controller.send(:form_authenticity_token, *args)
82
+ def form_authenticity_token(**options)
83
+ controller.send(:form_authenticity_token, **options)
83
84
  end
84
85
 
85
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.1.0"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
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.1.0
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: 2019-11-06 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
@@ -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.6.2
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,19 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4.7
4
- - 2.5.6
5
- - 2.6.4
6
- env:
7
- - "RAILS_VERSION=5.0"
8
- - "RAILS_VERSION=5.1"
9
- - "RAILS_VERSION=5.2"
10
- - "RAILS_VERSION=6.0"
11
- matrix:
12
- fast_finish: true
13
- exclude:
14
- - rvm: 2.3.8
15
- env: RAILS_VERSION=6.0
16
- - rvm: 2.4.7
17
- env: RAILS_VERSION=6.0
18
-
19
- cache: bundler