summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Rakefile2
-rw-r--r--lib/json/pure/parser.rb6
-rw-r--r--tests/test_json_string_matching.rb2
4 files changed, 7 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 4b2dce5..694ff3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@
coverage
pkg
.nfs.*
+.idea
+java/Json.iml
diff --git a/Rakefile b/Rakefile
index 6cd0b12..05871c9 100644
--- a/Rakefile
+++ b/Rakefile
@@ -23,7 +23,7 @@ MAKE = ENV['MAKE'] || %w[gmake make].find { |c| system(c, '-v') }
PKG_NAME = 'json'
PKG_TITLE = 'JSON Implementation for Ruby'
PKG_VERSION = File.read('VERSION').chomp
-PKG_FILES = FileList["**/*"].exclude(/CVS|pkg|tmp|coverage|Makefile|\.nfs\./).exclude(/\.(so|bundle|o|class|#{CONFIG['DLEXT']})$/)
+PKG_FILES = FileList["**/*"].exclude(/CVS|pkg|tmp|coverage|Makefile|\.nfs\.|\.iml\Z/).exclude(/\.(so|bundle|o|class|#{CONFIG['DLEXT']})$/)
EXT_ROOT_DIR = 'ext/json/ext'
EXT_PARSER_DIR = "#{EXT_ROOT_DIR}/parser"
diff --git a/lib/json/pure/parser.rb b/lib/json/pure/parser.rb
index cb531f4..6a0192c 100644
--- a/lib/json/pure/parser.rb
+++ b/lib/json/pure/parser.rb
@@ -119,7 +119,7 @@ module JSON
@create_id = opts[:create_id] || JSON.create_id
@object_class = opts[:object_class] || Hash
@array_class = opts[:array_class] || Array
- @match = opts[:match]
+ @json_match = opts[:match] # @match is an ivar in rbx's strscan
end
alias source string
@@ -189,8 +189,8 @@ module JSON
if string.respond_to?(:force_encoding)
string.force_encoding(::Encoding::UTF_8)
end
- if @create_additions and @match
- for (regexp, klass) in @match
+ if @create_additions and @json_match
+ for (regexp, klass) in @json_match
klass.json_creatable? or next
string =~ regexp and return klass.json_create(string)
end
diff --git a/tests/test_json_string_matching.rb b/tests/test_json_string_matching.rb
index 149a63b..6bd74e3 100644
--- a/tests/test_json_string_matching.rb
+++ b/tests/test_json_string_matching.rb
@@ -9,7 +9,7 @@ require 'time'
class TestJsonStringMatching < Test::Unit::TestCase
include JSON
- class TestTime < Time
+ class TestTime < ::Time
def self.json_create(string)
Time.parse(string)
end