Skip to content

Commit

Permalink
Remove permutation dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
flori committed Feb 24, 2016
1 parent 8d08bb3 commit ed95eeb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 41 deletions.
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ if defined?(Gem) and defined?(Gem::PackageTask)
s.files = PKG_FILES

s.require_path = 'lib'
s.add_development_dependency 'permutation'
s.add_development_dependency 'rake'

s.extra_rdoc_files << 'README.md'
Expand Down Expand Up @@ -120,7 +119,6 @@ if defined?(Gem) and defined?(Gem::PackageTask)
s.extensions = FileList['ext/**/extconf.rb']

s.require_path = 'lib'
s.add_development_dependency 'permutation'

s.extra_rdoc_files << 'README.md'
s.rdoc_options <<
Expand Down
Binary file modified json.gemspec
Binary file not shown.
7 changes: 2 additions & 5 deletions json_pure.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,27 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Florian Frank"]
s.date = "2015-11-06"
s.date = "2016-02-24"
s.description = "This is a JSON implementation in pure Ruby."
s.email = "[email protected]"
s.extra_rdoc_files = ["README.md"]
s.files = ["./tests/test_json.rb", "./tests/test_json_addition.rb", "./tests/test_json_encoding.rb", "./tests/test_json_fixtures.rb", "./tests/test_json_generate.rb", "./tests/test_json_generic_object.rb", "./tests/test_json_string_matching.rb", "./tests/test_json_unicode.rb", ".gitignore", ".travis.yml", "CHANGES", "Gemfile", "README-json-jruby.markdown", "README.md", "Rakefile", "TODO", "VERSION", "data/example.json", "data/index.html", "data/prototype.js", "diagrams/.keep", "ext/json/ext/fbuffer/fbuffer.h", "ext/json/ext/generator/depend", "ext/json/ext/generator/extconf.rb", "ext/json/ext/generator/generator.c", "ext/json/ext/generator/generator.h", "ext/json/ext/parser/depend", "ext/json/ext/parser/extconf.rb", "ext/json/ext/parser/parser.c", "ext/json/ext/parser/parser.h", "ext/json/ext/parser/parser.rl", "ext/json/extconf.rb", "install.rb", "java/src/json/ext/ByteListTranscoder.java", "java/src/json/ext/Generator.java", "java/src/json/ext/GeneratorMethods.java", "java/src/json/ext/GeneratorService.java", "java/src/json/ext/GeneratorState.java", "java/src/json/ext/OptionsReader.java", "java/src/json/ext/Parser.java", "java/src/json/ext/Parser.rl", "java/src/json/ext/ParserService.java", "java/src/json/ext/RuntimeInfo.java", "java/src/json/ext/StringDecoder.java", "java/src/json/ext/StringEncoder.java", "java/src/json/ext/Utils.java", "json-java.gemspec", "json.gemspec", "json_pure.gemspec", "lib/json.rb", "lib/json/add/bigdecimal.rb", "lib/json/add/complex.rb", "lib/json/add/core.rb", "lib/json/add/date.rb", "lib/json/add/date_time.rb", "lib/json/add/exception.rb", "lib/json/add/ostruct.rb", "lib/json/add/range.rb", "lib/json/add/rational.rb", "lib/json/add/regexp.rb", "lib/json/add/struct.rb", "lib/json/add/symbol.rb", "lib/json/add/time.rb", "lib/json/common.rb", "lib/json/ext.rb", "lib/json/ext/.keep", "lib/json/generic_object.rb", "lib/json/pure.rb", "lib/json/pure/generator.rb", "lib/json/pure/parser.rb", "lib/json/version.rb", "tests/fixtures/fail1.json", "tests/fixtures/fail10.json", "tests/fixtures/fail11.json", "tests/fixtures/fail12.json", "tests/fixtures/fail13.json", "tests/fixtures/fail14.json", "tests/fixtures/fail18.json", "tests/fixtures/fail19.json", "tests/fixtures/fail2.json", "tests/fixtures/fail20.json", "tests/fixtures/fail21.json", "tests/fixtures/fail22.json", "tests/fixtures/fail23.json", "tests/fixtures/fail24.json", "tests/fixtures/fail25.json", "tests/fixtures/fail27.json", "tests/fixtures/fail28.json", "tests/fixtures/fail3.json", "tests/fixtures/fail4.json", "tests/fixtures/fail5.json", "tests/fixtures/fail6.json", "tests/fixtures/fail7.json", "tests/fixtures/fail8.json", "tests/fixtures/fail9.json", "tests/fixtures/pass1.json", "tests/fixtures/pass15.json", "tests/fixtures/pass16.json", "tests/fixtures/pass17.json", "tests/fixtures/pass2.json", "tests/fixtures/pass26.json", "tests/fixtures/pass3.json", "tests/setup_variant.rb", "tests/test_json.rb", "tests/test_json_addition.rb", "tests/test_json_encoding.rb", "tests/test_json_fixtures.rb", "tests/test_json_generate.rb", "tests/test_json_generic_object.rb", "tests/test_json_string_matching.rb", "tests/test_json_unicode.rb", "tools/fuzz.rb", "tools/server.rb"]
s.homepage = "http://flori.github.com/json"
s.licenses = ["Ruby"]
s.rdoc_options = ["--title", "JSON implemention for ruby", "--main", "README.md"]
s.rubygems_version = "2.5.0"
s.rubygems_version = "2.5.1"
s.summary = "JSON Implementation for Ruby"
s.test_files = ["./tests/test_json.rb", "./tests/test_json_addition.rb", "./tests/test_json_encoding.rb", "./tests/test_json_fixtures.rb", "./tests/test_json_generate.rb", "./tests/test_json_generic_object.rb", "./tests/test_json_string_matching.rb", "./tests/test_json_unicode.rb"]

if s.respond_to? :specification_version then
s.specification_version = 4

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<permutation>, [">= 0"])
s.add_development_dependency(%q<rake>, [">= 0"])
else
s.add_dependency(%q<permutation>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
end
else
s.add_dependency(%q<permutation>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
end
end
34 changes: 0 additions & 34 deletions tests/test_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@
require 'tempfile'
require 'ostruct'

unless Array.method_defined?(:permutation)
begin
require 'enumerator'
require 'permutation'
class Array
def permutation
Permutation.for(self).to_enum.map { |x| x.project }
end
end
rescue LoadError
warn "Skipping permutation tests."
end
end

class TestJSON < Test::Unit::TestCase
include JSON

Expand Down Expand Up @@ -146,26 +132,6 @@ def test_parse_json_primitive_values
assert_raise(JSON::ParserError) { JSON.parse('[ 1, ]', :quirks_mode => true) }
end

if Array.method_defined?(:permutation)
def test_parse_more_complex_arrays
a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
a.permutation.each do |perm|
json = pretty_generate(perm)
assert_equal perm, parse(json)
end
end

def test_parse_complex_objects
a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
a.permutation.each do |perm|
s = "a"
orig_obj = perm.inject({}) { |h, x| h[s.dup] = x; s = s.succ; h }
json = pretty_generate(orig_obj)
assert_equal orig_obj, parse(json)
end
end
end

def test_parse_arrays
assert_equal([1,2,3], parse('[1,2,3]'))
assert_equal([1.2,2,3], parse('[1.2,2,3]'))
Expand Down

0 comments on commit ed95eeb

Please sign in to comment.