gitcredential 0.0.2 → 0.1.0
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.
- checksums.yaml +8 -8
- data/.gitignore +11 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/gitcredential.rb +20 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2EzOTc3OGI4MWU2NDA4MjY1MjQ3M2UyNjY2NDI3NTg2ZGYyZjcxMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjA3ZTk1N2EyZjgxY2JlMzZhYWJjZDk2Nzk0MDIzMGE1NDlkZDdhYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzZjODkyZGIwYWEzNmFlY2NjZjdmMTk0MzhmMWExMmFjMjk0ZmE4ZTJmNWMy
|
10
|
+
M2RmMDUzNTJhZjkxNzc5YjlmZGFlZGQ4YWRkMzk3Y2Y0ODZmODMzYWI3YWQx
|
11
|
+
NGQ2MmNmYTYzNjlkOWUyNjUwOGZmNjhmODkxODBjNjI3YTIzNDk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTc1ZmJmZTdlMGM0MWQ0ZjU4NDBkZTQyZWY2Y2Y2MjE0YjMwYzFjNjhkYjgx
|
14
|
+
MjUxNGNmMGQ2ZGJhNTU5NmUzNDg1OTAzMDk0MGI4NmUyNTU2MjVjNzY0YmVm
|
15
|
+
YjMwNjQ2ODllYjBmOTViNTNlNDQ4MDZmMjA1NGYwZmViYjIxMGQ=
|
data/.gitignore
ADDED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/gitcredential.rb
CHANGED
@@ -18,6 +18,23 @@ class Gitcredential
|
|
18
18
|
@backend = args[:backend] || Gitcredential.default_backend
|
19
19
|
|
20
20
|
raise Exception "no such backend" unless @valid_backends.include?(@backend)
|
21
|
+
|
22
|
+
begin
|
23
|
+
`#{cmd} 2>/dev/null`
|
24
|
+
rescue Errno::ENOENT
|
25
|
+
["/usr/local/lib/git-core", "/usr/local/libexec/git-core",
|
26
|
+
"/usr/lib/git-core", "/usr/libexec/git-core",
|
27
|
+
"/Library/Developer/CommandLineTools/usr/libexec/git-core"].each do |dir|
|
28
|
+
found=false
|
29
|
+
if File.exists? "#{dir}/#{cmd}"
|
30
|
+
ENV["PATH"] += ":#{dir}"
|
31
|
+
found=true
|
32
|
+
break
|
33
|
+
end
|
34
|
+
raise "can not find backend helper" unless found
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
21
38
|
end
|
22
39
|
|
23
40
|
def cmd
|
@@ -40,7 +57,7 @@ __EOS
|
|
40
57
|
|
41
58
|
def get u
|
42
59
|
out = nil
|
43
|
-
IO.popen(
|
60
|
+
IO.popen("#{cmd} get", mode='r+') { |fd|
|
44
61
|
fd.write(get_payload u)
|
45
62
|
fd.close_write
|
46
63
|
out = fd.read
|
@@ -51,7 +68,7 @@ __EOS
|
|
51
68
|
|
52
69
|
def set u
|
53
70
|
unset(u) unless get(u).nil?
|
54
|
-
IO.popen(
|
71
|
+
IO.popen("#{cmd} store", mode='r+') { |fd|
|
55
72
|
fd.write(set_payload u)
|
56
73
|
fd.close_write
|
57
74
|
}
|
@@ -62,7 +79,7 @@ __EOS
|
|
62
79
|
def unset u
|
63
80
|
return true if get(u).nil?
|
64
81
|
|
65
|
-
IO.popen(
|
82
|
+
IO.popen("#{cmd} erase", mode='r+') { |fd|
|
66
83
|
fd.write(get_payload u)
|
67
84
|
fd.close_write
|
68
85
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitcredential
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Maher
|
@@ -59,6 +59,7 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- .gitignore
|
62
63
|
- Gemfile
|
63
64
|
- Gemfile.lock
|
64
65
|
- README.md
|