Permalink
Browse files

Merge pull request #20 from azfire/branch-args-update-chosen

Allow branch args for update-chosen
  • Loading branch information...
2 parents 30defd4 + 6acb6be commit 4ac234ca7a7aeff827446265489e17b893628d2f @tsechingho committed Mar 4, 2013
Showing with 12 additions and 11 deletions.
  1. +3 −2 Rakefile
  2. +9 −9 lib/chosen-rails/source_file.rb
View
@@ -3,10 +3,11 @@ require 'bundler/gem_tasks'
require File.expand_path('../lib/chosen-rails/source_file', __FILE__)
desc "Update with Harvest's Chosen Library"
-task 'update-chosen', 'remote' do |task, args|
+task 'update-chosen', 'remote', 'branch' do |task, args|
remote = args['remote'] || 'https://github.com/harvesthq/chosen'
+ branch = args['branch'] || 'master'
files = SourceFile.new
- files.fetch remote
+ files.fetch remote, branch
files.convert
files.cleanup
end
@@ -4,16 +4,16 @@ class SourceFile < Thor
include Thor::Actions
desc 'fetch source files', 'fetch source files from GitHub'
- def fetch remote
+ def fetch remote, branch
self.destination_root = 'vendor/assets'
- get "#{remote}/raw/master/chosen/chosen-sprite.png", 'images/chosen-sprite.png'
- get "#{remote}/raw/master/chosen/chosen-sprite@2x.png", 'images/chosen-sprite@2x.png'
- get "#{remote}/raw/master/chosen/chosen.css", 'stylesheets/chosen.css'
- get "#{remote}/raw/master/coffee/lib/abstract-chosen.coffee", 'javascripts/lib/abstract-chosen.coffee'
- get "#{remote}/raw/master/coffee/lib/select-parser.coffee", 'javascripts/lib/select-parser.coffee'
- get "#{remote}/raw/master/coffee/chosen.jquery.coffee", 'javascripts/chosen.jquery.coffee'
- get "#{remote}/raw/master/coffee/chosen.proto.coffee", 'javascripts/chosen.proto.coffee'
- get "#{remote}/raw/master/VERSION", 'VERSION'
+ get "#{remote}/raw/#{branch}/chosen/chosen-sprite.png", 'images/chosen-sprite.png'
+ get "#{remote}/raw/#{branch}/chosen/chosen-sprite@2x.png", 'images/chosen-sprite@2x.png'
+ get "#{remote}/raw/#{branch}/chosen/chosen.css", 'stylesheets/chosen.css'
+ get "#{remote}/raw/#{branch}/coffee/lib/abstract-chosen.coffee", 'javascripts/lib/abstract-chosen.coffee'
+ get "#{remote}/raw/#{branch}/coffee/lib/select-parser.coffee", 'javascripts/lib/select-parser.coffee'
+ get "#{remote}/raw/#{branch}/coffee/chosen.jquery.coffee", 'javascripts/chosen.jquery.coffee'
+ get "#{remote}/raw/#{branch}/coffee/chosen.proto.coffee", 'javascripts/chosen.proto.coffee'
+ get "#{remote}/raw/#{branch}/VERSION", 'VERSION'
bump_version
end

0 comments on commit 4ac234c

Please sign in to comment.