labrat 1.2.1 → 1.2.2

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
  SHA256:
3
- metadata.gz: cdb50449198c30b9c302af3b7ce2aa2da97039b725ef62c1e73f07cd7213649e
4
- data.tar.gz: cc62b9c24f61e88a6dcd8e27efbc6c7f99fb47d70fee2bf2e4a467d22857a35e
3
+ metadata.gz: 020c36cc0c3e427e9e728076b7fad0fbb43f20c02a7c3141ed9826e9495e0aeb
4
+ data.tar.gz: b83174cd528a01d9b9276d456aee772e678b6aaf4185f11c8a69587ca7e638c6
5
5
  SHA512:
6
- metadata.gz: ca700ff4b6fe931729e70a6aa79cabb24524e05529031e6b0ecde8d34555265230493f32079ec21097787c6f1907ba1eb104d73f44cad9cb78bcdf9c44d926c3
7
- data.tar.gz: 7e09bcccf191f043efbeeba44df8ff94d4536912852ddb1e8a6ceafb6e6e35202395893994d3a992c1114a7d03b49fcc7c78eee894c902f4f46a153cf3791f5f
6
+ metadata.gz: a2b993dd909a916bc108dbd9d2408eb3cb37a1db0cf99fe518cb415eb36894d97f79b06da93fae6bf79517089c5454ab6ae53c3e7e2af88db4e789cbf65ce9da
7
+ data.tar.gz: 6538096acbb8366e2c22703247d30354f09cf2be1d60fecb41333a1036d6080f779dad81e01cd954e0c061fecf424548c04a5f3c274fbf05b46e9cadb2d0066e
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- labrat (1.2.1)
4
+ labrat (1.2.2)
5
5
  activesupport
6
+ fat_config (>= 0.3.0)
6
7
  fat_core
7
8
  matrix
8
9
  prawn (~> 2.0)
@@ -10,103 +11,129 @@ PATH
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- activesupport (7.1.3)
14
+ activesupport (8.0.0)
14
15
  base64
16
+ benchmark (>= 0.3)
15
17
  bigdecimal
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ concurrent-ruby (~> 1.0, >= 1.3.1)
17
19
  connection_pool (>= 2.2.5)
18
20
  drb
19
21
  i18n (>= 1.6, < 2)
22
+ logger (>= 1.4.2)
20
23
  minitest (>= 5.1)
21
- mutex_m
22
- tzinfo (~> 2.0)
24
+ securerandom (>= 0.3)
25
+ tzinfo (~> 2.0, >= 2.0.5)
26
+ uri (>= 0.13.1)
23
27
  ast (2.4.2)
24
28
  base64 (0.2.0)
25
- bigdecimal (3.1.6)
29
+ benchmark (0.4.0)
30
+ bigdecimal (3.1.8)
26
31
  coderay (1.1.3)
27
- concurrent-ruby (1.2.3)
32
+ concurrent-ruby (1.3.4)
28
33
  connection_pool (2.4.1)
29
34
  damerau-levenshtein (1.3.3)
30
- debug (1.7.1)
31
- irb (>= 1.5.0)
32
- reline (>= 0.3.1)
33
- diff-lcs (1.5.0)
34
- docile (1.4.0)
35
- drb (2.2.0)
36
- ruby2_keywords
37
- fat_core (4.14.0)
35
+ debug (1.9.2)
36
+ irb (~> 1.10)
37
+ reline (>= 0.3.8)
38
+ diff-lcs (1.5.1)
39
+ docile (1.4.1)
40
+ drb (2.2.1)
41
+ fat_config (0.3.0)
42
+ activesupport
43
+ inifile
44
+ tomlib
45
+ fat_core (5.5.0)
38
46
  activesupport
39
47
  damerau-levenshtein
40
- i18n (1.14.1)
48
+ ostruct
49
+ stringio (>= 3.1.2)
50
+ i18n (1.14.6)
41
51
  concurrent-ruby (~> 1.0)
