From a5cb669396edabf6d8a017825240ad6bf40c443b Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Tue, 14 Mar 2017 16:38:30 +1100 Subject: [PATCH 1/2] Add CLI returning versions We have two commands: - version, the plugin version - swiftlint_version, the version of the SwiftLint binary used by the plugin --- Gemfile.lock | 20 +++++++++++--------- bin/danger-swiftlint | 21 +++++++++++++++++++++ danger-swiftlint.gemspec | 2 ++ 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100755 bin/danger-swiftlint diff --git a/Gemfile.lock b/Gemfile.lock index 58b82b9..be4b3b1 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,10 @@ PATH remote: . specs: - danger-swiftlint (0.3.0) + danger-swiftlint (0.16.1) danger + rake (~> 10.0) + thor (~> 0.19) GEM remote: https://rubygems.org/ @@ -17,12 +19,13 @@ GEM open4 (~> 1.3) coderay (1.1.1) colored (1.2) + colored2 (3.1.2) cork (0.2.0) colored (~> 1.2) - danger (4.0.3) + danger (4.3.0) claide (~> 1.0) claide-plugins (>= 0.9.2) - colored (~> 1.2) + colored2 (~> 3.1) cork (~> 0.1) faraday (~> 0.9) faraday-http-cache (~> 1.0) @@ -31,7 +34,7 @@ GEM octokit (~> 4.2) terminal-table (~> 1) diff-lcs (1.2.5) - faraday (0.10.0) + faraday (0.11.0) multipart-post (>= 1.2, < 3) faraday-http-cache (1.3.1) faraday (~> 0.8) @@ -52,7 +55,7 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - kramdown (1.13.1) + kramdown (1.13.2) listen (3.0.7) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9.7) @@ -78,7 +81,7 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - public_suffix (2.0.4) + public_suffix (2.0.5) rake (10.5.0) rb-fsevent (0.9.7) rb-inotify (0.9.7) @@ -104,7 +107,7 @@ GEM terminal-table (1.7.3) unicode-display_width (~> 1.1.1) thor (0.19.1) - unicode-display_width (1.1.2) + unicode-display_width (1.1.3) PLATFORMS ruby @@ -120,8 +123,7 @@ DEPENDENCIES mocha-on-bacon prettybacon pry - rake (~> 10.0) rspec (~> 3.4) BUNDLED WITH - 1.13.1 + 1.14.6 diff --git a/bin/danger-swiftlint b/bin/danger-swiftlint new file mode 100755 index 0000000..a1bb3c5 --- /dev/null +++ b/bin/danger-swiftlint @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby + +if $PROGRAM_NAME == __FILE__ + $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +end +require 'thor' +require 'version' + +class DangerSwiftlintCLI < Thor + desc 'version', 'The version of the installed danger-swiftlint plugin' + def version + puts DangerSwiftlint::VERSION + end + + desc 'swiftlint_version', 'The SwiftLint version used by the plugin' + def swiftlint_version + puts DangerSwiftlint::SWIFTLINT_VERSION + end +end + +DangerSwiftlintCLI.start(ARGV) diff --git a/danger-swiftlint.gemspec b/danger-swiftlint.gemspec index ea3f2f3..5f2be04 100755 --- a/danger-swiftlint.gemspec +++ b/danger-swiftlint.gemspec @@ -17,8 +17,10 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] spec.extensions = %w(ext/swiftlint/Rakefile) + spec.executables = ['danger-swiftlint'] spec.add_dependency 'danger' + spec.add_dependency 'thor', '~> 0.19' spec.add_dependency 'rake', '~> 10.0' # General ruby development From 6bf3c2e6de284fb9ed2686e93ba72baf3ed55214 Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Tue, 14 Mar 2017 16:40:08 +1100 Subject: [PATCH 2/2] Set plugin version to 0.4.0 See discussion in https://github.com/ashfurrow/danger-swiftlint/issues/31 --- Gemfile.lock | 2 +- lib/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index be4b3b1..74d5343 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - danger-swiftlint (0.16.1) + danger-swiftlint (0.4.0) danger rake (~> 10.0) thor (~> 0.19) diff --git a/lib/version.rb b/lib/version.rb index 6a68b80..92c0a93 100755 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,4 +1,4 @@ module DangerSwiftlint - VERSION = "0.16.1".freeze + VERSION = "0.4.0".freeze SWIFTLINT_VERSION = "0.16.1".freeze end