Sha256: 792bf7eb8e653401c885c95a024896488bfc4130cdd0eb8d3cfc2b75c16db42e

Contents?: true

Size: 728 Bytes

Versions: 5

Compression:

Stored size: 728 Bytes

Contents

require 'bundler'
Bundler::GemHelper.install_tasks

# Check if versions are correct between VERSION constants and .js files
#
task :release => [:guard_version]

task :guard_version do
  def check_version(file, pattern, constant)
    body = File.read("vendor/assets/javascripts/#{file}")
    match = body.match(pattern) or abort "Version check failed: no pattern matched in #{file}"
    file_version = body.match(pattern)[1]
    constant_version = Jquery::Rails.const_get(constant)

    unless constant_version == file_version
      abort "Jquery::Rails::#{constant} was #{constant_version} but it should be #{file_version}"
    end
  end

  check_version('jquery.js', /jQuery JavaScript Library v([\S]+)/, 'JQUERY_VERSION')
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jquery-rails-3.0.4 Rakefile
jquery-rails-3.0.3 Rakefile
jquery-rails-3.0.2 Rakefile
jquery-rails-3.0.1 Rakefile
jquery-rails-3.0.0 Rakefile