json_logic 0.3 → 0.4.0

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
2
  SHA1:
3
- metadata.gz: 00b8f19def918cb66b14892b45d3dff9c4c84045
4
- data.tar.gz: f8fd51f4eb17fe1c1b6dec4dda24857c63b319a3
3
+ metadata.gz: 375c4179f20abd547af7992c9946a6011e536581
4
+ data.tar.gz: 85fdbfe24a920389383600f116d2866224c4b480
5
5
  SHA512:
6
- metadata.gz: 2e07d04d720757f412526c6b76611c6cbf9d68cd63406b8e26aff0f17159eefe7b957b9e86fd737d7962ee9b3e69b1ff522640096c17d9ded8b033462ff6a04a
7
- data.tar.gz: fca9ad53de483794014db293c762eca8b246ba812a930fb2d2295e69b419ddf4959f5d4be3552f6e2af08775c8c3ecd6e58079f90a25d6a7f85189302dd96b64
6
+ metadata.gz: d785101c15e9d1da6501a0ebaba7fb3f3bd442f6aaaf1a3ec7a74039ec849adc9fb52e77be55406b5a8a0da0770d533306c1d2c730577b4365f0e24b128cad44
7
+ data.tar.gz: 51356563bb58fd56fb0c8595b93476dff9b957e9b297096bddb98b867f0c0995662a400f4442983a18700391cbf25313ebd7278519569654db4e633978806882
data/README.md CHANGED
@@ -4,6 +4,10 @@ Build complex rules, serialize them as JSON, and execute them in ruby.
4
4
 
5
5
  **json-logic-ruby** is a ruby parser for [JsonLogic](http://jsonlogic.com). Other libraries are available for parsing this logic for Python and JavaScript at that link!
6
6
 
7
+ ## Installation
8
+
9
+ `gem install json_logic`
10
+
7
11
  ## Why use JsonLogic?
8
12
 
9
13
  If you're looking for a way to share logic between front-end and back-end code, and even store it in a database, JsonLogic might be a fit for you.
@@ -118,13 +118,13 @@ module JSONLogic
118
118
  end
119
119
 
120
120
  def self.is_standard?(operator)
121
- LAMBDAS.keys.include?(operator)
121
+ LAMBDAS.key?(operator.to_s)
122
122
  end
123
123
 
124
124
  # Determine if values associated with operator need to be re-interpreted for each iteration(ie some kind of iterator)
125
125
  # or if values can just be evaluated before passing in.
126
126
  def self.is_iterable?(operator)
127
- ['filter', 'some', 'all', 'none', 'in', 'map', 'reduce'].any? { |o| o == operator }
127
+ ['filter', 'some', 'all', 'none', 'in', 'map', 'reduce'].include?(operator.to_s)
128
128
  end
129
129
 
130
130
  def self.add_operation(operator, function)
@@ -1,3 +1,3 @@
1
1
  module JSONLogic
2
- VERSION = '0.3'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_logic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenneth Geerts
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-05 00:00:00.000000000 Z
12
+ date: 2018-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.5.1
101
+ rubygems_version: 2.6.14
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Build complex rules, serialize them as JSON, and execute them in ruby