Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 9035124

Browse files
authored
Remove colorize depedency (#94)
1 parent e0b8889 commit 9035124

4 files changed

Lines changed: 26 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/spec/reports/
88
/test/tmp/
99
/test/version_tmp/
10+
/test/reports/
1011
/tmp/
1112

1213
## Specific to RubyMotion:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### `0.2.8`
2+
- Remove `colorize` dependency
3+
14
### `0.2.7`
25
- Fix for enterprise users unable to upload using the v4 uploader
36

codecov.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ Gem::Specification.new do |s|
1313
s.required_ruby_version = '>=2.4'
1414
s.summary = 'hosted code coverage ruby/rails reporter'
1515
s.test_files = ['test/test_codecov.rb']
16-
s.version = '0.2.7'
16+
s.version = '0.2.8'
1717

18-
s.add_dependency 'colorize'
1918
s.add_dependency 'json'
2019
s.add_dependency 'simplecov'
2120

lib/codecov.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
require 'json'
55
require 'net/http'
66
require 'simplecov'
7-
require 'colorize'
87
require 'zlib'
98

109
class SimpleCov::Formatter::Codecov
11-
VERSION = '0.2.7'
10+
VERSION = '0.2.8'
1211

1312
### CIs
1413
RECOGNIZED_CIS = [
@@ -587,3 +586,23 @@ def net_blockers(switch)
587586
true
588587
end
589588
end
589+
590+
# https://stackoverflow.com/a/11482430/5769383
591+
class String
592+
# colorization
593+
def colorize(color_code)
594+
"\e[#{color_code}m#{self}\e[0m"
595+
end
596+
597+
def black
598+
colorize(30)
599+
end
600+
601+
def red
602+
colorize(31)
603+
end
604+
605+
def green
606+
colorize(32)
607+
end
608+
end

0 commit comments

Comments
 (0)