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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fe3e67b5d6e95407e12c4faf9f869c225b904ff
4
- data.tar.gz: dccfb3b75e385bf8c1b1ac2e898bd719c60fe747
3
+ metadata.gz: ae74c3065a7d5ed43b4449d9925b28878fbca7a8
4
+ data.tar.gz: b654385120dc79ea047deee77e4e168b3c19f9f1
5
5
  SHA512:
6
- metadata.gz: c271d30d2d725f552cdb0f347959962557a7892de5525aeb2c53a30e7f35c5a0de6ad61d18f66792011f4d9a80a5346e1670dfa0111f2bf531af23deea4a96d5
7
- data.tar.gz: e76498ef673c6a0bfd09fb9c7935512aabb2417589b4cd22ea22568bc335721e23d84fcc00112e863c11bb63d56f1ce7610e7db6e2b3b011ddc24d54575d97f7
6
+ metadata.gz: 56e97284275e453754a81af2996f00c1e3789c2007bad2c4310c07cdcf00540aa3f02f5941f7c7e57755f0ee65b27539f1c3f50606701977491a7e9e2ebc773d
7
+ data.tar.gz: b6bd8dc7a7589c0aa654fad04a564fdbf107c2e1195efd4cf8fa3f3e171b6e79406a0129174d398b3f84270d376f22f25591d6878585f3192dfc730876a03c6c
@@ -4,7 +4,6 @@ install:
4
4
  - gem update --system
5
5
  - bundle update
6
6
  rvm:
7
- - 1.8.7
8
7
  - 1.9.2
9
8
  - 1.9.3
10
9
  - 2.0.0
data/Rakefile CHANGED
@@ -5,3 +5,4 @@ RSpec::Core::RakeTask.new(:rspec) do |spec|
5
5
  spec.pattern = 'spec/*_spec.rb'
6
6
  spec.rspec_opts = %w(--format p --color)
7
7
  end
8
+ task :default => :rspec
@@ -12,6 +12,7 @@ Gem::Specification.new "botch", Botch::VERSION do |s|
12
12
 
13
13
  s.add_dependency "faraday"
14
14
  s.add_dependency "mechanize"
15
+ s.add_development_dependency "rake"
15
16
  s.add_development_dependency "rspec"
16
17
  s.add_development_dependency "fakeweb", ["~> 1.3"]
17
18
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Botch
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -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.3
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-23 00:00:00.000000000 Z
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