lino 2.2.0.pre.3 → 2.2.0.pre.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +24 -0
- data/Rakefile +2 -0
- data/lib/lino/options.rb +13 -0
- data/lib/lino/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 027d718112a95bd94fcd6f88a2f387de6d60abc41a131112a226e9e21b14b0be
|
4
|
+
data.tar.gz: ad1156f5456e249bf30ca814a3b6e55342ad62ff0c7b70ceb923e16992df56ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20e8f1c420a38574a3ab77b262cb7935afa64ec0db1ada92de14552adb5f845c330e2ddeb92a267c9037f682be0cc7ee170b78e40949a371011aeaa1644a194b
|
7
|
+
data.tar.gz: 296b6b3b2f14aeb52a96e7c9458d1a84180764118ae94de38ab041d70ea7428088195a49d7b5f7e0daab1946d50cf8269d5faf4f24dcf50b1db79b2134efa1df
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -62,6 +62,30 @@ Lino::CommandLineBuilder.for_command('gpg')
|
|
62
62
|
|
63
63
|
# => gpg --recipient tobyclemson@gmail.com --sign ./doc.txt
|
64
64
|
|
65
|
+
# ... or alternatively
|
66
|
+
Lino::CommandLineBuilder.for_command('gpg')
|
67
|
+
.with_options({
|
68
|
+
'--recipient' => 'tobyclemson@gmail.com',
|
69
|
+
'--sign' => './doc.txt'
|
70
|
+
})
|
71
|
+
.build
|
72
|
+
.to_s
|
73
|
+
|
74
|
+
# => gpg --recipient tobyclemson@gmail.com --sign ./doc.txt
|
75
|
+
|
76
|
+
# ... or alternatively
|
77
|
+
Lino::CommandLineBuilder.for_command('gpg')
|
78
|
+
.with_options(
|
79
|
+
[
|
80
|
+
{ option: '--recipient', value: 'tobyclemson@gmail.com' },
|
81
|
+
{ option: '--sign', value: './doc.txt' }
|
82
|
+
]
|
83
|
+
)
|
84
|
+
.build
|
85
|
+
.to_s
|
86
|
+
|
87
|
+
# => gpg --recipient tobyclemson@gmail.com --sign ./doc.txt
|
88
|
+
|
65
89
|
# commands with an option repeated multiple times
|
66
90
|
Lino::CommandLineBuilder.for_command('example.sh')
|
67
91
|
.with_repeated_option('--opt', ['file1.txt', nil, '', 'file2.txt'])
|
data/Rakefile
CHANGED
@@ -16,6 +16,7 @@ task default: %i[
|
|
16
16
|
|
17
17
|
namespace :encryption do
|
18
18
|
namespace :passphrase do
|
19
|
+
desc 'Generate encryption passphrase for CI GPG key'
|
19
20
|
task :generate do
|
20
21
|
File.open('config/secrets/ci/encryption.passphrase', 'w') do |f|
|
21
22
|
f.write(SecureRandom.base64(36))
|
@@ -96,6 +97,7 @@ RakeGithub.define_repository_tasks(
|
|
96
97
|
end
|
97
98
|
|
98
99
|
namespace :pipeline do
|
100
|
+
desc 'Prepare CircleCI Pipeline'
|
99
101
|
task prepare: %i[
|
100
102
|
circle_ci:project:follow
|
101
103
|
circle_ci:env_vars:ensure
|
data/lib/lino/options.rb
CHANGED
@@ -14,6 +14,19 @@ module Lino
|
|
14
14
|
))
|
15
15
|
end
|
16
16
|
|
17
|
+
def with_options(options)
|
18
|
+
return self if missing?(options)
|
19
|
+
|
20
|
+
options.entries.inject(self) do |s, entry|
|
21
|
+
s.with_option(
|
22
|
+
entry.include?(:option) ? entry[:option] : entry[0],
|
23
|
+
entry.include?(:value) ? entry[:value] : entry[1],
|
24
|
+
separator: (entry.include?(:separator) ? entry[:separator] : nil),
|
25
|
+
quoting: (entry.include?(:quoting) ? entry[:quoting] : nil)
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
17
30
|
def with_repeated_option(option, values, separator: nil, quoting: nil)
|
18
31
|
values.inject(self) do |s, value|
|
19
32
|
s.with_option(option, value, separator: separator, quoting: quoting)
|
data/lib/lino/version.rb
CHANGED