filta 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +6 -22
- data/VERSION +1 -1
- data/lib/filta.rb +2 -2
- data/lib/filta/methods.rb +4 -4
- data/lib/filta/version.rb +4 -1
- data/lib/tasks/filta.rake +2 -0
- metadata +12 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a94598f178ef2b287a339e160de461f30dbcdd5fe210467f277e5508e7025bc6
|
4
|
+
data.tar.gz: 33f375fa88a58bc990f9458e34f0b332d060f762b6d3d6df5b8ec6bbe568b61f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f0a422fa2767a24f501f1cd03d701c87d7bc53a5a14330e5dfe4126e90a981d120a3242390367554acf6436fcbd57a97b0b5c8b350f2c2d59a6caffc04679c4
|
7
|
+
data.tar.gz: 17684f7112962585e4e8a1f5e247e85afb7eac7ef08577c00ecbf27425ab550568cd51e8bab407a7e648d74bf1ce9f3f340d99319bf6e83498a7ae80424a1145
|
data/Rakefile
CHANGED
@@ -1,28 +1,12 @@
|
|
1
|
-
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rdoc/task'
|
8
|
-
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'Filta'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.md')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
16
|
-
|
17
|
-
require 'bundler/gem_tasks'
|
1
|
+
# frozen_string_literal: true
|
18
2
|
|
19
|
-
require
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
20
5
|
|
21
6
|
Rake::TestTask.new(:test) do |t|
|
22
|
-
t.libs <<
|
23
|
-
t.libs <<
|
24
|
-
t.
|
25
|
-
t.verbose = false
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
26
10
|
end
|
27
11
|
|
28
12
|
task default: :test
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/lib/filta.rb
CHANGED
data/lib/filta/methods.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Filta
|
2
4
|
module Methods
|
3
|
-
|
4
5
|
def self.included(base)
|
5
6
|
base.extend ClassMethods
|
6
7
|
end
|
7
8
|
|
8
9
|
module ClassMethods
|
9
10
|
def filter(by)
|
10
|
-
results =
|
11
|
+
results = where(nil)
|
11
12
|
|
12
13
|
by.each do |key, value|
|
13
|
-
results = results.where(
|
14
|
+
results = results.where(key.to_s.to_sym => value) if value.present?
|
14
15
|
end
|
15
16
|
|
16
17
|
results
|
17
18
|
end
|
18
19
|
end
|
19
|
-
|
20
20
|
end
|
21
21
|
end
|
data/lib/filta/version.rb
CHANGED
data/lib/tasks/filta.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Chinery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.11.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 5.11.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: with_model
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '2.0'
|
69
69
|
description: Super simple filtering for ActiveRecord, inspired by Justin Weiss' Gist
|
70
70
|
- https://gist.github.com/justinweiss/9065666
|
71
71
|
email:
|
@@ -82,7 +82,7 @@ files:
|
|
82
82
|
- lib/filta/methods.rb
|
83
83
|
- lib/filta/version.rb
|
84
84
|
- lib/tasks/filta.rake
|
85
|
-
homepage: https://github.com/
|
85
|
+
homepage: https://github.com/boxt/filta
|
86
86
|
licenses:
|
87
87
|
- MIT
|
88
88
|
metadata: {}
|
@@ -101,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
|
105
|
-
rubygems_version: 2.6.13
|
104
|
+
rubygems_version: 3.0.1
|
106
105
|
signing_key:
|
107
106
|
specification_version: 4
|
108
107
|
summary: Super simple filtering for ActiveRecord
|