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

Remove colorize depedency #94

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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