ruby-jq 0.1.7 → 0.1.8

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
- SHA1:
3
- metadata.gz: 5cec2eb595c9df2296574f2c0f8e451517feead1
4
- data.tar.gz: e2537b1e04395fb0eee5f53bdcde7683d0ac9fe9
2
+ SHA256:
3
+ metadata.gz: 537f5ec4e07f12337cd66123d06a2d148bf16ef623a8ec8cb17b80b809182a25
4
+ data.tar.gz: 68f12164fb0869149ddb318b3f9c6fd2a49caf3db9054f981281f83273c918b9
5
5
  SHA512:
6
- metadata.gz: c0cf18747748b7d27d73bfa93059d6ed492954971a6fb5d8b5b5ee5baccf36c0f427d165e1941766b858b180941a1df3e9fc270433ccdc5b2ab3dd892a19473c
7
- data.tar.gz: a102046963d2664782213e77ddb961e9def674c1af04c6458cc60eacde79eebcfa077b3f7bee89c057366c08218b97272091b7fbb2942dd37422d615c0e19b9e
6
+ metadata.gz: 035220f5256927a0cba9871d1e6364e5fb660ef8b7c13227ad31d6cd9fe6f1d8cd004a687055d65ea1292458baef6ac6daba6419f266d349300ab2ccbc4e34b7
7
+ data.tar.gz: d1a52a3a72c9be7922c84034432ddce4838c2290970e737f15583104cbef87eef09b3d9a8b6e019ad5584439420b51c132a6d0601361f1b9f79ba25d371f1240
@@ -1,31 +1,14 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
- - 2.2.9
4
- - 2.3.6
5
- - 2.4.3
6
- - 2.5.0
7
- before_install:
8
- - gem update --system
9
- - gem install bundler
10
- before_script:
11
- - wget http://ftp.gnu.org/gnu/bison/bison-3.0.2.tar.gz
12
- - tar xf bison-3.0.2.tar.gz
13
- - cd bison-3.0.2
14
- - ./configure
15
- - make
16
- - sudo make install
17
- - cd ..
18
- - sudo apt-get install flex libonig2 libonig-dev
19
- - git clone https://github.com/stedolan/jq.git
20
- - cd jq
21
- - autoreconf -i
22
- - ./configure --enable-shared
23
- - rm $PWD/docs/Gemfile.lock
24
- - BUNDLE_GEMFILE="$PWD/docs/Gemfile" bundle install
25
- - BUNDLE_GEMFILE="$PWD/docs/Gemfile" bundle exec make
26
- - sudo make install
27
- - sudo ldconfig
28
- - cd ..
4
+ - 2.3.8
5
+ - 2.4.6
6
+ - 2.5.5
7
+ - 2.6.3
29
8
  script:
30
- - bundle install
31
- - bundle exec rake
9
+ - bundle install
10
+ - bundle exec rake
11
+ addons:
12
+ apt:
13
+ packages:
14
+ - libonig-dev
data/README.md CHANGED
@@ -7,19 +7,12 @@ see [http://stedolan.github.io/jq/](http://stedolan.github.io/jq/).
7
7
  [![Gem Version](https://badge.fury.io/rb/ruby-jq.svg)](http://badge.fury.io/rb/ruby-jq)
8
8
  [![Build Status](https://travis-ci.org/winebarrel/ruby-jq.svg?branch=master)](https://travis-ci.org/winebarrel/ruby-jq)
9
9
 
10
- ## Installation
10
+ ## Prerequisites
11
11
 
12
- First, please install libjq from HEAD of [git repository](https://github.com/stedolan/jq).
12
+ jq requires the Oniguruma library to provide regex support. To install Oniguruma
13
+ for your system, please follow the instructions in the [jq FAQ](https://github.com/stedolan/jq/wiki/FAQ#installation).
13
14
 
14
- ```sh
15
- git clone https://github.com/stedolan/jq.git
16
- cd jq
17
- autoreconf -i
18
- ./configure --enable-shared
19
- make
20
- sudo make install
21
- sudo ldconfig
22
- ```
15
+ ## Installation
23
16
 
24
17
  Add this line to your application's Gemfile:
25
18
 
@@ -33,6 +26,13 @@ Or install it yourself as:
33
26
 
34
27
  $ gem install ruby-jq
35
28
 
29
+ ### Using system libraries
30
+
31
+ By default, ruby-jq downloads and compiles its own version of libjq. If you
32
+ would like to use your own version of libjq, you can skip this process by
33
+ passing the `--use-system-libraries` flag to `gem install`, or by setting the
34
+ `RUBYJQ_USE_SYSTEM_LIBRARIES` env var.
35
+
36
36
  ## Usage
37
37
 
38
38
  ```ruby
@@ -1,5 +1,33 @@
1
1
  require 'mkmf'
2
2
 
3
- if have_library('jq')
4
- create_makefile('jq_core')
3
+ def using_system_libraries?
4
+ arg_config('--use-system-libraries', !!ENV['RUBYJQ_USE_SYSTEM_LIBRARIES'])
5
5
  end
6
+
7
+ unless using_system_libraries?
8
+ message "Buildling jq using packaged libraries.\n"
9
+
10
+ require 'rubygems'
11
+ require 'mini_portile2'
12
+
13
+ recipe = MiniPortile.new("jq", "1.6")
14
+ recipe.files = ["https://github.com/stedolan/jq/archive/jq-1.6.tar.gz"]
15
+ recipe.configure_options = [
16
+ "--enable-shared",
17
+ "--disable-maintainer-mode"
18
+ ]
19
+ class << recipe
20
+ def configure
21
+ execute("autoreconf", "autoreconf -i")
22
+ super
23
+ end
24
+ end
25
+ recipe.cook
26
+ recipe.activate
27
+ $LIBPATH = ["#{recipe.path}/lib"] | $LIBPATH
28
+ $CPPFLAGS << " -I#{recipe.path}/include"
29
+ end
30
+
31
+ abort "libjq not found" unless have_library('jq')
32
+
33
+ create_makefile('jq_core')
@@ -1,3 +1,3 @@
1
1
  module JQ
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "multi_json"
23
- spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_runtime_dependency "mini_portile2", ">= 2.2.0"
24
+
24
25
  spec.add_development_dependency "rake"
25
26
  spec.add_development_dependency "rake-compiler"
26
27
  spec.add_development_dependency "rspec"
@@ -1,5 +1,5 @@
1
1
  describe JQ do
2
- it 'int' do
2
+ specify 'int' do
3
3
  expect(JQ('1').search('.')).to eq([1])
4
4
 
5
5
  JQ('1').search('.') do |value|
@@ -7,7 +7,7 @@ describe JQ do
7
7
  end
8
8
  end
9
9
 
10
- it 'float' do
10
+ specify 'float' do
11
11
  expect(JQ('1.2').search('.')).to eq([1.2])
12
12
 
13
13
  JQ('1.2').search('.') do |value|
@@ -15,7 +15,7 @@ describe JQ do
15
15
  end
16
16
  end
17
17
 
18
- it 'string' do
18
+ specify 'string' do
19
19
  expect(JQ('"Zzz"').search('.')).to eq(["Zzz"])
20
20
 
21
21
  JQ('"Zzz"').search('.') do |value|
@@ -23,7 +23,7 @@ describe JQ do
23
23
  end
24
24
  end
25
25
 
26
- it 'array' do
26
+ specify 'array' do
27
27
  expect(JQ('[1, "2", 3]').search('.')).to eq([[1, "2", 3]])
28
28
 
29
29
  JQ('[1, "2", 3]').search('.') do |value|
@@ -31,7 +31,7 @@ describe JQ do
31
31
  end
32
32
  end
33
33
 
34
- it 'hash' do
34
+ specify 'hash' do
35
35
  expect(JQ('{"foo":100, "bar":"zoo"}').search('.')).to eq([{"foo" => 100, "bar" => "zoo"}])
36
36
 
37
37
  JQ('{"foo":100, "bar":"zoo"}').search('.') do |value|
@@ -39,7 +39,7 @@ describe JQ do
39
39
  end
40
40
  end
41
41
 
42
- it 'composition' do
42
+ specify 'composition' do
43
43
  src = <<-EOS
44
44
  {
45
45
  "glossary": {
@@ -90,7 +90,7 @@ describe JQ do
90
90
  end
91
91
  end
92
92
 
93
- it 'read from file' do
93
+ specify 'read from file' do
94
94
  Tempfile.open("ruby-jq.spec.#{$$}") do |src|
95
95
  src.puts(<<-EOS)
96
96
  {
@@ -143,7 +143,7 @@ describe JQ do
143
143
  end
144
144
  end
145
145
 
146
- it 'read from file (> 4096)' do
146
+ specify 'read from file (> 4096)' do
147
147
  Tempfile.open("ruby-jq.spec.#{$$}") do |src|
148
148
  src.puts('[' + (1..10).map { (<<-EOS) }.join(',') + ']')
149
149
  {
@@ -198,7 +198,7 @@ describe JQ do
198
198
  end
199
199
  end
200
200
 
201
- it 'parse_json => false' do
201
+ specify 'parse_json => false' do
202
202
  src = <<-EOS
203
203
  {
204
204
  "glossary": {
@@ -237,7 +237,7 @@ describe JQ do
237
237
  end
238
238
  end
239
239
 
240
- it 'each value' do
240
+ specify 'each value' do
241
241
  src = <<-EOS
242
242
  {"menu": {
243
243
  "id": "file",
@@ -255,13 +255,13 @@ describe JQ do
255
255
  expect(JQ(src).search('.menu.popup.menuitem[].value')).to eq(["New", "Open", "Close"])
256
256
  end
257
257
 
258
- it 'compile error' do
258
+ specify 'compile error' do
259
259
  expect {
260
260
  JQ('{}').search('...')
261
261
  }.to raise_error(JQ::Error)
262
262
  end
263
263
 
264
- it 'runtime error' do
264
+ specify 'runtime error' do
265
265
  expect {
266
266
  JQ('{}').search('.') do |value|
267
267
  raise 'runtime error'
@@ -269,7 +269,7 @@ describe JQ do
269
269
  }.to raise_error(RuntimeError)
270
270
  end
271
271
 
272
- it 'runtime halt in jq raises error' do
272
+ specify 'runtime halt in jq raises error' do
273
273
  expect {
274
274
  JQ('{}').search('.data | keys') do |value|
275
275
  value
@@ -277,7 +277,7 @@ describe JQ do
277
277
  }.to raise_error(JQ::Error).with_message('null (null) has no keys')
278
278
  end
279
279
 
280
- it 'query for hash' do
280
+ specify 'query for hash' do
281
281
  src = {'FOO' => 100, 'BAR' => [200, 200]}
282
282
 
283
283
  expect(src.jq('.BAR[]')).to eq([200, 200])
@@ -287,7 +287,7 @@ describe JQ do
287
287
  end
288
288
  end
289
289
 
290
- it 'query for array' do
290
+ specify 'query for array' do
291
291
  src = ['FOO', 100, 'BAR', [200, 200]]
292
292
 
293
293
  expect(src.jq('.[3][]')).to eq([200, 200])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-03 00:00:00.000000000 Z
11
+ date: 2019-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: mini_portile2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.3'
34
- type: :development
33
+ version: 2.2.0
34
+ type: :runtime
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: '1.3'
40
+ version: 2.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.6.13
127
+ rubygems_version: 2.7.6
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Ruby bindings for jq