ruby-nuggets 0.9.6.pre3 → 0.9.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e661023674b7ff0f06dd711df4d2c67aa7026230
4
- data.tar.gz: 727d8002a0c68c8dadf8237b240448fe882efa90
3
+ metadata.gz: 1c79a1a77d2228f3f9df348d2e8cba583886460e
4
+ data.tar.gz: f8c3d91368c878220707d74f5d4706b0f4e15555
5
5
  SHA512:
6
- metadata.gz: 59fd315cfa38d34aed7113e06281b2a956251cb6cf49b8ce07a36af341d48bac0d4d94a3e2a5bc0e0fa538397f18e3660b94c982c14a228075872600657f69b7
7
- data.tar.gz: e213af8417fae28b29f2f76a7b2a6d31cc47ecba82475436f0e75984174e8e2a0108e16b1325f28a43fc018d901997da259d69c179554df874a802b6f48ad2c8
6
+ metadata.gz: 735ce39fe3ee94b23ba088a914af65ca93b26758cec4bad78e812a21b152049ad9e788c130879d11bd3821d80d14a364c49c36e3f88d28512e12cbc37931bf9b
7
+ data.tar.gz: 36b4cebd589355673234b92198642602d9b8b36b329a1cfe4ed9b1ac63d1b3547732048b5a1e920b3e2fb02610540793979f98e2cc5b49f951a98714d81dad68
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ruby-nuggets version 0.9.5
5
+ This documentation refers to ruby-nuggets version 0.9.6
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  :summary => %q{Some extensions to the Ruby programming language.},
11
11
  :author => %q{Jens Wille},
12
12
  :email => %q{jens.wille@gmail.com},
13
- :license => %q{AGPL},
13
+ :license => %q{AGPL-3.0},
14
14
  :homepage => :blackwinter,
15
15
  :dependencies => %w[]
16
16
  }
@@ -76,7 +76,7 @@ module Nuggets
76
76
  # Call #to_a (or any Enumerable method) to work with the regression points.
77
77
  class IncrementalLinearRegression
78
78
 
79
- include Enumerable
79
+ include ::Enumerable
80
80
 
81
81
  def initialize(*ys)
82
82
  clear
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
- @key = options[:key]
88
+ def initialize(options = {}, &block)
89
+ self.key = options[:key]
90
90
 
91
- @rs = options[:rs] || DEFAULT_RS
92
- @fs = options[:fs] || DEFAULT_FS
93
- @vs = options[:vs] || DEFAULT_VS
94
- @nl = options[:nl] || DEFAULT_NL
95
- @le = options[:le] || DEFAULT_LE
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
- attr_reader :rs, :fs, :vs, :nl, :le, :key, :records
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 = 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 auto_id(n = 0)
116
+ def default_auto_id(n = 0)
110
117
  lambda { n += 1 }
111
118
  end
112
119
 
@@ -10,7 +10,7 @@ module Nuggets
10
10
 
11
11
  # Returns array representation.
12
12
  def to_a
13
- [MAJOR, MINOR, TINY] << 'pre3'
13
+ [MAJOR, MINOR, TINY]
14
14
  end
15
15
 
16
16
  # Short-cut for version string.
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.pre3
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-26 00:00:00.000000000 Z
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: 1.3.1
250
+ version: '0'
251
251
  requirements: []
252
252
  rubyforge_project:
253
253
  rubygems_version: 2.1.11