-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbb3ee8
commit 416a9a5
Showing
6 changed files
with
57 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2016 Valerio Mazzeo <[email protected]> | ||
Copyright (c) 2016 Valerio Mazzeo | ||
|
||
MIT License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec| | |
spec.version = Xcodebuild::VERSION | ||
spec.authors = ['Valerio Mazzeo'] | ||
spec.email = ['[email protected]'] | ||
spec.description = %q{A short description of danger-xcodebuild.} | ||
spec.summary = %q{A longer description of danger-xcodebuild.} | ||
spec.homepage = 'https://github.com/Valerio Mazzeo/danger-xcodebuild' | ||
spec.description = %q{Exposes warnings, errors and test results.} | ||
spec.summary = %q{Exposes warnings, errors and test results. It requires a JSON generated using xcpretty-json-formatter to be passed as an argument for it to work.} | ||
spec.homepage = 'https://github.com/valeriomazzeo/danger-xcodebuild' | ||
spec.license = 'MIT' | ||
|
||
spec.files = `git ls-files`.split($/) | ||
|
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec| | |
spec.add_development_dependency 'rspec', '~> 3.4' | ||
|
||
# Linting code and docs | ||
spec.add_development_dependency "rubocop", "~> 0.41" | ||
spec.add_development_dependency "yard", "~> 0.8" | ||
|
||
# Makes testing easy via `bundle exec guard` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,61 @@ | ||
module Danger | ||
# This is your plugin class. Any attributes or methods you expose here will | ||
# be available from within your Dangerfile. | ||
# Exposes warnings, errors and test results. | ||
# It requires a JSON generated using [xcpretty-json-formatter](https://github.com/marcelofabri/xcpretty-json-formatter), | ||
# to be passed as an argument for it to work. | ||
# | ||
# To be published on the Danger plugins site, you will need to have | ||
# the public interface documented. Danger uses [YARD](http://yardoc.org/) | ||
# for generating documentation from your plugin source, and you can verify | ||
# by running `danger plugins lint` or `bundle exec rake spec`. | ||
# @example Ensure the project compiles without warnings, errors and all tests are executed correctly | ||
# | ||
# You should replace these comments with a public description of your library. | ||
# xcodebuild.parse_warnings | ||
# xcodebuild.parse_errors | ||
# xcodebuild.parse_tests | ||
# | ||
# @example Ensure people are well warned about merging on Mondays | ||
# | ||
# my_plugin.warn_on_mondays | ||
# | ||
# @see Valerio Mazzeo/danger-xcodebuild | ||
# @tags monday, weekends, time, rattata | ||
# @see valeriomazzeo/danger-xcodebuild | ||
# @tags xcode, xcodebuild, errors, warnings, tests, xcpretty-json-formatter | ||
# | ||
class DangerXcodebuild < Plugin | ||
|
||
# An attribute that you can read/write from your Dangerfile | ||
# Allows you to specify an xcodebuild JSON file location to parse. | ||
attr_accessor :xcodebuild_json | ||
|
||
def initialize | ||
@warning_count = 0 | ||
@error_count = 0 | ||
@test_failures_count = 0 | ||
end | ||
|
||
# Parses and exposes eventual warnings. | ||
# @return [warning_count] | ||
# | ||
# @return [Array<String>] | ||
attr_accessor :my_attribute | ||
def parse_warnings | ||
|
||
# A method that you can call from your Dangerfile | ||
# @return [Array<String>] | ||
end | ||
|
||
# Parses and expose eventual errors. | ||
# @return [error_count] | ||
# | ||
def warn_on_mondays | ||
warn 'Trying to merge code on a Monday' if Date.today.wday == 1 | ||
def parse_errors | ||
|
||
end | ||
|
||
# Parses and exposes eventual test failures. | ||
# @return [test_failures] | ||
# | ||
def parse_tests | ||
|
||
end | ||
|
||
# Prints "Perfect build ππ»" if everything is ok after parsing. | ||
# @return [is_perfect_build] | ||
# | ||
def perfect_build | ||
is_perfect_build = @warning_count == 0 && @errors.count == 0 && @test_failures.count == 0 | ||
message("Perfect build ππ»") if is_perfect_build | ||
return is_perfect_build | ||
end | ||
end | ||
|
||
def self.instance_name | ||
to_s.gsub("Danger", "").danger_underscore.split("/").last | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters