cached_mechanize2 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -19
  3. data/cached_mechanize2.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28bb73f528f1529f6ed553497534c95bbfcdaa47
4
- data.tar.gz: 63e310f1b7475010f29a5251cabf2c92e6220bf5
3
+ metadata.gz: 789cc37fc2b7d44aaf2f961e078a67e01427679b
4
+ data.tar.gz: c5e62d2f817d061d307aac3c5ea40ea30c48e3b4
5
5
  SHA512:
6
- metadata.gz: 81bc7ffb8527565f6d95dd55a0226dbf958e45f5d94541fa6ccbb8d1485dd5e8e9b9ae9805bf6717155adfba9f8b747dc5094673e468fd03a34b977bd4ab6239
7
- data.tar.gz: 9ce2edb824afa7e43d6494302f7f9c55e18992f901559f242e8214c728d78195193a94fb7a5428abc8283a300f8b1647d7635ae57878e144b152d6e852acb049
6
+ metadata.gz: c2e9803954106a6831990a35a331a3d038bd09ef3d5a7a5824472d34506ab3ccc1102d78610ac313f4ae80e5aae3c528980cca69b13752f186e6c0fc3f0c42a9
7
+ data.tar.gz: 1505b798b563dde3f5d817ffdccfadc3c9e1355d39a75935a5ab9feec29952e4dea55a96f5efcfcfeb73d3b804483587a5f937026d7e221ba040c52639d16df7
data/README.md CHANGED
@@ -6,7 +6,7 @@ is a small wrapper around [Mechanize](https://github.com/sparklemotion/mechanize
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'cached_mechanize'
9
+ gem 'cached_mechanize2'
10
10
 
11
11
  And then execute:
12
12
 
@@ -14,7 +14,7 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install cached_mechanize
17
+ $ gem install cached_mechanize2
18
18
 
19
19
  ## Usage
20
20
 
@@ -25,7 +25,7 @@ To configure the backend use this syntax:
25
25
  CachedMechanize.configure do |config|
26
26
  config.cache_class = CachedMechanize::CacheBackends::FileCache
27
27
  config.cache_options = {
28
- path: "/path/to/my/cached_files"
28
+ :path => "/path/to/my/cached_files"
29
29
  }
30
30
  end
31
31
 
@@ -34,26 +34,21 @@ Now you can use this class like you would use Mechanize:
34
34
  agent = CachedMechanize.new
35
35
  doc = agent.get('http://www.imdb.com')
36
36
 
37
- By default all retrieved pages will be cached for one day (86400 seconds). To change this behaviour you can provide an `expires_after` option:
37
+ ## Quick deviation from original code
38
38
 
39
- doc = agent.get('http://www.imdb.com', expires_after: 42)
39
+ The original author 'wukerplank' added some code to control cache time-out, but I dont need this and I discovered that the overloading and change of syntax from current version mechanize's 'get' command seemed to cause errors in running, and the link click function stopped working, so i left the expire time in as a hard coded value and returned the 'get' method signature back to normal.
40
40
 
41
- Note that the syntax has changed! If you want to provide parameters, additional headers or a referer, you can do it like this:
41
+ Here is what is now removed, and can be ignored (easy to fiddle with the code if you need this)
42
42
 
43
- doc = agent.get('http://www.imdb.com', {
44
- referer: 'http://thatothersite.com',
45
- expires_after: 42
46
- })
43
+ By default all retrieved pages will be cached for one day (86400 seconds). To change this behaviour you can provide an `expires_after` option:
47
44
 
48
- ## TO-DO
45
+ doc = agent.get('http://www.imdb.com', expires_after: 42)
49
46
 
50
- - add more backends
51
- - add tests
47
+ Note that the syntax has changed! If you want to provide parameters, additional headers or a referer, you can do it like this:
48
+
49
+ doc = agent.get('http://www.imdb.com', {
50
+ referer: 'http://thatothersite.com',
51
+ expires_after: 42
52
+ })
52
53
 
53
- ## Contributing
54
54
 
55
- 1. Fork it ( http://github.com/wukerplank/cached_mechanize/fork )
56
- 2. Create your feature branch (`git checkout -b my-new-feature`)
57
- 3. Commit your changes (`git commit -am 'Add some feature'`)
58
- 4. Push to the branch (`git push origin my-new-feature`)
59
- 5. Create new Pull Request
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "cached_mechanize2"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["johnwylie"]
9
9
  spec.email = ["johnwylie70@gmail.com"]
10
10
  spec.summary = %q{A small wrapper around Mechanize to enable caching for GET requests.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cached_mechanize2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnwylie