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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd70e9e7b70ad02c09c2ad9554cbb027e21f44cd
4
- data.tar.gz: 12e2091444d9c1e73d2aa9ed44b9310059883959
3
+ metadata.gz: dd87516fcca691575a0f0b67ecd362e02578e384
4
+ data.tar.gz: 327ebf9bfa45d9124907546662fc97c4f3111843
5
5
  SHA512:
6
- metadata.gz: 9d9dcec70db59ac74e81884766ccaf4b113796011100563dafb497f4a42f3826c5baa24316e5d3a097015cd7b29a37446851e55da8f58bca3257c19ea3c065a4
7
- data.tar.gz: 68c80212a00bca05d30e0e2dee5a4e47cd2b278df19b3be4915edf2b4e32d60140a50529fded7a4a1c5766fcb3b765629d9501975f9fc07fe3174d9a59afb69d
6
+ metadata.gz: 07164dbde760ef579290f3d47ec60a4b1cc5357238bbd4728d24cd2f64b18474fa9ec10514eb03045bfe76b222e9bb25259193479f421e17ab12bd208eb9de03
7
+ data.tar.gz: 431640a57a6603b968f494aa8d39166ff6d3fd8a88b0caa1a2efe91f3492f3a0e633fc00a5d79a4fceb76016d5f1b50d22b4c883f802eb90116ae9d6737145ab
@@ -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.2'
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.glob[bundle[0]].each do |bundle_directory|
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
- Dir.glob[bundle_glob].each do |file|
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
- build_target = fetch(:bundle_build_path)+bundle[2]+bundle_name+fetch(:bundle_build_suffix)+bundle_extension
16
- upload! build_output, build_target
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/**/*/", "**/*.css", "public/stylesheets/build/"],
30
- ["public/javascripts/**/*/", "**/*.js", "public/javascripts/build/"]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Riley