Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cp_r in local backend with recursive option #372

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

okuramasafumi
Copy link
Contributor

When recursive optionfor upload! method is true, local argument is likely to be a String representing a directory, but FileUtils.cp doesn't accept it. So here we use FileUtils.cp_r instead.

@leehambley
Copy link
Member

Thanks for the patch @okuramasafumi we'll need a test to verify this as working, and as you're working in this area, you may want to fix the build, which is currently failing because _options shouldn't be prefixed if it's now used in the function according to Rubocop.

@okuramasafumi
Copy link
Contributor Author

@leehambley OK, I'll change variable name from _options to option. Also, I'll add tests for upload! method, which currently doesn't exist.

@okuramasafumi
Copy link
Contributor Author

@leehambley Btw, do you have a plan for a test or stub backend? I used local backend for tests, but it feels like it lacks some features, such as stubbing executions.

@leehambley
Copy link
Member

You ought to be able to use the stubbing from the test framework, it's a fairly simple unit test that the method was called, I don't think we need to test the standard library behaves correctly!

@okuramasafumi
Copy link
Contributor Author

Sorry for the delay, I fixed the test so please check this again!

@mattbrictson
Copy link
Member

Hi @okuramasafumi, thanks again for the PR! I don't see the test that you mentioned. Can you make sure all your changes have been pushed?

@okuramasafumi
Copy link
Contributor Author

@mattbrictson I added tests and squashed commits.

@mattbrictson
Copy link
Member

Excellent work! Thanks ✨

@mattbrictson mattbrictson merged commit da3ff8f into capistrano:master Mar 15, 2017
@okuramasafumi okuramasafumi deleted the patch-1 branch March 15, 2017 05:46
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Apr 22, 2017
## [1.13.1][] (2017-03-31)

### Breaking changes

  * None

### Bug fixes

  * [#397](https://github.com/capistrano/sshkt/pull/397): Fix NoMethodError assign_defaults with net-ssh older than 4.0.0 - [@shirosaki](https://github.com/shirosaki)

## [1.13.0][] (2017-03-24)

### Breaking changes

  * None

### New features

  * [#372](capistrano/sshkit#372): Use cp_r in local backend with recursive option - [@okuramasafumi](https://github.com/okuramasafumi)

### Bug fixes

  * [#390](capistrano/sshkit#390): Properly wrap Ruby StandardError w/ add'l context - [@mattbrictson](https://github.com/mattbrictson)
  * [#392](capistrano/sshkit#392): Fix open two connections with changed cache key - [@shirosaki](https://github.com/shirosaki)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants