kaminari-cells 0.0.4 → 1.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
- SHA1:
3
- metadata.gz: d60741bc8169c26b69a9123f5806b0792e33ea4a
4
- data.tar.gz: d539c8ef29c839f2f7f48817720d08aedf0ac894
2
+ SHA256:
3
+ metadata.gz: 6e1de52baf3f4136f8de0bf664b79d14206a225c0f87ccc6fe4785139a6bf229
4
+ data.tar.gz: 5b031405a187e2bcc2b938f2e29df82ceb3c63d0a7e922abcfec730c5cf56173
5
5
  SHA512:
6
- metadata.gz: a1f6b3984a970a86a6e1d9b27889765cd50c58d4bd61f7b4b858fa502a0b4632637bafa9774c99f2b774660ae611e94c3bf0bb935641672a723341654e4027f7
7
- data.tar.gz: da4d7a98e5fd1530f9dae29ff91fddb241760cfb8dc5df23a9d3033835f666f2c1cc55ed3d052041b183f1cce349bfe382c8b7ab25c745ec24659de68fdf0958
6
+ metadata.gz: e0043854ab708f0d73523a3741629f5dfbda0be09f19a5f7f6ab440aa37967a3be991374b87a40f10d4843b176eeeb23a4e2dbc640b6954a85448e096199f72d
7
+ data.tar.gz: 0732246e5263e1ec74edf38246cd8668e0168884f257a1ed9e7923178728e58e08e8f4f8de4bbe4a50309a6c08fbca2ac74774a4ea6d5b9ca95f9586d3c3ebab
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ test/fake_app/log
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.0
2
+ - 2.2.7
3
+ - 2.3.4
4
+ - 2.4.1
data/CHANGES.md CHANGED
@@ -1,3 +1,14 @@
1
+ # 1.0.1
2
+
3
+ Add support for Rails 7 and Ruby 3.
4
+ Bump kaminari dependency to `kaminari ~> 1.2.0`.
5
+
6
+ # 0.1.0
7
+
8
+ Tighten dependency to `kaminari ~> 0.16.0` (previously was `kaminari >= 0.16.0`.
9
+ This version doesn't work with Kaminari 1.0.0+, and the gemspec should reflect this.
10
+ Once the gem has been made compatible with Kaminari 1.0.0+, it will be released as another version.
11
+
1
12
  # 0.0.4
2
13
 
3
14
  Require cell-4.0.0, cause we can.
@@ -12,4 +23,4 @@ First officially working version, with kaminari 0.16.x and above!
12
23
 
13
24
  # 0.0.1
14
25
 
15
- * First release in an unsuspecting world.
26
+ * First release in an unsuspecting world.
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
- # gem "cells"#, git: "https://github.com/apotonick/cells.git", branch: "master"
5
- gem "rails"
data/README.md CHANGED
@@ -12,14 +12,7 @@ Add this line to your application's Gemfile:
12
12
 
13
13
  ## Usage
14
14
 
15
- To use the wonderful [Kaminari](https://github.com/amatsuda/kaminari) gem in your Cells, just do
16
-
17
- ```ruby
18
- class CommentsCell < Cell::Rails
19
- include Kaminari::Cells
20
- ```
21
-
22
- The same works with Cells [view models](https://github.com/apotonick/cells#view-models).
15
+ To use the wonderful [Kaminari](https://github.com/amatsuda/kaminari) gem in your Cells view models, just do
23
16
 
24
17
  ```ruby
25
18
  class CommentsCell < Cell::ViewModel
@@ -18,12 +18,13 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "kaminari", ">= 0.16.0"
21
+ spec.add_dependency "kaminari", "~> 1.2.0"
22
22
  spec.add_dependency "cells", ">= 4.0.0", "<= 5.0.0"
23
- spec.add_development_dependency "cells-erb"
24
23
  spec.add_development_dependency "bundler", "~> 1.6"
25
- spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "cells-erb"
25
+ spec.add_development_dependency "cells-rails"
26
26
  spec.add_development_dependency "minitest"
27
- spec.add_development_dependency "activerecord"
27
+ spec.add_development_dependency "rails", "5.1.1"
28
+ spec.add_development_dependency "rake"
28
29
  spec.add_development_dependency "sqlite3"
29
30
  end
@@ -1,5 +1,5 @@
1
1
  module Kaminari
2
2
  module Cells
3
- VERSION = "0.0.4"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -1,22 +1,23 @@
1
1
  require "cells"
2
- require "kaminari"
2
+ require "kaminari/helpers/helper_methods"
3
3
  require "kaminari/cells/version"
4
4
  require "cell/partial"
5
5
 
6
- module Kaminari
7
- module Helpers
8
- module CellsHelper
9
- include Kaminari::ActionViewExtension
10
- include ActionView::Helpers::OutputSafetyHelper
11
- include ActionView::Helpers::TranslationHelper
12
- include Cell::ViewModel::Partial
6
+ ActiveSupport.on_load :action_view do
7
+ module Kaminari
8
+ module Helpers
9
+ module CellsHelper
10
+ include Kaminari::Helpers::HelperMethods
11
+ include ActionView::Helpers::OutputSafetyHelper
12
+ include ActionView::Helpers::TranslationHelper
13
+ include Cell::ViewModel::Partial
13
14
 
14
- def paginate(scope, options = {}, &block)
15
- options = options.reverse_merge(:views_prefix => "../views/")
16
- super
15
+ def paginate(scope, **options, &block)
16
+ options = options.reverse_merge(:views_prefix => "../views/")
17
+ super
18
+ end
17
19
  end
18
20
  end
19
21
  end
22
+ require 'kaminari/cells'
20
23
  end
21
-
22
- require 'kaminari/cells'
data/test/cells_test.rb CHANGED
@@ -23,7 +23,7 @@ class KaminariCellsTest < ActionController::TestCase
23
23
  # end
24
24
 
25
25
  test "rendering view model cell" do
26
- get :show, :id => 1
26
+ get :show, params: { id: 1 }
27
27
  assert_equal "<p>1</p>\n", @response.body
28
28
  end
29
- end
29
+ end
@@ -4,9 +4,9 @@ class ViewModelCell < Cell::ViewModel
4
4
  include Kaminari::Cells
5
5
  include Partial
6
6
 
7
- self.view_paths = ["test/fake_app/cells/"]
7
+ self.view_paths = ["test/fake_app/views/"]
8
8
 
9
9
  def show
10
10
  paginate(model)
11
11
  end
12
- end
12
+ end
@@ -1,16 +1,12 @@
1
1
  require "cells"
2
2
  require "cells-erb"
3
+ require "cells-rails"
3
4
  require 'kaminari-cells'
4
- require 'fake_app/cells'
5
5
 
6
6
  require 'action_controller/railtie'
7
- require 'action_view/railtie'
7
+ require 'action_view/base'
8
8
  require 'active_record'
9
9
 
10
- require 'fake_app/config'
11
-
12
-
13
-
14
10
  # config
15
11
  app = Class.new(Rails::Application)
16
12
  app.config.secret_token = '3b7cd727ee24e8444053437c36cc66c4'
@@ -21,13 +17,25 @@ app.config.root = File.dirname(__FILE__)
21
17
  Rails.backtrace_cleaner.remove_silencers!
22
18
  app.initialize!
23
19
 
20
+ require 'fake_app/cells'
21
+
24
22
  # routes
25
23
  app.routes.draw do
26
24
  resources :users
27
25
  end
28
26
 
29
- #models
30
- require 'fake_app/models'
27
+ ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
28
+ ActiveRecord::Base.logger = Logger.new(STDOUT)
29
+
30
+ ActiveRecord::Schema.define do
31
+ create_table(:users) do |t|
32
+ t.string :name
33
+ t.integer :age
34
+ end
35
+ end
36
+
37
+ class User < ActiveRecord::Base
38
+ end
31
39
 
32
40
  ActionView::Base.class_eval do
33
41
  include ::Cell::RailsExtensions::ActionView
@@ -49,4 +57,3 @@ end
49
57
 
50
58
  # helpers
51
59
  Object.const_set(:ApplicationHelper, Module.new)
52
-
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari-cells
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2022-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.0
19
+ version: 1.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.16.0
26
+ version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cells
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -45,35 +45,35 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: 5.0.0
47
47
  - !ruby/object:Gem::Dependency
48
- name: cells-erb
48
+ name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '1.6'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0'
60
+ version: '1.6'
61
61
  - !ruby/object:Gem::Dependency
62
- name: bundler
62
+ name: cells-erb
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '1.6'
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '1.6'
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: rake
76
+ name: cells-rails
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
@@ -101,7 +101,21 @@ dependencies:
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  - !ruby/object:Gem::Dependency
104
- name: activerecord
104
+ name: rails
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '='
108
+ - !ruby/object:Gem::Version
109
+ version: 5.1.1
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '='
115
+ - !ruby/object:Gem::Version
116
+ version: 5.1.1
117
+ - !ruby/object:Gem::Dependency
118
+ name: rake
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - ">="
@@ -148,8 +162,6 @@ files:
148
162
  - lib/kaminari/cells/version.rb
149
163
  - test/cells_test.rb
150
164
  - test/fake_app/cells.rb
151
- - test/fake_app/config.rb
152
- - test/fake_app/models.rb
153
165
  - test/fake_app/rails_app.rb
154
166
  - test/fake_app/views/kaminari/_paginator.html.erb
155
167
  - test/test_helper.rb
@@ -172,16 +184,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
184
  - !ruby/object:Gem::Version
173
185
  version: '0'
174
186
  requirements: []
175
- rubyforge_project:
176
- rubygems_version: 2.2.2
187
+ rubygems_version: 3.1.2
177
188
  signing_key:
178
189
  specification_version: 4
179
190
  summary: Kaminari pagination in Cells.
180
191
  test_files:
181
192
  - test/cells_test.rb
182
193
  - test/fake_app/cells.rb
183
- - test/fake_app/config.rb
184
- - test/fake_app/models.rb
185
194
  - test/fake_app/rails_app.rb
186
195
  - test/fake_app/views/kaminari/_paginator.html.erb
187
196
  - test/test_helper.rb
@@ -1,3 +0,0 @@
1
- # database
2
- ActiveRecord::Base.configurations = {'test' => {:adapter => 'sqlite3', :database => ':memory:'}}
3
- ActiveRecord::Base.establish_connection('test')
@@ -1,13 +0,0 @@
1
- # models
2
- class User < ActiveRecord::Base
3
- end
4
-
5
-
6
- #migrations
7
- class CreateAllTables < ActiveRecord::Migration
8
- def self.up
9
- create_table(:users) {|t| t.string :name; t.integer :age}
10
- end
11
- end
12
- ActiveRecord::Migration.verbose = false
13
- CreateAllTables.up