scribd_fu 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,7 @@ module ScribdFu
31
31
 
32
32
  # RegExp that matches AWS S3 URLs
33
33
  S3 = /^https?:\/\/s3.amazonaws.com/
34
+ CLOUD_FRONT = /^http:\/\/[A-Za-z0-9]*.cloudfront.net/
34
35
 
35
36
  # Available parameters for the JS API
36
37
  # http://www.scribd.com/publisher/api/api?method_name=Javascript+API
@@ -22,7 +22,11 @@ module ScribdFu
22
22
 
23
23
  # Yields the correct path to the file, either the local filename or the S3 URL.
24
24
  def file_path
25
- public_filename =~ ScribdFu::S3 ? public_filename : "#{RAILS_ROOT}/public#{public_filename}"
25
+ if public_filename =~ ScribdFu::S3 || public_filename =~ ScribdFu::CLOUD_FRONT
26
+ public_filename
27
+ else
28
+ "#{RAILS_ROOT}/public#{public_filename}"
29
+ end
26
30
  end
27
31
  end
28
32
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "scribd_fu"
3
- s.version = "2.0.4"
4
- s.date = "2009-04-12"
3
+ s.version = "2.0.5"
4
+ s.date = "2009-11-21"
5
5
  s.summary = "Quick and easy interactions with Scribd's iPaper service"
6
6
  s.email = "matt@matt-darby.com"
7
7
  s.homepage = "http://github.com/mdarby/scribd_fu/tree/master"
@@ -27,4 +27,4 @@ Gem::Specification.new do |s|
27
27
  'spec/spec_helper.rb'
28
28
  ]
29
29
  s.add_dependency 'rscribd'
30
- end
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scribd_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-12 00:00:00 -04:00
12
+ date: 2009-11-21 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -44,7 +44,7 @@ files:
44
44
  - spec/scribd_fu.yml
45
45
  - spec/scribd_fu_spec.rb
46
46
  - spec/spec_helper.rb
47
- has_rdoc: true
47
+ has_rdoc: false
48
48
  homepage: http://github.com/mdarby/scribd_fu/tree/master
49
49
  licenses: []
50
50