labrat 1.1.0 → 1.2.1

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: 3cb6a8e4afc8a5d258a6e62936df099cfd3d14aa0cc538c3ea0e505640999c08
4
- data.tar.gz: f99873b21e534ce721332491557be580d51c9b85431236fe3eac35e866e11e9f
3
+ metadata.gz: cdb50449198c30b9c302af3b7ce2aa2da97039b725ef62c1e73f07cd7213649e
4
+ data.tar.gz: cc62b9c24f61e88a6dcd8e27efbc6c7f99fb47d70fee2bf2e4a467d22857a35e
5
5
  SHA512:
6
- metadata.gz: dad638049b53df861e9511308ebd27552681c1fd4fbb9e69ab5926db7a99f66e9c4248cc6d8fef3e9787c09c502f95ecd42dca54908f003a8d9eecf0bf0ee7d9
7
- data.tar.gz: 2a903b57e3f2ba0ac02122b38c84e45de01b30d447617f8966f573c1ffe7dc2756f2bb5548f222341c575dffa78b8ca931ef435991bc0f2ae154f4c211e6a373
6
+ metadata.gz: ca700ff4b6fe931729e70a6aa79cabb24524e05529031e6b0ecde8d34555265230493f32079ec21097787c6f1907ba1eb104d73f44cad9cb78bcdf9c44d926c3
7
+ data.tar.gz: 7e09bcccf191f043efbeeba44df8ff94d4536912852ddb1e8a6ceafb6e6e35202395893994d3a992c1114a7d03b49fcc7c78eee894c902f4f46a153cf3791f5f
data/.envrc ADDED
@@ -0,0 +1 @@
1
+ PATH_add .bundle/bin
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ labrat.pdf
18
18
  /README.pdf
19
19
  /README.pyg
20
20
  /README.tex
21
+ /label.tex
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- labrat (1.0.0)
4
+ labrat (1.2.1)
5
5
  activesupport
6
6
  fat_core
7
7
  matrix
@@ -10,25 +10,34 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (6.1.7)
13
+ activesupport (7.1.3)
14
+ base64
15
+ bigdecimal
14
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ connection_pool (>= 2.2.5)
18
+ drb
15
19
  i18n (>= 1.6, < 2)
16
20
  minitest (>= 5.1)
21
+ mutex_m
17
22
  tzinfo (~> 2.0)
18
- zeitwerk (~> 2.3)
19
23
  ast (2.4.2)
24
+ base64 (0.2.0)
25
+ bigdecimal (3.1.6)
20
26
  coderay (1.1.3)
21
- concurrent-ruby (1.1.10)
27
+ concurrent-ruby (1.2.3)
28
+ connection_pool (2.4.1)
22
29
  damerau-levenshtein (1.3.3)
23
30
  debug (1.7.1)
24
31
  irb (>= 1.5.0)
25
32
  reline (>= 0.3.1)
26
33
  diff-lcs (1.5.0)
27
34
  docile (1.4.0)
28
- fat_core (4.13.0)
29
- activesupport (~> 6.0)
35
+ drb (2.2.0)
36
+ ruby2_keywords
37
+ fat_core (4.14.0)
38
+ activesupport
30
39
  damerau-levenshtein
31
- i18n (1.12.0)
40
+ i18n (1.14.1)
32
41
  concurrent-ruby (~> 1.0)
33
42
  io-console (0.6.0)
34
43
  irb (1.6.2)
@@ -36,7 +45,8 @@ GEM
36
45
  json (2.6.3)
37
46
  matrix (0.4.2)
38
47
  method_source (1.0.0)
39
- minitest (5.17.0)
48
+ minitest (5.22.2)
49
+ mutex_m (0.2.0)
40
50
  parallel (1.22.1)
41
51
  parser (3.2.0.0)
42
52
  ast (~> 2.4.1)
@@ -86,6 +96,7 @@ GEM
86
96
  rubocop-shopify (2.11.1)
87
97
  rubocop (~> 1.42)
88
98
  ruby-progressbar (1.11.0)
99
+ ruby2_keywords (0.0.5)
89
100
  simplecov (0.22.0)
90
101
  docile (~> 1.1)
91
102
  simplecov-html (~> 0.11)
@@ -93,10 +104,9 @@ GEM
93
104
  simplecov-html (0.12.3)
94
105
  simplecov_json_formatter (0.1.4)
