gitdis 0.1.0.1 → 0.1.1.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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitdis.rb +12 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 122d1a3f1436e31c123e42fdfb6e9f146f196004
|
4
|
+
data.tar.gz: 453ba3ef4a508206ef3b71e228eca18e7c534e66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0729411c0f2fe5519fffe64f965c2f449e9b4afc60fc3970c33215b3561f490abd1c2c992629c09b8947471c59ad90974e6eaa4e98d35cff5003d5f86285df8
|
7
|
+
data.tar.gz: e077368e323bb720bd3040506853e3994a81f96b66971b76bfd0f6ef02e1aba199bddc035aada22667aef7b4e8aa8b4dffd54a42e74c316d7869909d494283cc
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1.1
|
data/lib/gitdis.rb
CHANGED
@@ -97,23 +97,25 @@ class GitDis
|
|
97
97
|
when 1 then self.update_redis(base_key, File.read(files.first))
|
98
98
|
else
|
99
99
|
puts "concatenating #{files.length} files"
|
100
|
-
result = ''
|
101
100
|
sep = "\n"
|
102
|
-
|
103
|
-
|
104
|
-
|
101
|
+
|
102
|
+
payload = files.map { |fname|
|
103
|
+
contents = File.read(fname)
|
104
|
+
if contents and !contents.empty?
|
105
105
|
# scan for carriage returns (Microsoft text format)
|
106
|
-
sep = "\r\n" if sep == "\n" and
|
107
|
-
|
108
|
-
result << s
|
106
|
+
sep = "\r\n" if sep == "\n" and contents.include?("\r")
|
107
|
+
contents
|
109
108
|
# debugging
|
110
|
-
elsif
|
109
|
+
elsif contents
|
111
110
|
puts "#{fname} is empty"
|
111
|
+
nil
|
112
112
|
else
|
113
113
|
puts "File.read(#{fname}) returned false/nil"
|
114
|
+
nil
|
114
115
|
end
|
115
|
-
}
|
116
|
-
|
116
|
+
}.compact.join("---#{sep}")
|
117
|
+
|
118
|
+
self.update_redis(base_key, payload)
|
117
119
|
end
|
118
120
|
end
|
119
121
|
end
|