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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 538c94f5373c1c9f42645b9c1f77095628a20ea1
4
- data.tar.gz: 9840d0d1a80f5846a0316c33dd466189785afa6b
2
+ SHA256:
3
+ metadata.gz: a94598f178ef2b287a339e160de461f30dbcdd5fe210467f277e5508e7025bc6
4
+ data.tar.gz: 33f375fa88a58bc990f9458e34f0b332d060f762b6d3d6df5b8ec6bbe568b61f
5
5
  SHA512:
6
- metadata.gz: 71fcedcacc8ae3797a420161680765e679e45419f26e23352fb4569a3abc02a05e60e3817418e1e1501c829549af019ac1866a27d27b9f825a6e001d4fb5f44a
7
- data.tar.gz: 23fe9710d0cafafcb491b3b0a2f6b6bde48200e271d48b2d2f9983270cb4fff22085f96f9b2880d1c7a2a16a975b91d42c324c5115efa03a0736872fb892c5fa
6
+ metadata.gz: 4f0a422fa2767a24f501f1cd03d701c87d7bc53a5a14330e5dfe4126e90a981d120a3242390367554acf6436fcbd57a97b0b5c8b350f2c2d59a6caffc04679c4
7
+ data.tar.gz: 17684f7112962585e4e8a1f5e247e85afb7eac7ef08577c00ecbf27425ab550568cd51e8bab407a7e648d74bf1ce9f3f340d99319bf6e83498a7ae80424a1145
data/Rakefile CHANGED
@@ -1,28 +1,12 @@
1
- begin
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 'rake/testtask'
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
20
5
 
21
6
  Rake::TestTask.new(:test) do |t|
22
- t.libs << 'lib'
23
- t.libs << 'test'
24
- t.pattern = 'test/**/*_test.rb'
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.0
1
+ 0.3.1
@@ -1,9 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "filta/methods"
2
4
 
3
5
  module Filta
4
-
5
6
  ActiveSupport.on_load(:active_record) do
6
7
  include Filta::Methods
7
8
  end
8
-
9
9
  end
@@ -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 = self.where(nil)
11
+ results = where(nil)
11
12
 
12
13
  by.each do |key, value|
13
- results = results.where("#{key}".to_sym => value) if value.present?
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
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Filta
2
- VERSION = File.read("VERSION").split("\n").first
4
+ version_file = File.join(File.dirname(__FILE__), "../../VERSION")
5
+ VERSION = File.read(version_file).split("\n").first
3
6
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # desc "Explaining what the task does"
2
4
  # task :filta do
3
5
  # # Task goes here
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.0
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: 2018-04-27 00:00:00.000000000 Z
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: '5.0'
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: '5.0'
40
+ version: 5.11.3
41
41
  - !ruby/object:Gem::Dependency
42
- name: with_model
42
+ name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
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: '2.0'
54
+ version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
- name: sqlite3
56
+ name: with_model
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
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: '1.3'
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/sleepingstu/filta
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
- rubyforge_project:
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