Browse files

added s3 region support

  • Loading branch information...
1 parent dd7f3e5 commit 8abb12d48d007e50065f11b2ace7a4498a39d693 @davydotcom davydotcom committed Jul 14, 2013
Showing with 23 additions and 17 deletions.
  1. +18 −15 Gemfile.lock
  2. +1 −0 Readme.markdown
  3. +1 −0 app/models/spud_photo.rb
  4. +2 −1 lib/spud_photos/configuration.rb
  5. +1 −1 lib/spud_photos/version.rb
View
33 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- spud_photos (0.9.2)
+ spud_photos (0.9.3)
paperclip
rails (~> 3.2.2)
spud_core (>= 0.9.0, < 1.0.0)
@@ -37,16 +37,19 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
- authlogic (3.2.0)
- activerecord (>= 3.0.0)
- activesupport (>= 3.0.0)
+ authlogic (3.3.0)
+ activerecord (>= 3.2)
+ activesupport (>= 3.2)
bootstrap-will_paginate (0.0.9)
will_paginate
breadcrumbs_on_rails (2.3.0)
builder (3.0.4)
- cocaine (0.4.2)
- codemirror-rails (3.00)
- railties (~> 3.0)
+ climate_control (0.0.3)
+ activesupport (>= 3.0)
+ cocaine (0.5.1)
+ climate_control (>= 0.0.3, < 1.0)
+ codemirror-rails (3.14)
+ railties (>= 3.0, < 5)
database_cleaner (0.7.1)
diff-lcs (1.1.3)
erubis (2.7.0)
@@ -64,16 +67,16 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
- mime-types (1.19)
+ mime-types (1.23)
mocha (0.10.3)
metaclass (~> 0.0.1)
multi_json (1.3.7)
mysql2 (0.3.11)
- paperclip (3.4.0)
+ paperclip (3.4.2)
activemodel (>= 3.0.0)
activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
- cocaine (~> 0.4.0)
+ cocaine (~> 0.5.0)
mime-types
polyglot (0.3.3)
rack (1.4.1)
@@ -101,9 +104,9 @@ GEM
rake (10.0.2)
rdoc (3.12)
json (~> 1.4)
- retina_tag (1.1.7)
+ retina_tag (1.1.9)
jquery-rails
- rails (~> 3.1)
+ rails (>= 3.1)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
@@ -131,7 +134,7 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- spud_core (0.9.12)
+ spud_core (0.9.18)
authlogic
bootstrap-will_paginate
breadcrumbs_on_rails
@@ -142,10 +145,10 @@ GEM
will_paginate
thor (0.16.0)
tilt (1.3.3)
- treetop (1.4.12)
+ treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.35)
+ tzinfo (0.3.37)
will_paginate (3.0.4)
PLATFORMS
View
1 Readme.markdown
@@ -34,6 +34,7 @@ Spud Photos accepts the following configuration options. Place them in `applicat
config.s3_credentials = "#{Rails.root}/config/s3.yml"
config.storage_path = ":rails_root/public/system/spud_photos/:id/:style/:basename.:extension"
config.storage_url = "/system/spud_photos/:id/:style/:basename.:extension"
+ config.s3_host_name = "s3.amazonaws.com" #Defaults to us east zone, change for other regions.
end
The `photo_styles` option will be passed to [Paperclip][2], so any valid paperclip styles can be added here.
View
1 app/models/spud_photo.rb
@@ -12,6 +12,7 @@ class SpudPhoto < ActiveRecord::Base
:convert_options => Spud::Photos.config.convert_options,
:storage => Spud::Photos.paperclip_storage,
:s3_credentials => Spud::Photos.s3_credentials,
+ :s3_host_name => Spud::Photos.s3_host_name,
:url => Spud::Photos.storage_url,
:path => Spud::Photos.storage_path
View
3 lib/spud_photos/configuration.rb
@@ -1,7 +1,7 @@
module Spud
module Photos
include ActiveSupport::Configurable
- config_accessor :photo_styles, :convert_options, :galleries_enabled, :base_layout, :base_path,:s3_credentials,:storage_path,:storage_url,:paperclip_storage, :enable_full_page_caching, :page_caches_to_sweep
+ config_accessor :photo_styles, :convert_options, :galleries_enabled, :base_layout, :base_path,:s3_credentials,:storage_path,:storage_url,:paperclip_storage, :enable_full_page_caching, :page_caches_to_sweep, :s3_host_name
self.photo_styles = {
:small => '50x50#',
:medium => '200x200#',
@@ -13,6 +13,7 @@ module Photos
self.base_path = 'photos'
self.paperclip_storage = :filesystem
self.s3_credentials = "#{Rails.root}/config/s3.yml"
+ self.s3_host_name = 's3.amazonaws.com'
self.storage_path = ":rails_root/public/system/spud_photos/:id/:style/:basename.:extension"
self.storage_url = "/system/spud_photos/:id/:style/:basename.:extension"
self.enable_full_page_caching = false
View
2 lib/spud_photos/version.rb
@@ -1,5 +1,5 @@
module Spud
module Photos
- VERSION = "0.9.2"
+ VERSION = "0.9.3"
end
end

0 comments on commit 8abb12d

Please sign in to comment.