jan 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: 3f8becc9d54183c8d1cf62d1b6d9a7bdef63a84a3665aa2770745d58c3fb8f67
4
- data.tar.gz: 5db39280c3810f914d61e6f3a656801e7aa38f1f028bdec7fa4417901b396dbb
3
+ metadata.gz: e0effbb542c76db5c76ab38d7edc9a95e56aa47985b7d3f481aa4799629e4e02
4
+ data.tar.gz: 57c8f87ea36fe989cae817baa2d04981c28e723a838a848ea1672f35a24c8480
5
5
  SHA512:
6
- metadata.gz: 9074880acb2b9b6a23e64534a77d0029df53f3c3c0f791d6b73ba18874ab1aff4c3395fe1897576b7e7f8bf20920097480a0f32f23c0925db49dfb81186c5f7e
7
- data.tar.gz: 5cd5c301d286fc08375da7521f91f9ac6935c267cbe74a7b32efacfd82fb7a29604cb78e946b9a57cddcb89cee7943948f7252cb8e77cfc216c3d0383c4411a0
6
+ metadata.gz: cdb58db78040e27e525980eb5ea32c30cb38f3f31f60dedb87c5f57f39b5bd0acc2fcd9431a60bbd4566969c199c0bed2c8b08fc2ac3a3c1b57e47ad37105e63
7
+ data.tar.gz: 4efe19db1d9cacbea44eb314096e45d08f0f5d537104f8a0964153f554c4077f022e0a400385bac4f3561944f32045b6857acc4d8951b5d048f15297949f015d
data/jan.gemspec CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
+ spec.add_runtime_dependency 'builder'
21
+
20
22
  spec.add_development_dependency 'bundler', '~> 2.0'
21
23
  spec.add_development_dependency 'rake', '~> 12.3'
22
24
  spec.add_development_dependency 'rspec', '~> 3.8'
@@ -0,0 +1,15 @@
1
+ require 'jan/symbol/band'
2
+
3
+ module Jan
4
+ class Symbol
5
+ class Band
6
+ class Bar < self
7
+ # @param width [Integer]
8
+ # @param color [String]
9
+ def initialize(width, color: 'black')
10
+ super(width, color: color)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'jan/symbol/band'
2
+
3
+ module Jan
4
+ class Symbol
5
+ class Band
6
+ class Space < self
7
+ # @param width [Integer]
8
+ # @param color [String]
9
+ def initialize(width, color: 'white')
10
+ super(width, color: color)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ require 'jan/symbol/band/bar'
2
+ require 'jan/symbol/band/space'
3
+
4
+ module Jan
5
+ class Symbol
6
+ class Band
7
+ # @param width [Integer]
8
+ # @param color [String]
9
+ def initialize(width, color:)
10
+ @width = width
11
+ @color = color
12
+ end
13
+
14
+ attr_reader :width, :color
15
+
16
+ # @param other [Jan::Symbol::Band]
17
+ # @return [boolean]
18
+ def ==(other)
19
+ self.width == other.width && self.color == other.color
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ module Jan
2
+ class Symbol
3
+ class BandPattern
4
+ class CenterGuardPattern < self
5
+ # @return [Array<Band>]
6
+ def bands
7
+ [
8
+ Band::Space.new(1),
9
+ Band::Bar.new(1),
10
+ Band::Space.new(1),
11
+ Band::Bar.new(1),
12
+ Band::Space.new(1)
13
+ ]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ require 'jan/symbol/band'
2
+
3
+ module Jan
4
+ class Symbol
5
+ class BandPattern
6
+ class LeftQuietZone < self
7
+ # @return [Array<Band>]
8
+ def bands
9
+ [
10
+ Band::Space.new(11)
11
+ ]
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Jan
2
+ class Symbol
3
+ class BandPattern
4
+ class NormalGuardPattern < self
5
+ # @return [Array<Band>]
6
+ def bands
7
+ [
8
+ Band::Bar.new(1),
9
+ Band::Space.new(1),
10
+ Band::Bar.new(1)
11
+ ]
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module Jan
2
+ class Symbol
3
+ class BandPattern
4
+ class RightQuietZone < self
5
+ # @return [Array<Band>]
6
+ def bands
7
+ [
8
+ Band::Space.new(7)
9
+ ]
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,54 @@
1
+ module Jan
2
+ class Symbol
3
+ class BandPattern
4
+ class SymbolCharacter < self
5
+ # @param name [String]
6
+ def initialize(name)
7
+ unless name.match?(/\A[ABC]\d\z/)
8
+ raise ArgumentError
9
+ end
10
+
11
+ @name = name
12
+ end
13
+
14
+ # @return [Array<Jan::Symbol::Band>]
15
+ def bands
16
+ set_name, digit = @name.split('')
17
+
18
+ case set_name
19
+ when 'A'
20
+ stripe_pattern = [Band::Space, Band::Bar, Band::Space, Band::Bar]
21
+ width_arr = width_array(digit)
22
+ when 'B'
23
+ stripe_pattern = [Band::Space, Band::Bar, Band::Space, Band::Bar]
24
+ width_arr = width_array(digit).reverse
25
+ when 'C'
26
+ stripe_pattern = [Band::Bar, Band::Space, Band::Bar, Band::Space]
27
+ width_arr = width_array(digit)
28
+ end
29
+
30
+ stripe_pattern.zip(width_arr).map { |klass, width|
31
+ klass.new(width)
32
+ }
33
+ end
34
+
35
+ private
36
+
37
+ def width_array(digit)
38
+ case digit
39
+ when '0' then [3, 2, 1, 1]
40
+ when '1' then [2, 2, 2, 1]
41
+ when '2' then [2, 1, 2, 2]
42
+ when '3' then [1, 4, 1, 1]
43
+ when '4' then [1, 1, 3, 2]
44
+ when '5' then [1, 2, 3, 1]
45
+ when '6' then [1, 1, 1, 4]
46
+ when '7' then [1, 3, 1, 2]
47
+ when '8' then [1, 2, 1, 3]
48
+ when '9' then [3, 1, 1, 2]
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,16 @@
1
+ require 'jan/symbol/band_pattern/left_quiet_zone'
2
+ require 'jan/symbol/band_pattern/right_quiet_zone'
3
+ require 'jan/symbol/band_pattern/normal_guard_pattern'
4
+ require 'jan/symbol/band_pattern/center_guard_pattern'
5
+ require 'jan/symbol/band_pattern/symbol_character'
6
+
7
+ module Jan
8
+ class Symbol
9
+ class BandPattern
10
+ # @return [Array<Band>]
11
+ def bands
12
+ raise NotImplementedError
13
+ end
14
+ end
15
+ end
16
+ end
data/lib/jan/symbol.rb ADDED
@@ -0,0 +1,97 @@
1
+ require 'builder'
2
+
3
+ require 'jan/symbol/band_pattern'
4
+ require 'jan/symbol/band'
5
+
6
+ module Jan
7
+ class Symbol
8
+ # @param code [String]
9
+ def initialize(code)
10
+ @code = code
11
+ end
12
+
13
+ # @return [Array<Jan::Symbol::BandPattern>]
14
+ def band_patterns
15
+ [
16
+ BandPattern::LeftQuietZone.new,
17
+ BandPattern::NormalGuardPattern.new
18
+ ] + left_symbol_characters + [
19
+ BandPattern::CenterGuardPattern.new,
20
+ ] + right_symbol_characters + [
21
+ BandPattern::NormalGuardPattern.new,
22
+ BandPattern::RightQuietZone.new
23
+ ]
24
+ end
25
+
26
+ # @return [Array<String>]
27
+ def codepoints
28
+ additional_digit, *digits = @code.each_char.to_a
29
+ variable_parity_encodation_sequence(additional_digit).zip(digits).map(&:join)
30
+ end
31
+
32
+ # EXPERIMENTAL
33
+ #
34
+ # @return [String]
35
+ def svg
36
+ x = 0
37
+ height = 60
38
+
39
+ builder = Builder::XmlMarkup.new(indent: 2)
40
+ builder.instruct!(:xml, version: '1.0', encoding: 'UTF-8')
41
+ builder.svg(xmlns: 'http://www.w3.org/2000/svg', width: 113, height: height) do |svg|
42
+ svg.rect(x: 0, y: 0, width: 113, height: 60, fill: 'white')
43
+ band_patterns.each do |band_pattern|
44
+ svg.g(class: band_pattern.class.name.split('::').last) do |group|
45
+ band_pattern.bands.each do |band|
46
+ group.rect(x: x, y: 0, width: band.width, height: height, fill: band.color)
47
+ x += band.width
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ private
55
+
56
+ # @return [Array<Jan::Symbol::BandPattern::SymbolCharacter>]
57
+ def left_symbol_characters
58
+ codepoints[0..5].map { |codepoint|
59
+ BandPattern::SymbolCharacter.new(codepoint)
60
+ }
61
+ end
62
+
63
+ # @return [Array<Jan::Symbol::BandPattern::SymbolCharacter>]
64
+ def right_symbol_characters
65
+ codepoints[6..11].map { |codepoint|
66
+ BandPattern::SymbolCharacter.new(codepoint)
67
+ }
68
+ end
69
+
70
+ # @param digit [String]
71
+ # @return [Array<String>]
72
+ def variable_parity_encodation_sequence(digit)
73
+ case digit
74
+ when '0'
75
+ %w[A A A A A A C C C C C C]
76
+ when '1'
77
+ %w[A A B A B B C C C C C C]
78
+ when '2'
79
+ %w[A A B B A B C C C C C C]
80
+ when '3'
81
+ %w[A A B B B A C C C C C C]
82
+ when '4'
83
+ %w[A B A A B B C C C C C C]
84
+ when '5'
85
+ %w[A B B A A B C C C C C C]
86
+ when '6'
87
+ %w[A B B B A A C C C C C C]
88
+ when '7'
89
+ %w[A B A B A B C C C C C C]
90
+ when '8'
91
+ %w[A B A B B A C C C C C C]
92
+ when '9'
93
+ %w[A B B A B A C C C C C C]
94
+ end
95
+ end
96
+ end
97
+ end
data/lib/jan/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jan
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
data/lib/jan.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'jan/code'
2
+ require 'jan/symbol'
2
3
  require 'jan/random'
