concord_cacher 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'spec/rake/spectask'
6
6
  require './lib/concord_cacher.rb'
7
7
 
8
8
  require 'echoe'
9
- Echoe.new('concord_cacher', '0.0.3') do |p|
9
+ Echoe.new('concord_cacher', '0.0.4') do |p|
10
10
  p.description = "concord_cacher provides support for locally caching a resource and all referenced resources in multiple different ways. It is intended for using with other Concord Consortium projects and not necessarily for outside projects."
11
11
  p.summary = "Support for locally caching a resource and all referenced resources in multiple different ways"
12
12
  p.url = "http://github.com/psndcsrv/concord_cacher"
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{concord_cacher}
5
- s.version = "0.0.3"
5
+ s.version = "0.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Aaron Unger"]
@@ -27,9 +27,9 @@ class ::Concord::DiyLocalCacher < ::Concord::Cacher
27
27
  uri_path = uri.path.split('/')
28
28
  uri_path = ["","index.html"] if uri_path.size == 0
29
29
  uri_path.unshift("") if uri_path.size == 1
30
- file_dir = File.join("#{uri.scheme}","#{uri.host}","#{uri.port}",uri_path[0..-2])
31
- file = uri_path[-1]
32
- mkdir_p(File.join(@cache_dir,file_dir))
33
- return File.join(file_dir,file)
30
+ file_ext = uri_path[-1].split('.')[-1]
31
+ file = ::Digest::SHA1.hexdigest(uri.to_s)
32
+ file += ".#{file_ext}" if file_ext
33
+ return file
34
34
  end
35
35
  end
@@ -52,9 +52,10 @@ describe 'DIY Local Cacher' do
52
52
  uri_path = uri.path.split('/')
53
53
  uri_path = ["","index.html"] if uri_path.size == 0
54
54
  uri_path.unshift("") if uri_path.size == 1
55
- file_dir = File.join("#{uri.scheme}","#{uri.host}","#{uri.port}",uri_path[0..-2])
56
- file = uri_path[-1]
57
- return File.join(file_dir,file)
55
+ file = ::Digest::SHA1.hexdigest(uri.to_s)
56
+ file_ext = uri_path[-1].split('.')[-1]
57
+ file += ".#{file_ext}" if file_ext
58
+ return file
58
59
  end
59
60
 
60
61
  describe 'empty otml' do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Aaron Unger
metadata.gz.sig CHANGED
Binary file