sshkit 1.20.0 → 1.21.1

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: 15fa13df6228673b8f0f084b8df88cadaff79d93bb78b83fcaf37d5c4f390419
4
- data.tar.gz: 42f9c9401241796a150ef6c3f0d7f735c8fac91eed61975f22654df33c4200f5
3
+ metadata.gz: 302bdf2103654ae9a2cf858bf4c9cc585a57fac04a340f70c494a59cc0a8633f
4
+ data.tar.gz: 9dc1fe14a5ccfc3e3ae756c04790a37c6c84564f62c5a506df078fa9e8e07d83
5
5
  SHA512:
6
- metadata.gz: eb3b2a5df2f9706fc659e4cd901ffcea0487cae4009431f14b8606edd650d99229b63ff893ac45c6ce2501b860504d651430b2b98cb8f2368782e4f656dd50bd
7
- data.tar.gz: 466488b99bfa4a768d2901edf9e63924e0aa76f099b5ba67f938d15881fc548d39c7dd26e89782eafa63d0f35a55f0dca8ff58b4be0272e63e6e61e05c0f10fa
6
+ metadata.gz: 62dab7dd19368a572930d0eb704eed44f989e57cd68e7470998040f835b568f199ee230caf52ba519d58d596890b12e45fc010775a112fbcfe3ec7d9b94e3e4e
7
+ data.tar.gz: d9185a014c779dfa43dfa7586223bb56cfae83b4e25f7d74a69badafce37e680ee2f3c04bbbf2cffda82366b982e09cde13b9321a10f73a2b065a10d0cd45c9c
@@ -0,0 +1,17 @@
1
+ name-template: "$NEXT_PATCH_VERSION"
2
+ tag-template: "v$NEXT_PATCH_VERSION"
3
+ categories:
4
+ - title: "⚠️ Breaking Changes"
5
+ label: "⚠️ Breaking"
6
+ - title: "✨ New Features"
7
+ label: "✨ Feature"
8
+ - title: "🐛 Bug Fixes"
9
+ label: "🐛 Bug Fix"
10
+ - title: "📚 Documentation"
11
+ label: "📚 Docs"
12
+ - title: "🏠 Housekeeping"
13
+ label: "🏠 Housekeeping"
14
+ change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
15
+ no-changes-template: "- No changes"
16
+ template: |
17
+ $CHANGES
@@ -0,0 +1,12 @@
1
+ on: push
2
+ name: Push
3
+ jobs:
4
+ draftRelease:
5
+ name: Draft Release
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@master
9
+ - name: Draft Release
10
+ uses: toolmantim/release-drafter@v5.2.0
11
+ env:
12
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/.rubocop.yml CHANGED
@@ -6,10 +6,10 @@ AllCops:
6
6
  TargetRubyVersion: 2.0
7
7
 
8
8
  Lint/AmbiguousBlockAssociation:
9
- Enabled:
10
- false
9
+ Enabled: false
11
10
  Metrics/BlockLength:
12
11
  Exclude:
12
+ - "sshkit.gemspec"
13
13
  - "spec/**/*"
14
14
  - "lib/**/*.rake"
15
15
  Style/BarePercentLiterals:
