brocade 1.0.2 → 1.1.0
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/lib/brocade/has_barcode.rb +9 -2
- data/lib/brocade/version.rb +1 -1
- metadata +9 -9
data/lib/brocade/has_barcode.rb
CHANGED
@@ -77,16 +77,23 @@ module Brocade
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def barcode_url
|
80
|
-
"/system/barcodes/#{klass}/#{
|
80
|
+
"/system/barcodes/#{klass}/#{partitioned_id}/#{symbology}.png"
|
81
81
|
end
|
82
82
|
|
83
83
|
def barcode_path
|
84
|
-
"#{RAILS_ROOT}/public/system/barcodes/#{klass}/#{
|
84
|
+
"#{RAILS_ROOT}/public/system/barcodes/#{klass}/#{partitioned_id}/#{symbology}.png"
|
85
85
|
end
|
86
86
|
|
87
87
|
def klass
|
88
88
|
self.class.to_s.underscore.pluralize
|
89
89
|
end
|
90
|
+
|
91
|
+
# Returns the id in a split path form.
|
92
|
+
# E.g. Returns 001/234 for an id of 1234.
|
93
|
+
def partitioned_id
|
94
|
+
# 1,000,000 records is enough for now.
|
95
|
+
("%06d" % id).scan(/\d{3}/).join('/')
|
96
|
+
end
|
90
97
|
end
|
91
98
|
|
92
99
|
end
|
data/lib/brocade/version.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.2
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Stewart
|
@@ -15,14 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-08-11 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: barby
|
23
|
-
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
25
|
none: false
|
27
26
|
requirements:
|
28
27
|
- - "="
|
@@ -33,12 +32,12 @@ dependencies:
|
|
33
32
|
- 3
|
34
33
|
- 2
|
35
34
|
version: 0.3.2
|
36
|
-
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: png
|
39
|
-
type: :runtime
|
40
39
|
prerelease: false
|
41
|
-
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
41
|
none: false
|
43
42
|
requirements:
|
44
43
|
- - "="
|
@@ -49,7 +48,8 @@ dependencies:
|
|
49
48
|
- 1
|
50
49
|
- 0
|
51
50
|
version: 1.1.0
|
52
|
-
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
53
|
description: Generates barcodes for Rails ActiveRecord models.
|
54
54
|
email: boss@airbladesoftware.com
|
55
55
|
executables: []
|