midos 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/README +1 -1
- data/lib/midos/reader.rb +14 -7
- data/lib/midos/version.rb +1 -1
- metadata +6 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef79a2c068ab89c33c044396d6df49dd63427fe8
|
4
|
+
data.tar.gz: 2d3dcfbfc0103915d72b7d98bf2d7ea09085f356
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dbbe596aef26fa2cd0cbd71b1c44bc6b8832537bf77adbe6f1dd7d9fc05b6884daf05eb77e1585253f0c75139208de63a1f2799313f74739f2dc8b7df88ce23
|
7
|
+
data.tar.gz: 58a1a871fcf95d2b8d3bdcd9d661919df44fb373f8964b58761d5c4849c25e132daa9dbd9f6e394cfba0c4f4d65c180f090fac05ab2118956084a3a8867ec212
|
data/ChangeLog
CHANGED
data/README
CHANGED
data/lib/midos/reader.rb
CHANGED
@@ -43,15 +43,21 @@ module Midos
|
|
43
43
|
file_method(:parse, 'r', *args, &block)
|
44
44
|
end
|
45
45
|
|
46
|
-
def transform(value, vs,
|
47
|
-
|
46
|
+
def transform(value, nl, vs, ovs = nil)
|
47
|
+
rnl, rvs = replacements_for(*[nl, ovs].compact)
|
48
48
|
|
49
49
|
value.gsub!(nl, "\n")
|
50
|
-
value.gsub!(
|
50
|
+
value.gsub!(rnl, nl)
|
51
51
|
|
52
52
|
!value.index(vs) ?
|
53
|
-
|
54
|
-
value.split(vs).each { |v|
|
53
|
+
replace!(value, rvs, ovs) || value :
|
54
|
+
value.split(vs).each { |v| replace!(v, rvs, ovs) }
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def replace!(value, rvs, ovs)
|
60
|
+
value.gsub!(rvs, ovs) if rvs
|
55
61
|
end
|
56
62
|
|
57
63
|
end
|
@@ -64,7 +70,8 @@ module Midos
|
|
64
70
|
end
|
65
71
|
|
66
72
|
def vs=(vs)
|
67
|
-
@vs = vs.is_a?(Regexp) ?
|
73
|
+
@vs = vs.is_a?(Regexp) ? (@ovs = nil; vs) :
|
74
|
+
%r{\s*#{Regexp.escape(@ovs = vs)}\s*}
|
68
75
|
end
|
69
76
|
|
70
77
|
def parse(io = io(), &block)
|
@@ -94,7 +101,7 @@ module Midos
|
|
94
101
|
private
|
95
102
|
|
96
103
|
def transform(value)
|
97
|
-
self.class.transform(value, vs,
|
104
|
+
self.class.transform(value, nl, vs, @ovs)
|
98
105
|
end
|
99
106
|
|
100
107
|
def amend_block(&block)
|
data/lib/midos/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nuggets
|
@@ -82,15 +82,13 @@ licenses:
|
|
82
82
|
metadata: {}
|
83
83
|
post_install_message: |2+
|
84
84
|
|
85
|
-
midos-0.1.
|
85
|
+
midos-0.1.1 [2015-06-11]:
|
86
86
|
|
87
|
-
*
|
88
|
-
* Added Gzip support to Midos.open_file.
|
89
|
-
* Added Midos.uniq and Midos.uniq_file.
|
87
|
+
* Fixed replacement of special characters in Midos::Reader.
|
90
88
|
|
91
89
|
rdoc_options:
|
92
90
|
- "--title"
|
93
|
-
- midos Application documentation (v0.1.
|
91
|
+
- midos Application documentation (v0.1.1)
|
94
92
|
- "--charset"
|
95
93
|
- UTF-8
|
96
94
|
- "--line-numbers"
|
@@ -111,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
109
|
version: '0'
|
112
110
|
requirements: []
|
113
111
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.4.
|
112
|
+
rubygems_version: 2.4.8
|
115
113
|
signing_key:
|
116
114
|
specification_version: 4
|
117
115
|
summary: A Ruby client for MIDOS databases.
|