95
106
  ttfunk (1.7.0)
96
- tzinfo (2.0.5)
107
+ tzinfo (2.0.6)
97
108
  concurrent-ruby (~> 1.0)
98
109
  unicode-display_width (2.4.2)
99
- zeitwerk (2.6.6)
100
110
 
101
111
  PLATFORMS
102
112
  x86_64-linux
data/README.org CHANGED
@@ -59,7 +59,7 @@ wonderful [[https://github.com/prawnpdf/prawn][Prawn gem]] to generate PDF files
59
59
  =labrat= properly configured, printing a label is as simple as:
60
60
 
61
61
  #+begin_example
62
- $ labrat 'Income Taxes 2021-->Example Maker, Inc.'
62
+ $ labrat 'Income Taxes 2021 ~~ Example Maker, Inc.'
63
63
  #+end_example
64
64
 
65
65
  And you will get a two-line file-folder label printed that looks like this:
@@ -85,14 +85,14 @@ without success, I decided to write my own. Hence labrat. With it---after
85
85
  due configuration---printing a file folder label is as simple as:
86
86
 
87
87
  #+begin_src sh
88
- $ labrat 'First Line of Label-->And the Second Line'
88
+ $ labrat 'First Line of Label ~~ And the Second Line'
89
89
  #+end_src
90
90
 
91
91
  Or, you can preview the label in your previewer of choice (mine is qpdfview)
92
92
  by adding the -V flag:
93
93
 
94
94
  #+begin_src sh
95
- $ labrat -V 'First Line of Label-->And the Second Line'
95
+ $ labrat -V 'First Line of Label ~~ And the Second Line'
96
96
  #+end_src
97
97
 
98
98
  Even better, I have included with =labrat= an elisp file (=labrat.el=) that
@@ -346,10 +346,10 @@ later pages always start on the first label position.
346
346
 
347
347
  *** New line marker
348
348
  You can embed a special text-sequence in the label text to indicate where a
349
- line-break should occur. By default it is the sequence =-->=. This means
350
- that =labrat= will translate all occurrences of =-->= in the text into a
349
+ line-break should occur. By default it is the sequence = ~~ =. This means
350
+ that =labrat= will translate all occurrences of = ~~ = in the text into a
351
351
  line-break, even consecutive occurrences. There is no way to escape this in
352
- the text, so if you want labels for that use '-->' as part of the text, you
352
+ the text, so if you want labels for that use ' ~~ ' as part of the text, you
353
353
  are going to have difficulty printing a labels. But you can change the marker
354
354
  to something else with ~--nlsep~. This is especially helpful when you are
355
355
  using the command-line to supply the label text since specifying line-breaks
@@ -357,16 +357,16 @@ on a shell command can be difficult. However note that this substitution
357
357
  takes place even when reading label texts from a file or standard input.
358
358
 
359
359
  - ~-n~, ~--nlsep=SEPARATOR~ :: Specify text to be translated into a line-break
360
- (default '-->')
360
+ (default ' ~~ ')
361
361
 
362
362
  *** Label separator
363
363
  The only way to print more than one label from the command-line is to indicate
364
364
  where one label ends and the next begins with a special marker in the
365
- command-line arguments, by default the string '==>'. The text used for this
365
+ command-line arguments, by default the string '@@'. The text used for this
366
366
  can be customized with this option.
367
367
 
368
368
  - ~--label-sep=SEPARATOR~ :: Specify text that indicates the start of a new
369
- label (default '==>')
369
+ label (default '@@')
370
370
 
371
371
  *** Number of copies
372
372
  This option causes =labrat= to generate multiple copies of each label with all
@@ -388,11 +388,11 @@ on the command-line. It combines all the non-option arguments and joins them
388
388
  with a space between each argument. For example,
389
389
 
390
390
  #+begin_example
391
- $ labrat -c3 This is a 'single label' '-->composed of all this' text --font-style=italic
391
+ $ labrat -c3 This is a 'single label' ' ~~ composed of all this' text --font-style=italic
392
392
  #+end_example
393
393
 
394
394
  prints three copies of a single label in italics with two lines, breaking at
395
- the '-->' marker, resulting in something like this:
395
+ the ' ~~ ' marker, resulting in something like this:
396
396
 
397
397
  #+begin_example
398
398
  This is a single label
@@ -401,12 +401,12 @@ composed of all this text
401
401
 
402
402
  Note that when the label text is specified on the command-line, ~labrat~ just
403
403
  prints a single label. The only ways to get multiple labels is by (1) marking
404
- a separation between labels with the ~--label-sep~ marker ('==>' by default)
404
+ a separation between labels with the ~--label-sep~ marker ('@@' by default)
405
405
  or (2) using the ~-c~ (~--copies~) argument to get multiple copies of the
406
406
  label text. These options can be combined as well. For example,
407
407
 
408
408
  #+begin_example
409
- $ labrat -c3 This is the 'first label' ==> 'And the rest --> is the second' text --font-style=italic
409
+ $ labrat -c3 This is the 'first label' @@ 'And the rest ~~ is the second' text --font-style=italic
410
410
  #+end_example
411
411
 
412
412
  will produce three copies of two separate labels:
@@ -572,7 +572,7 @@ $ labrat -T -V --label=avery8987
572
572
 
573
573
  And if you want to see it with sample label text filled in, try the following:
574
574
  #+begin_example
575
- $ labrat -V -c30 --label=avery8987 'Four score and seven years ago-->Our fathers brought forth'
575
+ $ labrat -V -c30 --label=avery8987 'Four score and seven years ago ~~ Our fathers brought forth'
576
576
  #+end_example
577
577
 
578
578
  *** Nesting label definitions
@@ -608,7 +608,7 @@ badge:
608
608
 
609
609
  With this, you can print a file folder label with:
610
610
  #+begin_example
611
- $ labrat --label=ff 'Four score and seven years ago-->Our fathers brought forth'
611
+ $ labrat --label=ff 'Four score and seven years ago ~~ Our fathers brought forth'
612
612
  #+end_example
613
613
 
614
614
  And, if you want this to be your default label type, you can add to your user-level
@@ -620,13 +620,13 @@ label:
620
620
 
621
621
  Now you can print the label without the ~--label~ option on the command-line:
622
622
  #+begin_example
623
- $ labrat 'Four score and seven years ago-->Our fathers brought forth'
623
+ $ labrat 'Four score and seven years ago ~~ Our fathers brought forth'
624
624
  #+end_example
625
625
 
626
626
  If you want to print badges, you have to specify the ~--label~ option explicitly on
627
627
  the command-line:
628
628
  #+begin_example
629
- $ labrat -V -c14 --label=badge 'Daniel E. Doherty-->(Amateur Programmer)'
629
+ $ labrat -V -c14 --label=badge 'Daniel E. Doherty ~~ (Amateur Programmer)'
630
630
  #+end_example
631
631
 
632
632
  *** A Caution about option order
@@ -636,7 +636,7 @@ override earlier settings. For example, given the configuration above, where
636
636
  ~ff~ is your default label type, the following will not do what you expect:
637
637
 
638
638
  #+begin_example
639
- $ labrat --font-style=italic --label=ff 'Four score and seven years ago-->Our fathers brought forth'
639
+ $ labrat --font-style=italic --label=ff 'Four score and seven years ago ~~ Our fathers brought forth'
640
640
  #+end_example
641
641
 
642
642
  You expect the label to be printed in italic, but the ~--label=ff~ option in
@@ -647,7 +647,7 @@ namely ~--font-style=bold~ from the user-level label database.
647
647
  To get this to work, you have to put the command-line setting after the
648
648
  ~--label=ff~ option in order for it to take effect:
649
649
  #+begin_example
650
- $ labrat --label=ff --font-style=italic 'Four score and seven years ago-->Our fathers brought forth'
650
+ $ labrat --label=ff --font-style=italic 'Four score and seven years ago ~~ Our fathers brought forth'
651
651
  #+end_example
652
652
 
653
653
  * Development
data/labrat.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  the wonderful Prawn gem to generate PDF files with label formatting in mind. With
16
16
  labrat properly configured, printing a label is as simple as:
17
17
 
18
- $ labrat 'Income Taxes 2021-->Example Maker, Inc.'
18
+ $ labrat 'Income Taxes 2021 ~~ Example Maker, Inc.'
19
19
 
20
20
  And you will get a two-line file-folder label with the text centered. It can
21
21
  print on dymo label printer rolls or Avery sheet labels. It knows the layout of
@@ -41,7 +41,7 @@ DESC
41
41
  spec.bindir = 'bin'
42
42
  spec.executables = spec.files.grep(%r{\Abin/labrat}) { |f| File.basename(f) }
43
43
  spec.require_paths = ["lib"]
44
- spec.post_install_message = 'To install config and label database files, run [sudo] labrat-install.'
44
+ spec.post_install_message = 'To install config and label database files, run labrat-install.'
45
45
  spec.add_dependency "matrix"
46
46
  spec.add_dependency "prawn", "~> 2.0"
47
47
  spec.add_dependency "activesupport"
@@ -93,7 +93,7 @@
93
93
  # A string sequence that is interpreted as a line-break can be defined. Such
94
94
  # a sequence is particularly helpful when you provide the label text on the
95
95
  # command-line, though it will be applied to file-read label texts as well.
96
- # nlsep: '-->'
96
+ # nlsep: '~~'
97
97
 
98
98
  # A string sequence that indicates the start of a new label. Such a sequence
99
99
  # is particularly helpful when you provide the label text on the command-line,
@@ -3,7 +3,7 @@
3
3
  # add user-specific settings, such as the destination printer for that
4
4
  # particular label type.
5
5
  dymo30327:
6
- printer-name: dymo
6
+ printer: dymo
7
7
 
8
8
  # Or you might want a full definition of a label type not defined in the
9
9
  # system-level database. Here is a commented-out definition of a common avery
@@ -48,7 +48,7 @@ module Labrat
48
48
  parser.separator ""
49
49
  parser.separator "Print or view (with -V) a label with the given <label-text>."
50
50
  parser.separator "All non-option arguments are used for the label text with a special"
51
- parser.separator "marker ('-->' by default, see --nlsep) indicating a line-break."
51
+ parser.separator "marker ('~~' by default, see --nlsep) indicating a line-break."
52
52
  parser.separator ""
53
53
  parser.separator "Below, NUM indicates an integer, DIM, indicates a linear dimension,"
54
54
  parser.separator "valid DIM units are: pt, mm, cm, dm, m, in, ft, yd."
@@ -361,11 +361,11 @@ module Labrat
361
361
 
362
362
  # On a command-line, specifying where a line-break should occur is not
363
363
  # convenient when shell interpretation and quoting rules are taken into
364
- # account. This allows the user to use some distinctive marker ('-->' by
364
+ # account. This allows the user to use some distinctive marker ('~~' by
365
365
  # default) to designate where a line break should occur.
366
366
  def nl_sep_option
367
367
  parser.on("-nSEP", "--nl-sep=SEPARATOR",
368
- "Specify text to be translated into a line-break (default '-->')") do |nl|
368
+ "Specify text to be translated into a line-break (default '~~')") do |nl|
369
369
  options.nl_sep = nl
370
370
  warn " ::nl-sep <- '#{nl}'::" if options.verbose
371
371
  end
@@ -50,8 +50,8 @@ module Labrat
50
50
  self.font_size = init[:font_size] || 12
51
51
  # Input attributes
52
52
  self.in_file = init[:in_file] || nil
53
- self.nl_sep = init[:nl_sep] || '-->'
54
- self.label_sep = init[:label_sep] || '==>'
53
+ self.nl_sep = init[:nl_sep] || '~~'
54
+ self.label_sep = init[:label_sep] || '@@'
55
55
  self.copies = init[:copies] || 1
56
56
  # Output attributes
57
57
  self.printer = init[:printer] || ENV['LABRAT_PRINTER'] || ENV['PRINTER'] || 'dymo'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Labrat
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.1"
5
5
  end
data/lib/lisp/labrat.el CHANGED
@@ -22,7 +22,7 @@ e.g. ~/.rbenv/shims/labrat, for an rbenv ruby installation."
22
22
  :type 'string
23
23
  :group 'labrat)
24
24
 
25
- (defcustom labrat-nl-sep "-->"
25
+ (defcustom labrat-nl-sep "~~"
26
26
  "String to mark newlines in label text.
27
27
 
28
28
  If you change this, you need to make a corresponding change in your
@@ -30,7 +30,7 @@ labrat configuration at ~/.config/labrat/config.yml."
30
30
  :type 'string
31
31
  :group 'labrat)
32
32
 
33
- (defcustom labrat-label-sep "==>"
33
+ (defcustom labrat-label-sep "@@"
34
34
  "String to mark the separation between labels on the labrat command-line.
35
35
 
36
36
  If you change this, you need to make a corresponding change in your
@@ -88,10 +88,10 @@ returned"
88
88
  This invokes the \"labrat -V\ <label>\" command with the
89
89
  paragraph at or before point inserted in the <label> position,
90
90
  but with each new-line replaced with the value of the variable
91
- labrat-nl-sep, '-->' by default."
91
+ labrat-nl-sep, '~~' by default."
92
92
  (interactive)
93
93
  (call-process labrat-executable nil (get-buffer-create "*labrat*") nil
94
- "-V" "-o ~/labrat.pdf""-V --out-file=~/labrat.pdf" (labrat/pars-in-region)))
94
+ "-V" "-o ~/labrat.pdf" (labrat/pars-in-region)))
95
95
 
96
96
  (defun labrat-print ()
97
97
  "Print the paragraph at or before point as a label with labrat.
@@ -99,7 +99,7 @@ labrat-nl-sep, '-->' by default."
99
99
  This invokes the \"labrat -P <label>\" command with the paragraph
100
100
  at or before point inserted in the <label> position, but with
101
101
  each new-line replaced with the value of the variable
102
- labrat-nl-sep, '-->' by default."
102
+ labrat-nl-sep, '~~' by default."
103
103
  (interactive)
104
104
  (call-process labrat-executable nil (buffer-name (get-buffer-create "*labrat*")) nil
105
105
  "-o ~/labrat.pdf" (labrat/pars-in-region)))
Binary file
Binary file
Binary file
@@ -0,0 +1,17 @@
1
+ \documentclass{article}
2
+
3
+ \usepackage{geometry}
4
+ \geometry{paperwidth=25mm,paperheight=87mm,landscape}
5
+ \renewcommand*\familydefault{\sfdefault}
6
+ \usepackage{tgheros}
7
+
8
+ \begin{document}
9
+ \vfill
10
+ \begin{center}
11
+ \textbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
12
+ $\int_0^x e^{-t\pi} dx$\\
13
+ 0123456789abcdefghijklmnopqrstuvwxyz\\
14
+ \textbf{0123456789abcdefghijklmnopqrstuvwxyz}
15
+ \end{center}
16
+ \vfill
17
+ \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.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-06 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: matrix
@@ -184,7 +184,7 @@ description: |2+
184
184
  the wonderful Prawn gem to generate PDF files with label formatting in mind. With
185
185
  labrat properly configured, printing a label is as simple as:
186
186
 
187
- $ labrat 'Income Taxes 2021-->Example Maker, Inc.'
187
+ $ labrat 'Income Taxes 2021 ~~ Example Maker, Inc.'
188
188
 
189
189
  And you will get a two-line file-folder label with the text centered. It can
190
190
  print on dymo label printer rolls or Avery sheet labels. It knows the layout of
@@ -201,6 +201,7 @@ executables:
201
201
  extensions: []
202
202
  extra_rdoc_files: []
203
203
  files:
204
+ - ".envrc"
204
205
  - ".gitignore"
205
206
  - ".rspec"
206
207
  - ".rubocop.yml"
@@ -235,13 +236,17 @@ files:
235
236
  - lib/labrat/read_files.rb
236
237
  - lib/labrat/version.rb
237
238
  - lib/lisp/labrat.el
239
+ - texlabels/sample.dvi
240
+ - texlabels/sample.pdf
241
+ - texlabels/sample.synctex.gz
242
+ - texlabels/sample.tex
238
243
  homepage: http://github.com/ddoherty03/labrat
239
244
  licenses: []
240
245
  metadata:
241
246
  homepage_uri: http://github.com/ddoherty03/labrat
242
247
  source_code_uri: http://github.com/ddoherty03/labrat
243
248
  changelog_uri: http://github.com/ddoherty03/labrat/CHANGELOG.md
244
- post_install_message: To install config and label database files, run [sudo] labrat-install.
249
+ post_install_message: To install config and label database files, run labrat-install.
245
250
  rdoc_options: []
246
251
  require_paths:
247
252
  - lib
@@ -256,8 +261,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
261
  - !ruby/object:Gem::Version
257
262
  version: '0'
258
263
  requirements: []
259
- rubygems_version: 3.4.1
260
- signing_key:
264
+ rubygems_version: 3.5.18
265
+ signing_key:
261
266
  specification_version: 4
262
267
  summary: Command-line and Emacs label print software.
263
268
  test_files: []
269
+ ...