Skip to content

Commit

Permalink
Store VERSION as Google provides it
Browse files Browse the repository at this point in the history
This is required to create valid URLs to the CDN.

Signed-off-by: Mikhail S. Pobolovets <[email protected]>
  • Loading branch information
styx committed Oct 30, 2013
1 parent da7c936 commit cf208c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion angularjs-rails.gemspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- encoding: utf-8 -*-
require 'versionomy'
require File.expand_path('../lib/angularjs-rails/version', __FILE__)

Gem::Specification.new do |s|
s.name = 'angularjs-rails'
s.version = AngularJS::Rails::VERSION
s.version = Versionomy.parse(AngularJS::Rails::VERSION).convert(:rubygems)
s.date = '2013-09-06'
s.summary = 'Angular.js on Rails'
s.description = 'Injects Angular.js into your asset pipeline as well as other Angular modules.'
Expand Down
2 changes: 1 addition & 1 deletion lib/angularjs-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module AngularJS
module Rails
VERSION = "1.2.0.rc3"
VERSION = "1.2.0-rc.3"
UNSTABLE_VERSION = "1.1.5"
end
end
8 changes: 1 addition & 7 deletions tasks/angularjs-rails/updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ def update_version_to(version)
content = version_file.read
version_line = content.lines.find { |l| l =~ /^\s+#{version_constant_name}/ }

# We need to use a gemspec friendly version, so reformat angular version
# to match gem version format
new_version = Versionomy.create version.values_array,
current_gem_version.format,
current_gem_version.unparse_params

new_version_line = version_line.gsub(/"[^"]+"/, %Q{"#{new_version}"})
new_version_line = version_line.gsub(/"[^"]+"/, %Q{"#{version}"})
version_file.open('w+') do |f|
f.write content.gsub(version_line, new_version_line)
end
Expand Down

0 comments on commit cf208c1

Please sign in to comment.