getversion 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/bin/getversion.rb CHANGED
@@ -4,4 +4,4 @@ name = ARGV[0]
4
4
  should_guess = ARGV[1] && ARGV[1] == '--guess'
5
5
 
6
6
  version = should_guess ? GetVersion.guess(name) : GetVersion[name]
7
- puts version
7
+ puts version || 'unknown'
@@ -1,5 +1,3 @@
1
- require 'yaml'
2
-
3
1
  module GetVersion
4
2
 
5
3
  namespace :google
@@ -1,11 +1,8 @@
1
1
  class Path
2
2
 
3
- attr_accessor :path, :is_windows
4
-
5
3
  def initialize(*path)
6
- path.select! { |p| p unless p == '' }
4
+ path.select! { |p| p unless p.empty? }
7
5
  @path = File.join path
8
- @is_windows = !ENV['WINDIR'].nil?
9
6
  end
10
7
 
11
8
  def evaluated_path
@@ -15,11 +12,17 @@ class Path
15
12
 
16
13
  def normalised_path
17
14
  return unless @path
18
- @is_windows ? @path.gsub('/', '\\') : @path.gsub('\\', '/')
15
+ is_windows ? @path.gsub('/', '\\') : @path.gsub('\\', '/')
19
16
  end
20
17
 
21
18
  def to_s
22
19
  evaluated_path
23
20
  end
24
21
 
22
+ private
23
+
24
+ def is_windows
25
+ !ENV['WINDIR'].nil?
26
+ end
27
+
25
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: