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

Commit

Permalink
Remove colorize depedency (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu authored Aug 24, 2020
1 parent e0b8889 commit 9035124
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/spec/reports/
/test/tmp/
/test/version_tmp/
/test/reports/
/tmp/

## Specific to RubyMotion:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### `0.2.8`
- Remove `colorize` dependency

### `0.2.7`
- Fix for enterprise users unable to upload using the v4 uploader

Expand Down
3 changes: 1 addition & 2 deletions codecov.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>=2.4'
s.summary = 'hosted code coverage ruby/rails reporter'
s.test_files = ['test/test_codecov.rb']
s.version = '0.2.7'
s.version = '0.2.8'

s.add_dependency 'colorize'
s.add_dependency 'json'
s.add_dependency 'simplecov'

Expand Down
23 changes: 21 additions & 2 deletions lib/codecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
require 'json'
require 'net/http'
require 'simplecov'
require 'colorize'
require 'zlib'

class SimpleCov::Formatter::Codecov
VERSION = '0.2.7'
VERSION = '0.2.8'

### CIs
RECOGNIZED_CIS = [
Expand Down Expand Up @@ -587,3 +586,23 @@ def net_blockers(switch)
true
end
end

# https://stackoverflow.com/a/11482430/5769383
class String
# colorization
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end

def black
colorize(30)
end

def red
colorize(31)
end

def green
colorize(32)
end
end

0 comments on commit 9035124

Please sign in to comment.