mactag 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -36,7 +36,7 @@ module Mactag
36
36
  end
37
37
  File.join(Mactag::Config.gem_home, gem, 'lib', '**', '*.rb')
38
38
  else
39
- Mactag.warn "Gem #{@name} not found"
39
+ Mactag.warn "Gem #{@version ? splash : @name} not found"
40
40
  end
41
41
  end
42
42
 
@@ -62,7 +62,7 @@ module Mactag
62
62
  result = []
63
63
  packages.each do |package|
64
64
  if PACKAGES.include?(package)
65
- result << Gem.new(package.to_s, @options[:version]).tag
65
+ result << Gem.new(package.to_s, version).tag
66
66
  end
67
67
  end
68
68
  result
@@ -100,6 +100,14 @@ module Mactag
100
100
  "#{pkg}".gsub(/[^a-z]/, '').to_sym
101
101
  end
102
102
  end
103
+
104
+ ##
105
+ #
106
+ # Returns what Rails version to use.
107
+ #
108
+ def version
109
+ @options[:version] || ::Rails.version
110
+ end
103
111
  end
104
112
  end
105
113
  end
@@ -86,4 +86,20 @@ class RailsTest < ActiveSupport::TestCase
86
86
  end
87
87
  end
88
88
  end
89
+
90
+ context '#version' do
91
+ should 'pick specified version if given' do
92
+ @rails = Mactag::Tag::Rails.new({ :version => '3.0.0.rc' })
93
+
94
+ assert_equal '3.0.0.rc', @rails.send(:version)
95
+ end
96
+
97
+ should 'pick same rails version as application if not specified version' do
98
+ Rails.stubs(:version).returns('3.0.0.beta3')
99
+
100
+ @rails = Mactag::Tag::Rails.new({})
101
+
102
+ assert_equal '3.0.0.beta3', @rails.send(:version)
103
+ end
104
+ end
89
105
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Johan Andersson