Skip to content

Commit

Permalink
Add and auto-update JQUERY_UI_VERSION constant. Fixes #57
Browse files Browse the repository at this point in the history
  • Loading branch information
joliss committed Oct 25, 2013
1 parent 7d58c69 commit e22a185
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions History.md
@@ -1,5 +1,7 @@
# master

* Add Jquery::Ui::Rails::JQUERY_UI_VERSION constant

# 4.0.5

* Remove unused dependency on the `jquery-rails` gem. If you get an error
Expand Down
16 changes: 15 additions & 1 deletion Rakefile
Expand Up @@ -194,8 +194,22 @@ task :images => :submodule do
FileUtils.cp(Dir.glob("jquery-ui/themes/base/images/*"), target_dir)
end

desc "Update Jquery::Ui::Rails::JQUERY_UI_VERSION"
task :version => :submodule do
Rake.rake_output_message "Setting Jquery::Ui::Rails::JQUERY_UI_VERSION = \"#{version}\""

versionRb = 'lib/jquery/ui/rails/version.rb'
versionRbSource = File.read(versionRb)
versionDefinition = "JQUERY_UI_VERSION = \"#{version}\""
versionRbSource.sub! /JQUERY_UI_VERSION = "[^"]*"/, versionDefinition \
or fail "Could not find JQUERY_UI_VERSION in #{versionRb}"
File.open(versionRb, 'w') do |out|
out.write(versionRbSource)
end
end

desc "Clean and then generate everything (default)"
task :assets => [:clean, :javascripts, :stylesheets, :images]
task :assets => [:clean, :javascripts, :stylesheets, :images, :version]

task :build => :assets

Expand Down
1 change: 1 addition & 0 deletions lib/jquery/ui/rails/version.rb
Expand Up @@ -2,6 +2,7 @@ module Jquery
module Ui
module Rails
VERSION = "4.0.5"
JQUERY_UI_VERSION = "1.10.3"
end
end
end

0 comments on commit e22a185

Please sign in to comment.