mrsk 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mrsk/utils.rb CHANGED
@@ -24,8 +24,19 @@ module Mrsk::Utils
24
24
  end
25
25
 
26
26
  # Returns a list of shell-dashed option arguments. If the value is true, it's treated like a value-less option.
27
- def optionize(args)
28
- args.collect { |(key, value)| [ "--#{key}", value == true ? nil : escape_shell_value(value) ] }.flatten.compact
27
+ def optionize(args, with: nil)
28
+ options = if with
29
+ flatten_args(args).collect { |(key, value)| value == true ? "--#{key}" : "--#{key}#{with}#{escape_shell_value(value)}" }
30
+ else
31
+ flatten_args(args).collect { |(key, value)| [ "--#{key}", value == true ? nil : escape_shell_value(value) ] }
32
+ end
33
+
34
+ options.flatten.compact
35
+ end
36
+
37
+ # Flattens a one-to-many structure into an array of two-element arrays each containing a key-value pair
38
+ def flatten_args(args)
39
+ args.flat_map { |key, value| value.try(:map) { |entry| [key, entry] } || [ [ key, value ] ] }
29
40
  end
30
41
 
31
42
  # Copied from SSHKit::Backend::Abstract#redact to be available inside Commands classes
@@ -37,4 +48,9 @@ module Mrsk::Utils
37
48
  def escape_shell_value(value)
38
49
  value.to_s.dump.gsub(/`/, '\\\\`')
39
50
  end
51
+
52
+ # Abbreviate a git revhash for concise display
53
+ def abbreviate_version(version)
54
+ version[0...7] if version
55
+ end
40
56
  end
data/lib/mrsk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mrsk
2
- VERSION = "0.9.1"
2
+ VERSION = "0.10.0"
3
3
  end
data/lib/mrsk.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Mrsk
2
2
  end
3
3
 
4
+ require "active_support"
4
5
  require "zeitwerk"
5
6
 
6
7
  loader = Zeitwerk::Loader.for_gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrsk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-09 00:00:00.000000000 Z
11
+ date: 2023-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,6 +108,48 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: debug
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: mocha
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: railties
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
111
153
  description:
112
154
  email: dhh@hey.com
113
155
  executables:
@@ -125,6 +167,7 @@ files:
125
167
  - lib/mrsk/cli/base.rb
126
168
  - lib/mrsk/cli/build.rb
127
169
  - lib/mrsk/cli/healthcheck.rb
170
+ - lib/mrsk/cli/lock.rb
128
171
  - lib/mrsk/cli/main.rb
129
172
  - lib/mrsk/cli/prune.rb
130
173
  - lib/mrsk/cli/registry.rb
@@ -145,6 +188,7 @@ files:
145
188
  - lib/mrsk/commands/builder/native.rb
146
189
  - lib/mrsk/commands/builder/native/remote.rb
147
190
  - lib/mrsk/commands/healthcheck.rb
191
+ - lib/mrsk/commands/lock.rb
148
192
  - lib/mrsk/commands/prune.rb
149
193
  - lib/mrsk/commands/registry.rb
150
194
  - lib/mrsk/commands/traefik.rb
@@ -173,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
217
  - !ruby/object:Gem::Version
174
218
  version: '0'
175
219
  requirements: []
176
- rubygems_version: 3.4.6
220
+ rubygems_version: 3.4.8
177
221
  signing_key:
178
222
  specification_version: 4
179
223
  summary: Deploy web apps in containers to servers running Docker with zero downtime.