sequitur 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjQ5ZDcxYTMzZGJlOWUzOTg1YmYxMThiMTAxYjk5YjZmZjkyY2FjMA==
4
+ N2UxOWM5ZGY4OGM2YzY1NzRiOWU5OTRlNjVhOTJhNGJmM2FiZTE0Nw==
5
5
  data.tar.gz: !binary |-
6
- ZGIyODgxMjNhMmRiNGUyMjZlMTMzYjQwOGRjMjc3YzYyMTYzYjNmZQ==
6
+ ZGYzMTZhNjIwMTRhMWNmYTNiMWUyOTdkMTFkMjU0NTU2YmE0OWU4Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWFmNTRlN2NkZjRhNjVlOTU0MTlmZjZjNjllMDZjY2M4NWNiNWQ3NzQ0ZGMz
10
- MjBkOWQzNjJjN2JiODExNDc2OTFmNjIyMGEyY2VkMDdiNDQyZjdiZTFjNTgw
11
- NGE5NmVlZTEwMTkzNjU4ZGI2MjA5MGY3YTVhMjM2ZDcyZjhlMzk=
9
+ MTdkNDI3MDMyMmRlOTNlOTViOGQ4ODY3YzdkMjY4MDJlNWJjNGQxZTllMTgx
10
+ MmIzZjA3MGVlNzRiNDU2NmJlYjFlNTZiYTlmOGE0YjFmYzY3NDYxOTk1Mzcy
11
+ YWYwMjljMjdkMmE0MGIzNjMyZThiYzJhMjA4NTA5ZDEwY2RkNDI=
12
12
  data.tar.gz: !binary |-
13
- ZjUzNWVlNTQ1ODI0NDkyMGUxOWY4NDIwYWIzNmJjNTEzOTgzZDE3YmRmMTE3
14
- NjM1Mzc0Mzk5YmQ1MDdhMzFlZDc2YzVkYjc2MmY4ZWEwZWY0YjY1ZTdlYmFi
15
- ZGJjODhmYzBhNGU2Y2IxZGZlODZlODNhNTg2NzU1YTgwNmQ5OTk=
13
+ NTNmN2M5NTUyMjg2MTEyNDNhMjk2NWVmNDFiYmU0ZmVmM2E5NGIwZjM3MDRk
14
+ NjYwZTlhMWYyZjYzMjNiNzdlZWQyNmUwMzY2YTMxZTE0YjAwNDU1YmExNGU0
15
+ ODAzNjgzNzMyYzA5YzVmMmY2MjAxMTZiNWJkNTg1MzdiNzU4MjA=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 0.0.13 / 2014-08-24
2
+ * [CHANGE] Test coverage for all classes but SequiturGrammar is 100%
3
+
1
4
  ### 0.0.12 / 2014-08-24
2
5
  * [CHANGE] Significant internal refactoring.
3
6
  * [CHANGE] Method `ObjectSpace::id2ref` is no more used => one obstacle to JRuby porting is removed.
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Sequitur # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.0.12'
6
+ Version = '0.0.13'
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = 'Ruby implementation of the Sequitur algorithm'
@@ -10,7 +10,7 @@ class DynamicGrammar
10
10
  attr_reader(:productions)
11
11
 
12
12
  # nodoc Trace the execution of the algorithm.
13
- attr(:trace, true)
13
+ attr(:trace)
14
14
 
15
15
 
16
16
  # Constructor.
@@ -119,8 +119,7 @@ class Production
119
119
  rhs_text = rhs.map do |elem|
120
120
  case elem
121
121
  when String then "'#{elem}'"
122
- when Production then "#{elem.object_id}"
123
- else elem.to_s
122
+ else elem.to_s
124
123
  end
125
124
  end
126
125
 
@@ -69,6 +69,12 @@ describe ProductionRef do
69
69
  expect(target.refcount).to eq(0)
70
70
  expect(another_target.refcount).to eq(1)
71
71
  end
72
+
73
+ it 'should complain when binding to something else than production' do
74
+ subject.bind_to(target)
75
+ msg = "Illegal production type String"
76
+ expect {subject.bind_to('WRONG') }.to raise_error(StandardError, msg)
77
+ end
72
78
 
73
79
  it 'should compare to other production (reference)' do
74
80
  same = ProductionRef.new(target)
@@ -43,6 +43,24 @@ describe Production do
43
43
  expect(subject.last_digram).to be_nil
44
44
  end
45
45
  end # context
46
+
47
+ context 'Provided services:' do
48
+
49
+ it 'should compare to another production' do
50
+ expect(p_a).to eq(p_a)
51
+ expect(p_a).not_to eq(p_bc)
52
+ end
53
+
54
+ it 'should compare to a production reference' do
55
+ ref_a = ProductionRef.new(p_a)
56
+ expect(p_a).to eq(ref_a)
57
+ expect(p_bc).not_to eq(ref_a)
58
+
59
+ ref_bc = ProductionRef.new(p_bc)
60
+ expect(p_a).not_to eq(ref_bc)
61
+ expect(p_bc).to eq(ref_bc)
62
+ end
63
+ end # context
46
64
 
47
65
  context 'Knowing its rhs:' do
48
66
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequitur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-06 00:00:00.000000000 Z
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake