netrc 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/changelog.txt +5 -0
- data/lib/netrc.rb +3 -7
- data/test/test_netrc.rb +2 -34
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWIyNjAwOGRlMDg1MjMxOGRlYTNjMTZkOTk5ZGYxNjQ3ZDhkMzg0Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzVhZjQ2YWEyZjBlMGMwMDM2MTQyOGQ4NWQzMTU3YTRkY2JkM2YyNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzdlNjBjMWQ5ZjU3ZWNjMjk2OTAxZmRiYTZhYjkwMTZmOTM5N2EzMThlM2U4
|
10
|
+
OGU2MzVlMGUzZDliOTQ1YWM3NWNlZDUxYmJiMDg0YTMxMzFjNTVkODM0ZWQw
|
11
|
+
NjA1NWFlMjRiMzE3Njk2YTU4YmM2NGM0NDFmOWQ3MTQ5OWVlZTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWZmNTViOGUwNDRkMWVmYTAwNTg3MmU2YWFkMTQ0MDk5ZmZjNDljYzA3ODcw
|
14
|
+
NTNjODczZjBhY2Q2N2RmOWYyZmQwYjdlNjI3MWU2YWIzZjcyMjE1MDdlZjcz
|
15
|
+
MDQ2ODc1MmZmZTBjZmU2ZDU1N2Y4OWU3NDMzNGUyNjBkOGNlYzI=
|
data/changelog.txt
CHANGED
data/lib/netrc.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rbconfig'
|
2
2
|
|
3
3
|
class Netrc
|
4
|
-
VERSION = "0.7.
|
4
|
+
VERSION = "0.7.9"
|
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/
|
@@ -159,9 +159,9 @@ class Netrc
|
|
159
159
|
|
160
160
|
def [](k)
|
161
161
|
if item = @data.detect {|datum| datum[1] == k}
|
162
|
-
|
162
|
+
[item[3], item[5]]
|
163
163
|
elsif @default
|
164
|
-
|
164
|
+
[@default[3], @default[5]]
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
@@ -221,10 +221,6 @@ class Netrc
|
|
221
221
|
end.join
|
222
222
|
end
|
223
223
|
|
224
|
-
Entry = Struct.new(:login, :password) do
|
225
|
-
alias to_ary to_a
|
226
|
-
end
|
227
|
-
|
228
224
|
end
|
229
225
|
|
230
226
|
class Netrc::Error < ::StandardError
|
data/test/test_netrc.rb
CHANGED
@@ -120,7 +120,7 @@ class TestNetrc < Test::Unit::TestCase
|
|
120
120
|
def test_set_get
|
121
121
|
n = Netrc.read("data/sample.netrc")
|
122
122
|
n["m"] = "a", "b"
|
123
|
-
assert_equal(["a", "b"], n["m"]
|
123
|
+
assert_equal(["a", "b"], n["m"])
|
124
124
|
end
|
125
125
|
|
126
126
|
def test_add
|
@@ -157,7 +157,7 @@ class TestNetrc < Test::Unit::TestCase
|
|
157
157
|
n = Netrc.read("data/sample.netrc")
|
158
158
|
n.new_item_prefix = "# added\n"
|
159
159
|
n["x"] = "a", "b"
|
160
|
-
assert_equal(["a", "b"], n["x"]
|
160
|
+
assert_equal(["a", "b"], n["x"])
|
161
161
|
end
|
162
162
|
|
163
163
|
def test_get_missing
|
@@ -200,38 +200,6 @@ class TestNetrc < Test::Unit::TestCase
|
|
200
200
|
ENV["HOME"], nil_home = nil_home, ENV["HOME"]
|
201
201
|
end
|
202
202
|
|
203
|
-
def test_read_entry
|
204
|
-
entry = Netrc.read("data/sample.netrc")['m']
|
205
|
-
assert_equal 'l', entry.login
|
206
|
-
assert_equal 'p', entry.password
|
207
|
-
|
208
|
-
# hash-style
|
209
|
-
assert_equal 'l', entry[:login]
|
210
|
-
assert_equal 'p', entry[:password]
|
211
|
-
end
|
212
|
-
|
213
|
-
def test_write_entry
|
214
|
-
n = Netrc.read("data/sample.netrc")
|
215
|
-
entry = n['m']
|
216
|
-
entry.login = 'new_login'
|
217
|
-
entry.password = 'new_password'
|
218
|
-
n['m'] = entry
|
219
|
-
assert_equal(['new_login', 'new_password'], n['m'].to_a)
|
220
|
-
end
|
221
|
-
|
222
|
-
def test_entry_splat
|
223
|
-
e = Netrc::Entry.new("user", "pass")
|
224
|
-
user, pass = *e
|
225
|
-
assert_equal("user", user)
|
226
|
-
assert_equal("pass", pass)
|
227
|
-
end
|
228
|
-
|
229
|
-
def test_entry_implicit_splat
|
230
|
-
e = Netrc::Entry.new("user", "pass")
|
231
|
-
user, pass = e
|
232
|
-
assert_equal("user", user)
|
233
|
-
assert_equal("pass", pass)
|
234
|
-
end
|
235
203
|
|
236
204
|
def test_with_default
|
237
205
|
netrc = Netrc.read('data/sample_with_default.netrc')
|
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.7.
|
4
|
+
version: 0.7.9
|
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-10-
|
12
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: turn
|