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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cee8c3683bbc6d1aa1088315b0271fe95850ab79a815ca239230dc354d2296b1
4
- data.tar.gz: fe01bf1be359a9d52be65af820228c6859592a60c107a533f330c5bbf06bd34f
3
+ metadata.gz: 027d718112a95bd94fcd6f88a2f387de6d60abc41a131112a226e9e21b14b0be
4
+ data.tar.gz: ad1156f5456e249bf30ca814a3b6e55342ad62ff0c7b70ceb923e16992df56ce
5
5
  SHA512:
6
- metadata.gz: 002a1329d9ed0d050827c159e152ac6752e3e5d46ba225ffdac40accf9765189ce7c83fb9ef26c1ad876ecb018b3e24f50eeff60104b51cb8b342fb2b1d7dc3d
7
- data.tar.gz: 01d1c73ed195be4dcdc15e0365ca8865b6756133be2f95c4ef6a6f6824819c045720502c9a9e597ffe25244099a72435aae2f16e940a950bbae8d1f4f3c57094
6
+ metadata.gz: 20e8f1c420a38574a3ab77b262cb7935afa64ec0db1ada92de14552adb5f845c330e2ddeb92a267c9037f682be0cc7ee170b78e40949a371011aeaa1644a194b
7
+ data.tar.gz: 296b6b3b2f14aeb52a96e7c9458d1a84180764118ae94de38ab041d70ea7428088195a49d7b5f7e0daab1946d50cf8269d5faf4f24dcf50b1db79b2134efa1df
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lino (2.2.0.pre.3)
4
+ lino (2.2.0.pre.4)
5
5
  hamster (~> 3.0)
6
6
  open4 (~> 1.3)
7
7
 
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lino
4
- VERSION = '2.2.0.pre.3'
4
+ VERSION = '2.2.0.pre.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lino
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0.pre.3
4
+ version: 2.2.0.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson