caboose-cms 0.6.15 → 0.6.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzY2MjdlZGYxZmY2MGE1ZDYxOTVhODYzMGU1ZjgxNzg3ZTg2NjU1Nw==
4
+ YjI1YjFlNmY3MmZkYWIzMTJlNGFmZjVhZjJjMDk5OTE0ZjUyMWI0YQ==
5
5
  data.tar.gz: !binary |-
6
- YzMwNjdkYjczNjcxOTVkMDFiMjAxMDYyMDUyZDE2N2Y4OWUxNTVmYw==
6
+ MTQyNjIxZTRlZWQ0MTFiOTJkYjU0MDZmZGZhMzYxNmJhNWFiZDM1NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Yzk1MjBmYjJlN2NjZjNlYWFiYjFmMTkxYzllOGEzYjkwODdiNTU2MjZlNjM2
10
- OTNhZTg3MjdhZjk0YTliMzEwOTk5NjQ2MzRhNmI5MjY0ZDRhZjMwM2U2ZTFm
11
- YzBmNTJhNjg0YzBmODFkZjdkNjg5MDk5M2NkYjFmZTQ0NDM0OWU=
9
+ ZGZhNTk2ZmM1YWNjZmRiNjhjYTIzMjUyNDFkNWFiODcxZjU4YTNmOGJiNTdm
10
+ OGJmZmIzMzllOWZiZGNkYmRmZmQ1NWM4OGFhZTNiN2EzNTFiOGM4OWY0Nzcw
11
+ Y2NiNmMyZjM4NzVhZDZiNThjMjM1MDg3ZTM1MTJhZGM2MGViZmM=
12
12
  data.tar.gz: !binary |-
13
- YTQ4YmQwY2E5YzcxNmE5OWI0ZWEwODU1NDFiNTRkMTQ2MzJlMzc2N2MwYzk3
14
- MDAxMDIzMTcwMTZhMGExNzJjMWIyZThmYTc4Y2ZlZGQ2NDAyZTBiNGIxOTc5
15
- M2Y1NTUwYTcxOTRhYWEwYjkwMTliNWRiZDQ5MTlhMjY3Nzg2YzI=
13
+ OWQyZDRlMGU4ZTJlNTM5NGQ0YjRkZWZiM2ZhZTIzNzE1MTQwODgyMzNjYmNh
14
+ MzgzNGNkN2YwNThmNDVlNTMwMTI5ZDVhMDQyYTllZjU5YWZhYWU1NzU1Yjc5
15
+ YjdlMDVhMzc0NjhjNDJmM2EyZTk4ZGVjMzE5MzNiZWNmYzY5OGQ=
@@ -1,2 +1,3 @@
1
1
 
2
2
 
3
+ if arr['dog'] && arr['dog']['name'] && arr['dog']['name']['first_name']
@@ -37,13 +37,11 @@ class Caboose::Media < ActiveRecord::Base
37
37
 
38
38
  config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
39
39
  bucket = config['bucket']
40
+ bucket = Caboose::uploads_bucket && Caboose::uploads_bucket.strip.length > 0 ? Caboose::uploads_bucket : "#{bucket}-uploads"
40
41
 
41
- key = "#{self.media_category_id}_#{self.original_name}"
42
- Caboose.log("key before encoding: #{key}")
43
- key = URI.encode(key.gsub(' ', '+'))
44
- Caboose.log("key after encoding: #{key}")
45
- uri = "http://#{bucket}-uploads.s3.amazonaws.com/#{key}"
46
- Caboose.log("uri: #{uri}")
42
+ key = "#{self.media_category_id}_#{self.original_name}"
43
+ key = URI.encode(key.gsub(' ', '+'))
44
+ uri = "http://#{bucket}.s3.amazonaws.com/#{key}"
47
45
 
48
46
  image_extensions = ['.jpg', '.jpeg', '.gif', '.png', '.tif']
49
47
  ext = File.extname(key).downcase
@@ -64,7 +62,7 @@ class Caboose::Media < ActiveRecord::Base
64
62
  #end
65
63
 
66
64
  # Remove the temp file
67
- bucket = AWS::S3::Bucket.new("#{bucket}-uploads")
65
+ bucket = AWS::S3::Bucket.new(bucket)
68
66
  obj = bucket.objects[key]
69
67
  obj.delete
70
68
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.6.15'
2
+ VERSION = '0.6.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.15
4
+ version: 0.6.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry