xcpretty-travis-formatter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7a71ff4b9428b55d6fa575b0eb6f4b29e1236ec9
4
+ data.tar.gz: 92fc137fb5f7061308a8b4c4dd74cdcaf6e6a8d2
5
+ SHA512:
6
+ metadata.gz: 8c85f84f0f0c516249201f01968dd0b4c636fcd35a6cce8f3da3335a4af888eb3843f2710d228871646f67d5d88bcb9e3fd579cb0483cb730eba8e9ae5e7027c
7
+ data.tar.gz: 4e09074ef43be6ae1a12f4ed1b5e05151bdc116418570f6e7fa7c7c2785abb9ca83270f5044289d570b5fa6161de1a2b92d36fa77b5978ca09e9f5a5282a4d83
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Delisa Mason
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # XCPretty TravisCI Formatter
2
+
3
+ Custom formatter for [xcpretty](https://github.com/supermarin/xcpretty) with some syntactic sugar for presentation on TravisCI.
4
+
5
+ ## Installation
6
+
7
+ This formatter is distributed via RubyGems, and depends on a version of `xcpretty` >= 0.0.7 (when custom formatters were introduced). Run:
8
+
9
+ gem install xcpretty-travis-formatter
10
+
11
+ ## Usage
12
+
13
+ Specify `xcpretty-travis-formatter` as a custom formatter to `xcpretty`:
14
+
15
+ ```bash
16
+ #!/bin/bash
17
+
18
+ xcodebuild | xcpretty -f `xcpretty-travis-formatter`
19
+ ```
20
+
21
+ ## How it works
22
+
23
+ The `--formatter` option takes a file path as an argument, which is returned by the `xcpretty-travis-formatter` binary. It must be evaluated before the xcpretty arguments are evaluated, hence the backtick wrapping. The specified file must return a Ruby subclass of `XCPretty::Formatter`, which will then receive `formatter_*` method invocations as the build output is parsed.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ print File.expand_path('../../lib/travis_formatter.rb', __FILE__)
@@ -0,0 +1,37 @@
1
+
2
+ class TravisFormatter < XCPretty::Simple
3
+
4
+ def open_fold(text)
5
+ return if text == @open_fold
6
+ close_fold(@open_fold) if @open_fold
7
+ puts "travis_fold:start:#{text}\r"
8
+ @open_fold = text
9
+ end
10
+
11
+ def close_fold(text)
12
+ puts "travis_fold:end:#{text}\r"
13
+ @open_fold = nil
14
+ end
15
+
16
+ def format_build_target(target, project, configuration)
17
+ open_fold("Build:#{target}")
18
+ super
19
+ end
20
+
21
+ def format_clean_target(project, target, configuration)
22
+ open_fold("Clean Targets")
23
+ super
24
+ end
25
+
26
+ def format_test_run_started(name)
27
+ open_fold(name)
28
+ super
29
+ end
30
+
31
+ def format_test_run_finished(name, time)
32
+ super
33
+ close_fold(name)
34
+ end
35
+ end
36
+
37
+ TravisFormatter
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xcpretty-travis-formatter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Delisa Mason
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xcpretty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.7
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.1'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.0.7
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.3'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.3'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bacon
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.2'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '1.2'
75
+ description: "\n Formatter for xcpretty customized to provide pretty output on TravisCI\n
76
+ \ "
77
+ email:
78
+ - iskanamagus@gmail.com
79
+ executables:
80
+ - xcpretty-travis-formatter
81
+ extensions: []
82
+ extra_rdoc_files: []
83
+ files:
84
+ - LICENSE
85
+ - README.md
86
+ - bin/xcpretty-travis-formatter
87
+ - lib/travis_formatter.rb
88
+ homepage: https://github.com/kattrali/xcpretty-travis-formatter
89
+ licenses:
90
+ - MIT
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.2.2
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: xcpretty custom formatter for TravisCI
112
+ test_files: []