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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc1114593359377788c5becae5330809e6d883b7
4
- data.tar.gz: d04ec2c46112c7f0f722bedf1aeca80bbbbcedd9
3
+ metadata.gz: ef79a2c068ab89c33c044396d6df49dd63427fe8
4
+ data.tar.gz: 2d3dcfbfc0103915d72b7d98bf2d7ea09085f356
5
5
  SHA512:
6
- metadata.gz: a923f3a6f6272f1c8d863f3bc9d232513481d7be3767abc9306232041614a8d61567a2bb93d72c97569f7f3dadcd02f0f5abae715c0519a4a680c71e70ef013f
7
- data.tar.gz: 2c6342a4711a6a23c5894de3c1abad1a16fbc7635f2dfb7b77499f8028c7ca8892a6ede0f8a0645ab8103ab3a9662807cd08c6e2da593054fb6d23746e54f19a
6
+ metadata.gz: 7dbbe596aef26fa2cd0cbd71b1c44bc6b8832537bf77adbe6f1dd7d9fc05b6884daf05eb77e1585253f0c75139208de63a1f2799313f74739f2dc8b7df88ce23
7
+ data.tar.gz: 58a1a871fcf95d2b8d3bdcd9d661919df44fb373f8964b58761d5c4849c25e132daa9dbd9f6e394cfba0c4f4d65c180f090fac05ab2118956084a3a8867ec212
data/ChangeLog CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  = Revision history for midos
4
4
 
5
+ == 0.1.1 [2015-06-11]
6
+
7
+ * Fixed replacement of special characters in Midos::Reader.
8
+
5
9
  == 0.1.0 [2015-04-28]
6
10
 
7
11
  * Percent-encode special characters <tt>^</tt> and <tt>|</tt>.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to midos version 0.1.0
5
+ This documentation refers to midos version 0.1.1
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -43,15 +43,21 @@ module Midos
43
43
  file_method(:parse, 'r', *args, &block)
44
44
  end
45
45
 
46
- def transform(value, vs, nl)
47
- rvs, rnl = replacements_for(vs, nl)
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!(rvs, nl)
50
+ value.gsub!(rnl, nl)
51
51
 
52
52
  !value.index(vs) ?
53
- value.gsub!(rnl, vs) || value :
54
- value.split(vs).each { |v| v.gsub!(rnl, vs) }
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) ? vs : %r{\s*#{Regexp.escape(vs)}\s*}
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, nl)
104
+ self.class.transform(value, nl, vs, @ovs)
98
105
  end
99
106
 
100
107
  def amend_block(&block)
@@ -4,7 +4,7 @@ module Midos
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- TINY = 0
7
+ TINY = 1
8
8
 
9
9
  class << self
10
10
 
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.0
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-04-28 00:00:00.000000000 Z
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.0 [2015-04-28]:
85
+ midos-0.1.1 [2015-06-11]:
86
86
 
87
- * Percent-encode special characters <tt>^</tt> and <tt>|</tt>.
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.0)
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.6
112
+ rubygems_version: 2.4.8
115
113
  signing_key:
116
114
  specification_version: 4
117
115
  summary: A Ruby client for MIDOS databases.