42
- io-console (0.6.0)
43
- irb (1.6.2)
44
- reline (>= 0.3.0)
45
- json (2.6.3)
52
+ inifile (3.0.0)
53
+ io-console (0.7.2)
54
+ irb (1.14.1)
55
+ rdoc (>= 4.0.0)
56
+ reline (>= 0.4.2)
57
+ json (2.8.2)
58
+ language_server-protocol (3.17.0.3)
59
+ logger (1.6.1)
46
60
  matrix (0.4.2)
47
- method_source (1.0.0)
48
- minitest (5.22.2)
49
- mutex_m (0.2.0)
50
- parallel (1.22.1)
51
- parser (3.2.0.0)
61
+ method_source (1.1.0)
62
+ minitest (5.25.2)
63
+ ostruct (0.6.1)
64
+ parallel (1.26.3)
65
+ parser (3.3.6.0)
52
66
  ast (~> 2.4.1)
53
- pdf-core (0.9.0)
54
- prawn (2.4.0)
55
- pdf-core (~> 0.9.0)
56
- ttfunk (~> 1.7)
57
- pry (0.14.1)
67
+ racc
68
+ pdf-core (0.10.0)
69
+ prawn (2.5.0)
70
+ matrix (~> 0.4)
71
+ pdf-core (~> 0.10.0)
72
+ ttfunk (~> 1.8)
73
+ pry (0.15.0)
58
74
  coderay (~> 1.1)
59
75
  method_source (~> 1.0)
76
+ psych (5.2.0)
77
+ stringio
78
+ racc (1.8.1)
60
79
  rainbow (3.1.1)
61
- rake (13.0.6)
62
- regexp_parser (2.6.1)
63
- reline (0.3.2)
80
+ rake (13.2.1)
81
+ rdoc (6.8.1)
82
+ psych (>= 4.0.0)
83
+ regexp_parser (2.9.2)
84
+ reline (0.5.12)
64
85
  io-console (~> 0.5)
65
- rexml (3.2.5)
66
- rspec (3.12.0)
67
- rspec-core (~> 3.12.0)
68
- rspec-expectations (~> 3.12.0)
69
- rspec-mocks (~> 3.12.0)
70
- rspec-core (3.12.0)
71
- rspec-support (~> 3.12.0)
72
- rspec-expectations (3.12.1)
86
+ rspec (3.13.0)
87
+ rspec-core (~> 3.13.0)
88
+ rspec-expectations (~> 3.13.0)
89
+ rspec-mocks (~> 3.13.0)
90
+ rspec-core (3.13.2)
91
+ rspec-support (~> 3.13.0)
92
+ rspec-expectations (3.13.3)
73
93
  diff-lcs (>= 1.2.0, < 2.0)
74
- rspec-support (~> 3.12.0)
75
- rspec-mocks (3.12.1)
94
+ rspec-support (~> 3.13.0)
95
+ rspec-mocks (3.13.2)
76
96
  diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.12.0)
78
- rspec-support (3.12.0)
79
- rubocop (1.42.0)
97
+ rspec-support (~> 3.13.0)
98
+ rspec-support (3.13.1)
99
+ rubocop (1.69.0)
80
100
  json (~> 2.3)
101
+ language_server-protocol (>= 3.17.0)
81
102
  parallel (~> 1.10)
82
- parser (>= 3.1.2.1)
103
+ parser (>= 3.3.0.2)
83
104
  rainbow (>= 2.2.2, < 4.0)
84
- regexp_parser (>= 1.8, < 3.0)
85
- rexml (>= 3.2.5, < 4.0)
86
- rubocop-ast (>= 1.24.1, < 2.0)
105
+ regexp_parser (>= 2.4, < 3.0)
106
+ rubocop-ast (>= 1.36.1, < 2.0)
87
107
  ruby-progressbar (~> 1.7)
