Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow branch args for update-chosen #20

Merged
merged 1 commit into from

2 participants

@azfire

Added the possibility to chose a specific branch when running update-chosen. Please merge it if you find it useful.

@tsechingho tsechingho merged commit 4ac234c into tsechingho:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2013
  1. @azfire
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 11 deletions.
  1. +3 −2 Rakefile
  2. +9 −9 lib/chosen-rails/source_file.rb
View
5 Rakefile
@@ -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
View
18 lib/chosen-rails/source_file.rb
@@ -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
Something went wrong with that request. Please try again.