version 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,7 +1,13 @@
1
+ === Version 0.6.2 / 2010-02-05
2
+
3
+ * bug fixes
4
+ * fix critical bug in Class#is_versioned which prevented it from working at
5
+ all
6
+
1
7
  === Version 0.6.1 / 2010-02-05
2
8
 
3
9
  * enhancements
4
- * renamed Versioned() to has_version
10
+ * renamed Versioned() to is_versioned
5
11
 
6
12
  === Version 0.6.0 / 2010-02-04
7
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.2
data/lib/ext/class.rb CHANGED
@@ -3,13 +3,14 @@ require 'pathname'
3
3
  class Class
4
4
  #
5
5
  # Automagically sets a VERSION constant in the current class, populated by
6
- # the Version in +filename+. Attempts to guess the filename if none given.
7
- # Can read both .yml files and plain text.
6
+ # the Version in +filename+. Attempts to guess the filename of the VERSION
7
+ # file by looking for VERSION or VERSION.yml files in the directories above
8
+ # the caller
8
9
  #
9
10
  def is_versioned(filename = nil)
10
11
  # attempt to guess the filename if none given
11
12
  if filename.nil?
12
- filename = Pathname.new('.').expand_path.ascend do |d|
13
+ filename = Pathname.new(caller.first).dirname.expand_path.ascend do |d|
13
14
  break d.join('VERSION') if d.join('VERSION').exist?
14
15
  break d.join('VERSION.yml') if d.join('VERSION.yml').exist?
15
16
  end
@@ -4,6 +4,7 @@ require 'pathname'
4
4
  class Rake::VersionTask < Rake::TaskLib
5
5
  attr_accessor :filename
6
6
  attr_writer :filetype
7
+ attr_accessor :with_git
7
8
 
8
9
  #
9
10
  # Creates a new VersionTask with the given +filename+. Attempts to
@@ -11,6 +12,9 @@ class Rake::VersionTask < Rake::TaskLib
11
12
  #
12
13
  def initialize(filename = 'VERSION')
13
14
  self.filename = filename
15
+ self.with_git = File.exist?('.git')
16
+
17
+ # raise self.with_git.to_s
14
18
 
15
19
  yield(self) if block_given?
16
20
 
@@ -93,6 +97,8 @@ class Rake::VersionTask < Rake::TaskLib
93
97
  end
94
98
  end
95
99
 
100
+ # if self.with_git
101
+
96
102
  version
97
103
  end
98
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: version
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Touset