88
- unicode-display_width (>= 1.4.0, < 3.0)
89
- rubocop-ast (1.24.1)
90
- parser (>= 3.1.1.0)
91
- rubocop-performance (1.15.2)
92
- rubocop (>= 1.7.0, < 2.0)
93
- rubocop-ast (>= 0.4.0)
94
- rubocop-rspec (2.16.0)
95
- rubocop (~> 1.33)
96
- rubocop-shopify (2.11.1)
97
- rubocop (~> 1.42)
98
- ruby-progressbar (1.11.0)
99
- ruby2_keywords (0.0.5)
108
+ unicode-display_width (>= 2.4.0, < 4.0)
109
+ rubocop-ast (1.36.2)
110
+ parser (>= 3.3.1.0)
111
+ rubocop-performance (1.23.0)
112
+ rubocop (>= 1.48.1, < 2.0)
113
+ rubocop-ast (>= 1.31.1, < 2.0)
114
+ rubocop-rspec (3.2.0)
115
+ rubocop (~> 1.61)
116
+ rubocop-shopify (2.15.1)
117
+ rubocop (~> 1.51)
118
+ ruby-progressbar (1.13.0)
119
+ securerandom (0.3.2)
100
120
  simplecov (0.22.0)
101
121
  docile (~> 1.1)
102
122
  simplecov-html (~> 0.11)
103
123
  simplecov_json_formatter (~> 0.1)
104
- simplecov-html (0.12.3)
124
+ simplecov-html (0.13.1)
105
125
  simplecov_json_formatter (0.1.4)
106
- ttfunk (1.7.0)
126
+ stringio (3.1.2)
127
+ tomlib (0.7.2)
128
+ bigdecimal
129
+ ttfunk (1.8.0)
130
+ bigdecimal (~> 3.1)
107
131
  tzinfo (2.0.6)
108
132
  concurrent-ruby (~> 1.0)
109
- unicode-display_width (2.4.2)
133
+ unicode-display_width (3.1.2)
134
+ unicode-emoji (~> 4.0, >= 4.0.4)
135
+ unicode-emoji (4.0.4)
136
+ uri (1.0.2)
110
137
 
111
138
  PLATFORMS
112
139
  x86_64-linux
