ruby-nuggets 0.9.6.pre3 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +1 -1
- data/Rakefile +1 -1
- data/lib/nuggets/array/regression_mixin.rb +1 -1
- data/lib/nuggets/midos.rb +18 -11
- data/lib/nuggets/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c79a1a77d2228f3f9df348d2e8cba583886460e
|
4
|
+
data.tar.gz: f8c3d91368c878220707d74f5d4706b0f4e15555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735ce39fe3ee94b23ba088a914af65ca93b26758cec4bad78e812a21b152049ad9e788c130879d11bd3821d80d14a364c49c36e3f88d28512e12cbc37931bf9b
|
7
|
+
data.tar.gz: 36b4cebd589355673234b92198642602d9b8b36b329a1cfe4ed9b1ac63d1b3547732048b5a1e920b3e2fb02610540793979f98e2cc5b49f951a98714d81dad68
|
data/README
CHANGED
data/Rakefile
CHANGED
data/lib/nuggets/midos.rb
CHANGED
@@ -37,7 +37,7 @@ module Nuggets
|
|
37
37
|
DEFAULT_FS = ':'
|
38
38
|
|
39
39
|
# Value separator
|
40
|
-
DEFAULT_VS = '
|
40
|
+
DEFAULT_VS = '|'
|
41
41
|
|
42
42
|
# Line break indicator
|
43
43
|
DEFAULT_NL = '^'
|
@@ -85,28 +85,35 @@ module Nuggets
|
|
85
85
|
|
86
86
|
class Base
|
87
87
|
|
88
|
-
def initialize(options = {})
|
89
|
-
|
88
|
+
def initialize(options = {}, &block)
|
89
|
+
self.key = options[:key]
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
91
|
+
self.rs = options[:rs] || DEFAULT_RS
|
92
|
+
self.fs = options[:fs] || DEFAULT_FS
|
93
|
+
self.vs = options[:vs] || DEFAULT_VS
|
94
|
+
self.nl = options[:nl] || DEFAULT_NL
|
95
|
+
self.le = options[:le] || DEFAULT_LE
|
96
96
|
|
97
|
+
@auto_id_block = block
|
97
98
|
reset
|
98
99
|
end
|
99
100
|
|
100
|
-
|
101
|
+
attr_accessor :key, :rs, :fs, :nl, :le, :auto_id
|
102
|
+
|
103
|
+
attr_reader :vs, :records
|
104
|
+
|
105
|
+
def vs=(vs)
|
106
|
+
@vs = vs.is_a?(::Regexp) ? vs : %r{\s*#{::Regexp.escape(vs)}\s*}
|
107
|
+
end
|
101
108
|
|
102
109
|
def reset
|
103
110
|
@records = {}
|
104
|
-
@auto_id =
|
111
|
+
@auto_id = @auto_id_block ? @auto_id_block.call : default_auto_id
|
105
112
|
end
|
106
113
|
|
107
114
|
private
|
108
115
|
|
109
|
-
def
|
116
|
+
def default_auto_id(n = 0)
|
110
117
|
lambda { n += 1 }
|
111
118
|
end
|
112
119
|
|
data/lib/nuggets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-nuggets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.6
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Some extensions to the Ruby programming language.
|
14
14
|
email: jens.wille@gmail.com
|
@@ -224,16 +224,16 @@ files:
|
|
224
224
|
- ".rspec"
|
225
225
|
homepage: http://github.com/blackwinter/ruby-nuggets
|
226
226
|
licenses:
|
227
|
-
- AGPL
|
227
|
+
- AGPL-3.0
|
228
228
|
metadata: {}
|
229
229
|
post_install_message:
|
230
230
|
rdoc_options:
|
231
|
+
- "--title"
|
232
|
+
- ruby-nuggets Application documentation (v0.9.6)
|
231
233
|
- "--charset"
|
232
234
|
- UTF-8
|
233
235
|
- "--line-numbers"
|
234
236
|
- "--all"
|
235
|
-
- "--title"
|
236
|
-
- ruby-nuggets Application documentation (v0.9.6.pre3)
|
237
237
|
- "--main"
|
238
238
|
- README
|
239
239
|
require_paths:
|
@@ -245,9 +245,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
245
245
|
version: '0'
|
246
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
|
-
- - "
|
248
|
+
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
250
|
+
version: '0'
|
251
251
|
requirements: []
|
252
252
|
rubyforge_project:
|
253
253
|
rubygems_version: 2.1.11
|