dbd 0.0.10 → 0.0.11

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: f0ecabc694d7fb96ca29461e84ec65065d15e3ec
4
- data.tar.gz: b31a6c1b351ddcfde4e90d10589526fb7e15bc78
3
+ metadata.gz: 4738e212a553b87a79d494de3a1825690de3af64
4
+ data.tar.gz: f511eb469bd7d3705bb921bab74fa107e9852de5
5
5
  SHA512:
6
- metadata.gz: 9b5aac83bb9c2ae36d95121aec6570513821daf56372af99713930ab44e11e19dc585a2d730d35710c3614ca3c62e5f18fd1c3a4cfd4bff01e1e21bd74f2a7cb
7
- data.tar.gz: 161310b4ba873d17a52707da9ae58f6b1c40a5c4163739f512410ae0c1445ecca818d88a0f7362008d8eb392fa103ae7ff0dbf883265dd838913801f315fe767
6
+ metadata.gz: 8b25ea06edaed016cb0826836b8dbc3555df29ffece9f2ad534d00fb02bc6564c407ddbd5a01761fd843d516a0e29a3f6d2e0ea91f7e4529925bded33684494a
7
+ data.tar.gz: 11c13f6dcde106d7d67018b6f07791b42165d62a605c9f3aee08c8483ead0f9b4ff6090252c19390629380e1fbdd159d95861e28ec4da6401992351aa9e10d4a
data/HISTORY.txt CHANGED
@@ -61,3 +61,9 @@
61
61
  (removing the dependency injection violations from the Fact class)
62
62
  * work-arounds for JRuby nanosecond rounding issues (#1)
63
63
  * renamed Factories to TestFactories
64
+
65
+ 0.0.11 (8 July 2013)
66
+ ======
67
+
68
+ * object in Fact#short now truncated to 80 bytes
69
+ * using a utf-8 safe truncation (from ruby_peter_v)
data/dbd.gemspec CHANGED
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'yard'
27
27
  spec.add_runtime_dependency 'neography'
28
28
  spec.add_runtime_dependency 'rdf'
29
- spec.add_runtime_dependency 'ruby_peter_v', '>= 0.0.9'
29
+ spec.add_runtime_dependency 'ruby_peter_v', '>= 0.0.11'
30
30
  end
data/lib/dbd/fact.rb CHANGED
@@ -170,8 +170,8 @@ module Dbd
170
170
  def short
171
171
  "#{provenance_subject_short} : " \
172
172
  "#{subject.to_s[0...8]} : " \
173
- "#{predicate.to_s.ljust(24, ' ')[0...24]} : " \
174
- "#{object.to_s[0..60].gsub(/\n/, '_')}"
173
+ "#{predicate.to_s.ljust(24, ' ').truncate_utf8(24)} : " \
174
+ "#{object.to_s.truncate_utf8(80).gsub(/\n/, '_')}"
175
175
  end
176
176
 
177
177
  ##
data/lib/dbd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dbd
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -9,6 +9,7 @@ module Dbd
9
9
  let(:fact_1) { TestFactories::Fact.fact_1(provenance_subject) }
10
10
  let(:fact_2_with_subject) { TestFactories::Fact.fact_2_with_subject(provenance_subject) }
11
11
  let(:fact_with_newline) { TestFactories::Fact.fact_with_newline(provenance_subject) }
12
+ let(:fact_with_special_chars) { TestFactories::Fact.fact_with_special_chars(provenance_subject) }
12
13
  let(:full_fact) { TestFactories::Fact.full_fact }
13
14
 
14
15
  describe '.factory' do
@@ -52,6 +53,28 @@ module Dbd
52
53
  fact_1.short.should match(/^[0-9a-f]{8} : [0-9a-f]{8} : http:\/\/example\.org\/test\/ : Gandhi$/)
53
54
  end
54
55
 
56
+ describe 'truncates the object to 80 bytes' do
57
+
58
+ before(:each) { fact_with_special_chars.subject = subject }
59
+
60
+ it "object is 80 bytes long" do
61
+ fact_with_special_chars.short.split(' : ')[3].size.should == 80
62
+ end
63
+
64
+ it "object matches the first part of the string" do
65
+ fact_with_special_chars.short.should match(/^[0-9a-f]{8} : [0-9a-f]{8} : http:\/\/example\.org\/test\/ : A long story with a newline_really with a comma, a double quote \" and a non-ASCI$/)
66
+ end
67
+ end
68
+
69
+ describe 'forces the predicate to 24 bytes' do
70
+
71
+ before(:each) { fact_with_special_chars.subject = subject }
72
+
73
+ it "predicate is 24 bytes long" do
74
+ fact_with_special_chars.short.split(' : ')[2].size.should == 24
75
+ end
76
+ end
77
+
55
78
  it 'for a fact with a newline replaces it with a underscore' do
56
79
  fact_with_newline.subject = subject
57
80
  fact_with_newline.short.should match(/^[0-9a-f]{8} : [0-9a-f]{8} : http:\/\/example\.org\/test\/ : A long story_really.$/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenabeele
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-07 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - '>='
130
130
  - !ruby/object:Gem::Version
131
- version: 0.0.9
131
+ version: 0.0.11
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '>='
137
137
  - !ruby/object:Gem::Version
138
- version: 0.0.9
138
+ version: 0.0.11
139
139
  description: A data store that (almost) never forgets
140
140
  email:
141
141
  - peter@vandenabeele.com