data/README.org CHANGED
@@ -38,7 +38,7 @@ The following is for org.
38
38
  - [[#standard-input][Standard input]]
39
39
  - [[#template-exception][Template exception]]
40
40
  - [[#printing-or-viewing][Printing or viewing]]
41
- - [[#shell-commands][Shell commands]]
41
+ - [[#printing-and-viewing-shell-commands][Printing and viewing shell commands]]
42
42
  - [[#aids-to-testing-label-layouts][Aids to testing label layouts]]
43
43
  - [[#page-grid-1][Page Grid]]
44
44
  - [[#page-template][Page Template]]
@@ -139,28 +139,30 @@ install =labrat= with:
139
139
  $ gem install labrat
140
140
  #+end_SRC
141
141
 
142
- After installation, you should install the user and system configuration files
142
+ After installation, you should install the user and system (if you have sudo
143
+ privileges) configuration files
143
144
  with:
144
145
 
145
146
  #+begin_SRC sh
146
147
  $ labrat-install
147
148
  #+end_SRC
148
149
 
149
- This will install an annotated system-wide config file in
150
- =/etc/xdg/labrat/config.yml= and a system-wide label database in
151
- =/etc/xdg/labrat/labeldb.yml=.
150
+ This will, assuming you have sudo privileges, install an annotated system-wide
151
+ config file in =/etc/xdg/labrat/config.yml= and a system-wide label database
152
+ in =/etc/xdg/labrat/labeldb.yml=.
152
153
 
153
154
  It will also install an annotated sample user config file in
154
155
  =~/.config/labrat/labrat.el= and a sample user-level label database in
155
156
  =~/.config/labrat/labeldb.yml=.
156
157
 
157
158
  For the benefit of Emacs users, it also installs the =labrat.el= elisp library
158
- in =~/.config/labrat= as well, though you may want to move it to a different
159
- location.
159
+ in =~/.config/labrat= as well. You may want to add this directory to your
160
+ ~load-path~ or copy, move, or link it to a directory already in your
161
+ ~load-path~.
160
162
 
161
163
  If you invoke =labrat-install= multiple times, it will refuse to overwrite any
162
164
  existing config or database files that you may have already installed. If you
163
- want to re-install them you have to move the existing files out of the way.
165
+ want to re-install them you have to remove or move the existing files out of the way.
164
166
 
165
167
  ** Setting options
166
168
  You can control how =labrat= composes a label completely from the
@@ -272,12 +274,17 @@ taking the page orientation into account
272
274
  - ~--column-gap=DIM~ :: The distance between columns of labels on a page
273
275
 
274
276
  ** Label Setup Options
275
- These options determine the layout of individual labels within the page rather
276
- than the page as a whole. Note that the dimensions of a single whole label is
277
- not specified, but is implicitly determined by (1) the page width and height,
278
- (2) the page margins, (3) the number of rows and columns per page, and (4) the
279
- row and column gaps. The remaining space on the page is divided into a grid
280
- of identically-sized labels, which determines the size of each label.
277
+ These options determine the layout of individual labels within the page grid
278
+ rather than the page grid as a whole. Note that the dimensions of a single
279
+ whole label is not specified, but is implicitly determined by:
280
+
281
+ 1. the page width and height,
282
+ 2. the page margins
283
+ 3. the number of rows and columns per page, and
284
+ 4. the row and column gaps.
285
+
286
+ The remaining space on the page is divided into a grid of identically-sized
287
+ labels, which determines the size of each label.
281
288
 
282
289
  *** Padding
283
290
  Within each label, the following options allow you to set the margins on each
@@ -461,7 +468,7 @@ command from ~--view-command~ to view the generated PDF file instead.
461
468
 
462
469
  - ~-V~, ~--[no-]view~ :: View rather than print
463
470
 
464
- *** Shell commands
471
+ *** Printing and viewing shell commands
465
472
  By default, =labrat= uses the shell command:
466
473
  #+begin_example
467
474
  lpr -P %p %o
@@ -511,7 +518,7 @@ provide.
511
518
  When trying to define a new label layout, it also helps to just see what a
512
519
  single sheet of labels would look like. That is what the ~--template~ (or
513
520
  ~-T~) option gives you: it just prints an outline of where labels would be
514
- printed but ignores any label text.
521
+ printed and numbers the labels, but it ignores any label text.
515
522
 
516
523
  - ~-T~, ~--[no-]template~ :: Print a template of a page of labels and ignore
517
524
  any content
@@ -519,7 +526,8 @@ printed but ignores any label text.
519
526
  **** Verbose Reporting
520
527
  Finally, =labrat= will print a lot of information about what it's doing with
521
528
  the ~--verbose~ or ~-v~ option. The information is printed to the standard
522
- error output stream.
529
+ error output stream. This is particularly helpful in determining how the
530
+ final configuration was constructed from the various config files.
523
531
 
524
532
  - ~-v~, ~--[no-]verbose~ :: Run verbosely, that is, print out lots of
525
533
  information about what =labrat= is doing as it processes the job.
@@ -527,7 +535,7 @@ error output stream.
527
535
  ** The Label Database and the label option
528
536
  One of the nice things about =labrat= is that it comes with a database of
529
537
  pre-defined label configurations for many standard labels, especially Avery
530
- labels since they are kind enough to publish PDF templates for all their
538
+ labels since they were good enough to publish PDF templates for all their
531
539
  products at [[https://www.avery.com/templates]].
532
540
 
533
541
  *** Listing labels
@@ -583,7 +591,7 @@ avery8986:
583
591
  label: avery8987
584
592
  #+end_example
585
593
  In other words, it defines the ~avery8986~ label with a nested ~--label~
586
- option that simply refers to the ~avery8987~ entry.
594
+ option that simply incorporates the ~avery8987~ entry settings.
587
595
 
588
596
  *** Label database entries as configuration sets
589
597
  This ability to use a label database definition as an alias for a whole set of
data/labrat.gemspec CHANGED
@@ -46,6 +46,7 @@ DESC
46
46
  spec.add_dependency "prawn", "~> 2.0"
47
47
  spec.add_dependency "activesupport"
48
48
  spec.add_dependency "fat_core"
49
+ spec.add_dependency "fat_config", '>=0.3.0'
49
50
 
50
51
  spec.add_development_dependency 'rake'
51
52
  spec.add_development_dependency 'rspec'
@@ -10,8 +10,8 @@ module Labrat
10
10
  # Read in the Labrat database of label settings, merging system and user
11
11
  # databases.
12
12
  def self.read(dir_prefix: '')
13
- self.db = Config.read('labrat', base: 'labeldb', dir_prefix: dir_prefix)
14
- .transform_keys(&:to_sym)
13
+ reader = FatConfig::Reader.new('labrat', root_prefix: dir_prefix)
14
+ self.db = reader.read('labeldb')
15
15
  end
16
16
 
17
17
  # Return a hash of config settings for the label named by labname.
@@ -73,8 +73,8 @@ module Labrat
73
73
  default_config.report("Default settings") if verbose
74
74
 
75
75
  # Config files
76
- file_config = Labrat::Config.read('labrat', verbose: verbose)
77
- file_config.report("Settings from merged config files") if verbose
76
+ config_reader = FatConfig::Reader.new('labrat', xdg: true)
77
+ file_config = config_reader.read('labrat', verbose: verbose)
78
78
  file_options = Labrat::ArgParser.new.parse(file_config, prior: default_config, verbose: verbose)
79
79
 
80
80
  # Command-line
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Labrat
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
data/lib/labrat.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'active_support'
4
4
  require 'active_support/core_ext'
5
5
  require 'fat_core/enumerable'
6
+ require 'fat_config'
6
7
  require 'prawn'
7
8
  require 'prawn/measurement_extensions'
8
9
  require 'optparse'
data/texlabels/sample.pdf CHANGED
Binary file
data/texlabels/sample.tex CHANGED
@@ -1,17 +1,21 @@
1
1
  \documentclass{article}
2
2
 
3
3
  \usepackage{geometry}
4
- \geometry{paperwidth=25mm,paperheight=87mm,landscape}
4
+ \geometry{paperwidth=25mm,paperheight=87mm,landscape,left=1mm,right=1mm,top=1mm,bottom=1mm}
5
5
  \renewcommand*\familydefault{\sfdefault}
6
6
  \usepackage{tgheros}
7
+ \usepackage{beton}
7
8
 
8
9
  \begin{document}
9
- \vfill
10
+ \vfill\hbox{}
10
11
  \begin{center}
12
+ % \footnotesize
13
+ \large
11
14
  \textbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
12
15
  $\int_0^x e^{-t\pi} dx$\\
13
- 0123456789abcdefghijklmnopqrstuvwxyz\\
14
- \textbf{0123456789abcdefghijklmnopqrstuvwxyz}
16
+ % 0123456789abcdefghijklmnopqrstuvwxyz\\
17
+ % \textbf{0123456789abcdefghijklmnopqrstuvwxyz}\\
18
+ % $c^2 - a^2 + b^2$\\
15
19
  \end{center}
16
- \vfill
20
+ \vfill\hbox{}
17
21
  \end{document}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: labrat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-20 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: matrix
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fat_config
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -238,7 +252,6 @@ files:
238
252
  - lib/lisp/labrat.el
239
253
  - texlabels/sample.dvi
240
254
  - texlabels/sample.pdf
241
- - texlabels/sample.synctex.gz
242
255
  - texlabels/sample.tex
243
256
  homepage: http://github.com/ddoherty03/labrat
244
257
  licenses: []
@@ -261,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
274
  - !ruby/object:Gem::Version
262
275
  version: '0'
263
276
  requirements: []
264
- rubygems_version: 3.5.18
277
+ rubygems_version: 3.5.23
265
278
  signing_key:
266
279
  specification_version: 4
267
280
  summary: Command-line and Emacs label print software.
Binary file