gitconfigio 1.0.0 → 1.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.
- data/README.md +20 -1
- data/lib/gitconfigio.rb +10 -0
- data/lib/gitconfigio/version.rb +1 -1
- data/spec/gitconfigio_spec.rb +4 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://travis-ci.org/mocchit/gitconfigio)
|
4
4
|
[](https://codeclimate.com/github/mocchit/gitconfigio)
|
5
|
-
|
5
|
+
[](http://badge.fury.io/rb/gitconfigio)
|
6
6
|
#### test:
|
7
7
|
|
8
8
|
[](https://travis-ci.org/mocchit/gitconfigio)
|
@@ -38,7 +38,26 @@ conf['color'] = color.merge conf['color'] || {}
|
|
38
38
|
# dump file
|
39
39
|
GitConfigIO::dump('~/.gitconfig.bak',conf)
|
40
40
|
```
|
41
|
+
otherwise
|
42
|
+
```
|
43
|
+
#!/bin/usr/env ruby
|
41
44
|
|
45
|
+
require 'gitconfigio'
|
46
|
+
|
47
|
+
GitConfigIO::merge!('~/.gitconfig',<<-EOS)
|
48
|
+
[color]
|
49
|
+
ui = true
|
50
|
+
diff = ture
|
51
|
+
EOS
|
52
|
+
|
53
|
+
# before:
|
54
|
+
# [color]
|
55
|
+
# ui = true
|
56
|
+
# after:
|
57
|
+
# [color]
|
58
|
+
# ui = true
|
59
|
+
# diff = true
|
60
|
+
```
|
42
61
|
|
43
62
|
## Contributing
|
44
63
|
|
data/lib/gitconfigio.rb
CHANGED
@@ -63,4 +63,14 @@ module GitConfigIO
|
|
63
63
|
dump(path,merge(path,source))
|
64
64
|
end
|
65
65
|
|
66
|
+
def self.delete(source,subject)
|
67
|
+
source = source.class == String ? parse(source) : source.dup
|
68
|
+
source.delete(subject)
|
69
|
+
generate(source)
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.delete!(path,subject)
|
73
|
+
config = load(path)
|
74
|
+
dump(path,delete(config,subject))
|
75
|
+
end
|
66
76
|
end
|
data/lib/gitconfigio/version.rb
CHANGED
data/spec/gitconfigio_spec.rb
CHANGED