3
4
  require 'jan/version'
4
5
 
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::Band::Bar do
4
+ describe 'initializer' do
5
+ it 'receives width' do
6
+ bar = described_class.new(1)
7
+ expect(bar).to be_an_instance_of(described_class)
8
+ expect(bar.color).to eq 'black'
9
+ end
10
+
11
+ it 'receives width and color' do
12
+ bar = described_class.new(1, color: 'gray')
13
+ expect(bar).to be_an_instance_of(described_class)
14
+ expect(bar.color).to eq 'gray'
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::Band::Space do
4
+ describe 'initializer' do
5
+ it 'receives width' do
6
+ bar = described_class.new(1)
7
+ expect(bar).to be_an_instance_of(described_class)
8
+ expect(bar.color).to eq 'white'
9
+ end
10
+
11
+ it 'receives width and color' do
12
+ bar = described_class.new(1, color: 'gray')
13
+ expect(bar).to be_an_instance_of(described_class)
14
+ expect(bar.color).to eq 'gray'
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::BandPattern::CenterGuardPattern do
4
+ let(:center_guard_pattern) { described_class.new }
5
+ let(:bar) { Jan::Symbol::Band::Bar }
6
+ let(:space) { Jan::Symbol::Band::Space }
7
+
8
+ describe '#bands' do
9
+ it { expect(center_guard_pattern.bands).to eq [space.new(1), bar.new(1), space.new(1), bar.new(1), space.new(1)] }
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::BandPattern::LeftQuietZone do
4
+ let(:left_quiet_zone) { described_class.new }
5
+ let(:bar) { Jan::Symbol::Band::Bar }
6
+ let(:space) { Jan::Symbol::Band::Space }
7
+
8
+ describe '#bands' do
9
+ it { expect(left_quiet_zone.bands).to eq [space.new(11)] }
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::BandPattern::NormalGuardPattern do
4
+ let(:normal_guard_pattern) { described_class.new }
5
+ let(:bar) { Jan::Symbol::Band::Bar }
6
+ let(:space) { Jan::Symbol::Band::Space }
7
+
8
+ describe '#bands' do
9
+ it { expect(normal_guard_pattern.bands).to eq [bar.new(1), space.new(1), bar.new(1)] }
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::BandPattern::RightQuietZone do
4
+ let(:right_quiet_zone) { described_class.new }
5
+ let(:bar) { Jan::Symbol::Band::Bar }
6
+ let(:space) { Jan::Symbol::Band::Space }
7
+
8
+ describe '#bands' do
9
+ it { expect(right_quiet_zone.bands).to eq [space.new(7)] }
10
+ end
11
+ end
@@ -0,0 +1,94 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::BandPattern::SymbolCharacter do
4
+ bar = Jan::Symbol::Band::Bar
5
+ space = Jan::Symbol::Band::Space
6
+
7
+ set_a_mappings = {
8
+ 'A0' => [space.new(3), bar.new(2), space.new(1), bar.new(1)],
9
+ 'A1' => [space.new(2), bar.new(2), space.new(2), bar.new(1)],
10
+ 'A2' => [space.new(2), bar.new(1), space.new(2), bar.new(2)],
11
+ 'A3' => [space.new(1), bar.new(4), space.new(1), bar.new(1)],
12
+ 'A4' => [space.new(1), bar.new(1), space.new(3), bar.new(2)],
13
+ 'A5' => [space.new(1), bar.new(2), space.new(3), bar.new(1)],
14
+ 'A6' => [space.new(1), bar.new(1), space.new(1), bar.new(4)],
15
+ 'A7' => [space.new(1), bar.new(3), space.new(1), bar.new(2)],
16
+ 'A8' => [space.new(1), bar.new(2), space.new(1), bar.new(3)],
17
+ 'A9' => [space.new(3), bar.new(1), space.new(1), bar.new(2)],
18
+ }
19
+
20
+ set_b_mappings = {
21
+ 'B0' => [space.new(1), bar.new(1), space.new(2), bar.new(3)],
22
+ 'B1' => [space.new(1), bar.new(2), space.new(2), bar.new(2)],
23
+ 'B2' => [space.new(2), bar.new(2), space.new(1), bar.new(2)],
24
+ 'B3' => [space.new(1), bar.new(1), space.new(4), bar.new(1)],
25
+ 'B4' => [space.new(2), bar.new(3), space.new(1), bar.new(1)],
26
+ 'B5' => [space.new(1), bar.new(3), space.new(2), bar.new(1)],
27
+ 'B6' => [space.new(4), bar.new(1), space.new(1), bar.new(1)],
28
+ 'B7' => [space.new(2), bar.new(1), space.new(3), bar.new(1)],
29
+ 'B8' => [space.new(3), bar.new(1), space.new(2), bar.new(1)],
30
+ 'B9' => [space.new(2), bar.new(1), space.new(1), bar.new(3)],
31
+ }
32
+
33
+ set_c_mappings = {
34
+ 'C0' => [bar.new(3), space.new(2), bar.new(1), space.new(1)],
35
+ 'C1' => [bar.new(2), space.new(2), bar.new(2), space.new(1)],
36
+ 'C2' => [bar.new(2), space.new(1), bar.new(2), space.new(2)],
37
+ 'C3' => [bar.new(1), space.new(4), bar.new(1), space.new(1)],
38
+ 'C4' => [bar.new(1), space.new(1), bar.new(3), space.new(2)],
39
+ 'C5' => [bar.new(1), space.new(2), bar.new(3), space.new(1)],
40
+ 'C6' => [bar.new(1), space.new(1), bar.new(1), space.new(4)],
41
+ 'C7' => [bar.new(1), space.new(3), bar.new(1), space.new(2)],
42
+ 'C8' => [bar.new(1), space.new(2), bar.new(1), space.new(3)],
43
+ 'C9' => [bar.new(3), space.new(1), bar.new(1), space.new(2)],
44
+ }
45
+
46
+
47
+ describe 'Set A' do
48
+ set_a_mappings.each do |name, valid_pattern|
49
+ it "has valid pattern in #{name}" do
50
+ bands = described_class.new(name).bands
51
+
52
+ expect(bands).to eq valid_pattern
53
+
54
+ # Width of symbol character must be 7X
55
+ expect(bands.sum(&:width)).to eq 7
56
+
57
+ # Set A symbol character has odd parity
58
+ expect(bands.grep(Jan::Symbol::Band::Bar).sum(&:width)).to be_odd
59
+ end
60
+ end
61
+ end
62
+
63
+ describe 'Set B' do
64
+ set_b_mappings.each do |name, valid_pattern|
65
+ it "has valid pattern in #{name}" do
66
+ bands = described_class.new(name).bands
67
+
68
+ expect(bands).to eq valid_pattern
69
+
70
+ # Width of symbol character must be 7X
71
+ expect(bands.sum(&:width)).to eq 7
72
+
73
+ # Set A symbol character has odd parity
74
+ expect(bands.grep(Jan::Symbol::Band::Bar).sum(&:width)).to be_even
75
+ end
76
+ end
77
+ end
78
+
79
+ describe 'Set C' do
80
+ set_c_mappings.each do |name, valid_pattern|
81
+ it "has valid pattern in #{name}" do
82
+ bands = described_class.new(name).bands
83
+
84
+ expect(bands).to eq valid_pattern
85
+
86
+ # Width of symbol character must be 7X
87
+ expect(bands.sum(&:width)).to eq 7
88
+
89
+ # Set A symbol character has odd parity
90
+ expect(bands.grep(Jan::Symbol::Band::Bar).sum(&:width)).to be_even
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,48 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol::Band do
4
+ describe 'initializer' do
5
+ it 'receives width and color' do
6
+ bar = described_class.new(1, color: 'black')
7
+ expect(bar).to be_an_instance_of(described_class)
8
+ end
9
+
10
+ it 'raises error if color missing' do
11
+ expect{ described_class.new(1) }.to raise_error ArgumentError
12
+ end
13
+ end
14
+
15
+ describe 'equality' do
16
+ context 'same width, same color' do
17
+ it 'equals' do
18
+ bar1 = described_class.new(1, color: 'black')
19
+ bar2 = described_class.new(1, color: 'black')
20
+ expect(bar1).to eq bar2
21
+ end
22
+ end
23
+
24
+ context 'same width, different color' do
25
+ it 'does not equal' do
26
+ bar1 = described_class.new(1, color: 'black')
27
+ bar2 = described_class.new(1, color: 'white')
28
+ expect(bar1).not_to eq bar2
29
+ end
30
+ end
31
+
32
+ context 'different width, same color' do
33
+ it 'does not equal' do
34
+ bar1 = described_class.new(1, color: 'black')
35
+ bar2 = described_class.new(2, color: 'black')
36
+ expect(bar1).not_to eq bar2
37
+ end
38
+ end
39
+
40
+ context 'different width, different color' do
41
+ it 'does not equal' do
42
+ bar1 = described_class.new(1, color: 'black')
43
+ bar2 = described_class.new(2, color: 'white')
44
+ expect(bar1).not_to eq bar2
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jan::Symbol do
4
+ let(:symbol) { described_class.new('4901085188033') }
5
+
6
+ describe 'initializer' do
7
+ it { expect(symbol).to be_an_instance_of Jan::Symbol }
8
+ end
9
+
10
+ describe '#band_patterns' do
11
+ it { expect(symbol.band_patterns).to be_an_instance_of Array }
12
+ it { expect(symbol.band_patterns).to all( be_an Jan::Symbol::BandPattern) }
13
+
14
+ it 'has correct format' do
15
+ patterns = symbol.band_patterns
16
+
17
+ expect(patterns[0]).to be_an_instance_of Jan::Symbol::BandPattern::LeftQuietZone
18
+ expect(patterns[1]).to be_an_instance_of Jan::Symbol::BandPattern::NormalGuardPattern
19
+ expect(patterns[2..7]).to all( be_an Jan::Symbol::BandPattern::SymbolCharacter )
20
+ expect(patterns[8]).to be_an_instance_of Jan::Symbol::BandPattern::CenterGuardPattern
21
+ expect(patterns[9..14]).to all( be_an Jan::Symbol::BandPattern::SymbolCharacter )
22
+ expect(patterns[15]).to be_an_instance_of Jan::Symbol::BandPattern::NormalGuardPattern
23
+ expect(patterns[16]).to be_an_instance_of Jan::Symbol::BandPattern::RightQuietZone
24
+ end
25
+ end
26
+
27
+ describe '#codepoints' do
28
+ mappings = {
29
+ '0123456789012' => %w[A1 A2 A3 A4 A5 A6 C7 C8 C9 C0 C1 C2],
30
+ '1123456789012' => %w[A1 A2 B3 A4 B5 B6 C7 C8 C9 C0 C1 C2],
31
+ '2123456789012' => %w[A1 A2 B3 B4 A5 B6 C7 C8 C9 C0 C1 C2],
32
+ '3123456789012' => %w[A1 A2 B3 B4 B5 A6 C7 C8 C9 C0 C1 C2],
33
+ '4123456789012' => %w[A1 B2 A3 A4 B5 B6 C7 C8 C9 C0 C1 C2],
34
+ '5123456789012' => %w[A1 B2 B3 A4 A5 B6 C7 C8 C9 C0 C1 C2],
35
+ '6123456789012' => %w[A1 B2 B3 B4 A5 A6 C7 C8 C9 C0 C1 C2],
36
+ '7123456789012' => %w[A1 B2 A3 B4 A5 B6 C7 C8 C9 C0 C1 C2],
37
+ '8123456789012' => %w[A1 B2 A3 B4 B5 A6 C7 C8 C9 C0 C1 C2],
38
+ '9123456789012' => %w[A1 B2 B3 A4 B5 A6 C7 C8 C9 C0 C1 C2],
39
+ }
40
+
41
+ mappings.each do |code, answer|
42
+ it 'returns codepoints with correct set' do
43
+ symbol = described_class.new(code)
44
+ expect(symbol.codepoints).to eq answer
45
+ end
46
+ end
47
+ end
48
+
49
+ describe '#svg' do
50
+ it 'returns SVG string'
51
+ end
52
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OSA Shunsuke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-12 00:00:00.000000000 Z
11
+ date: 2019-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: builder
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -71,10 +85,29 @@ files:
71
85
  - lib/jan/code.rb
