obbistrano 1.1.19 → 1.1.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -461,71 +461,75 @@ Capistrano::Configuration.instance(:must_exist).load do
461
461
 
462
462
  end
463
463
 
464
- end
465
464
 
465
+ namespace :bundle do
466
466
 
467
- namespace :bundle do
468
-
469
- task :css do
470
- paths = get_top_level_directories("#{deploy_to}/public/stylesheets")
471
- paths << "#{deploy_to}/public/stylesheets/"
472
- Dir.mkdir("#{deploy_to}/public/stylesheets/build") rescue ""
473
- paths.each do |bundle_directory|
474
- bundle_name = bundle_directory.gsub("#{deploy_to}/public/stylesheets/", "")
475
- bundle_name ="common" if bundle_name.empty?
476
- files = recursive_file_list(bundle_directory, ".css")
477
- next if files.empty? || bundle_name == 'dev'
478
- bundle = ''
479
- files.each do |file_path|
480
- bundle << File.read(file_path) << "\n"
467
+ task :css do
468
+ paths = get_top_level_directories("#{deploy_to}/public/stylesheets")
469
+ paths << "#{deploy_to}/public/stylesheets/"
470
+ Dir.mkdir("#{deploy_to}/public/stylesheets/build") rescue ""
471
+ paths.each do |bundle_directory|
472
+ bundle_name = bundle_directory.gsub("#{deploy_to}/public/stylesheets/", "")
473
+ bundle_name ="common" if bundle_name.empty?
474
+ files = recursive_file_list(bundle_directory, ".css")
475
+ next if files.empty? || bundle_name == 'dev'
476
+ bundle = ''
477
+ files.each do |file_path|
478
+ bundle << File.read(file_path) << "\n"
479
+ end
480
+ target = "#{deploy_to}/public/stylesheets/build/#{bundle_name}_combined.css"
481
+ File.open(target, 'w') { |f| f.write(bundle) }
481
482
  end
482
- target = "#{deploy_to}/public/stylesheets/build/#{bundle_name}_combined.css"
483
- File.open(target, 'w') { |f| f.write(bundle) }
483
+ upload "#{deploy_to}/public/stylesheets/build", "#{deploy_to}/public/stylesheets/build"
484
484
  end
485
- upload "#{deploy_to}/public/stylesheets/build", "#{deploy_to}/public/stylesheets/build"
486
- end
487
-
488
- task :js do
489
- paths = get_top_level_directories("#{deploy_to}/public/javascripts")
490
- paths << "#{deploy_to}/public/javascripts/"
491
- Dir.mkdir("#{deploy_to}/public/javascripts/build") rescue ""
492
- paths.each do |bundle_directory|
493
- bundle_name = bundle_directory.gsub("#{deploy_to}/public/javascripts/", "")
494
- bundle_name ="common" if bundle_name.empty?
495
- files = recursive_file_list(bundle_directory, ".js")
496
- next if files.empty? || bundle_name == 'dev'
497
- bundle = ''
498
- files.each do |file_path|
499
- bundle << File.read(file_path) << "\n"
485
+
486
+ task :js do
487
+ paths = get_top_level_directories("#{deploy_to}/public/javascripts")
488
+ paths << "#{deploy_to}/public/javascripts/"
489
+ Dir.mkdir("#{deploy_to}/public/javascripts/build") rescue ""
490
+ paths.each do |bundle_directory|
491
+ bundle_name = bundle_directory.gsub("#{deploy_to}/public/javascripts/", "")
492
+ bundle_name ="common" if bundle_name.empty?
493
+ files = recursive_file_list(bundle_directory, ".js")
494
+ next if files.empty? || bundle_name == 'dev'
495
+ bundle = ''
496
+ files.each do |file_path|
497
+ bundle << File.read(file_path) << "\n"
498
+ end
499
+ target = "#{deploy_to}/public/javascripts/build/#{bundle_name}_combined.css"
500
+ File.open(target, 'w') { |f| f.write(bundle) }
500
501
  end
501
- target = "#{deploy_to}/public/javascripts/build/#{bundle_name}_combined.css"
502
- File.open(target, 'w') { |f| f.write(bundle) }
502
+ upload "#{deploy_to}/public/javascripts/build", "#{deploy_to}/public/javascripts/build"
503
+
503
504
  end
504
- upload "#{deploy_to}/public/javascripts/build", "#{deploy_to}/public/javascripts/build"
505
-
506
- end
507
-
508
- require 'find'
509
- def recursive_file_list(basedir, ext)
510
- files = []
511
- Find.find(basedir) do |path|
512
- if FileTest.directory?(path)
513
- if File.basename(path)[0] == ?. # Skip dot directories
514
- Find.prune
515
- else
516
- next
505
+
506
+ require 'find'
507
+ def recursive_file_list(basedir, ext)
508
+ files = []
509
+ Find.find(basedir) do |path|
510
+ if FileTest.directory?(path)
511
+ if File.basename(path)[0] == ?. # Skip dot directories
512
+ Find.prune
513
+ else
514
+ next
515
+ end
517
516
  end
517
+ files << path if File.extname(path) == ext
518
518
  end
519
- files << path if File.extname(path) == ext
519
+ files.sort
520
+ end
521
+
522
+ def get_top_level_directories(base_path)
523
+ Dir.entries(base_path).collect do |path|
524
+ path = "#{base_path}/#{path}"
525
+ File.basename(path)[0] == ?. || !File.directory?(path) || File.basename(path)=="build" ? nil : path # not dot directories or files
526
+ end - [nil]
520
527
  end
521
- files.sort
522
- end
523
528
 
524
- def get_top_level_directories(base_path)
525
- Dir.entries(base_path).collect do |path|
526
- path = "#{base_path}/#{path}"
527
- File.basename(path)[0] == ?. || !File.directory?(path) || File.basename(path)=="build" ? nil : path # not dot directories or files
528
- end - [nil]
529
529
  end
530
-
530
+
531
+
532
+
533
+
531
534
  end
535
+
data/obbistrano.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{obbistrano}
5
- s.version = "1.1.19"
5
+ s.version = "1.1.20"
6
6
  s.authors = ["Ross Riley", "One Black Bear"]
7
7
  s.date = Time.now
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obbistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.19
4
+ version: 1.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Riley