wagon 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.2
1
+ 0.9.3
@@ -11,6 +11,7 @@ module Wagon
11
11
  class Connection
12
12
  HOST = 'secure.lds.org'
13
13
  LOGIN_PATH = '/units/a/login/1,21568,779-1,00.html?URL='
14
+ CACHE_PATH = File.join(File.expand_path('~'), '.wagon_cache')
14
15
 
15
16
  def initialize(username, password)
16
17
  response = post(LOGIN_PATH, 'username' => username, 'password' => password)
@@ -37,7 +38,8 @@ module Wagon
37
38
  end
38
39
 
39
40
  def get_with_caching(path)
40
- cache_path = File.join(Wagon::BASE_PATH, 'cache', Digest::SHA1.hexdigest(path) + ".cache")
41
+ FileUtils::mkdir(CACHE_PATH) unless File.directory?(CACHE_PATH)
42
+ cache_path = File.join(CACHE_PATH, Digest::SHA1.hexdigest(path) + ".cache")
41
43
  return open(cache_path).read if File.exists?(cache_path)
42
44
  open(cache_path, "w").write(data = get_without_caching(path))
43
45
  data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devin Christensen
@@ -79,7 +79,6 @@ files:
79
79
  - Rakefile
80
80
  - VERSION
81
81
  - bin/wagon
82
- - cache/.gitignore
83
82
  - extra/placeholder.jpg
84
83
  - lib/wagon.rb
85
84
  - lib/wagon/address.rb
data/cache/.gitignore DELETED
@@ -1 +0,0 @@
1
- *.cache