Permalink
Browse files

Use MultiJSON gem instead of the Yajl::Ruby gem as a dependency for p…

…arsing #execute_script results.
  • Loading branch information...
1 parent 22f94a6 commit 73cd43f0db3c24c47d1de74194a099046f7a8fc2 @jarmo jarmo committed Oct 21, 2012
Showing with 8 additions and 8 deletions.
  1. +4 −4 Gemfile.lock
  2. +1 −1 lib/watir-classic/ie.rb
  3. +2 −2 lib/watir-classic/page-container.rb
  4. +1 −1 watir-classic.gemspec
View
@@ -1,20 +1,20 @@
PATH
remote: .
specs:
- watir-classic (3.2.0.rc1)
+ watir-classic (3.2.0)
ffi (~> 1.0)
+ multi_json
nokogiri
rautomation (~> 0.7.2)
user-choices
win32-process (>= 0.5.5)
win32screenshot
windows-pr (>= 0.6.6)
- yajl-ruby
GEM
remote: http://rubygems.org/
specs:
- builder (3.0.0)
+ builder (3.1.3)
childprocess (0.3.4)
ffi (~> 1.0, >= 1.0.6)
diff-lcs (1.1.3)
@@ -23,6 +23,7 @@ GEM
rake (~> 0.8)
mini_magick (3.2.1)
subexec (~> 0.0.4)
+ multi_json (1.3.6)
nokogiri (1.5.5-x86-mingw32)
rack (1.4.1)
rack-protection (1.2.0)
@@ -63,7 +64,6 @@ GEM
win32-api (>= 1.4.5)
windows-api (>= 0.3.0)
xml-simple (1.1.1)
- yajl-ruby (1.1.0-x86-mingw32)
yard (0.8.2.1)
PLATFORMS
@@ -3,7 +3,7 @@
require 'watir-classic/close_all'
require 'watir-classic/ie-process'
require 'watir-classic/screenshot'
-require 'yajl'
+require 'multi_json'
# these switches need to be deleted from ARGV to enable the Test::Unit
# functionality that grabs
@@ -47,7 +47,7 @@ def execute_script(source)
result = document.getElementById(wrapper).innerHTML
end
- Yajl::Parser.parse(result) rescue nil
+ MultiJson.load(result)["value"] rescue nil
end
# The HTML of the current page
@@ -99,7 +99,7 @@ def with_json2_if_needed source
document.getElementsByTagName('head')[0].appendChild(json2)
}
- return JSON.stringify((function() {#{source}})());
+ return JSON.stringify({value: (function() {#{source}})()});
})()
]
end
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
s.add_dependency 'ffi', '~>1.0'
s.add_dependency 'rautomation', '~>0.7.2'
s.add_dependency 'user-choices'
- s.add_dependency 'yajl-ruby'
+ s.add_dependency 'multi_json'
s.add_dependency 'win32screenshot'
s.add_development_dependency("rspec", "~>2.3")

0 comments on commit 73cd43f

Please sign in to comment.