idhja22 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Idhja22
2
- VERSION = "1.2.0"
2
+ VERSION = "2.0.0"
3
3
  end
data/lib/idhja22.rb CHANGED
@@ -8,17 +8,11 @@ require "idhja22/tree"
8
8
  require "idhja22/bayes"
9
9
 
10
10
  module Idhja22
11
- def self.default_config
12
- Configuration.for('default')
13
- end
14
-
15
- def self.configure(name)
16
- new_config = Configuration.for(name)
17
- @cached_config = new_config
11
+ def self.configure(&block)
12
+ @cached_config = Configuration.for('default', &block)
18
13
  end
19
14
 
20
15
  def self.config
21
- @cached_config ||= default_config
16
+ @cached_config ||= Configuration.for('default')
22
17
  end
23
-
24
18
  end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe Idhja22 do
4
+ describe '.configure' do
5
+ it 'should edit the default config' do
6
+ Idhja22.configure do
7
+ min_dataset_size 2
8
+ new_setting 42
9
+ end
10
+ Idhja22.config.new_setting.should == 42
11
+ Idhja22.config.min_dataset_size.should == 2
12
+ end
13
+ end
14
+ end
data/spec/spec_helper.rb CHANGED
@@ -9,11 +9,9 @@ $: << File.dirname(__FILE__) + '/../lib'
9
9
  require 'idhja22'
10
10
  require 'ruby-debug'
11
11
 
12
- Configuration.for('spec', Idhja22.config) {
12
+ Idhja22.configure do
13
13
  min_dataset_size 2
14
- }
15
-
16
- Idhja22.configure('spec')
14
+ end
17
15
 
18
16
  def data_dir
19
17
  File.dirname(__FILE__) + '/data/'
data/spec/version_spec.rb CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Idhja22 do
4
4
  describe 'VERSION' do
5
5
  it 'should be current version' do
6
- Idhja22::VERSION.should == '1.2.0'
6
+ Idhja22::VERSION.should == '2.0.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idhja22
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
12
+ date: 2012-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -157,6 +157,7 @@ files:
157
157
  - spec/data/spec_data.csv
158
158
  - spec/dataset/example_spec.rb
159
159
  - spec/dataset_spec.rb
160
+ - spec/idhja22_spec.rb
160
161
  - spec/node/decision_node_spec.rb
161
162
  - spec/node/leaf_node_spec.rb
162
163
  - spec/spec_helper.rb
@@ -176,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
177
  version: '0'
177
178
  segments:
178
179
  - 0
179
- hash: 144077394884408186
180
+ hash: -4074205080648422327
180
181
  required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  none: false
182
183
  requirements:
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
186
  version: '0'
186
187
  segments:
187
188
  - 0
188
- hash: 144077394884408186
189
+ hash: -4074205080648422327
189
190
  requirements: []
190
191
  rubyforge_project:
191
192
  rubygems_version: 1.8.24
@@ -200,6 +201,7 @@ test_files:
200
201
  - spec/data/spec_data.csv
201
202
  - spec/dataset/example_spec.rb
202
203
  - spec/dataset_spec.rb
204
+ - spec/idhja22_spec.rb
203
205
  - spec/node/decision_node_spec.rb
204
206
  - spec/node/leaf_node_spec.rb
205
207
  - spec/spec_helper.rb