netrc 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/changelog.txt +5 -0
  3. data/lib/netrc.rb +8 -9
  4. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9a0d93d9bb22f77d99ddfe8b5bc50869dd42007
4
- data.tar.gz: 6fd95dbe500475ff61347e808b269dccd84f1f85
3
+ metadata.gz: ff42e907d9e08059eca13e54dac95b5a7247cb02
4
+ data.tar.gz: d2692d21a8ab3880d2c06135e972e91b17c6455f
5
5
  SHA512:
6
- metadata.gz: 59ed68b4295eb1e34eceacdc558fa75cb8568123f98c239fd6bfb097bc7ce608bc8e3eae92cb6e1cb6a301c1d04cd2840da463a301cee6330401b04bce858961
7
- data.tar.gz: f664f3370ad18eb37136deb524debb929e3be23d2c4f03da04e9765d8f6ce034b62d2758ef9f6e33dae9268eca2eb0444238f1c44552fa0c19d63b457bbcedf8
6
+ metadata.gz: 92a9c3f6b1e85e748ab46f573eab3cd08b25dab74b82559be56d439f41099476c9b380c2f0ac032b17a01cd0da08696b1380a9935db9c6f2edfda724af56c2e7
7
+ data.tar.gz: 42e37d26587a9379f712f31f6b9c98923d7b439697e25037cff58bda148501dfcfee4c6441b260a5ae27b9905675141a975ca6e4e27da6b2b6d444110bc277cc
@@ -1,3 +1,8 @@
1
+ 0.10.3 02/24/15
2
+ ===============
3
+
4
+ error when Dir.home is not readable
5
+
1
6
  0.10.2 12/17/14
2
7
  ===============
3
8
 
@@ -1,7 +1,7 @@
1
1
  require 'rbconfig'
2
2
 
3
3
  class Netrc
4
- VERSION = "0.10.2"
4
+ VERSION = "0.10.3"
5
5
 
6
6
  # see http://stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows
7
7
  WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
@@ -12,17 +12,16 @@ class Netrc
12
12
  end
13
13
 
14
14
  def self.home_path
15
- return Dir.home if defined? Dir.home # Ruby 1.9+
15
+ home = Dir.respond_to?(:home) ? Dir.home : ENV['HOME']
16
+
16
17
  if WINDOWS && !CYGWIN
17
- home = ENV['HOME']
18
- home ||= ENV['HOMEDRIVE'] + ENV['HOMEPATH'] if ENV['HOMEDRIVE'] && ENV['HOMEPATH']
18
+ home ||= File.join(ENV['HOMEDRIVE'], ENV['HOMEPATH']) if ENV['HOMEDRIVE'] && ENV['HOMEPATH']
19
19
  home ||= ENV['USERPROFILE']
20
- home.gsub("\\","/")
21
- else
22
- # In some cases, people run master process as "root" user, and run worker processes as "www" user.
23
- # Fix "Permission denied" error in worker processes when $HOME is "/root".
24
- (ENV['HOME'] && File.exist?(ENV['HOME']) && File.stat(ENV['HOME']).readable?) ? ENV['HOME'] : './'
20
+ # XXX: old stuff; most likely unnecessary
21
+ home = home.gsub("\\", "/") unless home.nil?
25
22
  end
23
+
24
+ (home && File.readable?(home)) ? home : Dir.pwd
26
25
  rescue ArgumentError
27
26
  return Dir.pwd
28
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netrc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Rarick
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-17 00:00:00.000000000 Z
12
+ date: 2015-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: turn
@@ -73,4 +73,3 @@ signing_key:
73
73
  specification_version: 4
74
74
  summary: Library to read and write netrc files.
75
75
  test_files: []
76
- has_rdoc: