facet 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bf32ae4d71605965f10204b1f506ac6b793b61a1a67ae691ff9a3abd6271d42f
4
+ data.tar.gz: 2fec26e6bf7facc28d0159fc5403bdd8ccc50ca79e10e27911681cb308578580
5
+ SHA512:
6
+ metadata.gz: 1428de7b6d1a06c0388eb62a5f6ead9e0bbfdb0fdf9d50a96ad41e06bf1ed1b90142449cdf321d749bfc190384acd337051b9e98b4fc076fbc286d8da7c0bd30
7
+ data.tar.gz: c14758818065d284b516706a347ccefb29da1b690d0764f2cb2ce578afcd537d70f4fe7b5d55168253aae49728da89f717f9ef8b7a28b67dc6bf5053f9d007cb
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Eric Garside
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,46 @@
1
+ # Facet
2
+
3
+ Create cacheable collections of filtered, sorted, and paginated ActiveRecord objects.
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/facet.svg)](https://badge.fury.io/rb/facet)
6
+ [![Build Status](https://semaphoreci.com/api/v1/freshly/spicerack/branches/master/badge.svg)](https://semaphoreci.com/freshly/spicerack)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/7e089c2617c530a85b17/maintainability)](https://codeclimate.com/github/Freshly/spicerack/maintainability)
8
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/7e089c2617c530a85b17/test_coverage)](https://codeclimate.com/github/Freshly/spicerack/test_coverage)
9
+
10
+ * [Installation](#installation)
11
+ * [Usage](#usage)
12
+ * [Development](#development)
13
+ * [Contributing](#contributing)
14
+ * [License](#license)
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'facet'
22
+ ```
23
+
24
+ And then execute:
25
+
26
+ $ bundle
27
+
28
+ Or install it yourself as:
29
+
30
+ $ gem install facet
31
+
32
+ ## Usage
33
+
34
+ TODO: Write usage instructions here
35
+
36
+ ## Development
37
+
38
+ Consult Spicerack's [development instructions](../README.md#development) for more info.
39
+
40
+ ## Contributing
41
+
42
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Freshly/spicerack.
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support"
4
+
5
+ require "tablesalt/dsl_accessor"
6
+
7
+ require "facet/version"
8
+
9
+ require "facet/base"
10
+
11
+ module Facet
12
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "concerns/core"
4
+
5
+ module Facet
6
+ class Base
7
+ include Facet::Core
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facet
4
+ module Core
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ attr_reader :current_page, :filter_by, :sort_by
9
+ end
10
+
11
+ def initialize(current_page: 0, filter_by: nil, sort_by: nil)
12
+ @current_page = current_page
13
+ @filter_by = filter_by
14
+ @sort_by = sort_by
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facet
4
+ # This constant is managed by spicerack
5
+ VERSION = "0.16.1"
6
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: facet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.16.1
5
+ platform: ruby
6
+ authors:
7
+ - Eric Garside
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 5.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 5.2.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: tablesalt
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.16.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.16.1
41
+ description: Create cacheable collections of filtered, sorted, and paginated ActiveRecord
42
+ objects
43
+ email:
44
+ - eric.garside@freshly.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - LICENSE.txt
50
+ - README.md
51
+ - lib/facet.rb
52
+ - lib/facet/base.rb
53
+ - lib/facet/concerns/core.rb
54
+ - lib/facet/version.rb
55
+ homepage: https://github.com/Freshly/spicerack/tree/master/facet
56
+ licenses:
57
+ - MIT
58
+ metadata:
59
+ homepage_uri: https://github.com/Freshly/spicerack/tree/master/facet
60
+ source_code_uri: https://github.com/Freshly/spicerack/tree/master/facet
61
+ changelog_uri: https://github.com/Freshly/spicerack/blob/master/facet/CHANGELOG.md
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubygems_version: 3.0.3
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: A filterable, sortable, pageable, and Rails cacheable ActiveRecord::Relation
81
+ test_files: []