listings 0.1.8 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +20 -0
  3. data/app/controllers/listings/listings_controller.rb +1 -1
  4. data/lib/listings/action_view_extensions.rb +1 -1
  5. data/lib/listings/base.rb +19 -20
  6. data/lib/listings/base_field_descriptor.rb +1 -1
  7. data/lib/listings/filter_view.rb +7 -1
  8. data/lib/listings/rspec/listings_helpers.rb +5 -1
  9. data/lib/listings/sources/active_record_data_source.rb +5 -4
  10. data/lib/listings/sources/data_source.rb +1 -1
  11. data/lib/listings/sources/object_data_source.rb +1 -1
  12. data/lib/listings/version.rb +1 -1
  13. data/lib/listings/view_helper_methods.rb +10 -2
  14. data/spec/dummy/app/assets/config/manifest.js +1 -0
  15. data/spec/dummy/app/assets/javascripts/application.js +14 -2
  16. data/spec/dummy/app/controllers/application_controller.rb +8 -2
  17. data/spec/dummy/app/controllers/welcome_controller.rb +3 -0
  18. data/spec/dummy/app/listings/authors_listing.rb +26 -0
  19. data/spec/dummy/app/listings/posts_listing.rb +1 -1
  20. data/spec/dummy/app/listings/tracks_listing.rb +13 -1
  21. data/spec/dummy/app/models/author.rb +5 -0
  22. data/spec/dummy/app/models/post.rb +2 -0
  23. data/spec/dummy/app/models/track.rb +1 -1
  24. data/spec/dummy/app/views/listings/_posts_count.html.haml +5 -0
  25. data/spec/dummy/app/views/welcome/authors.html.haml +3 -0
  26. data/spec/dummy/app/views/welcome/index.html.haml +6 -0
  27. data/spec/dummy/config/routes.rb +1 -0
  28. data/spec/dummy/db/schema.rb +10 -1
  29. data/spec/dummy/db/seeds.rb +10 -2
  30. data/spec/dummy/spec +1 -0
  31. data/spec/factories/authors.rb +5 -0
  32. data/spec/factories/{post.rb → posts.rb} +1 -0
  33. metadata +52 -56
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4591a7706b0590ae7a1958eb970989b111ddd602
4
+ data.tar.gz: 9d77ce4ae69577c507ebce9ad93eaf1383dbb794
5
+ SHA512:
6
+ metadata.gz: d0da43eddc770ae15ad49502830922bc4f5592be2135fe888c4a24549ca66a592deef3c8982bfb1ff0db6c7f4bbec4d9c601d70d3218e610717e3806f6bfb812
7
+ data.tar.gz: a2f408023fbe5f2a6fca0615ebeeeedd75be2e129c40bb2ecaa02318af7465a50c025bfc09f2c6d3caf6afcf6e6d532401197f8603bf2073babd59d8fecb186c
data/README.md CHANGED
@@ -207,6 +207,14 @@ The block is evaluated in a view_context so any helper you will usually use in a
207
207
  column album: :name, title: 'Album'
208
208
  ```
209
209
 
210
+ > **computed columns**
211
+ >
212
+ > Listings will try to sort and filter by default using the `<table_name>.<column_name>` field of the query, on computed queries this will not work, you will need to use `column :my_computed_field, query_column: :my_computed_field` to allow sorting and filtering.
213
+ >
214
+ > Using computed columns might cause some issues depending on the Kaminari version used. If this is the case and you need to filter based on a computed filed, you will need to define a `custom_filter` to apply the filtering of the computed field.
215
+ >
216
+ > See example at [spec/dummy/app/listings/authors_listing.rb](spec/dummy/app/listings/authors_listing.rb)
217
+
210
218
  ### scope
211
219
 
212
220
  Declaring a `scope` with a symbol with allow user to show only records matching the scope in the ActiveRecord class
@@ -243,6 +251,18 @@ It supports `title:` and a block
243
251
  end
244
252
  ```
245
253
 
254
+ A `values: :method` can be specified to avoid the select distinct over the values.
255
+
256
+ ```ruby
257
+ filter album: :name, values: :all_album_names, title: 'Album' do |album_name|
258
+ album_name.titleize
259
+ end
260
+
261
+ def all_album_names
262
+ Album.order("name").pluck("distinct name").reject(&:nil?)
263
+ end
264
+ ```
265
+
246
266
  Also `render:` option can be used to suppress the rendering of the filter, but allowing the user to filter by it. For example to filter by the id:
247
267
 
248
268
  ```ruby
@@ -20,7 +20,7 @@ module Listings
20
20
  @listing = prepare_listing params, view_context, false
21
21
 
22
22
  respond_to do |format|
23
- format.csv { send_data @listing.to_csv, filename: @listing.export_filename(:csv) }
23
+ format.csv { @listing.send_csv(self) }
24
24
  format.xls do
25
25
  headers["Content-Disposition"] = "attachment; filename=\"#{@listing.export_filename(:xls)}\""
26
26
  render 'listings/export'
@@ -38,7 +38,7 @@ module Listings
38
38
  if !paging
39
39
  listing.page_size = :none
40
40
  end
41
- listing.query_items(params)
41
+ listing.query_items(params.respond_to?(:to_unsafe_h) ? params.to_unsafe_h : params)
42
42
  end
43
43
  end
44
44
 
@@ -177,26 +177,25 @@ module Listings
177
177
  (params[:format] || :html).to_sym
178
178
  end
179
179
 
180
- def to_array
181
- data = []
182
-
183
- data << self.columns.map { |c| c.human_name }
184
-
185
- self.items.each do |item|
186
- row = []
187
- self.columns.each do |col|
188
- row << col.value_for(item)
189
- end
190
- data << row
191
- end
192
-
193
- data
194
- end
195
-
196
- def to_csv
197
- CSV.generate do |csv|
198
- self.to_array.each do |row|
199
- csv << row
180
+ def send_csv(controller)
181
+ csv_filename = self.export_filename(:csv)
182
+
183
+ controller.headers["X-Accel-Buffering"] = "no"
184
+ controller.headers["Cache-Control"] = "no-cache"
185
+ controller.headers["Content-Type"] = "text/csv; charset=utf-8"
186
+ controller.headers["Content-Disposition"] = %(attachment; filename="#{csv_filename}")
187
+ controller.headers["Transfer-Encoding"] = "chunked"
188
+ controller.headers.delete("Content-Length")
189
+
190
+ controller.response_body = Enumerator.new do |lines|
191
+ lines << self.columns.map { |c| c.human_name }.to_csv
192
+
193
+ self.items.find_each do |item|
194
+ row = []
195
+ self.columns.each do |col|
196
+ row << col.value_for(item)
197
+ end
198
+ lines << row.to_csv
200
199
  end
201
200
  end
202
201
  end
@@ -11,7 +11,7 @@ module Listings
11
11
  end
12
12
 
13
13
  def build_field(listing)
14
- listing.data_source.build_field(path)
14
+ listing.data_source.build_field(path, props)
15
15
  end
16
16
 
17
17
  def is_field?
@@ -9,7 +9,13 @@ module Listings
9
9
  end
10
10
 
11
11
  def values
12
- @values ||= listing.data_source.values_for_filter(field)
12
+ @values ||= begin
13
+ if method = @field_description.props[:values]
14
+ listing.send(method)
15
+ else
16
+ listing.data_source.values_for_filter(field)
17
+ end
18
+ end
13
19
  end
14
20
 
15
21
  def value_for(value)
@@ -40,7 +40,11 @@ module RSpec::ListingsHelpers
40
40
  controller.request = if Rails::VERSION::MAJOR < 5
41
41
  ActionController::TestRequest.new(:host => "http://test.com")
42
42
  else
43
- ActionController::TestRequest.create
43
+ if Rails::VERSION::MINOR >= 1 # ~> 5.1
44
+ ActionController::TestRequest.create(controller.class)
45
+ else
46
+ ActionController::TestRequest.create
47
+ end
44
48
  end
45
49
  context = controller.view_context
46
50
 
@@ -68,12 +68,12 @@ module Listings::Sources
68
68
  @items = @items.eager_load(relation)
69
69
  end
70
70
 
71
- def build_field(path)
71
+ def build_field(path, props)
72
72
  path = self.class.sanitaize_path(path)
73
73
  if path.is_a?(Array)
74
74
  ActiveRecordAssociationField.new(path, self)
75
75
  else
76
- ActiveRecordField.new(path, self)
76
+ ActiveRecordField.new(path, self, props[:query_column])
77
77
  end
78
78
  end
79
79
  end
@@ -113,9 +113,10 @@ module Listings::Sources
113
113
  end
114
114
 
115
115
  class ActiveRecordField < BaseActiveRecordField
116
- def initialize(attribute_name, data_source)
116
+ def initialize(attribute_name, data_source, query_column)
117
117
  super(data_source)
118
118
  @attribute_name = attribute_name
119
+ @query_column = query_column
119
120
  end
120
121
 
121
122
  def value_for(item)
@@ -123,7 +124,7 @@ module Listings::Sources
123
124
  end
124
125
 
125
126
  def query_column
126
- "#{quote_table_name(data_source.items.table_name)}.#{quote_column_name(@attribute_name)}"
127
+ @query_column || "#{quote_table_name(data_source.items.table_name)}.#{quote_column_name(@attribute_name)}"
127
128
  end
128
129
 
129
130
  def key
@@ -45,7 +45,7 @@ module Listings::Sources
45
45
  end
46
46
 
47
47
  # returns a +Field+ for the specified options
48
- def build_field(path)
48
+ def build_field(path, props)
49
49
  end
50
50
 
51
51
  def self.for(model)
@@ -47,7 +47,7 @@ module Listings::Sources
47
47
  end
48
48
  end
49
49
 
50
- def build_field(path)
50
+ def build_field(path, props)
51
51
  path = self.class.sanitaize_path(path)
52
52
  unless path.is_a?(Array)
53
53
  path = [path]
@@ -1,3 +1,3 @@
1
1
  module Listings
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.14"
3
3
  end
@@ -22,11 +22,19 @@ module Listings
22
22
  # TODO add url_for_filter that will build the search string
23
23
 
24
24
  def build_params(more_params)
25
- res = view_context.params.merge(:listing => self.name).merge(params).merge(more_params)
25
+ res = _to_unsafe_h(view_context.params).merge(:listing => self.name).merge(_to_unsafe_h(params)).merge(more_params)
26
26
  res.delete param_page
27
27
  res.delete :controller
28
28
  res.delete :action
29
- Rails::VERSION::MAJOR < 5 ? res.with_indifferent_access : res.to_unsafe_h
29
+ _to_unsafe_h(res).with_indifferent_access
30
+ end
31
+
32
+ def _to_unsafe_h(hsh)
33
+ if hsh.respond_to?(:to_unsafe_h)
34
+ hsh.to_unsafe_h
35
+ else
36
+ hsh
37
+ end
30
38
  end
31
39
 
32
40
  def no_data_message
@@ -23,9 +23,9 @@
23
23
  // });
24
24
  // });
25
25
 
26
- $(function(){
26
+ $(function () {
27
27
 
28
- $('.listing').on('change', '#date-filter', function(){
28
+ $('.listing').on('change', '#date-filter', function () {
29
29
  var listings = $(this).closest('.listing')
30
30
  var filter = $(this);
31
31
 
@@ -35,5 +35,17 @@ $(function(){
35
35
  listings.trigger("listings:filter:key:set", [filter.data('filter-key'), filter.val()])
36
36
  }
37
37
  });
38
+
39
+ $('.listing').on('click', '#posts-count-filter', function () {
40
+ var listings = $(this).closest('.listing')
41
+ var filter = $(this);
42
+ var value = filter.data('filter-value');
43
+
44
+ if (value == '') {
45
+ listings.trigger("listings:filter:key:clear", filter.data('filter-key'))
46
+ } else {
47
+ listings.trigger("listings:filter:key:set", [filter.data('filter-key'), value])
48
+ }
49
+ });
38
50
  });
39
51
 
@@ -1,7 +1,13 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
3
 
4
- before_filter do
5
- Listings.configuration.theme = params[:theme] || Listings::Configuration.new.theme
4
+ if Rails::VERSION::MAJOR < 5
5
+ before_filter do
6
+ Listings.configuration.theme = params[:theme] || Listings::Configuration.new.theme
7
+ end
8
+ else
9
+ before_action do
10
+ Listings.configuration.theme = params[:theme] || Listings::Configuration.new.theme
11
+ end
6
12
  end
7
13
  end
@@ -10,4 +10,7 @@ class WelcomeController < ApplicationController
10
10
 
11
11
  def tracks
12
12
  end
13
+
14
+ def authors
15
+ end
13
16
  end
@@ -0,0 +1,26 @@
1
+ class AuthorsListing < Listings::Base
2
+ model do
3
+ Author
4
+ .select('authors.*, (select count(*) from posts where posts.author_id = authors.id) as posts_count')
5
+ end
6
+
7
+ paginates_per 7
8
+
9
+ filter :category, values: :categories
10
+
11
+ custom_filter :posts_count_eq, render: 'posts_count' do |items, value|
12
+ items.where("(select count(*) from posts where posts.author_id = authors.id) = ?", value.to_i)
13
+ end
14
+
15
+ def categories
16
+ Author.select('distinct category').pluck(:category).reject(&:nil?)
17
+ end
18
+
19
+ def query_counts
20
+ (1..30).to_a
21
+ end
22
+
23
+ column :name, seachable: true
24
+ column :posts_count, query_column: :posts_count
25
+ column :category
26
+ end
@@ -22,7 +22,7 @@ class PostsListing < Listings::Base
22
22
 
23
23
  column :id
24
24
  column :title, searchable: true
25
- column :author, searchable: true
25
+ column author: :name, searchable: true
26
26
  column :category
27
27
  column do |post|
28
28
  link_to 'Editar', edit_post_path(post)
@@ -2,11 +2,23 @@ class TracksListing < Listings::Base
2
2
 
3
3
  model Track
4
4
 
5
- filter album: :name
5
+ # filter album: :name # this also works but will do a distinct over the mode
6
+ filter album: :name, values: :album_names
6
7
  filter album: :id, title: 'The Album Id' do |value|
7
8
  "#{value}!"
8
9
  end
9
10
  filter :order, render: false
11
+ filter :label, values: :label_values
12
+
13
+ def album_names
14
+ Album.order("name").pluck("distinct name").reject(&:nil?)
15
+ end
16
+
17
+ def label_values
18
+ res = ["red", "blue"]
19
+ res << params[:l] if params[:l]
20
+ res
21
+ end
10
22
 
11
23
  custom_filter :order_lte do |items, value|
12
24
  items.where('"order" <= ?', value.to_i)
@@ -0,0 +1,5 @@
1
+ class Author < ActiveRecord::Base
2
+ attr_accessible :name, :category if Rails::VERSION::MAJOR == 3
3
+
4
+ has_many :posts
5
+ end
@@ -1,6 +1,8 @@
1
1
  class Post < ActiveRecord::Base
2
2
  attr_accessible :title, :author, :category if Rails::VERSION::MAJOR == 3
3
3
 
4
+ belongs_to :author
5
+
4
6
  scope :even, -> { where('id % 2 = 0') }
5
7
  scope :odd, -> { where('id % 2 = 1') }
6
8
  scope :greater_than, lambda { |gt_id| where('id > ?', gt_id) }
@@ -1,6 +1,6 @@
1
1
  class Track < ActiveRecord::Base
2
2
  belongs_to :album
3
- attr_accessible :order, :title if Rails::VERSION::MAJOR == 3
3
+ attr_accessible :order, :title, :label if Rails::VERSION::MAJOR == 3
4
4
 
5
5
  scope :even, -> { where("#{table_name}.id % 2 = 0") }
6
6
 
@@ -0,0 +1,5 @@
1
+ %ul.nav.nav-list.well
2
+ %li.nav-header
3
+ = "Filter by #{filter.key}"
4
+ - (1..20).each do |value|
5
+ %a#posts-count-filter{:'data-filter-key' => filter.key, :'data-filter-value' => value, :href => '#'}= value
@@ -0,0 +1,3 @@
1
+ %h1 Welcome#authors
2
+
3
+ = render_listing :authors
@@ -12,6 +12,12 @@
12
12
  %dd
13
13
  ActiveRecord based listing with scopes, deferred_scopes, styles and selectable
14
14
 
15
+ %dl
16
+ %dt
17
+ = link_to 'Authors', authors_path
18
+ %dd
19
+ ActiveRecord based listing with computed columns
20
+
15
21
  %dl
16
22
  %dt
17
23
  = link_to 'Filtered posts', filtered_posts_path
@@ -5,6 +5,7 @@ Rails.application.routes.draw do
5
5
  get 'filtered'
6
6
  end
7
7
  end
8
+ get 'authors', to: 'welcome#authors'
8
9
 
9
10
  get 'array', to: 'welcome#array'
10
11
  get 'hash', to: 'welcome#hash'
@@ -19,11 +19,18 @@ ActiveRecord::Schema.define(:version => 20150611185922) do
19
19
  t.datetime "updated_at", :null => false
20
20
  end
21
21
 
22
+ create_table "authors", :force => true do |t|
23
+ t.string "name"
24
+ t.string "category"
25
+ t.datetime "created_at", :null => false
26
+ t.datetime "updated_at", :null => false
27
+ end
28
+
22
29
  create_table "posts", :force => true do |t|
23
30
  t.string "title"
24
31
  t.datetime "created_at", :null => false
25
32
  t.datetime "updated_at", :null => false
26
- t.text "author"
33
+ t.integer "author_id"
27
34
  t.string "category"
28
35
  end
29
36
 
@@ -31,10 +38,12 @@ ActiveRecord::Schema.define(:version => 20150611185922) do
31
38
  t.string "title"
32
39
  t.integer "order"
33
40
  t.integer "album_id"
41
+ t.string "label"
34
42
  t.datetime "created_at", :null => false
35
43
  t.datetime "updated_at", :null => false
36
44
  end
37
45
 
38
46
  add_index "tracks", ["album_id"], :name => "index_tracks_on_album_id"
47
+ add_index "posts", ["author_id"], :name => "index_posts_on_author_id"
39
48
 
40
49
  end
@@ -1,14 +1,22 @@
1
1
  require 'factory_girl'
2
2
  # Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}
3
3
 
4
+ AUTHORS = []
5
+
6
+ (1..20).each do |sn|
7
+ AUTHORS << Author.create!(name: "john-#{(sn % 20) + 1}", category: "category-#{(sn % 3) + 1}")
8
+ end
9
+
4
10
  (1..100).each do |sn|
5
- Post.create! title: "post n-#{sn}", author: "john-#{(sn % 4) + 1}", category: "category-#{(sn % 3) + 1}"
11
+ Post.create! title: "post n-#{sn}", author: AUTHORS[sn % (sn / 10 + 1)], category: "category-#{(sn % 3) + 1}"
6
12
  end
7
13
 
8
14
  (1..10).each do |sn|
9
15
  FactoryGirl.create :album
10
16
  end
11
17
 
18
+ LABELS = %w(Green Red Blue)
19
+
12
20
  (1..10).each do |sn|
13
- FactoryGirl.create :track, album: nil
21
+ FactoryGirl.create :track, album: nil, label: LABELS[sn % LABELS.size]
14
22
  end
@@ -0,0 +1 @@
1
+ spec/dummy/../../spec
@@ -0,0 +1,5 @@
1
+ FactoryGirl.define do
2
+ factory :author do
3
+ name
4
+ end
5
+ end
@@ -1,5 +1,6 @@
1
1
  FactoryGirl.define do
2
2
  factory :post do
3
3
  title
4
+ author
4
5
  end
5
6
  end
metadata CHANGED
@@ -1,142 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
5
- prerelease:
4
+ version: 0.1.14
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brian J. Cardiff
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2017-05-09 00:00:00.000000000 Z
11
+ date: 2021-01-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: haml-rails
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sass-rails
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: kaminari
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bootstrap-kaminari-views
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: sqlite3
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rspec-rails
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: factory_girl_rails
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - ">="
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - ">="
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  description: Simple creation of listings in rails applications.
@@ -146,11 +129,14 @@ executables: []
146
129
  extensions: []
147
130
  extra_rdoc_files: []
148
131
  files:
132
+ - LICENSE
133
+ - README.md
134
+ - Rakefile
149
135
  - app/assets/javascripts/jquery-throttle.js
150
- - app/assets/javascripts/listings/application.js
151
136
  - app/assets/javascripts/listings.js
152
- - app/assets/stylesheets/listings/application.css
137
+ - app/assets/javascripts/listings/application.js
153
138
  - app/assets/stylesheets/listings.scss
139
+ - app/assets/stylesheets/listings/application.css
154
140
  - app/controllers/listings/application_controller.rb
155
141
  - app/controllers/listings/listings_controller.rb
156
142
  - app/helpers/listings/application_helper.rb
@@ -174,6 +160,7 @@ files:
174
160
  - app/views/listings/twitter-bootstrap-3/_top_filter.html.haml
175
161
  - config/locales/listings.yml
176
162
  - config/routes.rb
163
+ - lib/listings.rb
177
164
  - lib/listings/action_view_extensions.rb
178
165
  - lib/listings/base.rb
179
166
  - lib/listings/base_field_descriptor.rb
@@ -190,20 +177,19 @@ files:
190
177
  - lib/listings/filter_view.rb
191
178
  - lib/listings/filters/base.rb
192
179
  - lib/listings/kaminari_helpers_tag_patch.rb
193
- - lib/listings/rspec/listings_helpers.rb
194
180
  - lib/listings/rspec.rb
181
+ - lib/listings/rspec/listings_helpers.rb
195
182
  - lib/listings/scope_descriptor.rb
183
+ - lib/listings/sources.rb
196
184
  - lib/listings/sources/active_record_data_source.rb
197
185
  - lib/listings/sources/data_source.rb
198
186
  - lib/listings/sources/object_data_source.rb
199
- - lib/listings/sources.rb
200
187
  - lib/listings/version.rb
201
188
  - lib/listings/view_helper_methods.rb
202
- - lib/listings.rb
203
189
  - lib/tasks/listings_tasks.rake
204
- - LICENSE
205
- - Rakefile
206
- - README.md
190
+ - spec/dummy/README.rdoc
191
+ - spec/dummy/Rakefile
192
+ - spec/dummy/app/assets/config/manifest.js
207
193
  - spec/dummy/app/assets/javascripts/application.js
208
194
  - spec/dummy/app/assets/stylesheets/application.css
209
195
  - spec/dummy/app/controllers/application_controller.rb
@@ -212,25 +198,30 @@ files:
212
198
  - spec/dummy/app/helpers/application_helper.rb
213
199
  - spec/dummy/app/helpers/posts_helper.rb
214
200
  - spec/dummy/app/listings/array_listing.rb
201
+ - spec/dummy/app/listings/authors_listing.rb
215
202
  - spec/dummy/app/listings/filtered_posts_listing.rb
216
203
  - spec/dummy/app/listings/hash_listing.rb
217
204
  - spec/dummy/app/listings/posts_listing.rb
218
205
  - spec/dummy/app/listings/tracks_fixed_order_listing.rb
219
206
  - spec/dummy/app/listings/tracks_listing.rb
220
207
  - spec/dummy/app/models/album.rb
208
+ - spec/dummy/app/models/author.rb
221
209
  - spec/dummy/app/models/object_album.rb
222
210
  - spec/dummy/app/models/object_track.rb
223
211
  - spec/dummy/app/models/post.rb
224
212
  - spec/dummy/app/models/track.rb
225
213
  - spec/dummy/app/views/layouts/application.html.erb
226
214
  - spec/dummy/app/views/listings/_date.html.haml
215
+ - spec/dummy/app/views/listings/_posts_count.html.haml
227
216
  - spec/dummy/app/views/posts/filtered.html.haml
228
217
  - spec/dummy/app/views/posts/index.html.haml
229
218
  - spec/dummy/app/views/shared/_post_partial.html.haml
230
219
  - spec/dummy/app/views/welcome/array.html.haml
220
+ - spec/dummy/app/views/welcome/authors.html.haml
231
221
  - spec/dummy/app/views/welcome/hash.html.haml
232
222
  - spec/dummy/app/views/welcome/index.html.haml
233
223
  - spec/dummy/app/views/welcome/tracks.html.haml
224
+ - spec/dummy/config.ru
234
225
  - spec/dummy/config/application.rb
235
226
  - spec/dummy/config/boot.rb
236
227
  - spec/dummy/config/database.yml
@@ -247,7 +238,6 @@ files:
247
238
  - spec/dummy/config/initializers/wrap_parameters.rb
248
239
  - spec/dummy/config/locales/en.yml
249
240
  - spec/dummy/config/routes.rb
250
- - spec/dummy/config.ru
251
241
  - spec/dummy/db/migrate/20130618143317_create_posts.rb
252
242
  - spec/dummy/db/migrate/20130618195559_add_author_to_posts.rb
253
243
  - spec/dummy/db/migrate/20140728151246_add_category_to_post.rb
@@ -259,11 +249,11 @@ files:
259
249
  - spec/dummy/public/422.html
260
250
  - spec/dummy/public/500.html
261
251
  - spec/dummy/public/favicon.ico
262
- - spec/dummy/Rakefile
263
- - spec/dummy/README.rdoc
264
252
  - spec/dummy/script/rails
253
+ - spec/dummy/spec
265
254
  - spec/factories/albums.rb
266
- - spec/factories/post.rb
255
+ - spec/factories/authors.rb
256
+ - spec/factories/posts.rb
267
257
  - spec/factories/tracks.rb
268
258
  - spec/factories/traits.rb
269
259
  - spec/lib/filter_parser_spec.rb
@@ -279,29 +269,31 @@ files:
279
269
  - spec/support/query_counter.rb
280
270
  homepage: https://github.com/manastech/listings
281
271
  licenses: []
272
+ metadata: {}
282
273
  post_install_message:
283
274
  rdoc_options: []
284
275
  require_paths:
285
276
  - lib
286
277
  required_ruby_version: !ruby/object:Gem::Requirement
287
- none: false
288
278
  requirements:
289
- - - ! '>='
279
+ - - ">="
290
280
  - !ruby/object:Gem::Version
291
281
  version: '0'
292
282
  required_rubygems_version: !ruby/object:Gem::Requirement
293
- none: false
294
283
  requirements:
295
- - - ! '>='
284
+ - - ">="
296
285
  - !ruby/object:Gem::Version
297
286
  version: '0'
298
287
  requirements: []
299
288
  rubyforge_project:
300
- rubygems_version: 1.8.23.2
289
+ rubygems_version: 2.6.12
301
290
  signing_key:
302
- specification_version: 3
291
+ specification_version: 4
303
292
  summary: Simple creation of listings in rails applications.
304
293
  test_files:
294
+ - spec/dummy/README.rdoc
295
+ - spec/dummy/Rakefile
296
+ - spec/dummy/app/assets/config/manifest.js
305
297
  - spec/dummy/app/assets/javascripts/application.js
306
298
  - spec/dummy/app/assets/stylesheets/application.css
307
299
  - spec/dummy/app/controllers/application_controller.rb
@@ -310,22 +302,26 @@ test_files:
310
302
  - spec/dummy/app/helpers/application_helper.rb
311
303
  - spec/dummy/app/helpers/posts_helper.rb
312
304
  - spec/dummy/app/listings/array_listing.rb
305
+ - spec/dummy/app/listings/authors_listing.rb
313
306
  - spec/dummy/app/listings/filtered_posts_listing.rb
314
307
  - spec/dummy/app/listings/hash_listing.rb
315
308
  - spec/dummy/app/listings/posts_listing.rb
316
309
  - spec/dummy/app/listings/tracks_fixed_order_listing.rb
317
310
  - spec/dummy/app/listings/tracks_listing.rb
318
311
  - spec/dummy/app/models/album.rb
312
+ - spec/dummy/app/models/author.rb
319
313
  - spec/dummy/app/models/object_album.rb
320
314
  - spec/dummy/app/models/object_track.rb
321
315
  - spec/dummy/app/models/post.rb
322
316
  - spec/dummy/app/models/track.rb
323
317
  - spec/dummy/app/views/layouts/application.html.erb
324
318
  - spec/dummy/app/views/listings/_date.html.haml
319
+ - spec/dummy/app/views/listings/_posts_count.html.haml
325
320
  - spec/dummy/app/views/posts/filtered.html.haml
326
321
  - spec/dummy/app/views/posts/index.html.haml
327
322
  - spec/dummy/app/views/shared/_post_partial.html.haml
328
323
  - spec/dummy/app/views/welcome/array.html.haml
324
+ - spec/dummy/app/views/welcome/authors.html.haml
329
325
  - spec/dummy/app/views/welcome/hash.html.haml
330
326
  - spec/dummy/app/views/welcome/index.html.haml
331
327
  - spec/dummy/app/views/welcome/tracks.html.haml
@@ -357,11 +353,11 @@ test_files:
357
353
  - spec/dummy/public/422.html
358
354
  - spec/dummy/public/500.html
359
355
  - spec/dummy/public/favicon.ico
360
- - spec/dummy/Rakefile
361
- - spec/dummy/README.rdoc
362
356
  - spec/dummy/script/rails
357
+ - spec/dummy/spec
363
358
  - spec/factories/albums.rb
364
- - spec/factories/post.rb
359
+ - spec/factories/authors.rb
360
+ - spec/factories/posts.rb
365
361
  - spec/factories/tracks.rb
366
362
  - spec/factories/traits.rb
367
363
  - spec/lib/filter_parser_spec.rb