Skip to content

Commit

Permalink
only bump chosen version while rake update-chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
tsechingho committed Jan 21, 2013
1 parent 1e743d4 commit 194a8c0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/chosen-rails/source_file.rb
Expand Up @@ -15,12 +15,7 @@ def fetch
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'
inside destination_root do
version = File.read('VERSION').sub("\n", '')
gsub_file '../../lib/chosen-rails/version.rb', /VERSION\s=\s'(\d|\.)+'$/ do |match|
%Q{VERSION = '#{version}'}
end
end
bump_version
end

desc 'convert css to sass file', 'convert css to sass file by sass-convert'
Expand All @@ -40,4 +35,15 @@ def cleanup
remove_file 'stylesheets/chosen.css'
remove_file 'VERSION'
end

protected

def bump_version
inside destination_root do
version = File.read('VERSION').sub("\n", '')
gsub_file '../../lib/chosen-rails/version.rb', /CHOSEN_VERSION\s=\s'(\d|\.)+'$/ do |match|
%Q{CHOSEN_VERSION = '#{version}'}
end
end
end
end

0 comments on commit 194a8c0

Please sign in to comment.