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

Add CLI command to print managed SwiftLint version #32

Merged
merged 2 commits into from
Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
PATH
remote: .
specs:
danger-swiftlint (0.3.0)
danger-swiftlint (0.4.0)
danger
rake (~> 10.0)
thor (~> 0.19)

GEM
remote: https://rubygems.org/
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -120,8 +123,7 @@ DEPENDENCIES
mocha-on-bacon
prettybacon
pry
rake (~> 10.0)
rspec (~> 3.4)

BUNDLED WITH
1.13.1
1.14.6
21 changes: 21 additions & 0 deletions bin/danger-swiftlint
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions danger-swiftlint.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module DangerSwiftlint
VERSION = "0.16.1".freeze
VERSION = "0.4.0".freeze
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone else following along, this is fine because 0.16.1 was never released to RubyGems.org so we're fine to "go backward" in semver.

SWIFTLINT_VERSION = "0.16.1".freeze
end