path 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@
3
3
  Dir.glob(File.expand_path('../path/*.rb',__FILE__)) { |file| require file }
4
4
 
5
5
  require 'tempfile'
6
+ require 'rbconfig'
6
7
 
7
8
  class Path
8
9
  class << self
@@ -33,6 +34,16 @@ class Path
33
34
  end
34
35
  alias :home :~
35
36
 
37
+ # A {Path} to the null device on the current platform.
38
+ def null
39
+ new case RbConfig::CONFIG['host_os']
40
+ when /mswin|mingw/ then 'NUL'
41
+ when /amiga/i then 'NIL:'
42
+ when /openvms/i then 'NL:'
43
+ else '/dev/null'
44
+ end
45
+ end
46
+
36
47
  # Same as +Path.file.backfind(path)+. See {#backfind}.
37
48
  def backfind(path)
38
49
  file(caller).backfind(path)
@@ -16,6 +16,7 @@ class Path
16
16
  def Path.getwd
17
17
  new Dir.getwd
18
18
  end
19
+ alias :cwd :getwd
19
20
  alias :pwd :getwd
20
21
  end
21
22
 
@@ -73,9 +73,12 @@ class Path
73
73
  end
74
74
  @plus_configured = caller.first
75
75
  end
76
+ class << self
77
+ alias :configure_plus :+
78
+ end
76
79
 
77
80
  @plus_configured = nil # Initialization
78
- Path + :warning
81
+ Path.configure_plus(:warning)
79
82
  @plus_configured = nil # Let the user overrides this default configuration
80
83
 
81
84
  # @!method +(other)
@@ -1,5 +1,5 @@
1
1
  class Path
2
2
  # The version of the gem.
3
3
  # Set here to avoid duplication and allow introspection.
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: path
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-16 00:00:00.000000000 Z
12
+ date: 2012-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -33,7 +33,6 @@ executables: []
33
33
  extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
- - lib/epath.rb
37
36
  - lib/path/compatibility.rb
38
37
  - lib/path/dir.rb
39
38
  - lib/path/file.rb
@@ -72,9 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
71
  version: '0'
73
72
  requirements: []
74
73
  rubyforge_project:
75
- rubygems_version: 1.8.23
74
+ rubygems_version: 1.8.24
76
75
  signing_key:
77
76
  specification_version: 3
78
77
  summary: The Path manipulation library
79
78
  test_files: []
80
- has_rdoc:
@@ -1,2 +0,0 @@
1
- # For compatibility with old gem name
2
- require File.expand_path('../path.rb', __FILE__)