hoe-version 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ === 1.2.0 / 2012-07-19
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Adds prep_history as prereq to prep_release.
6
+ * Tell hoe about new version. Adds tests.
7
+
8
+
1
9
  === 1.1.0 / 2012-07-19
2
10
 
3
11
  * 2 minor enhancements:
data/Rakefile CHANGED
@@ -13,4 +13,6 @@ Hoe.spec 'hoe-version' do
13
13
  # self.rubyforge_name = 'hoe-versionx' # if different than 'hoe-version'
14
14
  end
15
15
 
16
+ task 'prep_release' => 'prep_history'
17
+
16
18
  # vim: syntax=ruby
@@ -10,7 +10,7 @@
10
10
  # version:bump:patch:: Writes out version, bumping to next patch level release.
11
11
  #
12
12
  module Hoe::Version
13
- VERSION = '1.1.0'
13
+ VERSION = '1.2.0'
14
14
 
15
15
  def define_version_tasks
16
16
  desc 'print current version'
@@ -76,6 +76,8 @@ module Hoe::Version
76
76
  if data and data[version_re, 2] &&= vers
77
77
  #File.write(file, data)
78
78
  File.open(file, 'w'){|f| f.write data}
79
+ # tell hoe about the new version
80
+ spec.version = self.version = vers.dup
79
81
  return true
80
82
  end
81
83
  end
@@ -8,12 +8,16 @@ class TestHoe; end
8
8
  class TestHoe::TestVersion < MiniTest::Unit::TestCase
9
9
  include Hoe::Version
10
10
 
11
+ attr_accessor :version
12
+
11
13
  def setup
12
14
  @version = '1.1.1'
13
15
  @files = []
14
- @spec = MiniTest::Mock.new
15
- @spec.expect(:files, @files)
16
+ @spec = Gem::Specification.new
17
+ @spec.files = @files
18
+ ENV.delete 'VERSION'
16
19
  end
20
+ def spec() @spec end
17
21
 
18
22
  def test_increment_minor
19
23
  v = increment [0,1,nil]
@@ -30,6 +34,11 @@ class TestHoe::TestVersion < MiniTest::Unit::TestCase
30
34
  assert_equal '1.1.2', v
31
35
  end
32
36
 
37
+ def test_override_increment
38
+ ENV['VERSION'] = '4.5.6'
39
+ refute increment [1,2,3]
40
+ end
41
+
33
42
  def test_update_version
34
43
  expected = ["def nothing() 'No version here' end\n",
35
44
  "class Blah\n VERSION = '1.1.1'\nend\n"]
@@ -40,6 +49,9 @@ class TestHoe::TestVersion < MiniTest::Unit::TestCase
40
49
  assert_equal expected[0], File.read(@files[0])
41
50
  expected[1].gsub! '1.1.1', '3.2.1'
42
51
  assert_equal expected[1], File.read(@files[1])
52
+
53
+ assert_equal '3.2.1', version
54
+ assert_equal '3.2.1', spec.version.version
43
55
  end
44
56
  end
45
57
 
@@ -62,6 +74,4 @@ class TestHoe::TestVersion < MiniTest::Unit::TestCase
62
74
  end
63
75
  end
64
76
 
65
- def spec() @spec end
66
- def version() @version end
67
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-version
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: