active_json_cli 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cdd1ffe2a71bd5883e77e1f8c150f7619b2bbb558d5dc28cde36d9bc16fa016
4
- data.tar.gz: 6df976807d6e2c2313dc46578e3c412a43f62f59d85664500fab01419230f7a0
3
+ metadata.gz: 9a209022658ce114499725b4ce4e908c1046c23900e1918c14178ffdf4b1d3b5
4
+ data.tar.gz: ad83f18b1b21e9f1c623986055ed2a38de8a6718d588c1c4ce4a8211a3815ce5
5
5
  SHA512:
6
- metadata.gz: d9df44ec2d021fcd8c777feb7b62f58fb05d59599848af76d5199b4bfccde89a093b221a3549daefc0a45cf9cc4517d528d0584506a9e0681df17ed89bb3d31b
7
- data.tar.gz: 1fde3ad093f0ec56707a66c64d1d80e813ff7928f27bd27adf1be4015844acc73fbd8deb805bacc62382159d09a118408448f8a43154ce652f2d0e7d460012a1
6
+ metadata.gz: b4dcfa17f1b816fa5a1d3f946514576103d72445d5dcb7f67409ab9d89898f23fad261047995faf94ee4bbfd824a21fc3c3725d3d99351b905ca1526661aaa2e
7
+ data.tar.gz: 13d00eb86e7326c7b557bf2bc47f4af116741fa536d18c9093128607b6f2dbcfed3c5dbc6aed61b6235399abbd83af874fed4288b0573881d38ad2ca4ae4d447
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_json_cli (0.1.3)
4
+ active_json_cli (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
Binary file
@@ -5,12 +5,12 @@ module ActiveJson
5
5
  extend self
6
6
 
7
7
  def select(data, where:, pluck: nil)
8
- result = Array(data).select(&apply_filters(where))
8
+ result = array(data).select(&apply_filters(where))
9
9
  pluck ? result.map(&pluck_attributes(pluck)).compact : result
10
10
  end
11
11
 
12
12
  def reject(data, where:, pluck: nil)
13
- result = Array(data).reject(&apply_filters(where))
13
+ result = array(data).reject(&apply_filters(where))
14
14
  pluck ? result.map(&pluck_attributes(pluck)).compact : result
15
15
  end
16
16
 
@@ -26,5 +26,9 @@ module ActiveJson
26
26
  -> (record) { pluck.call(record) }
27
27
  end
28
28
 
29
+ def array(elem)
30
+ elem.is_a?(Array) ? elem : [elem]
31
+ end
32
+
29
33
  end
30
34
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveJson
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_json_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah
@@ -100,6 +100,7 @@ files:
100
100
  - active_json_cli-0.1.0.gem
101
101
  - active_json_cli-0.1.1.gem
102
102
  - active_json_cli-0.1.2.gem
103
+ - active_json_cli-0.1.3.gem
103
104
  - active_json_cli.gemspec
104
105
  - bin/active_json
105
106
  - bin/console