72
86
  - lib/jan/code_body.rb
73
87
  - lib/jan/random.rb
88
+ - lib/jan/symbol.rb
89
+ - lib/jan/symbol/band.rb
90
+ - lib/jan/symbol/band/bar.rb
91
+ - lib/jan/symbol/band/space.rb
92
+ - lib/jan/symbol/band_pattern.rb
93
+ - lib/jan/symbol/band_pattern/center_guard_pattern.rb
94
+ - lib/jan/symbol/band_pattern/left_quiet_zone.rb
95
+ - lib/jan/symbol/band_pattern/normal_guard_pattern.rb
96
+ - lib/jan/symbol/band_pattern/right_quiet_zone.rb
97
+ - lib/jan/symbol/band_pattern/symbol_character.rb
74
98
  - lib/jan/version.rb
75
99
  - spec/jan/code_body_spec.rb
76
100
  - spec/jan/code_spec.rb
77
101
  - spec/jan/random_spec.rb
102
+ - spec/jan/symbol/band/bar_spec.rb
103
+ - spec/jan/symbol/band/space_spec.rb
104
+ - spec/jan/symbol/band_pattern/center_guard_pattern_spec.rb
105
+ - spec/jan/symbol/band_pattern/left_quiet_zone_spec.rb
106
+ - spec/jan/symbol/band_pattern/normal_guard_pattern_spec.rb
107
+ - spec/jan/symbol/band_pattern/right_quiet_zone_spec.rb
108
+ - spec/jan/symbol/band_pattern/symbol_character_spec.rb
109
+ - spec/jan/symbol/band_spec.rb
110
+ - spec/jan/symbol_spec.rb
78
111
  - spec/spec_helper.rb
79
112
  homepage: https://github.com/s-osa/jan
80
113
  licenses:
@@ -103,4 +136,13 @@ test_files:
103
136
  - spec/jan/code_body_spec.rb
104
137
  - spec/jan/code_spec.rb
105
138
  - spec/jan/random_spec.rb
139
+ - spec/jan/symbol/band/bar_spec.rb
140
+ - spec/jan/symbol/band/space_spec.rb
141
+ - spec/jan/symbol/band_pattern/center_guard_pattern_spec.rb
142
+ - spec/jan/symbol/band_pattern/left_quiet_zone_spec.rb
143
+ - spec/jan/symbol/band_pattern/normal_guard_pattern_spec.rb
144
+ - spec/jan/symbol/band_pattern/right_quiet_zone_spec.rb
145
+ - spec/jan/symbol/band_pattern/symbol_character_spec.rb
146
+ - spec/jan/symbol/band_spec.rb
147
+ - spec/jan/symbol_spec.rb
106
148
  - spec/spec_helper.rb