capistrano-bundle 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/capistrano-bundle.gemspec +1 -1
- data/lib/capistrano/tasks/bundle.rake +13 -9
- 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: dd87516fcca691575a0f0b67ecd362e02578e384
|
4
|
+
data.tar.gz: 327ebf9bfa45d9124907546662fc97c4f3111843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07164dbde760ef579290f3d47ec60a4b1cc5357238bbd4728d24cd2f64b18474fa9ec10514eb03045bfe76b222e9bb25259193479f421e17ab12bd208eb9de03
|
7
|
+
data.tar.gz: 431640a57a6603b968f494aa8d39166ff6d3fd8a88b0caa1a2efe91f3492f3a0e633fc00a5d79a4fceb76016d5f1b50d22b4c883f802eb90116ae9d6737145ab
|
data/capistrano-bundle.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'capistrano-bundle'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.3'
|
8
8
|
spec.authors = ["Ross Riley"]
|
9
9
|
spec.email = ["riley.ross@gmail.com"]
|
10
10
|
spec.description = %q{Very Basic Asset Bundler for Capistrano 3.x}
|
@@ -4,16 +4,21 @@ namespace :bundle do
|
|
4
4
|
desc "Packages up assets into combined, modular files"
|
5
5
|
task :build do
|
6
6
|
fetch(:bundle_dirs).each do |bundle|
|
7
|
-
Dir
|
7
|
+
Dir[bundle[0]].each do |bundle_directory|
|
8
8
|
bundle_name = File.basename(bundle_directory)
|
9
9
|
bundle_glob = bundle_directory+bundle[1]
|
10
10
|
bundle_output = ''
|
11
|
-
|
11
|
+
bundle_extension = ''
|
12
|
+
Dir[bundle_glob].each do |file|
|
12
13
|
bundle_extension = File.extname(file)
|
13
14
|
bundle_output << File.read(file)
|
14
15
|
end
|
15
|
-
|
16
|
-
|
16
|
+
build_destination = fetch(:bundle_build_path)+"/"+bundle[2]
|
17
|
+
build_target = build_destination+bundle_name+fetch(:bundle_build_suffix)+bundle_extension
|
18
|
+
on roles(:web) do
|
19
|
+
execute :mkdir, '-p', build_destination
|
20
|
+
upload! StringIO.new(bundle_output), build_target
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
@@ -24,13 +29,12 @@ end
|
|
24
29
|
namespace :load do
|
25
30
|
|
26
31
|
task :defaults do
|
27
|
-
set :bundle_build_path, fetch(:deploy_to)
|
32
|
+
set :bundle_build_path, -> { fetch(:deploy_to) }
|
28
33
|
set :bundle_dirs, [
|
29
|
-
["public/stylesheets
|
30
|
-
["public/javascripts
|
34
|
+
["public/stylesheets/*/", "**/*.css", "public/stylesheets/build/"],
|
35
|
+
["public/javascripts/*/", "**/*.js", "public/javascripts/build/"]
|
31
36
|
]
|
32
37
|
set :bundle_build_suffix, "_combined"
|
33
38
|
end
|
34
39
|
|
35
|
-
end
|
36
|
-
|
40
|
+
end
|