danger-shroud 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.travis.yml +12 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +141 -0
- data/Guardfile +19 -0
- data/README.md +23 -0
- data/Rakefile +16 -0
- data/danger-shroud.gemspec +51 -0
- data/lib/danger_plugin.rb +1 -0
- data/lib/danger_shroud.rb +1 -0
- data/lib/shroud/gem_version.rb +3 -0
- data/lib/shroud/plugin.rb +106 -0
- data/spec/shroud_spec.rb +13 -0
- data/spec/spec_helper.rb +65 -0
- metadata +214 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 6f3ffc4824ad6bfa00483d31b2205bf7cefb8e32
|
|
4
|
+
data.tar.gz: ac67e86ed5ae5a83741838ceeec93da4fddb6fa4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f255150c99519afe159b75524eaba76bfaf98d911d89fbf0448691e0ae6bba8f13616d5b21376e90ca2db44b3548cd0df70dee2de9b6f5365f24fd05852438a5
|
|
7
|
+
data.tar.gz: a26d7f2ad1322fb83345a0cd8ec6fea67677d506bcc44a4672e3ccf73b6b63756f333dacb43ccc49e99234bc5415cd28c7d52472a5a6abaa8d032eebc8caf29d
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
danger-shroud (0.0.1)
|
|
5
|
+
danger-plugin-api (~> 1.0)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
addressable (2.6.0)
|
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
|
12
|
+
ast (2.4.0)
|
|
13
|
+
claide (1.0.2)
|
|
14
|
+
claide-plugins (0.9.2)
|
|
15
|
+
cork
|
|
16
|
+
nap
|
|
17
|
+
open4 (~> 1.3)
|
|
18
|
+
coderay (1.1.2)
|
|
19
|
+
colored2 (3.1.2)
|
|
20
|
+
cork (0.3.0)
|
|
21
|
+
colored2 (~> 3.1)
|
|
22
|
+
danger (6.0.9)
|
|
23
|
+
claide (~> 1.0)
|
|
24
|
+
claide-plugins (>= 0.9.2)
|
|
25
|
+
colored2 (~> 3.1)
|
|
26
|
+
cork (~> 0.1)
|
|
27
|
+
faraday (~> 0.9)
|
|
28
|
+
faraday-http-cache (~> 2.0)
|
|
29
|
+
git (~> 1.5)
|
|
30
|
+
kramdown (~> 2.0)
|
|
31
|
+
kramdown-parser-gfm (~> 1.0)
|
|
32
|
+
no_proxy_fix
|
|
33
|
+
octokit (~> 4.7)
|
|
34
|
+
terminal-table (~> 1)
|
|
35
|
+
danger-plugin-api (1.0.0)
|
|
36
|
+
danger (> 2.0)
|
|
37
|
+
diff-lcs (1.3)
|
|
38
|
+
faraday (0.15.4)
|
|
39
|
+
multipart-post (>= 1.2, < 3)
|
|
40
|
+
faraday-http-cache (2.0.0)
|
|
41
|
+
faraday (~> 0.8)
|
|
42
|
+
ffi (1.11.1)
|
|
43
|
+
formatador (0.2.5)
|
|
44
|
+
git (1.5.0)
|
|
45
|
+
guard (2.15.0)
|
|
46
|
+
formatador (>= 0.2.4)
|
|
47
|
+
listen (>= 2.7, < 4.0)
|
|
48
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
49
|
+
nenv (~> 0.1)
|
|
50
|
+
notiffany (~> 0.0)
|
|
51
|
+
pry (>= 0.9.12)
|
|
52
|
+
shellany (~> 0.0)
|
|
53
|
+
thor (>= 0.18.1)
|
|
54
|
+
guard-compat (1.2.1)
|
|
55
|
+
guard-rspec (4.7.3)
|
|
56
|
+
guard (~> 2.1)
|
|
57
|
+
guard-compat (~> 1.1)
|
|
58
|
+
rspec (>= 2.99.0, < 4.0)
|
|
59
|
+
jaro_winkler (1.5.2)
|
|
60
|
+
kramdown (2.1.0)
|
|
61
|
+
kramdown-parser-gfm (1.1.0)
|
|
62
|
+
kramdown (~> 2.0)
|
|
63
|
+
listen (3.0.7)
|
|
64
|
+
rb-fsevent (>= 0.9.3)
|
|
65
|
+
rb-inotify (>= 0.9.7)
|
|
66
|
+
lumberjack (1.0.13)
|
|
67
|
+
method_source (0.9.2)
|
|
68
|
+
mini_portile2 (2.4.0)
|
|
69
|
+
multipart-post (2.1.1)
|
|
70
|
+
nap (1.1.0)
|
|
71
|
+
nenv (0.3.0)
|
|
72
|
+
no_proxy_fix (0.1.2)
|
|
73
|
+
nokogiri (1.10.3)
|
|
74
|
+
mini_portile2 (~> 2.4.0)
|
|
75
|
+
notiffany (0.1.1)
|
|
76
|
+
nenv (~> 0.1)
|
|
77
|
+
shellany (~> 0.0)
|
|
78
|
+
octokit (4.14.0)
|
|
79
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
|
80
|
+
open4 (1.3.4)
|
|
81
|
+
parallel (1.17.0)
|
|
82
|
+
parser (2.6.3.0)
|
|
83
|
+
ast (~> 2.4.0)
|
|
84
|
+
pry (0.12.2)
|
|
85
|
+
coderay (~> 1.1.0)
|
|
86
|
+
method_source (~> 0.9.0)
|
|
87
|
+
public_suffix (3.1.0)
|
|
88
|
+
rainbow (3.0.0)
|
|
89
|
+
rake (10.5.0)
|
|
90
|
+
rb-fsevent (0.10.3)
|
|
91
|
+
rb-inotify (0.10.0)
|
|
92
|
+
ffi (~> 1.0)
|
|
93
|
+
rspec (3.8.0)
|
|
94
|
+
rspec-core (~> 3.8.0)
|
|
95
|
+
rspec-expectations (~> 3.8.0)
|
|
96
|
+
rspec-mocks (~> 3.8.0)
|
|
97
|
+
rspec-core (3.8.0)
|
|
98
|
+
rspec-support (~> 3.8.0)
|
|
99
|
+
rspec-expectations (3.8.3)
|
|
100
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
101
|
+
rspec-support (~> 3.8.0)
|
|
102
|
+
rspec-mocks (3.8.0)
|
|
103
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
104
|
+
rspec-support (~> 3.8.0)
|
|
105
|
+
rspec-support (3.8.0)
|
|
106
|
+
rubocop (0.71.0)
|
|
107
|
+
jaro_winkler (~> 1.5.1)
|
|
108
|
+
parallel (~> 1.10)
|
|
109
|
+
parser (>= 2.6)
|
|
110
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
111
|
+
ruby-progressbar (~> 1.7)
|
|
112
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
|
113
|
+
ruby-progressbar (1.10.1)
|
|
114
|
+
sawyer (0.8.2)
|
|
115
|
+
addressable (>= 2.3.5)
|
|
116
|
+
faraday (> 0.8, < 2.0)
|
|
117
|
+
shellany (0.0.1)
|
|
118
|
+
terminal-table (1.8.0)
|
|
119
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
|
120
|
+
thor (0.20.3)
|
|
121
|
+
unicode-display_width (1.6.0)
|
|
122
|
+
yard (0.9.19)
|
|
123
|
+
|
|
124
|
+
PLATFORMS
|
|
125
|
+
ruby
|
|
126
|
+
|
|
127
|
+
DEPENDENCIES
|
|
128
|
+
bundler (~> 1.3)
|
|
129
|
+
danger-shroud!
|
|
130
|
+
guard (~> 2.14)
|
|
131
|
+
guard-rspec (~> 4.7)
|
|
132
|
+
listen (= 3.0.7)
|
|
133
|
+
nokogiri
|
|
134
|
+
pry
|
|
135
|
+
rake (~> 10.0)
|
|
136
|
+
rspec (~> 3.4)
|
|
137
|
+
rubocop
|
|
138
|
+
yard
|
|
139
|
+
|
|
140
|
+
BUNDLED WITH
|
|
141
|
+
1.16.1
|
data/Guardfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# A guardfile for making Danger Plugins
|
|
2
|
+
# For more info see https://github.com/guard/guard#readme
|
|
3
|
+
|
|
4
|
+
# To run, use `bundle exec guard`.
|
|
5
|
+
|
|
6
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
|
7
|
+
require 'guard/rspec/dsl'
|
|
8
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
9
|
+
|
|
10
|
+
# RSpec files
|
|
11
|
+
rspec = dsl.rspec
|
|
12
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
|
13
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
|
14
|
+
watch(rspec.spec_files)
|
|
15
|
+
|
|
16
|
+
# Ruby files
|
|
17
|
+
ruby = dsl.ruby
|
|
18
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
|
19
|
+
end
|
data/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# danger-shroud
|
|
2
|
+
|
|
3
|
+
Danger plugin for reporting jacoco coverage reports to Danger.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Methods and attributes from this plugin are available in
|
|
8
|
+
your `Dangerfile` under the `shroud` namespace.
|
|
9
|
+
|
|
10
|
+
## Development
|
|
11
|
+
|
|
12
|
+
1. Clone this repo
|
|
13
|
+
2. Run `bundle install` to setup dependencies.
|
|
14
|
+
3. Run `bundle exec rake spec` to run the tests.
|
|
15
|
+
|
|
16
|
+
## TODO
|
|
17
|
+
|
|
18
|
+
- [ ] Write real README
|
|
19
|
+
- [ ] Add paramater for failing project threshold
|
|
20
|
+
- [ ] Add paramater for failing modified file threshold
|
|
21
|
+
- [ ] Add shroud to bridge
|
|
22
|
+
- [ ] Write tests
|
|
23
|
+
- [ ] Make public, released as a regular ol' gem
|
data/Rakefile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rspec/core/rake_task'
|
|
3
|
+
|
|
4
|
+
RSpec::Core::RakeTask.new(:specs)
|
|
5
|
+
|
|
6
|
+
task default: :specs
|
|
7
|
+
|
|
8
|
+
task :spec do
|
|
9
|
+
Rake::Task['specs'].invoke
|
|
10
|
+
Rake::Task['spec_docs'].invoke
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc 'Ensure that the plugin passes `danger plugins lint`'
|
|
14
|
+
task :spec_docs do
|
|
15
|
+
sh 'bundle exec danger plugins lint'
|
|
16
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'shroud/gem_version.rb'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'danger-shroud'
|
|
8
|
+
spec.version = Shroud::VERSION
|
|
9
|
+
spec.authors = ['andrewhaisting']
|
|
10
|
+
spec.email = ['ahaisting@gmail.com']
|
|
11
|
+
spec.description = %q{A short description of danger-shroud.}
|
|
12
|
+
spec.summary = %q{A longer description of danger-shroud.}
|
|
13
|
+
spec.homepage = 'https://github.com/andrewhaisting/danger-shroud'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files`.split($/)
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
|
|
22
|
+
|
|
23
|
+
# General ruby development
|
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
26
|
+
|
|
27
|
+
# Testing support
|
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
|
29
|
+
|
|
30
|
+
# Linting code and docs
|
|
31
|
+
spec.add_development_dependency "rubocop"
|
|
32
|
+
spec.add_development_dependency "yard"
|
|
33
|
+
|
|
34
|
+
# Makes testing easy via `bundle exec guard`
|
|
35
|
+
spec.add_development_dependency 'guard', '~> 2.14'
|
|
36
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
|
37
|
+
|
|
38
|
+
# If you want to work on older builds of ruby
|
|
39
|
+
spec.add_development_dependency 'listen', '3.0.7'
|
|
40
|
+
|
|
41
|
+
spec.add_dependency 'nokogiri'
|
|
42
|
+
|
|
43
|
+
# This gives you the chance to run a REPL inside your tests
|
|
44
|
+
# via:
|
|
45
|
+
#
|
|
46
|
+
# require 'pry'
|
|
47
|
+
# binding.pry
|
|
48
|
+
#
|
|
49
|
+
# This will stop test execution and let you inspect the results
|
|
50
|
+
spec.add_development_dependency 'pry'
|
|
51
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "shroud/plugin"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "shroud/gem_version"
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
require 'nokogiri'
|
|
2
|
+
|
|
3
|
+
module Danger
|
|
4
|
+
# This is your plugin class. Any attributes or methods you expose here will
|
|
5
|
+
# be available from within your Dangerfile.
|
|
6
|
+
#
|
|
7
|
+
# To be published on the Danger plugins site, you will need to have
|
|
8
|
+
# the public interface documented. Danger uses [YARD](http://yardoc.org/)
|
|
9
|
+
# for generating documentation from your plugin source, and you can verify
|
|
10
|
+
# by running `danger plugins lint` or `bundle exec rake spec`.
|
|
11
|
+
#
|
|
12
|
+
# You should replace these comments with a public description of your library.
|
|
13
|
+
#
|
|
14
|
+
class DangerShroud < Plugin
|
|
15
|
+
|
|
16
|
+
# Report coverage on diffed files, as well as overall coverage.
|
|
17
|
+
#
|
|
18
|
+
# file should reference a jacoco xml coverage report.
|
|
19
|
+
# totalProjectThreshold defines the threshold at which a warning will be emitted on total project coverage. deafult 0.
|
|
20
|
+
# modifiedFileThreshold defines the threshold at which a warning will be emitted on each modified file's coverage. default 0.
|
|
21
|
+
# failIfUnderThreshold when set to true will fail builds that fall under the above thresholds. default is false, which will warn.
|
|
22
|
+
#
|
|
23
|
+
# @return [void]
|
|
24
|
+
def report(file, totalProjectThreshold = 0, modifiedFileThreshold = 0, failIfUnderThreshold = false)
|
|
25
|
+
raise "Please specify file name." if file.empty?
|
|
26
|
+
raise "No jacoco xml report found at #{file}" unless File.exist? file
|
|
27
|
+
rawXml = File.read(file)
|
|
28
|
+
parsedXml = Nokogiri::XML.parse(rawXml)
|
|
29
|
+
totalInstructionCoverage = parsedXml.xpath("/report/counter[@type='INSTRUCTION']")
|
|
30
|
+
missed = totalInstructionCoverage.attr("missed").value.to_i
|
|
31
|
+
covered = totalInstructionCoverage.attr("covered").value.to_i
|
|
32
|
+
total = missed + covered
|
|
33
|
+
coveragePercent = (covered / total.to_f) * 100
|
|
34
|
+
|
|
35
|
+
# get array of files names touched by this PR (modified + added)
|
|
36
|
+
touchedFileNames = @dangerfile.git.modified_files.map { |file| File.basename(file) }
|
|
37
|
+
touchedFileNames += @dangerfile.git.added_files.map { |file| File.basename(file) }
|
|
38
|
+
|
|
39
|
+
# used to later report files that were modified but not included in the jacoco report
|
|
40
|
+
fileNamesNotInJacocoReport = []
|
|
41
|
+
|
|
42
|
+
# hash for keeping track of coverage per filename: {filename => coverage percent}
|
|
43
|
+
touchedFilesHash = {}
|
|
44
|
+
|
|
45
|
+
touchedFileNames.each do |touchedFileName|
|
|
46
|
+
xmlForFileName = parsedXml.xpath("//class[@sourcefilename='#{touchedFileName}']/counter[@type='INSTRUCTION']")
|
|
47
|
+
|
|
48
|
+
if (xmlForFileName.length > 0)
|
|
49
|
+
missed = 0
|
|
50
|
+
covered = 0
|
|
51
|
+
xmlForFileName.each do |classCountXml|
|
|
52
|
+
missed += classCountXml.attr("missed").to_i
|
|
53
|
+
covered += classCountXml.attr("covered").to_i
|
|
54
|
+
end
|
|
55
|
+
touchedFilesHash[touchedFileName] = (covered.to_f / (missed + covered)) * 100
|
|
56
|
+
else
|
|
57
|
+
fileNamesNotInJacocoReport << touchedFileName
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
puts "Here are unreported files"
|
|
62
|
+
puts fileNamesNotInJacocoReport.to_s
|
|
63
|
+
puts "Here is the touched files coverage hash"
|
|
64
|
+
puts touchedFilesHash
|
|
65
|
+
|
|
66
|
+
output = "## 🧛 Project Code Coverage: **`#{'%.2f' % coveragePercent}%`**\n"
|
|
67
|
+
|
|
68
|
+
output << "### Coverage of Modified Files:\n"
|
|
69
|
+
output << "File | Coverage\n"
|
|
70
|
+
output << ":-----|:-----:\n"
|
|
71
|
+
|
|
72
|
+
# go through each file:
|
|
73
|
+
touchedFilesHash.sort.each do |fileName, coveragePercent|
|
|
74
|
+
output << "`#{fileName}` | **`#{'%.2f' % coveragePercent}%`**\n"
|
|
75
|
+
|
|
76
|
+
# warn or fail if under specified file threshold:
|
|
77
|
+
if (coveragePercent < modifiedFileThreshold)
|
|
78
|
+
warningMessage = "Uh oh! #{fileName} is under #{modifiedFileThreshold}% coverage!"
|
|
79
|
+
if (failIfUnderThreshold)
|
|
80
|
+
fail warningMessage
|
|
81
|
+
else
|
|
82
|
+
warn warningMessage
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
output << "### Modified Files Not Found In Coverage Report:\n"
|
|
88
|
+
fileNamesNotInJacocoReport.sort.each do |unreportedFileName|
|
|
89
|
+
output << "#{unreportedFileName}\n"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
output << '> Codebase cunningly covered by count [Shroud 🧛](https://github.com/livefront/livefront-shroud-android/)'
|
|
93
|
+
markdown output
|
|
94
|
+
|
|
95
|
+
# warn or fail if total coverage is under specified threshold
|
|
96
|
+
if (coveragePercent < totalProjectThreshold)
|
|
97
|
+
totalCoverageWarning = "Uh oh! Your project is under #{totalProjectThreshold}% coverage!"
|
|
98
|
+
if (failIfUnderThreshold)
|
|
99
|
+
fail totalCoverageWarning
|
|
100
|
+
else
|
|
101
|
+
warn totalCoverageWarning
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
data/spec/shroud_spec.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require File.expand_path("../spec_helper", __FILE__)
|
|
2
|
+
|
|
3
|
+
module Danger
|
|
4
|
+
describe Danger::DangerShroud do
|
|
5
|
+
it "should be a plugin" do
|
|
6
|
+
expect(Danger::DangerShroud.new(nil)).to be_a Danger::Plugin
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
#
|
|
10
|
+
# TODO test your custom attributes and methods here
|
|
11
|
+
#
|
|
12
|
+
end
|
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require "pathname"
|
|
2
|
+
ROOT = Pathname.new(File.expand_path("../../", __FILE__))
|
|
3
|
+
$:.unshift((ROOT + "lib").to_s)
|
|
4
|
+
$:.unshift((ROOT + "spec").to_s)
|
|
5
|
+
|
|
6
|
+
require "bundler/setup"
|
|
7
|
+
require "pry"
|
|
8
|
+
|
|
9
|
+
require "rspec"
|
|
10
|
+
require "danger"
|
|
11
|
+
|
|
12
|
+
if `git remote -v` == ''
|
|
13
|
+
puts "You cannot run tests without setting a local git remote on this repo"
|
|
14
|
+
puts "It's a weird side-effect of Danger's internals."
|
|
15
|
+
exit(0)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Use coloured output, it's the best.
|
|
19
|
+
RSpec.configure do |config|
|
|
20
|
+
config.filter_gems_from_backtrace "bundler"
|
|
21
|
+
config.color = true
|
|
22
|
+
config.tty = true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
require "danger_plugin"
|
|
26
|
+
|
|
27
|
+
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
|
28
|
+
# If you are expanding these files, see if it's already been done ^.
|
|
29
|
+
|
|
30
|
+
# A silent version of the user interface,
|
|
31
|
+
# it comes with an extra function `.string` which will
|
|
32
|
+
# strip all ANSI colours from the string.
|
|
33
|
+
|
|
34
|
+
# rubocop:disable Lint/NestedMethodDefinition
|
|
35
|
+
def testing_ui
|
|
36
|
+
@output = StringIO.new
|
|
37
|
+
def @output.winsize
|
|
38
|
+
[20, 9999]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
cork = Cork::Board.new(out: @output)
|
|
42
|
+
def cork.string
|
|
43
|
+
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
|
44
|
+
end
|
|
45
|
+
cork
|
|
46
|
+
end
|
|
47
|
+
# rubocop:enable Lint/NestedMethodDefinition
|
|
48
|
+
|
|
49
|
+
# Example environment (ENV) that would come from
|
|
50
|
+
# running a PR on TravisCI
|
|
51
|
+
def testing_env
|
|
52
|
+
{
|
|
53
|
+
"HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
|
|
54
|
+
"TRAVIS_PULL_REQUEST" => "800",
|
|
55
|
+
"TRAVIS_REPO_SLUG" => "artsy/eigen",
|
|
56
|
+
"TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
|
|
57
|
+
"DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# A stubbed out Dangerfile for use in tests
|
|
62
|
+
def testing_dangerfile
|
|
63
|
+
env = Danger::EnvironmentManager.new(testing_env)
|
|
64
|
+
Danger::Dangerfile.new(env, testing_ui)
|
|
65
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: danger-shroud
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- andrewhaisting
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-03-27 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: danger-plugin-api
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.3'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.3'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '10.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '10.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '3.4'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '3.4'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rubocop
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: yard
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: guard
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '2.14'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '2.14'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: guard-rspec
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '4.7'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '4.7'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: listen
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - '='
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: 3.0.7
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - '='
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: 3.0.7
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: nokogiri
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '0'
|
|
146
|
+
type: :runtime
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '0'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: pry
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - ">="
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '0'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - ">="
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '0'
|
|
167
|
+
description: A short description of danger-shroud.
|
|
168
|
+
email:
|
|
169
|
+
- ahaisting@gmail.com
|
|
170
|
+
executables: []
|
|
171
|
+
extensions: []
|
|
172
|
+
extra_rdoc_files: []
|
|
173
|
+
files:
|
|
174
|
+
- ".gitignore"
|
|
175
|
+
- ".travis.yml"
|
|
176
|
+
- Gemfile
|
|
177
|
+
- Gemfile.lock
|
|
178
|
+
- Guardfile
|
|
179
|
+
- README.md
|
|
180
|
+
- Rakefile
|
|
181
|
+
- danger-shroud.gemspec
|
|
182
|
+
- lib/danger_plugin.rb
|
|
183
|
+
- lib/danger_shroud.rb
|
|
184
|
+
- lib/shroud/gem_version.rb
|
|
185
|
+
- lib/shroud/plugin.rb
|
|
186
|
+
- spec/shroud_spec.rb
|
|
187
|
+
- spec/spec_helper.rb
|
|
188
|
+
homepage: https://github.com/andrewhaisting/danger-shroud
|
|
189
|
+
licenses:
|
|
190
|
+
- MIT
|
|
191
|
+
metadata: {}
|
|
192
|
+
post_install_message:
|
|
193
|
+
rdoc_options: []
|
|
194
|
+
require_paths:
|
|
195
|
+
- lib
|
|
196
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
|
+
requirements:
|
|
198
|
+
- - ">="
|
|
199
|
+
- !ruby/object:Gem::Version
|
|
200
|
+
version: '0'
|
|
201
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
|
+
requirements:
|
|
203
|
+
- - ">="
|
|
204
|
+
- !ruby/object:Gem::Version
|
|
205
|
+
version: '0'
|
|
206
|
+
requirements: []
|
|
207
|
+
rubyforge_project:
|
|
208
|
+
rubygems_version: 2.6.11
|
|
209
|
+
signing_key:
|
|
210
|
+
specification_version: 4
|
|
211
|
+
summary: A longer description of danger-shroud.
|
|
212
|
+
test_files:
|
|
213
|
+
- spec/shroud_spec.rb
|
|
214
|
+
- spec/spec_helper.rb
|