caboose-cms 0.9.167 → 0.9.168
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/caboose/theme.rb +5 -3
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fff02cf440829495affd7ac1d92ee2f744de8bb2
|
4
|
+
data.tar.gz: 12b891c6d08d26db212943cf01b8b5078f348544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dc57142c836592143e6b769cfd0ed5af3aed66023f59deccc6e517a7253e30726f1edca0b410aca39b400f1e35806752af7fcc41f5bbfb046bf2d69a9c860cb
|
7
|
+
data.tar.gz: 6d707887e94cea4ff497eb11335dc69d71ea0f73ff19809fe23c2d05cec660f4e27f927812a140e8278571aaef9d0332fadfb90fcaa5291a6a3d0d073ec72f14
|
data/app/models/caboose/theme.rb
CHANGED
@@ -75,7 +75,7 @@ class Caboose::Theme < ActiveRecord::Base
|
|
75
75
|
def compile(for_site_id = 0)
|
76
76
|
theme = self
|
77
77
|
theme_name = 'default'
|
78
|
-
path = Rails.root.join(
|
78
|
+
path = Rails.root.join('themes', "#{theme_name}.scss.erb")
|
79
79
|
body = ERB.new(File.read(File.join(path))).result(theme.get_binding(for_site_id))
|
80
80
|
tmp_themes_path = File.join(Rails.root, 'tmp', 'themes')
|
81
81
|
tmp_asset_name = "theme_#{self.id}_site_#{for_site_id}"
|
@@ -95,13 +95,15 @@ class Caboose::Theme < ActiveRecord::Base
|
|
95
95
|
:style => :compressed
|
96
96
|
}).render
|
97
97
|
str = StringIO.new(compressed_body)
|
98
|
-
theme.delete_asset
|
99
98
|
if Rails.env.production?
|
100
99
|
config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
101
100
|
AWS.config(:access_key_id => config['access_key_id'], :secret_access_key => config['secret_access_key'])
|
102
101
|
bucket = AWS::S3.new.buckets[config['bucket']]
|
103
102
|
bucket.objects[theme.asset_path(asset.digest, for_site_id)].write(str, :acl => 'public-read', :content_type => 'text/css')
|
104
103
|
else
|
104
|
+
Caboose.log("creating themes folder if doesn't exist")
|
105
|
+
theme_path = File.join(Rails.root, 'public', 'assets', 'themes')
|
106
|
+
FileUtils.mkdir_p(theme_path) unless File.directory?(theme_path)
|
105
107
|
File.open(File.join(Rails.root, 'public', theme.asset_path(asset.digest, for_site_id)), 'w') { |f| f.write(compressed_body) }
|
106
108
|
end
|
107
109
|
self.update_digest(asset.digest)
|
@@ -119,7 +121,7 @@ class Caboose::Theme < ActiveRecord::Base
|
|
119
121
|
end
|
120
122
|
|
121
123
|
def delete_asset
|
122
|
-
|
124
|
+
Caboose.log("deleting asset")
|
123
125
|
end
|
124
126
|
|
125
127
|
def asset_path(digest = self.digest, site_id = 0)
|
data/lib/caboose/version.rb
CHANGED