ganapati 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ganapati/client.rb +16 -0
- metadata +4 -4
data/lib/ganapati/client.rb
CHANGED
@@ -52,6 +52,22 @@ module Ganapati
|
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
55
|
+
def readlines(path, sep="\n")
|
56
|
+
lastbit = ""
|
57
|
+
readchunks(path) { |chunk|
|
58
|
+
parts = chunk.split(sep)
|
59
|
+
if parts.length == 0
|
60
|
+
yield lastbit if lastbit != ""
|
61
|
+
elsif parts.length == 1
|
62
|
+
yield lastbit + parts.first
|
63
|
+
else
|
64
|
+
yield lastbit + parts.first
|
65
|
+
parts.slice(1, parts.length).each { |p| yield p }
|
66
|
+
end
|
67
|
+
lastbit = ""
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
55
71
|
# for writing to a new file
|
56
72
|
def create(path, &block)
|
57
73
|
file_handle :create, path, &block
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ganapati
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Muller
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-02-10 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|