Skip to content
This repository
Browse code

allow remote args for update-chosen

  • Loading branch information...
commit 30defd4eb42629498a5bc7d956cc1faf3fb249aa 1 parent 8f25248
Tse-Ching Ho authored

Showing 2 changed files with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +3 2 Rakefile
  2. +1 2  lib/chosen-rails/source_file.rb
5 Rakefile
@@ -3,9 +3,10 @@ require 'bundler/gem_tasks'
3 3 require File.expand_path('../lib/chosen-rails/source_file', __FILE__)
4 4
5 5 desc "Update with Harvest's Chosen Library"
6   -task 'update-chosen' do
  6 +task 'update-chosen', 'remote' do |task, args|
  7 + remote = args['remote'] || 'https://github.com/harvesthq/chosen'
7 8 files = SourceFile.new
8   - files.fetch
  9 + files.fetch remote
9 10 files.convert
10 11 files.cleanup
11 12 end
3  lib/chosen-rails/source_file.rb
@@ -4,9 +4,8 @@ class SourceFile < Thor
4 4 include Thor::Actions
5 5
6 6 desc 'fetch source files', 'fetch source files from GitHub'
7   - def fetch
  7 + def fetch remote
8 8 self.destination_root = 'vendor/assets'
9   - remote = 'https://github.com/harvesthq/chosen'
10 9 get "#{remote}/raw/master/chosen/chosen-sprite.png", 'images/chosen-sprite.png'
11 10 get "#{remote}/raw/master/chosen/chosen-sprite@2x.png", 'images/chosen-sprite@2x.png'
12 11 get "#{remote}/raw/master/chosen/chosen.css", 'stylesheets/chosen.css'

0 comments on commit 30defd4

Please sign in to comment.
Something went wrong with that request. Please try again.