sumodev_deploy 0.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ Capistrano::Configuration.instance.load do
2
+ namespace :assets do
3
+ desc "Compile and upload the CSS files"
4
+ task :precompile do
5
+ compass_folders = fetch(:compass_folders, Dir.glob('**/config.rb'))
6
+ asset_path = fetch(:asset_cache_dir, Dir.pwd + "/cache/cached_assets")
7
+ output_style = fetch(:compass_output, :compressed)
8
+
9
+ compass_folders.each do |config|
10
+ path = File.dirname(config)
11
+
12
+ run_locally "rm -rf #{asset_path} && mkdir -p #{asset_path}" # Cleanup
13
+ run_locally "cd #{path} && compass clean --css-dir #{asset_path}/css && compass compile -s #{output_style} --css-dir #{asset_path}/css"
14
+
15
+ assets = Dir.glob(asset_path + '/*/*').map {|f| [f, f.gsub(asset_path, '')] }
16
+ sprites = Dir.glob(path + "/images/**/*").grep(/-[0-9a-z]{11}.(png|jpg)/).map {|f| [f, f.gsub(path, '')] }
17
+
18
+ (assets + sprites).each do |file, filepath|
19
+ upload file, "#{latest_release.shellescape}/#{path}#{filepath}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "sumodev_deploy"
5
- s.version = "0.4"
5
+ s.version = "0.4.1"
6
6
 
7
7
  s.authors = ["Jan De Poorter"]
8
8
  s.date = "2012-04-18"
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.files = [
15
15
  "sumodev_deploy.gemspec",
16
16
  "lib/sumodev_deploy.rb",
17
+ "lib/sumodev_deploy/tasks/assets.rb",
17
18
  "lib/sumodev_deploy/tasks/db.rb",
18
19
  "lib/sumodev_deploy/tasks/errbit.rb",
19
20
  "lib/sumodev_deploy/tasks/files.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumodev_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - sumodev_deploy.gemspec
21
21
  - lib/sumodev_deploy.rb
22
+ - lib/sumodev_deploy/tasks/assets.rb
22
23
  - lib/sumodev_deploy/tasks/db.rb
23
24
  - lib/sumodev_deploy/tasks/errbit.rb
24
25
  - lib/sumodev_deploy/tasks/files.rb