spree_banner 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +1 -1
  2. data/app/models/spree/banner.rb +15 -15
  3. metadata +2 -2
data/README.md CHANGED
@@ -9,7 +9,7 @@ Basic Installation
9
9
 
10
10
  1. Add the following to your Gemfile
11
11
  <pre>
12
- gem 'spree_banner', '~> 1.0.7'
12
+ gem 'spree_banner', '~> 1.0.8'
13
13
  </pre>
14
14
  2. Run `bundle install`
15
15
  3. To copy and apply migrations run:
@@ -23,23 +23,23 @@ module Spree
23
23
  scope :enable, lambda { |category| {:conditions => {:enabled => true, :category => category}} }
24
24
 
25
25
  # Load S3 settings
26
- if (!YAML.load_file(Rails.root.join('config', 's3.yml'))[Rails.env].blank?)
26
+ if (FileTest.exist?(Rails.root.join('config', 's3.yml')) && !YAML.load_file(Rails.root.join('config', 's3.yml'))[Rails.env].blank?)
27
27
  S3_OPTIONS = {
28
- :storage => 's3',
29
- :s3_credentials => Rails.root.join('config', 's3.yml')
30
- }
31
- elsif (ENV['S3_KEY'] && ENV['S3_SECRET'] && ENV['S3_BUCKET'])
28
+ :storage => 's3',
29
+ :s3_credentials => Rails.root.join('config', 's3.yml')
30
+ }
31
+ elsif (FileTest.exist?(Rails.root.join('config', 's3.yml')) && ENV['S3_KEY'] && ENV['S3_SECRET'] && ENV['S3_BUCKET'])
32
32
  S3_OPTIONS = {
33
- :storage => 's3',
34
- :s3_credentials => {
35
- :access_key_id => ENV['S3_KEY'],
36
- :secret_access_key => ENV['S3_SECRET']
37
- },
38
- :bucket => ENV['S3_BUCKET']
39
- }
40
- else
41
- S3_OPTIONS = { :storage => 'filesystem' }
42
- end
33
+ :storage => 's3',
34
+ :s3_credentials => {
35
+ :access_key_id => ENV['S3_KEY'],
36
+ :secret_access_key => ENV['S3_SECRET']
37
+ },
38
+ :bucket => ENV['S3_BUCKET']
39
+ }
40
+ else
41
+ S3_OPTIONS = { :storage => 'filesystem' }
42
+ end
43
43
 
44
44
  attachment_definitions[:attachment] = (attachment_definitions[:attachment] || {}).merge(S3_OPTIONS)
45
45
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_banner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-22 00:00:00.000000000 Z
12
+ date: 2012-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core