data/CHANGELOG.md CHANGED
@@ -1,796 +1 @@
1
- ## Changelog
2
-
3
- This file is written in reverse chronological order, newer releases will
4
- appear at the top.
5
-
6
- ## [Unreleased][]
7
-
8
- * Your contribution here!
9
-
10
- ## [1.20.0][] (2019-08-03)
11
-
12
- * [#468](https://github.com/capistrano/sshkit/pull/468): Make `upload!` take a `:verbosity` option like `exec` does - [@grosser](https://github.com/grosser)
13
-
14
- ## [1.19.1][] (2019-07-02)
15
-
16
- * [#465](https://github.com/capistrano/sshkit/pull/456): Fix a regression in 1.19.0 that prevented `~` from being used in Capistrano paths, e.g. `:deploy_to`, etc. - [@grosser](https://github.com/grosser)
17
-
18
- ## [1.19.0][] (2019-06-30)
19
-
20
- * [#455](https://github.com/capistrano/sshkit/pull/455): Ensure UUID of commands are stable in logging - [@lazyatom](https://github.com/lazyatom)
21
- * [#453](https://github.com/capistrano/sshkit/pull/453): `as` and `within` now properly escape their user/group/path arguments, and the command nested within an `as` block is now properly escaped before passing to `sh -c`. In the unlikely case that you were manually escaping commands passed to SSHKit as a workaround, you will no longer need to do this. See [#458](https://github.com/capistrano/sshkit/issues/458) for examples of what has been fixed. - [@grosser](https://github.com/grosser)
22
- * [#460](https://github.com/capistrano/sshkit/pull/460): Handle IPv6 addresses without port - [@will-in-wi](https://github.com/will-in-wi)
23
-
24
- ## [1.18.2][] (2019-02-03)
25
-
26
- * [#448](https://github.com/capistrano/sshkit/pull/448): Fix misbehaving connection eviction loop when disabling connection pooling - [Sebastian Cohnen](https://github.com/tisba)
27
-
28
- ## [1.18.1][] (2019-01-26)
29
-
30
- * [#447](https://github.com/capistrano/sshkit/pull/447): Fix broken thread safety by widening critical section - [Takumasa Ochi](https://github.com/aeroastro)
31
-
32
- ## [1.18.0][] (2018-10-21)
33
-
34
- * [#435](https://github.com/capistrano/sshkit/pull/435): Consistent verbosity configuration #capture and #test methods - [@NikolayRys](https://github.com/NikolayRys)
35
-
36
- ## [1.17.0][] (2018-07-07)
37
-
38
- * [#430](https://github.com/capistrano/sshkit/pull/430): [Feature] Command Argument STDOUT/capistrano.log Hiding - [@NorseGaud](https://github.com/NorseGaud)
39
-
40
- ## [1.16.1][] (2018-05-20)
41
-
42
- * [#425](https://github.com/capistrano/sshkit/pull/425): Command#group incorrectly escapes double quotes, resulting in a a syntax error when specifying the group execution using `as`. This issue manifested when user command quotes changed from double quotes to single quotes. This fix removes the double quote escaping - [@pblesi](https://github.com/pblesi).
43
-
44
- ## [1.16.0][] (2018-02-03)
45
-
46
- * [#417](https://github.com/capistrano/sshkit/pull/417): Cache key generation for connections becomes slow when `known_hosts` is a valid `net/ssh` options and `known_hosts` file is big. This changes the cache key generation and fixes performance issue - [@ElvinEfendi](https://github.com/ElvinEfendi).
47
-
48
- ## [1.15.1][] (2017-11-18)
49
-
50
- This is a small bug-fix release that fixes problems with `upload!` and `download!` that were inadvertently introduced in 1.15.0.
51
-
52
- ### Breaking changes
53
-
54
- * None
55
-
56
- ### Bug fixes
57
-
58
- * [#410](https://github.com/capistrano/sshkit/pull/410): fix NoMethodError when using upload!/download! with Pathnames - [@UnderpantsGnome](https://github.com/UnderpantsGnome)
59
- * [#411](https://github.com/capistrano/sshkit/pull/410): fix upload!/download! when using relative paths outside of `within` blocks - [@Fjan](https://github.com/Fjan)
60
-
61
- ## [1.15.0][] (2017-11-03)
62
-
63
- ### New features
64
-
65
- * [#408](https://github.com/capistrano/sshkit/pull/408): upload! and download! now respect `within` - [@sj26](https://github.com/sj26)
66
-
67
- ### Potentially breaking changes
68
-
69
- * `upload!` and `download!` now support remote paths which are
70
- relative to the `within` working directory. They were previously documented
71
- as only supporting absolute paths, but relative paths still worked relative
72
- to the remote working directory. If you rely on the previous behaviour you
73
- may need to adjust your code.
74
-
75
- ## [1.14.0][] (2017-06-30)
76
-
77
- ### Breaking changes
78
-
79
- * None
80
-
81
- ### New features
82
-
83
- * [#401](https://github.com/capistrano/sshkit/pull/401): Add :log_percent option to specify upload!/download! transfer log percentage - [@aubergene](https://github.com/aubergene)
84
-
85
- ## [1.13.1][] (2017-03-31)
86
-
87
- ### Breaking changes
88
-
89
- * None
90
-
91
- ### Bug fixes
92
-
93
- * [#397](https://github.com/capistrano/sshkit/pull/397): Fix NoMethodError assign_defaults with net-ssh older than 4.0.0 - [@shirosaki](https://github.com/shirosaki)
94
-
95
- ## [1.13.0][] (2017-03-24)
96
-
97
- ### Breaking changes
98
-
99
- * None
100
-
101
- ### New features
102
-
103
- * [#372](https://github.com/capistrano/sshkit/pull/372): Use cp_r in local backend with recursive option - [@okuramasafumi](https://github.com/okuramasafumi)
104
-
105
- ### Bug fixes
106
-
107
- * [#390](https://github.com/capistrano/sshkit/pull/390): Properly wrap Ruby StandardError w/ add'l context - [@mattbrictson](https://github.com/mattbrictson)
108
- * [#392](https://github.com/capistrano/sshkit/pull/392): Fix open two connections with changed cache key - [@shirosaki](https://github.com/shirosaki)
109
-
110
- ## [1.12.0][] (2017-02-10)
111
-
112
- ### Breaking changes
113
-
114
- * None
115
-
116
- ### New features
117
-
118
- * Add `SSHKit.config.default_runner_config` option that allows overriding default runner configs.
119
-
120
- ## [1.11.5][] (2016-12-16)
121
-
122
- ### Bug fixes
123
-
124
- * Do not prefix `exec` command
125
- [PR #378](https://github.com/capistrano/sshkit/pull/378) @dreyks
126
-
127
- ## [1.11.4][] (2016-11-02)
128
-
129
- * Use string interpolation for environment variables to avoid escaping issues
130
- with sprintf
131
- [PR #280](https://github.com/capistrano/sshkit/pull/280)
132
- @Sinjo - Chris Sinjakli
133
-
134
- ## [1.11.3][] (2016-09-16)
135
-
136
- * Fix known_hosts caching to match on the entire hostlist
137
- [PR #364](https://github.com/capistrano/sshkit/pull/364) @byroot
138
-
139
- ## [1.11.2][] (2016-07-29)
140
-
141
- ### Bug fixes
142
-
143
- * Fixed a crash occurring when `Host@keys` was set to a non-Enumerable.
144
- @xavierholt [PR #360](https://github.com/capistrano/sshkit/pull/360)
145
-
146
- ## [1.11.1][] (2016-06-17)
147
-
148
- ### Bug fixes
149
-
150
- * Fixed a regression in 1.11.0 that would cause
151
- `ArgumentError: invalid option(s): known_hosts` in some older versions of
152
- net-ssh. @byroot [#357](https://github.com/capistrano/sshkit/issues/357)
153
-
154
- ## [1.11.0][] (2016-06-14)
155
-
156
- ### Bug fixes
157
-
158
- * Fixed colorized output alignment in Logger::Pretty. @xavierholt
159
- [PR #349](https://github.com/capistrano/sshkit/pull/349)
160
- * Fixed a bug that prevented nested `with` calls
161
- [#43](https://github.com/capistrano/sshkit/issues/43)
162
-
163
- ### Other changes
164
-
165
- * Known hosts lookup optimization is now enabled by default. @byroot
166
-
167
- ## 1.10.0 (2016-04-22)
168
-
169
- * You can now opt-in to caching of SSH's known_hosts file for a speed boost
170
- when deploying to a large fleet of servers. Refer to the
171
- [README](https://github.com/capistrano/sshkit/tree/v1.10.0#known-hosts-caching) for
172
- details. We plan to turn this on by default in a future version of SSHKit.
173
- [PR #330](https://github.com/capistrano/sshkit/pull/330) @byroot
174
- * SSHKit now explicitly closes its pooled SSH connections when Ruby exits;
175
- this fixes `zlib(finalizer): the stream was freed prematurely` warnings
176
- [PR #343](https://github.com/capistrano/sshkit/pull/343) @mattbrictson
177
- * Allow command map entries (`SSHKit::CommandMap#[]`) to be Procs
178
- [PR #310](https://github.com/capistrano/sshkit/pull/310)
179
- @mikz
180
-
181
- ## 1.9.0
182
-
183
- **Refer to the 1.9.0.rc1 release notes for a full list of new features, fixes,
184
- and potentially breaking changes since SSHKit 1.8.1.** There are no changes
185
- since 1.9.0.rc1.
186
-
187
- ## 1.9.0.rc1
188
-
189
- ### Potentially breaking changes
190
-
191
- * The SSHKit DSL is no longer automatically included when you `require` it.
192
- **This means you must now explicitly `include SSHKit::DSL`.**
193
- See [PR #219](https://github.com/capistrano/sshkit/pull/219) for details.
194
- @beatrichartz
195
- * `SSHKit::Backend::Printer#test` now always returns true
196
- [PR #312](https://github.com/capistrano/sshkit/pull/312) @mikz
197
-
198
- ### New features
199
-
200
- * `SSHKit::Formatter::Abstract` now accepts an optional Hash of options
201
- [PR #308](https://github.com/capistrano/sshkit/pull/308) @mattbrictson
202
- * Add `SSHKit::Backend.current` so that Capistrano plugin authors can refactor
203
- helper methods and still have easy access to the currently-executing Backend
204
- without having to use global variables.
205
- * Add `SSHKit.config.default_runner` options that allows to override default command runner.
206
- This option also accepts a name of the custom runner class.
207
- * The ConnectionPool has been rewritten in this release to be more efficient
208
- and have a cleaner internal API. You can still completely disable the pool
209
- by setting `SSHKit::Backend::Netssh.pool.idle_timeout = 0`.
210
- @mattbrictson @byroot [PR #328](https://github.com/capistrano/sshkit/pull/328)
211
-
212
- ### Bug fixes
213
-
214
- * make sure working directory for commands is properly cleared after `within` blocks
215
- [PR #307](https://github.com/capistrano/sshkit/pull/307)
216
- @steved
217
- * display more accurate string for commands with spaces being output in `Formatter::Pretty`
218
- [PR #304](https://github.com/capistrano/sshkit/pull/304)
219
- @steved
220
- [PR #319](https://github.com/capistrano/sshkit/pull/319) @mattbrictson
221
- * Fix a race condition experienced in JRuby that could cause multi-server
222
- deploys to fail. [PR #322](https://github.com/capistrano/sshkit/pull/322)
223
- @mattbrictson
224
-
225
- ## 1.8.1
226
-
227
- * Change license to MIT, thanks to all the patient contributors who gave
228
- their permissions.
229
-
230
- ## 1.8.0
231
-
232
- * add SSHKit::Backend::ConnectionPool#close_connections
233
- [PR #285](https://github.com/capistrano/sshkit/pull/285)
234
- @akm
235
- * Clean up rubocop lint warnings
236
- [PR #275](https://github.com/capistrano/sshkit/pull/275)
237
- @cshaffer
238
- * Prepend unused parameter names with an underscore
239
- * Prefer “safe assignment in condition”
240
- * Disambiguate regexp literals with parens
241
- * Prefer `sprintf` over `String#%`
242
- * No longer shadow `caller_line` variable in `DeprecationLogger`
243
- * Rescue `StandardError` instead of `Exception`
244
- * Remove useless `private` access modifier in `TestAbstract`
245
- * Disambiguate block operator with parens
246
- * Disambiguate between grouped expression and method params
247
- * Remove assertion in `TestHost#test_assert_hosts_compare_equal` that compares something with itself
248
- * Export environment variables and execute command in a subshell.
249
- [PR #273](https://github.com/capistrano/sshkit/pull/273)
250
- @kuon
251
- * Introduce `log_command_start`, `log_command_data`, `log_command_exit` methods on `Formatter`
252
- [PR #257](https://github.com/capistrano/sshkit/pull/257)
253
- @robd
254
- * Deprecate `@stdout` and `@stderr` accessors on `Command`
255
- * Add support for deprecation logging options.
256
- [README](README.md#deprecation-warnings),
257
- [PR #258](https://github.com/capistrano/sshkit/pull/258)
258
- @robd
259
- * Quote environment variable values.
260
- [PR #250](https://github.com/capistrano/sshkit/pull/250)
261
- @Sinjo - Chris Sinjakli
262
- * Simplified formatter hierarchy.
263
- [PR #248](https://github.com/capistrano/sshkit/pull/248)
264
- @robd
265
- * `SimpleText` formatter now extends `Pretty`, rather than duplicating.
266
- * Hide ANSI color escape sequences when outputting to a file.
267
- [README](README.md#output-colors),
268
- [Issue #245](https://github.com/capistrano/sshkit/issues/245),
269
- [PR #246](https://github.com/capistrano/sshkit/pull/246)
270
- @robd
271
- * Now only color the output if it is associated with a tty,
272
- or the `SSHKIT_COLOR` environment variable is set.
273
- * Removed broken support for assigning an `IO` to the `output` config option.
274
- [Issue #243](https://github.com/capistrano/sshkit/issues/243),
275
- [PR #244](https://github.com/capistrano/sshkit/pull/244)
276
- @robd
277
- * Use `SSHKit.config.output = SSHKit::Formatter::SimpleText.new($stdin)` instead
278
- * Added support for `:interaction_handler` option on commands.
279
- [PR #234](https://github.com/capistrano/sshkit/pull/234),
280
- [PR #242](https://github.com/capistrano/sshkit/pull/242)
281
- @robd
282
- * Removed partially supported `TRACE` log level.
283
- [2aa7890](https://github.com/capistrano/sshkit/commit/2aa78905f0c521ad9f697e7a4ed04ba438d5ee78)
284
- @robd
285
- * Add support for the `:strip` option to the `capture` method and strip by default on the `Local` backend.
286
- [PR #239](https://github.com/capistrano/sshkit/pull/239),
287
- [PR #249](https://github.com/capistrano/sshkit/pull/249)
288
- @robd
289
- * The `Local` backend now strips by default to be consistent with the `Netssh` one.
290
- * This reverses change [7d15a9a](https://github.com/capistrano/sshkit/commit/7d15a9aebfcc43807c8151bf6f3a4bc038ce6218) to the `Local` capture API to remove stripping by default.
291
- * If you require the raw, unstripped output, pass the `strip: false` option: `capture(:ls, strip: false)`
292
- * Simplified backend hierarchy.
293
- [PR #235](https://github.com/capistrano/sshkit/pull/235),
294
- [PR #237](https://github.com/capistrano/sshkit/pull/237)
295
- @robd
296
- * Moved duplicate implementations of `make`, `rake`, `test`, `capture`, `background` on to `Abstract` backend.
297
- * Backend implementations now only need to implement `execute_command`, `upload!` and `download!`
298
- * Removed `Printer` from backend hierarchy for `Local` and `Netssh` backends (they now just extend `Abstract`)
299
- * Removed unused `Net::SSH:LogLevelShim`
300
- * Removed dependency on the `colorize` gem. SSHKit now implements its own ANSI color logic, with no external dependencies. Note that SSHKit now only supports the `:bold` or plain modes. Other modes will be gracefully ignored. [#263](https://github.com/capistrano/sshkit/issues/263)
301
- * New API for setting the formatter: `use_format`. This differs from `format=` in that it accepts options or arguments that will be passed to the formatter's constructor. The `format=` syntax will be deprecated in a future release. [#295](https://github.com/capistrano/sshkit/issues/295)
302
- * SSHKit now immediately raises a `NameError` if you try to set a formatter that does not exist. [#295](https://github.com/capistrano/sshkit/issues/295)
303
- * Fix error message when the formatter does not exist. [#301](https://github.com/capistrano/sshkit/pull/301)
304
-
305
- ## 1.7.1
306
-
307
- * Fix a regression in 1.7.0 that caused command completion messages to be removed from log output. @mattbrictson
308
-
309
- ## 1.7.0
310
-
311
- * Update Vagrantfile to use multi-provider Hashicorp precise64 box - remove URLs. @townsen
312
- * Merge host ssh_options and Netssh defaults @townsen
313
- Previously if host-level ssh_options were defined the Netssh defaults
314
- were ignored.
315
- * Merge host ssh_options and Netssh defaults
316
- * Fixed race condition where output of failed command would be empty. @townsen
317
- Caused random failures of `test_execute_raises_on_non_zero_exit_status_and_captures_stdout_and_stderr`
318
- Also fixes output handling in failed commands, and generally buggy output.
319
- * Remove override of backtrace() and backtrace_locations() from ExecuteError. @townsen
320
- This interferes with rake default behaviour and creates duplicate stacktraces.
321
- * Allow running local commands using `on(:local)`
322
- * Implement the upload! and download! methods for the local backend
323
-
324
- ## 1.6.0
325
-
326
- * Fix colorize to use the correct API (@fazibear)
327
- * Lock colorize (sorry guys) version at >= 0.7.0
328
-
329
- ## 1.6.0 (Yanked, because of colorize.)
330
-
331
- * Force dependency on colorize v0.6.0
332
- * Add your entries here, remember to credit yourself however you want to be
333
- credited!
334
- * Remove strip from capture to preserve whitespace. Nick Townsend
335
- * Add vmware_fusion Vagrant provider. Nick Townsend
336
- * Add some padding to the pretty log formatter
337
-
338
- ## 1.5.1
339
-
340
- * Use `sudo -u` rather than `sudo su` to switch users. Mat Trudel
341
-
342
- ## 1.5.0
343
-
344
- * Deprecate background helper - too many badly behaved pseudo-daemons. Lee Hambley
345
- * Don't colourize unless $stdout is a tty. Lee Hambley
346
- * Remove out of date "Known Issues" section from README. Lee Hambley
347
- * Dealy variable interpolation inside `as()` block. Nick Townsend
348
- * Fixes for functional tests under modern Vagrant. Lewis Marshal
349
- * Fixes for connection pooling. Chris Heald
350
- * Add `localhost` hostname to local backend. Adam Mckaig
351
- * Wrap execptions to include hostname. Brecht Hoflack
352
- * Remove `shellwords` stdlib dependency Bruno Sutic
353
- * Remove unused `cooldown` accessor. Bruno Sutic
354
- * Replace Term::ANSIColor with a lighter solution. Tom Clements
355
- * Documentation fixes. Matt Brictson
356
-
357
- ## 1.4.0
358
-
359
- https://github.com/capistrano/sshkit/compare/v1.3.0...v1.4.0
360
-
361
- * Removed `invoke` alias for [`SSHKit::Backend::Printer.execute`](https://github.com/capistrano/sshkit/blob/master/lib/sshkit/backends/printer.rb#L20). This is to prevent collisions with
362
- methods in capistrano with similar names, and to provide a cleaner API. See [capistrano issue 912](https://github.com/capistrano/capistrano/issues/912) and [issue 107](https://github.com/capistrano/sshkit/issues/107) for more details.
363
- * Connection pooling now uses a thread local to store connection pool, giving each thread its own connection pool. Thank you @mbrictson see [#101](https://github.com/capistrano/sshkit/pull/101) for more.
364
- * Command map indifferent towards strings and symbols thanks to @thomasfedb see [#91](https://github.com/capistrano/sshkit/pull/91)
365
- * Moved vagrant wrapper to `support` directory, added ability to run tests with vagrant using ssh. @miry see [#64](https://github.com/capistrano/sshkit/pull/64)
366
- * Removed unnecessary require `require_relative '../sshkit'` in `lib/sshkit/dsl.rb` prevents warnings thanks @brabic.
367
- * Doc fixes thanks @seanhandley @vojto
368
-
369
- ## 1.3.0
370
-
371
- https://github.com/capistrano/sshkit/compare/v1.2.0...v1.3.0
372
-
373
- * Connection pooling. SSH connections are reused across multiple invocations
374
- of `on()`, which can result in significant performance gains. See:
375
- https://github.com/capistrano/sshkit/pull/70. Matt @mbrictson Brictson.
376
- * Fixes to the Formatter::Dot and to the formatter class name resolver. @hab287:w
377
- * Added the license to the Gemspec. @anatol.
378
- * Fix :limit handling for the `in: :groups` run mode. Phil @phs Smith
379
- * Doc fixes @seanhandley, @sergey-alekseev.
380
-
381
- ## 1.2.0
382
-
383
- https://github.com/capistrano/sshkit/compare/v1.1.0...v1.2.0
384
-
385
- * Support picking up a project local SSH config file, if a SSH config file
386
- exists at ./.ssh/config it will be merged with the ~/.ssh/config. This is
387
- ideal for defining project-local proxies/gateways, etc. Thanks to Alex
388
- @0rca Vzorov.
389
- * Tests and general improvements to the Printer backends (mostly used
390
- internally). Thanks to Michael @miry Nikitochkin.
391
- * Update the net-scp dependency version. Thanks again to Michael @miry
392
- Nikitochkin.
393
- * Improved command map. This feature allows mapped variables to be pushed
394
- and unshifted onto the mapping so that the Capistrano extensions for
395
- rbenv and bundler, etc can work together. For discussion about the reasoning
396
- see https://github.com/capistrano/capistrano/issues/639 and
397
- https://github.com/capistrano/sshkit/pull/45. A big thanks to Kir @kirs
398
- Shatrov.
399
- * `test()` and `capture()` now behave as expected inside a `run_locally` block
400
- meaning that they now run on your local machine, rather than erring out. Thanks
401
- to Kentaro @kentaroi Imai.
402
- * The `:wait` option is now successfully passed to the runner now. Previously the
403
- `:wait` option was ignored. Thanks to Jordan @jhollinger Hollinger for catching
404
- the mistake in our test coverage.
405
- * Fixes and general improvements to the `download()` method which until now was
406
- quite naïve. Thanks to @chqr.
407
-
408
- ## 1.1.0
409
-
410
- https://github.com/capistrano/sshkit/compare/v1.0.0...v1.1.0
411
-
412
- * Please see the Git history. `git rebase` ate our changelog (we should have been
413
- more careful)
414
-
415
- ## 1.0.0
416
-
417
- * The gem now supports a run_locally, although it's nothing to do with SSH,
418
- it makes a nice API. There are examples in the EXAMPLES.md.
419
-
420
- ## 0.0.34
421
-
422
- * Allow the setting of global SSH options on the `backend.ssh` as a hash,
423
- these options are the same as Net::SSH configure expects. Thanks to Rafał
424
- @lisukorin Lisowski
425
-
426
- ## 0.0.32
427
-
428
- * Lots of small changes since 0.0.27.
429
- * Particularly working around a possible NaN issue when uploading
430
- comparatively large files.
431
-
432
- ## 0.0.27
433
-
434
- * Don't clobber SSH options with empty values. This allows Net::SSH to
435
- do the right thing most of the time, and look into the SSH configuration
436
- files.
437
-
438
- ## 0.0.26
439
-
440
- * Pretty output no longer prints white text. ("Command.....")
441
- * Fixed a double-output bug, where upon receiving the exit status from a
442
- remote command, the last data packet that it sent would be re-printed
443
- by the pretty formatter.
444
- * Integration tests now use an Ubuntu Precise 64 Vagrant base box.
445
- * Additional host declaration syntax, `SSHKit::Host` can now take a hash of
446
- host properties in addition to a number of new (common sense) DSN type
447
- syntaxes.
448
- * Changes to the constants used for logging, we no longer re-define a
449
- `Logger::TRACE` constant on the global `Logger` class, rather everyhing
450
- now uses `SSHKit::Logger` (Thanks to Rafa Garcia)
451
- * Various syntax and documentation fixes.
452
-
453
- ## 0.0.25
454
-
455
- * `upload!` and `download!` now log to different levels depending on
456
- completion percentage. When the upload is 0 percent complete or a number
457
- indivisible by 10, the message is logged to `Logger::DEBUG` otherwise the
458
- message is logged to `Logger::INFO`, this should mean that normal users at
459
- a sane log level should see upload progress jump to `100%` for small
460
- files, and otherwise for larger files they'll see output every `10%`.
461
-
462
- ## 0.0.24
463
-
464
- * Pretty output now streams stdout and stderr. Previous versions would
465
- append (`+=`) chunks of data written by the remote host to the `Command`
466
- instance, and the `Pretty` formatter would only print stdout/stderr if the
467
- command was `#complete?`. Historically this lead to issues where the
468
- remote process was blocking for input, had written the prompt to stdout,
469
- but it was not visible on the client side.
470
-
471
- Now each time the command is passed to the output stream, the
472
- stdout/stderr are replaced with the lines returned from the remote server
473
- in this chunk. (i.e were yielded to the callback block). Commands now have
474
- attribute accessors for `#full_stdout` and `#full_stderr` which are appended
475
- in the way that `#stdout` and `#stderr` were previously.
476
-
477
- This should be considered a private API, and one should beware of relying
478
- on `#full_stdout` or `#full_stderr`, they will likely be replaced with a
479
- cleaner soltion eventually.
480
-
481
- * `upload!` and `download!` now print progress reports at the `Logger::INFO`
482
- verbosity level.
483
-
484
- ## 0.0.23
485
-
486
- * Explicitly rely on `net-scp` gem.
487
-
488
- ## 0.0.22
489
-
490
- * Added naïve implementations of `upload!()` and `download!()` (syncoronous) to
491
- the Net::SSH backend. See `EXAMPLES.md` for more extensive usage examples.
492
-
493
- The `upload!()` method can take a filename, or an `IO`, this reflects the way
494
- the underlying Net::SCP implementation works. The same is true of
495
- `download!()`, when called with a single argument it captures the file's
496
- contents, otherwise it downloads the file to the local disk.
497
-
498
- on hosts do |host|
499
- upload!(StringIO.new('some-data-here'), '~/.ssh/authorized_keys')
500
- upload!('~/.ssh/id_rsa.pub', '~/.ssh/authorized_keys')
501
- puts download!('/etc/monit/monitrc')
502
- download!('/etc/monit/monitrc', '~/monitrc')
503
- end
504
-
505
- ## 0.0.21
506
-
507
- * Fixed an issue with default formatter
508
- * Modified `SSHKit.config.output_verbosity=` to accept different objects:
509
-
510
- SSHKit.config.output_verbosity = Logger::INFO
511
- SSHKit.config.output_verbosity = :info
512
- SSHKit.config.output_verbosity = 1
513
-
514
- ## 0.0.20
515
-
516
- * Fixed a bug where the log level would be assigned, not compared in the
517
- pretty formatter, breaking the remainder of the output verbosity.
518
-
519
- ## 0.0.19
520
-
521
- * Modified the `Pretty` formatter to include the log level in front of
522
- executed commands.
523
-
524
- * Modified the `Pretty` formatter not to print stdout and stderr by default,
525
- the log level must be raised to Logger::DEBUG to see the command outputs.
526
-
527
- * Modified the `Pretty` formatter to use `Command#to_s` when printing the
528
- command, this prints the short form (without modifications/wrappers applied
529
- to the command for users, groups, directories, umasks, etc).
530
-
531
- ## 0.0.18
532
-
533
- * Enable `as()` to take either a string/symbol as previously, but also now
534
- accepts a hash of `{user: ..., group: ...}`. In case that your host system
535
- supports the command `sg` (`man 1 sg`) to switch your effective group ID
536
- then one can work on files as a team group user.
537
-
538
- on host do |host|
539
- as user: :peter, group: griffin do
540
- execute :touch, 'somefile'
541
- end
542
- end
543
-
544
- will result in a file with the following permissions:
545
-
546
- -rw-r--r-- 1 peter griffin 0 Jan 27 08:12 somefile
547
-
548
- This should make it much easier to share deploy scripts between team
549
- members.
550
-
551
- **Note:** `sg` has some very strict user and group password requirements
552
- (the user may not have a password (`passwd username -l` to lock an account
553
- that already has a password), and the group may not have a password.)
554
-
555
- Additionally, and unsurprisingly *the user must also be a member of the
556
- group.*
557
-
558
- `sg` was chosen over `newgrp` as it's easier to embed in a one-liner
559
- command, `newgrp` could be used with a heredoc, but my research suggested
560
- that it might be better to use sg, as it better represents my intention, a
561
- temporary switch to a different effective group.
562
-
563
- * Fixed a bug with environmental variables and umasking introduced in 0.0.14.
564
- Since that version the environmental variables were being presented to the
565
- umask command's subshell, and not to intended command's subshell.
566
-
567
- incorrect: `ENV=var umask 002 && env`
568
- correct: `umask 002 && ENV=var env`
569
-
570
- * Changed the exception handler, if a command returns with a non-zero exit
571
- status then the output will be prefixed with the command name and which
572
- channel any output was written to, for example:
573
-
574
- Command.new("echo ping; false")
575
- => echo stdout: ping
576
- echo stderr: Nothing written
577
-
578
- In this contrived example that's more or less useless, however with badly
579
- behaved commands that write errors to stdout, and don't include their name
580
- in the program output, it can help a lot with debugging.
581
-
582
- ## 0.0.17
583
-
584
- * Fixed a bug introduced in 0.0.16 where the capture() helper returned
585
- the name of the command that had been run, not it's output.
586
-
587
- * Classify the pre-directory switch, and pre-user switch command guards
588
- as having a DEBUG log level to exclude them from the logs.
589
-
590
- ## 0.0.16
591
-
592
- * Fixed a bug introduced in 0.0.15 where the capture() helper returned
593
- boolean, discarding any output from the server.
594
-
595
- ## 0.0.15
596
-
597
- * `Command` now takes a `verbosity` option. This defaults to `Logger::INFO`
598
- and can be set to any of the Ruby logger level constants. You can also set
599
- it to the symbol `:debug` (and friends) which will be expanded into the correct
600
- constants.
601
-
602
- The log verbosity level is set to Logger::INFO by default, and can be
603
- overridden by setting `SSHKit.config.output_verbosity = Logger::{...}`,
604
- pick a level that works for you.
605
-
606
- By default `test()` and `capture()` calls are surpressed, and not printed
607
- by the pretty logger as of this version.
608
-
609
- ## 0.0.14
610
-
611
- * Umasks can now be set on `Command` instances. It can be set globally with
612
- `SSHKit.config.umask` (default, nil; meaning take the system default). This
613
- can be used to set, for example a umask of `007` for allowing users with
614
- the same primary group to share code without stepping on eachother's toes.
615
-
616
- ## 0.0.13
617
-
618
- * Correctly quote `as(user)` commands, previously it would expand to:
619
- `sudo su user -c /usr/bin/env echo "Hello World"`, in which the command to
620
- run was taken as simply `/usr/bin/env`. By quoting all arguments it should
621
- now work as expected. `sudo su user -c "/usr/bin/env echo \""Hello World\""`
622
-
623
- ## 0.0.12
624
-
625
- * Also print anything the program wrote to stdout when the exit status is
626
- non-zero and the command raises an error. (assits debugging badly behaved
627
- programs that fail, and write their error output to stdout.)
628
-
629
- ## 0.0.11
630
-
631
- * Implementing confuguration objects on the backends (WIP, undocumented)
632
- * Implement `SSHKit.config.default_env`, a hash which can be modified and
633
- will act as a global `with`.
634
- * Fixed #9 (with(a: 'b', c: 'c') being parsed as `A=bC=d`. Now properly space
635
- separated.
636
- * Fixed #10 (overly aggressive shell escaping), one can now do:
637
- `with(path: 'foo:$PATH') without the $ being escaped too early.
638
-
639
- ## 0.0.10
640
-
641
- * Include more attributes in `Command#to_hash`.
642
-
643
- ## 0.0.9
644
-
645
- * Include more attributes in `Command#to_hash`.
646
-
647
- ## 0.0.8
648
-
649
- * Added DSL method `background()` this sends a task to the background using
650
- `nohup` and redirects it's output to `/dev/null` so as to avoid littering
651
- the filesystem with `nohup.out` files.
652
-
653
- **Note:** Backgrounding a task won't work as you expect if you give it a
654
- string, that is you must do `background(:sleep, 5)` and not `background("sleep 5")`
655
- according to the rules by which a command is not processed in any way **if it
656
- contains a spaca character in it's first argument**.
657
-
658
- Usage Example:
659
-
660
- on hosts do
661
- background :rake, "assets:precompile" # typically takes 5 minutes!
662
- end
663
-
664
- **Further:** Many programs are badly behaved and no not work well with `nohup`
665
- it has to do with the way nohup works, reopening the processe's file
666
- descriptors and redirecting them. Programs that re-open, or otherwise
667
- manipulate their own file descriptors may lock up when the SSH session is
668
- disconnected, often they block writing to, or reading from stdin/out.
669
-
670
- ## 0.0.7
671
-
672
- * DSL method `execute()` will now raise `SSHKit::Command::Failed` when the
673
- exit status is non-zero. The message of the exception will be whatever the
674
- process had written to stdout.
675
- * New DSL method `test()` behaves as `execute()` used to until this version.
676
- * `Command` now raises an error in `#exit_status=()` if the exit status given
677
- is not zero. (see below)
678
- * All errors raised by error conditions of SSHKit are defined as subclasses of
679
- `SSHKit::StandardError` which is itself a subclass of `StandardError`.
680
-
681
- The `Command` objects can be set to not raise, by passing `raise_on_non_zero_exit: false`
682
- when instantiating them, this is exactly what `test()` does internally.
683
-
684
- Example:
685
-
686
- on hosts do |host
687
- if test "[ -d /opt/sites ]" do
688
- within "/opt/sites" do
689
- execute :git, :pull
690
- end
691
- else
692
- execute :git, :clone, 'some-repository', '/opt/sites'
693
- end
694
- end
695
-
696
- ## 0.0.6
697
-
698
- * Support arbitrary properties on Host objects. (see below)
699
-
700
- Starting with this version, the `Host` class supports arbitrary properties,
701
- here's a proposed use-case:
702
-
703
- servers = %w{one.example.com two.example.com
704
- three.example.com four.example.com}.collect do |s|
705
- h = SSHKit::Host.new(s)
706
- if s.match /(one|two)/
707
- h.properties.roles = [:web]
708
- else
709
- h.properties.roles = [:app]
710
- end
711
- end
712
-
713
- on servers do |host|
714
- if host.properties.roles.include?(:web)
715
- # Do something pertinent to web servers
716
- elsif host.properties.roles.include?(:app)
717
- # Do something pertinent to application servers
718
- end
719
- end
720
-
721
- Naturally, this is a contrived example, the `#properties` attribute on the
722
- Host instance is implemented as an [`OpenStruct`](http://ruby-doc.org/stdlib-1.9.3/libdoc/ostruct/rdoc/OpenStruct.html) and
723
- will behave exactly as such.
724
-
725
- ## 0.0.5
726
-
727
- * Removed configuration option `SSHKit.config.format` (see below)
728
- * Removed configuration option `SSHKit.config.runner` (see below)
729
-
730
- The format should now be set by doing:
731
-
732
- SSHKit.config.output = File.open('/dev/null')
733
- SSHKit.config.output = MyFormatterClass.new($stdout)
734
-
735
- The library ships with three formatters, `BlackHole`, `Dot` and `Pretty`.
736
-
737
- The default is `Pretty`, but can easily be changed:
738
-
739
- SSHKit.config.output = SSHKit::Formatter::Pretty.new($stdout)
740
- SSHKit.config.output = SSHKit::Formatter::Dot.new($stdout)
741
- SSHKit.config.output = SSHKit::Formatter::BlackHole.new($stdout)
742
-
743
- The one and only argument to the formatter is the *String/StringIO*ish object
744
- to which the output should be sent. (It should be possible to stack
745
- formatters, or build a multi-formatter to log, and stream to the screen, for
746
- example)
747
-
748
- The *runner* is now set by `default_options` on the Coordinator class. The
749
- default is still *:parallel*, and can be overridden on the `on()` (or
750
- `Coordinator#each`) calls directly.
751
-
752
- There is no global way to change the runner style for all `on()` calls as of
753
- version `0.0.5`.
754
-
755
- ## 0.0.4
756
-
757
- * Rename the ConnectionManager class to Coordinator, connections are handled
758
- in the backend, if it needs to create some connections.
759
-
760
- ## 0.0.3
761
-
762
- * Refactor the runner classes into an abstract heirarchy.
763
-
764
- ## 0.0.2
765
-
766
- * Include a *Pretty* formatter
767
- * Modify example to use Pretty formatter.
768
- * Move common behaviour to an abstract formatter.
769
- * Formatters no longer inherit StringIO
770
-
771
- ## 0.0.1
772
-
773
- First release.
774
-
775
- [Unreleased]: https://github.com/capistrano/sshkit/compare/v1.20.0...HEAD
776
- [1.20.0]: https://github.com/capistrano/sshkit/compare/v1.19.1...v1.20.0
777
- [1.19.1]: https://github.com/capistrano/sshkit/compare/v1.19.0...v1.19.1
778
- [1.19.0]: https://github.com/capistrano/sshkit/compare/v1.18.2...v1.19.0
779
- [1.18.2]: https://github.com/capistrano/sshkit/compare/v1.18.1...v1.18.2
780
- [1.18.1]: https://github.com/capistrano/sshkit/compare/v1.18.0...v1.18.1
781
- [1.18.0]: https://github.com/capistrano/sshkit/compare/v1.17.0...v1.18.0
782
- [1.17.0]: https://github.com/capistrano/sshkit/compare/v1.16.1...v1.17.0
783
- [1.16.1]: https://github.com/capistrano/sshkit/compare/v1.16.0...v1.16.1
784
- [1.16.0]: https://github.com/capistrano/sshkit/compare/v1.15.1...v1.16.0
785
- [1.15.1]: https://github.com/capistrano/sshkit/compare/v1.15.0...v1.15.1
786
- [1.15.0]: https://github.com/capistrano/sshkit/compare/v1.14.0...v1.15.0
787
- [1.14.0]: https://github.com/capistrano/sshkit/compare/v1.13.1...v1.14.0
788
- [1.13.1]: https://github.com/capistrano/sshkit/compare/v1.13.0...v1.13.1
789
- [1.13.0]: https://github.com/capistrano/sshkit/compare/v1.12.0...v1.13.0
790
- [1.12.0]: https://github.com/capistrano/sshkit/compare/v1.11.5...v1.12.0
791
- [1.11.5]: https://github.com/capistrano/sshkit/compare/v1.11.4...v1.11.5
792
- [1.11.4]: https://github.com/capistrano/sshkit/compare/v1.11.3...v1.11.4
793
- [1.11.3]: https://github.com/capistrano/sshkit/compare/v1.11.2...v1.11.3
794
- [1.11.2]: https://github.com/capistrano/sshkit/compare/v1.11.1...v1.11.2
795
- [1.11.1]: https://github.com/capistrano/sshkit/compare/v1.11.0...v1.11.1
796
- [1.11.0]: https://github.com/capistrano/sshkit/compare/v1.10.0...v1.11.0
1
+ Release notes for this project are kept here: https://github.com/capistrano/sshkit/releases
data/Dangerfile CHANGED
@@ -1 +1 @@
1
- danger.import_dangerfile(github: "capistrano/danger")
1
+ danger.import_dangerfile(github: "capistrano/danger", branch: "no-changelog")
data/Gemfile CHANGED
@@ -7,13 +7,6 @@ platforms :rbx do
7
7
  gem 'json'
8
8
  end
9
9
 
10
- # Chandler requires Ruby >= 2.1.0, but depending on the Travis environment,
11
- # we may not meet that requirement. Only include the chandler gem if the Ruby
12
- # requirement is met. (Chandler is used only for `rake release`; see Rakefile.)
13
- if Gem::Requirement.new('>= 2.1.0').satisfied_by?(Gem::Version.new(RUBY_VERSION))
14
- gem 'chandler', '>= 0.1.1'
15
- end
16
-
17
10
  # public_suffix 3+ requires ruby 2.1+
18
11
  if Gem::Requirement.new('< 2.1').satisfied_by?(Gem::Version.new(RUBY_VERSION))
19
12
  gem 'public_suffix', '< 3'
data/README.md CHANGED
@@ -590,8 +590,4 @@ end
590
590
 
591
591
  ## SSHKit Related Blog Posts
592
592
 
593
- [SSHKit Gem Basics](http://www.rubyplus.com/articles/591)
594
-
595
- [SSHKit Gem Part 2](http://www.rubyplus.com/articles/601)
596
-
597
593
  [Embedded Capistrano with SSHKit](http://ryandoyle.net/posts/embedded-capistrano-with-sshkit/)
data/RELEASING.md CHANGED
@@ -5,7 +5,6 @@
5
5
  * You must have commit rights to the SSHKit repository.
6
6
  * You must have push rights for the sshkit gem on rubygems.org.
7
7
  * You must be using Ruby >= 2.1.0.
8
- * Your `~/.netrc` must be configured with your GitHub credentials, [as explained here](https://github.com/mattbrictson/chandler#2-configure-netrc).
9
8
 
10
9
  ## How to release
11
10
 
@@ -13,6 +12,6 @@
13
12
  2. **Ensure the tests are passing by running `rake test`.** If functional tests fail, ensure you have [Vagrant](https://www.vagrantup.com) installed and have started it with `vagrant up`.
14
13
  3. Determine which would be the correct next version number according to [semver](http://semver.org/).
15
14
  4. Update the version in `./lib/sshkit/version.rb`.
16
- 5. Update the `CHANGELOG`.
17
- 6. Commit the changelog and version in a single commit, the message should be "Preparing vX.Y.Z"
18
- 7. Run `rake release`; this will tag, push to GitHub, publish to rubygems.org, and upload the latest changelog entry to the [GitHub releases page](https://github.com/capistrano/sshkit/releases).
15
+ 5. Commit the `version.rb` change with a message like "Preparing vX.Y.Z"
16
+ 6. Run `rake release`; this will tag, push to GitHub, and publish to rubygems.org
17
+ 7. Update the draft release on the [GitHub releases page](https://github.com/capistrano/sshkit/releases) to point to the new tag and publish the release
data/Rakefile CHANGED
@@ -30,10 +30,7 @@ RuboCop::RakeTask.new(:lint) do |task|
30
30
  task.options = ['--lint']
31
31
  end
32
32
 
33
- task "release:rubygem_push" do
34
- # Delay loading Chandler until this point, since it requires Ruby >= 2.1,
35
- # which may not be available in all environments (e.g. Travis).
36
- # We assume that the person doing `rake release` has Ruby >= 2.1.
37
- require "chandler/tasks"
38
- Rake.application.invoke_task("chandler:push")
33
+ Rake::Task["release"].enhance do
34
+ puts "Don't forget to publish the release on GitHub!"
35
+ system "open https://github.com/capistrano/sshkit/releases"
39
36
  end
@@ -7,4 +7,3 @@ include SSHKit::DSL
7
7
  on [ENV.fetch("HOST")] do
8
8
  execute "echo hello"
9
9
  end
10
-
@@ -239,7 +239,7 @@ module SSHKit
239
239
 
240
240
  def call_interaction_handler(stream_name, data, channel)
241
241
  interaction_handler = options[:interaction_handler]
242
- interaction_handler = MappingInteractionHandler.new(interaction_handler) if interaction_handler.kind_of?(Hash)
242
+ interaction_handler = MappingInteractionHandler.new(interaction_handler) if interaction_handler.kind_of?(Hash) or interaction_handler.kind_of?(Proc)
243
243
  interaction_handler.on_data(self, stream_name, data, channel) if interaction_handler.respond_to?(:on_data)
244
244
  end
245
245
 
@@ -1,3 +1,3 @@
1
1
  module SSHKit
2
- VERSION = "1.20.0".freeze
2
+ VERSION = "1.21.1".freeze
3
3
  end
data/sshkit.gemspec CHANGED
@@ -9,6 +9,9 @@ Gem::Specification.new do |gem|
9
9
  gem.description = %q{A comprehensive toolkit for remotely running commands in a structured manner on groups of servers.}
10
10
  gem.homepage = "http://github.com/capistrano/sshkit"
11
11
  gem.license = "MIT"
12
+ gem.metadata = {
13
+ "changelog_uri" => "https://github.com/capistrano/sshkit/releases"
14
+ }
12
15
 
13
16
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
14
17
  gem.files = `git ls-files`.split("\n")
@@ -99,6 +99,24 @@ module SSHKit
99
99
  end.run
100
100
  assert_equal("Enter Data\nCaptured SOME DATA", captured_command_result)
101
101
  end
102
+
103
+ def test_interaction_handler_with_proc
104
+ captured_command_result = nil
105
+ Local.new do
106
+ command = 'echo Enter Data; read the_data; echo Captured $the_data;'
107
+ captured_command_result = capture(command, interaction_handler:
108
+ lambda { |data|
109
+ case data
110
+ when "Enter Data\n"
111
+ "SOME DATA\n"
112
+ when "Captured SOME DATA\n"
113
+ nil
114
+ end
115
+ }
116
+ )
117
+ end.run
118
+ assert_equal("Enter Data\nCaptured SOME DATA", captured_command_result)
119
+ end
102
120
  end
103
121
  end
104
122
  end
@@ -180,7 +180,7 @@ module SSHKit
180
180
  size = 25
181
181
  fills = SecureRandom.random_bytes(1024*1024)
182
182
  file_name = "/tmp/file-#{size}.txt"
183
- File.open(file_name, 'w') do |f|
183
+ File.open(file_name, 'wb') do |f|
184
184
  (size).times {f.write(fills) }
185
185
  end
186
186
  file_contents = ""
@@ -188,7 +188,7 @@ module SSHKit
188
188
  upload!(file_name, file_name)
189
189
  file_contents = download!(file_name)
190
190
  end.run
191
- assert_equal File.open(file_name).read, file_contents
191
+ assert_equal File.open(file_name, 'rb').read, file_contents
192
192
  end
193
193
 
194
194
  def test_upload_via_pathname
data/test/helper.rb CHANGED
@@ -3,7 +3,7 @@ require 'bundler/setup'
3
3
  require 'tempfile'
4
4
  require 'minitest/autorun'
5
5
  require 'minitest/reporters'
6
- require 'mocha/setup'
6
+ require 'mocha/minitest'
7
7
  require 'stringio'
8
8
  require 'json'
9
9
 
@@ -115,7 +115,7 @@ module SSHKit
115
115
 
116
116
  def test_can_write_to_output_which_just_supports_append
117
117
  # Note output doesn't have to be an IO, it only needs to support <<
118
- output = stub(:<<)
118
+ output = stub(:<< => nil)
119
119
  pretty = SSHKit::Formatter::Pretty.new(output)
120
120
  simulate_command_lifecycle(pretty)
121
121
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Hambley
8
8
  - Tom Clements
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-08-03 00:00:00.000000000 Z
12
+ date: 2020-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -180,6 +180,8 @@ executables: []
180
180
  extensions: []
181
181
  extra_rdoc_files: []
182
182
  files:
183
+ - ".github/release-drafter.yml"
184
+ - ".github/workflows/push.yml"
183
185
  - ".gitignore"
184
186
  - ".rubocop.yml"
185
187
  - ".rubocop_todo.yml"
@@ -271,8 +273,9 @@ files:
271
273
  homepage: http://github.com/capistrano/sshkit
272
274
  licenses:
273
275
  - MIT
274
- metadata: {}
275
- post_install_message:
276
+ metadata:
277
+ changelog_uri: https://github.com/capistrano/sshkit/releases
278
+ post_install_message:
276
279
  rdoc_options: []
277
280
  require_paths:
278
281
  - lib
@@ -287,8 +290,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
290
  - !ruby/object:Gem::Version
288
291
  version: '0'
289
292
  requirements: []
290
- rubygems_version: 3.0.4
291
- signing_key:
293
+ rubygems_version: 3.1.4
294
+ signing_key:
292
295
  specification_version: 4
293
296
  summary: SSHKit makes it easy to write structured, testable SSH commands in Ruby
294
297
  test_files: