libyajl2 1.2.0 → 2.1.0
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 +5 -5
- data/Gemfile +10 -12
- data/Rakefile +32 -32
- data/ext/libyajl2/extconf.rb +14 -13
- data/lib/libyajl2/version.rb +1 -1
- data/libyajl2.gemspec +6 -17
- data/spec/ffi_spec.rb +2 -2
- data/spec/path_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +10 -97
- data/CONTRIBUTING.md +0 -4
- data/README.md +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 772c24f5ec0300301d32c89923f651443f4a88d15c9b4f5a70916b7c9b8c3955
|
4
|
+
data.tar.gz: 5d541036506e19c824ec4b1102e58733e49d1b77b37e5b5c912b8f474ab346cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc003ebc372536ecb758a19c3a0a7fb40a9c3cb6d3edd6d24331aad29cb78bbc2fdda86b9f45d5bbea665ab5dc812481a24d540a1d1d949428163d630cc3c23e
|
7
|
+
data.tar.gz: 806ea890fc96cfbad5595c26115b5a99c8439d000f258acd8e672a449d8ca26188c37961766a10b70b8352862f60b5c4d47811f22bd1eef460dc1b75ede1eede
|
data/Gemfile
CHANGED
@@ -1,18 +1,16 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
group :
|
6
|
-
|
7
|
-
gem
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
5
|
+
group :development do
|
6
|
+
# required for 'rake spec'
|
7
|
+
gem "bundler"
|
8
|
+
gem "rake"
|
9
|
+
gem "rake-compiler"
|
10
|
+
gem "rspec"
|
11
|
+
gem "ffi", "~> 1.9"
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
gem
|
16
|
-
gem 'rubysl', '~> 2.0'
|
17
|
-
gem 'psych'
|
14
|
+
group :development_extras do
|
15
|
+
gem "chefstyle"
|
18
16
|
end
|
data/Rakefile
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
$: << File.expand_path(File.join(File.dirname( __FILE__ ), "lib"))
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "rubygems"
|
4
|
+
require "rake"
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
6
|
+
require "rubygems/package_task"
|
7
|
+
require "rspec/core/rake_task"
|
8
|
+
require "rake/extensiontask"
|
9
9
|
|
10
10
|
GEM_NAME = "libyajl2"
|
11
11
|
|
12
|
-
gemspec = eval(File.read(
|
12
|
+
gemspec = eval(File.read("libyajl2.gemspec")) # rubocop:disable Security/Eval
|
13
13
|
|
14
14
|
Gem::PackageTask.new(gemspec) do |pkg|
|
15
15
|
pkg.need_tar = true
|
@@ -41,9 +41,9 @@ task :clean do
|
|
41
41
|
sh "git clean -fdx"
|
42
42
|
end
|
43
43
|
|
44
|
-
Rake::ExtensionTask.new(
|
45
|
-
ext.lib_dir =
|
46
|
-
ext.ext_dir =
|
44
|
+
Rake::ExtensionTask.new("libyajl", gemspec) do |ext|
|
45
|
+
ext.lib_dir = "lib/libyajl2/vendored-libyajl2/lib"
|
46
|
+
ext.ext_dir = "ext/libyajl2"
|
47
47
|
end
|
48
48
|
|
49
49
|
# hack to generate yajl_version.h without using cmake
|
@@ -53,17 +53,17 @@ def generate_yajl_version
|
|
53
53
|
|
54
54
|
yajl_major = yajl_minor = yajl_micro = nil
|
55
55
|
File.open("#{vendor_path}/CMakeLists.txt").each do |line|
|
56
|
-
if m = line.match(/YAJL_MAJOR (\d+)/)
|
56
|
+
if (m = line.match(/YAJL_MAJOR (\d+)/))
|
57
57
|
yajl_major = m[1]
|
58
58
|
end
|
59
|
-
if m = line.match(/YAJL_MINOR (\d+)/)
|
59
|
+
if (m = line.match(/YAJL_MINOR (\d+)/))
|
60
60
|
yajl_minor = m[1]
|
61
61
|
end
|
62
|
-
if m = line.match(/YAJL_MICRO (\d+)/)
|
62
|
+
if (m = line.match(/YAJL_MICRO (\d+)/))
|
63
63
|
yajl_micro = m[1]
|
64
64
|
end
|
65
65
|
end
|
66
|
-
File.open("#{build_path}/api/yajl_version.h", "w+") do |out|
|
66
|
+
File.open("#{build_path}/api/yajl_version.h", "w+") do |out| # FIXME: relative path
|
67
67
|
File.open("#{vendor_path}/src/api/yajl_version.h.cmake").each do |line|
|
68
68
|
line.gsub!(/\$\{YAJL_MAJOR\}/, yajl_major)
|
69
69
|
line.gsub!(/\$\{YAJL_MINOR\}/, yajl_minor)
|
@@ -136,7 +136,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
136
136
|
if RUBY_VERSION.to_f >= 1.9
|
137
137
|
namespace :integration do
|
138
138
|
begin
|
139
|
-
require
|
139
|
+
require "kitchen"
|
140
140
|
rescue LoadError
|
141
141
|
task :vagrant do
|
142
142
|
puts "test-kitchen gem is not installed"
|
@@ -145,7 +145,7 @@ if RUBY_VERSION.to_f >= 1.9
|
|
145
145
|
puts "test-kitchen gem is not installed"
|
146
146
|
end
|
147
147
|
else
|
148
|
-
desc
|
148
|
+
desc "Run Test Kitchen with Vagrant"
|
149
149
|
task :vagrant do
|
150
150
|
Kitchen.logger = Kitchen.default_file_logger
|
151
151
|
Kitchen::Config.new.instances.each do |instance|
|
@@ -153,32 +153,33 @@ if RUBY_VERSION.to_f >= 1.9
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
|
-
desc
|
156
|
+
desc "Run Test Kitchen with cloud plugins"
|
157
157
|
task :cloud do
|
158
|
-
if ENV[
|
159
|
-
ENV[
|
158
|
+
if ENV["TRAVIS_PULL_REQUEST"] != "true"
|
159
|
+
ENV["KITCHEN_YAML"] = ".kitchen.cloud.yml"
|
160
160
|
sh "kitchen test --concurrency 4"
|
161
161
|
end
|
162
162
|
end
|
163
163
|
end
|
164
164
|
end
|
165
165
|
namespace :style do
|
166
|
-
desc
|
166
|
+
desc "Run Ruby style checks"
|
167
167
|
begin
|
168
|
-
require
|
168
|
+
require "chefstyle"
|
169
|
+
require "rubocop/rake_task"
|
169
170
|
rescue LoadError
|
170
171
|
task :rubocop do
|
171
172
|
puts "rubocop gem is not installed"
|
172
173
|
end
|
173
174
|
else
|
174
|
-
|
175
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
175
176
|
t.fail_on_error = false
|
176
177
|
end
|
177
178
|
end
|
178
179
|
|
179
|
-
desc
|
180
|
+
desc "Run Ruby smell checks"
|
180
181
|
begin
|
181
|
-
require
|
182
|
+
require "reek/rake/task"
|
182
183
|
rescue LoadError
|
183
184
|
task :reek do
|
184
185
|
puts "reek gem is not installed"
|
@@ -186,7 +187,7 @@ if RUBY_VERSION.to_f >= 1.9
|
|
186
187
|
else
|
187
188
|
Reek::Rake::Task.new(:reek) do |t|
|
188
189
|
t.fail_on_error = false
|
189
|
-
t.
|
190
|
+
t.config_file = ".reek.yml"
|
190
191
|
end
|
191
192
|
end
|
192
193
|
end
|
@@ -209,14 +210,13 @@ else
|
|
209
210
|
end
|
210
211
|
end
|
211
212
|
|
213
|
+
desc "Run all style checks"
|
214
|
+
task :style => ["style:rubocop", "style:reek"]
|
212
215
|
|
213
|
-
desc
|
214
|
-
task :
|
216
|
+
desc "Run style + spec tests by default on travis"
|
217
|
+
task :travis => %w{spec style}
|
215
218
|
|
216
|
-
desc
|
217
|
-
task :
|
219
|
+
desc "Run style, spec and test kichen on travis"
|
220
|
+
task :travis_all => ["spec", "integration:cloud", "style"]
|
218
221
|
|
219
|
-
|
220
|
-
task :travis_all => ['spec', 'integration:cloud', 'style']
|
221
|
-
|
222
|
-
task :default => ['spec', 'integration:vagrant', 'style']
|
222
|
+
task :default => ["spec", "integration:vagrant", "style"]
|
data/ext/libyajl2/extconf.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "rbconfig"
|
3
|
+
require "fileutils"
|
4
|
+
require "shellwords"
|
4
5
|
|
5
6
|
if ENV["USE_SYSTEM_LIBYAJL2"]
|
6
7
|
File.open("Makefile", "w+") do |f|
|
@@ -32,26 +33,26 @@ module Libyajl2Build
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def self.prefix
|
35
|
-
PREFIX
|
36
|
+
PREFIX.shellescape
|
36
37
|
end
|
37
38
|
|
38
39
|
def self.deps
|
39
|
-
require
|
40
|
+
require "mkmf"
|
40
41
|
end
|
41
42
|
|
42
43
|
def self.setup_env
|
43
|
-
RbConfig::MAKEFILE_CONFIG[
|
44
|
+
RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"] if ENV["CC"]
|
44
45
|
|
45
46
|
# set some sane defaults
|
46
|
-
if RbConfig::MAKEFILE_CONFIG[
|
47
|
+
if RbConfig::MAKEFILE_CONFIG["CC"] =~ /gcc|clang/
|
47
48
|
# magic flags copied from upstream yajl build system (-std=c99 is necessary for older gcc)
|
48
49
|
$CFLAGS << " -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes"
|
49
|
-
$CFLAGS << " -O2"
|
50
|
+
$CFLAGS << " -O2" # match what the upstream uses for optimization
|
51
|
+
end
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
53
|
+
# create the implib on windows
|
54
|
+
if windows?
|
55
|
+
$LDFLAGS << " -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--out-implib=libyajldll.a -Wl,--output-def,libyajl.def"
|
55
56
|
end
|
56
57
|
|
57
58
|
$CFLAGS << " -DNDEBUG"
|
@@ -95,8 +96,8 @@ EOF
|
|
95
96
|
# i could not figure out how to tell mkmf.rb to stop being so helpful, so instead will just patch it here.
|
96
97
|
if windows?
|
97
98
|
makefile = IO.read("Makefile")
|
98
|
-
makefile.gsub!(/\$\(DEFFILE\)/,
|
99
|
-
File.open("Makefile",
|
99
|
+
makefile.gsub!(/\$\(DEFFILE\)/, "")
|
100
|
+
File.open("Makefile", "w+") { |f| f.write(makefile) }
|
100
101
|
end
|
101
102
|
|
102
103
|
system("pwd")
|
data/lib/libyajl2/version.rb
CHANGED
data/libyajl2.gemspec
CHANGED
@@ -1,33 +1,22 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "libyajl2/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "libyajl2"
|
8
8
|
spec.version = Libyajl2::VERSION
|
9
9
|
spec.authors = ["lamont-granquist"]
|
10
|
-
spec.email = ["lamont@
|
10
|
+
spec.email = ["lamont@chef.io"]
|
11
11
|
spec.summary = %q{Installs a vendored copy of libyajl2 for distributions which lack it}
|
12
12
|
spec.description = spec.summary
|
13
|
-
spec.homepage = "https://github.com/
|
14
|
-
spec.licenses
|
13
|
+
spec.homepage = "https://github.com/chef/libyajl2-gem"
|
14
|
+
spec.licenses = ["Apache-2.0"]
|
15
15
|
|
16
16
|
spec.files = Dir.glob("{ext,lib,spec}/**/*") +
|
17
|
-
%w{Gemfile Rakefile
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
%w{Gemfile Rakefile libyajl2.gemspec bootstrap.sh LICENSE}
|
19
18
|
spec.test_files = spec.files.grep(%r{^spec/})
|
20
19
|
spec.require_paths = ["lib"]
|
21
20
|
|
22
21
|
spec.extensions = Dir["ext/**/extconf.rb"]
|
23
|
-
|
24
|
-
# required for 'rake spec'
|
25
|
-
spec.add_development_dependency "bundler"
|
26
|
-
spec.add_development_dependency "rake"
|
27
|
-
# rake-compiler 0.9.2 is required for rbx compiles, and in turn requires rubygems >= 1.8.25
|
28
|
-
spec.add_development_dependency "rake-compiler", "~> 0.9"
|
29
|
-
# pin mime-types in order to work on ruby 1.8.7
|
30
|
-
spec.add_development_dependency "mime-types", "~> 1.16"
|
31
|
-
spec.add_development_dependency "rspec", "~> 2.14"
|
32
|
-
spec.add_development_dependency "ffi", "~> 1.9"
|
33
22
|
end
|
data/spec/ffi_spec.rb
CHANGED
data/spec/path_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe "when testing path helpers" do
|
4
4
|
it "should define Libyajl2::VENDORED_LIBYAJL2_DIR" do
|
@@ -15,7 +15,7 @@ describe "when testing path helpers" do
|
|
15
15
|
|
16
16
|
%w{yajl_common.h yajl_gen.h yajl_parse.h yajl_tree.h yajl_version.h}.each do |hdr|
|
17
17
|
it "should copy the #{hdr} header file to the gem path" do
|
18
|
-
expect(File.exist?(File.join(Libyajl2.include_path, "yajl", hdr))).to
|
18
|
+
expect(File.exist?(File.join(Libyajl2.include_path, "yajl", hdr))).to be_truthy
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,25 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libyajl2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lamont-granquist
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake-compiler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.9'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.9'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: mime-types
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.16'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.16'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '2.14'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '2.14'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: ffi
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.9'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.9'
|
11
|
+
date: 2021-04-07 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
97
13
|
description: Installs a vendored copy of libyajl2 for distributions which lack it
|
98
14
|
email:
|
99
|
-
- lamont@
|
15
|
+
- lamont@chef.io
|
100
16
|
executables: []
|
101
17
|
extensions:
|
102
18
|
- ext/libyajl2/extconf.rb
|
103
19
|
extra_rdoc_files: []
|
104
20
|
files:
|
105
|
-
- CONTRIBUTING.md
|
106
21
|
- Gemfile
|
107
22
|
- LICENSE
|
108
|
-
- README.md
|
109
23
|
- Rakefile
|
110
24
|
- bootstrap.sh
|
111
25
|
- ext/libyajl2/api/yajl_common.h
|
@@ -309,11 +223,11 @@ files:
|
|
309
223
|
- spec/ffi_spec.rb
|
310
224
|
- spec/path_spec.rb
|
311
225
|
- spec/spec_helper.rb
|
312
|
-
homepage: https://github.com/
|
226
|
+
homepage: https://github.com/chef/libyajl2-gem
|
313
227
|
licenses:
|
314
|
-
- Apache
|
228
|
+
- Apache-2.0
|
315
229
|
metadata: {}
|
316
|
-
post_install_message:
|
230
|
+
post_install_message:
|
317
231
|
rdoc_options: []
|
318
232
|
require_paths:
|
319
233
|
- lib
|
@@ -328,9 +242,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
328
242
|
- !ruby/object:Gem::Version
|
329
243
|
version: '0'
|
330
244
|
requirements: []
|
331
|
-
|
332
|
-
|
333
|
-
signing_key:
|
245
|
+
rubygems_version: 3.2.3
|
246
|
+
signing_key:
|
334
247
|
specification_version: 4
|
335
248
|
summary: Installs a vendored copy of libyajl2 for distributions which lack it
|
336
249
|
test_files:
|
data/CONTRIBUTING.md
DELETED
data/README.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
libyajl2-gem
|
2
|
-
============
|
3
|
-
|
4
|
-
[](http://travis-ci.org/opscode/libyajl2-gem)
|
5
|
-
[](https://gemnasium.com/opscode/libyajl2-gem)
|
6
|
-
[](https://codeclimate.com/github/opscode/libyajl2-gem)
|
7
|
-
[](http://badge.fury.io/rb/libyajl2)
|
8
|
-
|
9
|
-
gem to install the libyajl2 c-library for distributions which do not have it
|