ashfurrow / danger-ruby-swiftlint

A Danger plugin for SwiftLint.
https://rubygems.org/gems/danger-swiftlint
MIT License
203 stars 81 forks source link

Fix gem installation when installation path contains spaces #126

Closed johnhammerlund closed 5 years ago

johnhammerlund commented 5 years ago

Summary

A standard local installation of the danger-swiftlint gem will fail if spaces exist in the installation path.

Example:

Path: ~/Desktop/Folder With Spaces/. Gemfile:

source 'https://rubygems.org'

gem 'danger-swiftlint'

Running bundle install --path .bundle will incur a build failure within the native extension

Implementation

The issue occurs due to unescaped spaces being interpreted as bash argument delimiters in the swiftlint extension. This simply wraps the captured DESTINATION in the Rakefile for the swiftlint extension.

Testing

Using the above example:

  1. Locally check out this branch
  2. Update the gemfile:
    
    source 'https://rubygems.org'

gem 'danger-swiftlint', :path => '/path/to/local/gem'


3. Run `bundle install --path .bundle`
ashfurrow commented 5 years ago

This has been released as 0.19.2. Thanks again!!