botch 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/Rakefile +1 -0
- data/botch.gemspec +1 -0
- data/lib/botch/base.rb +3 -2
- data/lib/botch/version.rb +1 -1
- data/spec/botch_spec.rb +12 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae74c3065a7d5ed43b4449d9925b28878fbca7a8
|
4
|
+
data.tar.gz: b654385120dc79ea047deee77e4e168b3c19f9f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e97284275e453754a81af2996f00c1e3789c2007bad2c4310c07cdcf00540aa3f02f5941f7c7e57755f0ee65b27539f1c3f50606701977491a7e9e2ebc773d
|
7
|
+
data.tar.gz: b6bd8dc7a7589c0aa654fad04a564fdbf107c2e1195efd4cf8fa3f3e171b6e79406a0129174d398b3f84270d376f22f25591d6878585f3192dfc730876a03c6c
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
data/botch.gemspec
CHANGED
data/lib/botch/base.rb
CHANGED
@@ -65,7 +65,7 @@ module Botch
|
|
65
65
|
%w( Filter Rule ).each { |klass| Object.const_set(klass, Class.new(Route)) }
|
66
66
|
|
67
67
|
class Base
|
68
|
-
DEFAULT_INSTANCE_VARIABLES = { :header => nil, :body => nil, :status => nil }
|
68
|
+
DEFAULT_INSTANCE_VARIABLES = { :header => nil, :body => nil, :status => nil, :url => nil }
|
69
69
|
attr_reader(*DEFAULT_INSTANCE_VARIABLES.keys)
|
70
70
|
|
71
71
|
def initialize
|
@@ -165,7 +165,8 @@ module Botch
|
|
165
165
|
|
166
166
|
set_instance_variables :header => response[:header],
|
167
167
|
:body => response[:body],
|
168
|
-
:status => response[:status]
|
168
|
+
:status => response[:status],
|
169
|
+
:url => url
|
169
170
|
|
170
171
|
response = response[:response]
|
171
172
|
valid = true
|
data/lib/botch/version.rb
CHANGED
data/spec/botch_spec.rb
CHANGED
@@ -57,5 +57,17 @@ module Botch
|
|
57
57
|
expect(SampleBotch.run(@fake.url)[0]).to eq("test")
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
describe "helper methods" do
|
62
|
+
before(:all) do
|
63
|
+
class SampleBotch < Botch::Base
|
64
|
+
rule(:all) { url }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should be able to use instance variable." do
|
69
|
+
expect(SampleBotch.run(@fake.url)[0]).to eq("http://example.com/")
|
70
|
+
end
|
71
|
+
end
|
60
72
|
end
|
61
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: botch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- namusyaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|