syc-barcode 0.0.1 → 0.0.2
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.
- data/README.rdoc +12 -1
- data/lib/interleave2of5.rb +1 -0
- metadata +9 -6
data/README.rdoc
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
= Barcode
|
2
|
-
Creating barcodes (at the moment only
|
2
|
+
Creating barcodes (at the moment only Interleaved2of5).
|
3
3
|
|
4
4
|
== Usage
|
5
5
|
Create the barcode string and the barcode graphics data
|
@@ -9,7 +9,18 @@ Create the barcode string and the barcode graphics data
|
|
9
9
|
pdf = Prawn::Document.new
|
10
10
|
barcode.to_pdf(pdf)
|
11
11
|
|
12
|
+
When used with rails add
|
13
|
+
require 'interleave2of5'
|
14
|
+
to config/application.rb
|
15
|
+
|
12
16
|
The barcode can be used to create a graphical representation of the barcode.
|
13
17
|
|
18
|
+
== Release Notes
|
19
|
+
* Version 0.0.1
|
20
|
+
Create barcode Interleaved 2 of 5 that can be added to a pdf file
|
21
|
+
|
22
|
+
* Version 0.0.2
|
23
|
+
Fix check digit calculation
|
24
|
+
|
14
25
|
== Licencse
|
15
26
|
Barcode is published under the MIT license
|
data/lib/interleave2of5.rb
CHANGED
@@ -112,6 +112,7 @@ class Interleave2of5 < Barcode
|
|
112
112
|
@check_digit = 10 - reverse_value.each_with_index.collect do |v, i|
|
113
113
|
i.even? ? v.to_i * 3 : v.to_i
|
114
114
|
end.inject(:+) % 10 if @check
|
115
|
+
@check_digit = 0 if @check_digit == 10
|
115
116
|
@encodable = @value + (@check ? @check_digit.to_s : "")
|
116
117
|
@encodable = "0" + @encodable if @encodable.size.odd?
|
117
118
|
@encodable
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syc-barcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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: 2013-06-
|
12
|
+
date: 2013-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
@@ -59,12 +59,15 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
description: ! "= Barcode\nCreating barcodes (at the moment only
|
62
|
+
description: ! "= Barcode\nCreating barcodes (at the moment only Interleaved2of5).
|
63
63
|
\n\n== Usage\nCreate the barcode string and the barcode graphics data\n i2o5
|
64
64
|
= Interleave2of5(\"01199\")\n code = i2o5.encode\n barcode = i2o5.barcode\n
|
65
|
-
\ pdf = Prawn::Document.new\n barcode.to_pdf(pdf)\n\
|
66
|
-
|
67
|
-
|
65
|
+
\ pdf = Prawn::Document.new\n barcode.to_pdf(pdf)\n\nWhen used with rails add\n
|
66
|
+
\ require 'interleave2of5'\nto config/application.rb\n\nThe barcode can be used
|
67
|
+
to create a graphical representation of the barcode.\n\n== Release Notes\n* Version
|
68
|
+
0.0.1\n Create barcode Interleaved 2 of 5 that can be added to a pdf file\n\n*
|
69
|
+
Version 0.0.2\n Fix check digit calculation\n\n== Licencse\nBarcode is published
|
70
|
+
under the MIT license\n"
|
68
71
|
email: pierre@sugaryourcoffee.de
|
69
72
|
executables: []
|
70
73
|
extensions: []
|