qrcli 0.0.1 → 1.0.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.
- checksums.yaml +7 -0
- data/bin/qrcli +1 -31
- data/qrcli.gemspec +2 -8
- metadata +19 -23
- data/lib/qrcli/version.rb +0 -3
- data/lib/qrcli.rb +0 -5
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4505df254a822668552b4bc8b15997d5e2e2f6548a6e713cd1957d1580eba698
|
4
|
+
data.tar.gz: cb62f18a6f62b506992ab9671d0fef7bcfce02a7448d4e1f0869372098510844
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0ba40aa858052cb90f892701ecaaefb0aac4afedf92e0848da615fa5a1c24bb9e26469e7bc3072a73540ed112ed2d941d11934ce67cd5a8c4d8c48aeb0c857f5
|
7
|
+
data.tar.gz: ff59505acd879cbc1fef9230a806a758afb46d0fa6fda87cb6d8ede8bc76ddba012c4cc34e8988452d57360daeb19c495a88e08e109268bddd9883274ddf5a97
|
data/bin/qrcli
CHANGED
@@ -2,36 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'rqrcode'
|
4
4
|
|
5
|
-
BLACK = "\e[40m"
|
6
|
-
WHITE = "\e[107m"
|
7
|
-
DEFAULT = "\e[0m"
|
8
|
-
SPACER = " "
|
9
|
-
|
10
5
|
text = ARGV[0] || STDIN.read
|
11
|
-
|
12
|
-
# make a qr code of the smallest possible size
|
13
|
-
def minimal_qrcode text, opts={}
|
14
|
-
opts[:size] = 1
|
15
|
-
begin
|
16
|
-
return RQRCode::QRCode.new(text, opts)
|
17
|
-
rescue RQRCode::QRCodeRunTimeError => e
|
18
|
-
opts[:size] += 1
|
19
|
-
raise e if opts[:size] > 10
|
20
|
-
retry
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def format_qrcode qr
|
25
|
-
width = qr.module_count
|
26
|
-
pad = WHITE + SPACER * (width + 2) + BLACK
|
27
|
-
|
28
|
-
lines = qr.to_s(:true => BLACK + SPACER, :false => WHITE + SPACER).split("\n")
|
29
|
-
lines.map! { |line| WHITE + SPACER + line + WHITE + SPACER + DEFAULT }
|
30
|
-
|
31
|
-
([pad] + lines + [pad]).join("\n")
|
32
|
-
end
|
33
|
-
|
34
|
-
level = 'l'
|
35
|
-
qr = minimal_qrcode text, :level => level
|
36
|
-
puts format_qrcode(qr)
|
6
|
+
puts RQRCode::QRCode.new(text).as_ansi
|
37
7
|
|
data/qrcli.gemspec
CHANGED
@@ -1,22 +1,16 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "qrcli/version"
|
4
|
-
|
5
2
|
Gem::Specification.new do |s|
|
6
3
|
s.name = "qrcli"
|
7
|
-
s.version =
|
4
|
+
s.version = "1.0.0"
|
8
5
|
s.authors = ["John Hawthorn"]
|
9
6
|
s.email = ["john.hawthorn@gmail.com"]
|
10
7
|
s.homepage = "https://github.com/jhawthorn/qrcli"
|
11
8
|
s.summary = %q{Generates QR codes on the command line using ANSI terminal colors}
|
12
9
|
s.description = %q{Generates QR codes on the command line using ANSI terminal colors}
|
13
10
|
|
14
|
-
s.
|
15
|
-
|
16
|
-
s.add_dependency 'rqrcode'
|
11
|
+
s.add_dependency 'rqrcode', "~> 2.0"
|
17
12
|
|
18
13
|
s.files = `git ls-files`.split("\n")
|
19
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
15
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
-
s.require_paths = ["lib"]
|
22
16
|
end
|
metadata
CHANGED
@@ -1,28 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qrcli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- John Hawthorn
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
14
|
name: rqrcode
|
17
|
-
requirement:
|
18
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
19
16
|
requirements:
|
20
|
-
- -
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '0'
|
19
|
+
version: '2.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
26
27
|
description: Generates QR codes on the command line using ANSI terminal colors
|
27
28
|
email:
|
28
29
|
- john.hawthorn@gmail.com
|
@@ -31,36 +32,31 @@ executables:
|
|
31
32
|
extensions: []
|
32
33
|
extra_rdoc_files: []
|
33
34
|
files:
|
34
|
-
- .gitignore
|
35
|
+
- ".gitignore"
|
35
36
|
- Gemfile
|
36
37
|
- Rakefile
|
37
38
|
- bin/qrcli
|
38
|
-
- lib/qrcli.rb
|
39
|
-
- lib/qrcli/version.rb
|
40
39
|
- qrcli.gemspec
|
41
|
-
has_rdoc: true
|
42
40
|
homepage: https://github.com/jhawthorn/qrcli
|
43
41
|
licenses: []
|
44
|
-
|
42
|
+
metadata: {}
|
43
|
+
post_install_message:
|
45
44
|
rdoc_options: []
|
46
45
|
require_paths:
|
47
46
|
- lib
|
48
47
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
48
|
requirements:
|
51
|
-
- -
|
49
|
+
- - ">="
|
52
50
|
- !ruby/object:Gem::Version
|
53
51
|
version: '0'
|
54
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
53
|
requirements:
|
57
|
-
- -
|
54
|
+
- - ">="
|
58
55
|
- !ruby/object:Gem::Version
|
59
56
|
version: '0'
|
60
57
|
requirements: []
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
specification_version: 3
|
58
|
+
rubygems_version: 3.5.16
|
59
|
+
signing_key:
|
60
|
+
specification_version: 4
|
65
61
|
summary: Generates QR codes on the command line using ANSI terminal colors
|
66
62
|
test_files: []
|
data/lib/qrcli/version.rb
DELETED