Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow branch args for update-chosen #20

Merged
merged 1 commit into from
Mar 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions lib/chosen-rails/source_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down