Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Exclude the keys starting with "async" from the request env when echo…

…ing,

as these point to ruby Method objects inserted by Thin/EventMachine and
they aren't serializable.
  • Loading branch information...
commit 4d36fc11834f7714cb4596ffd4dab1b057b038ac 1 parent 319b83e
@lukeredpath authored
Showing with 37 additions and 24 deletions.
  1. +16 −6 Gemfile.lock
  2. +1 −1  Rakefile
  3. +3 −3 lib/mimic/fake_host.rb
  4. +17 −14 mimic.gemspec
View
22 Gemfile.lock
@@ -3,9 +3,10 @@ PATH
specs:
mimic (0.4.3)
json
- plist
+ plist (~> 3.1.0)
rack
sinatra
+ thin
GEM
remote: http://rubygems.org/
@@ -17,14 +18,18 @@ GEM
gherkin (~> 2.4.1)
json (>= 1.4.6)
term-ansicolor (>= 1.0.5)
+ daemons (1.1.8)
diff-lcs (1.1.2)
+ eventmachine (0.12.10)
gherkin (2.4.1)
json (>= 1.4.6)
json (1.5.3)
mime-types (1.16)
mocha (0.9.12)
plist (3.1.0)
- rack (1.3.0)
+ rack (1.4.1)
+ rack-protection (1.2.0)
+ rack
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
@@ -38,11 +43,16 @@ GEM
rspec-expectations (2.4.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.4.0)
- sinatra (1.2.6)
- rack (~> 1.1)
- tilt (>= 1.2.2, < 2.0)
+ sinatra (1.3.2)
+ rack (~> 1.3, >= 1.3.6)
+ rack-protection (~> 1.2)
+ tilt (~> 1.3, >= 1.3.3)
term-ansicolor (1.0.5)
- tilt (1.3.2)
+ thin (1.3.1)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
+ tilt (1.3.3)
PLATFORMS
ruby
View
2  Rakefile
@@ -49,7 +49,7 @@ spec = Gem::Specification.new do |s|
s.add_dependency("sinatra")
s.add_dependency("thin")
s.add_dependency("json")
- s.add_dependency("plist")
+ s.add_dependency("plist", "~> 3.1.0")
# If your tests use any gems, include them here
s.add_development_dependency("rspec", "~> 2.4.0")
View
6 lib/mimic/fake_host.rb
@@ -131,15 +131,15 @@ def to_s(format)
def to_hash
{"echo" => {
"params" => @request.params,
- "env" => env_without_rack_env,
+ "env" => env_without_rack_and_async_env,
"body" => @request.body.read
}}
end
private
- def env_without_rack_env
- Hash[*@request.env.select { |key, value| key !~ /^rack/i }.flatten]
+ def env_without_rack_and_async_env
+ Hash[*@request.env.select { |key, value| key !~ /^(rack|async)/i }.flatten]
end
end
View
31 mimic.gemspec
@@ -1,20 +1,20 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{mimic}
+ s.name = "mimic"
s.version = "0.4.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = [%q{Luke Redpath}]
- s.date = %q{2011-06-25}
- s.email = %q{luke@lukeredpath.co.uk}
- s.extra_rdoc_files = [%q{README.md}]
- s.files = [%q{LICENSE}, %q{CHANGES}, %q{Rakefile}, %q{README.md}, %q{spec}, %q{lib/mimic}, %q{lib/mimic/api.rb}, %q{lib/mimic/fake_host.rb}, %q{lib/mimic.rb}]
- s.homepage = %q{http://lukeredpath.co.uk}
- s.rdoc_options = [%q{--main}, %q{README.md}]
- s.require_paths = [%q{lib}]
- s.rubygems_version = %q{1.8.5}
- s.summary = %q{A Ruby gem for faking external web services for testing}
+ s.authors = ["Luke Redpath"]
+ s.date = "2012-03-17"
+ s.email = "luke@lukeredpath.co.uk"
+ s.extra_rdoc_files = ["README.md"]
+ s.files = ["LICENSE", "CHANGES", "Rakefile", "README.md", "spec", "lib/mimic", "lib/mimic/api.rb", "lib/mimic/fake_host.rb", "lib/mimic.rb"]
+ s.homepage = "http://lukeredpath.co.uk"
+ s.rdoc_options = ["--main", "README.md"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = "1.8.11"
+ s.summary = "A Ruby gem for faking external web services for testing"
if s.respond_to? :specification_version then
s.specification_version = 3
@@ -22,8 +22,9 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rack>, [">= 0"])
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
+ s.add_runtime_dependency(%q<thin>, [">= 0"])
s.add_runtime_dependency(%q<json>, [">= 0"])
- s.add_runtime_dependency(%q<plist>, [">= 0"])
+ s.add_runtime_dependency(%q<plist>, ["~> 3.1.0"])
s.add_development_dependency(%q<rspec>, ["~> 2.4.0"])
s.add_development_dependency(%q<cucumber>, [">= 0"])
s.add_development_dependency(%q<mocha>, [">= 0"])
@@ -31,8 +32,9 @@ Gem::Specification.new do |s|
else
s.add_dependency(%q<rack>, [">= 0"])
s.add_dependency(%q<sinatra>, [">= 0"])
+ s.add_dependency(%q<thin>, [">= 0"])
s.add_dependency(%q<json>, [">= 0"])
- s.add_dependency(%q<plist>, [">= 0"])
+ s.add_dependency(%q<plist>, ["~> 3.1.0"])
s.add_dependency(%q<rspec>, ["~> 2.4.0"])
s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
@@ -41,8 +43,9 @@ Gem::Specification.new do |s|
else
s.add_dependency(%q<rack>, [">= 0"])
s.add_dependency(%q<sinatra>, [">= 0"])
+ s.add_dependency(%q<thin>, [">= 0"])
s.add_dependency(%q<json>, [">= 0"])
- s.add_dependency(%q<plist>, [">= 0"])
+ s.add_dependency(%q<plist>, ["~> 3.1.0"])
s.add_dependency(%q<rspec>, ["~> 2.4.0"])
s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
Please sign in to comment.
Something went wrong with that request. Please try again.