colored2 4.0.0 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -4
- data/Rakefile +37 -5
- data/lib/colored2/codes.rb +1 -1
- data/lib/colored2/version.rb +1 -1
- data/lib/colored2.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ee693f49e7208ff644370725aa2b7b9888ebac0647f2657545e515fec328ed4
|
4
|
+
data.tar.gz: 9f3892276803dffd61a614ebbad278aec4883fa08e7df3ed3831e3ed99bf4dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efee32f318d52bccf99f3695a24a9c129b2096754a9dff942cc84c1204ee9843b19af36f6d8271624e5dad7f40d3e3d8714ce85d45642399c3ea14aa009173ce
|
7
|
+
data.tar.gz: fb369f890ae3103193f69599517a36e0bc20897daf14bed46fd0706ee9628578f1ade9006ba47da97f941d08a8c86bb6ec340aeaf5d41e942bc3dc286507a2cc
|
data/README.md
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
[![RSpecs](https://github.com/kigster/colored2/actions/workflows/ruby-ci.yml/badge.svg)](https://github.com/kigster/colored2/actions/workflows/ruby-ci.yml)
|
3
3
|
[![Rubocop](https://github.com/kigster/colored2/actions/workflows/rubocop-ci.yml/badge.svg)](https://github.com/kigster/colored2/actions/workflows/rubocop-ci.yml)
|
4
4
|
|
5
|
-
|
6
|
-
[![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/colored2)
|
5
|
+
![Gem Version](https://img.shields.io/gem/v/colored2?style=for-the-badge&color=0AF) ![MIT License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge&color=0AF) [![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg?style=for-the-badge&color=F6F)](https://app.gitter.im/#/room/#colored2:gitter.im)
|
7
6
|
|
8
|
-
|
7
|
+
# Colored2
|
9
8
|
|
10
|
-
|
9
|
+
The most downloaded ANSI color gem you'll find :-)
|
10
|
+
|
11
|
+
![Gem Total Downloads](https://img.shields.io/gem/dt/colored2?style=for-the-badge&color=A0F)
|
12
|
+
|
13
|
+
## Backstory
|
14
|
+
|
15
|
+
It's an actively maintained fork of Chris [@defunkt](https://github.com/defunkt) Wanstrath's gem [colored](https://github.com/defunkt/colored), which appears to be no longer supported. So instead of accepting this as a pull request, a new gem was born.
|
11
16
|
|
12
17
|
This fork comes with a slightly spruced up syntax, some additional features, and a test suite written in [RSpec](http://rspec.info/).
|
13
18
|
|
@@ -87,6 +92,10 @@ Or install it yourself as:
|
|
87
92
|
|
88
93
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
89
94
|
|
95
|
+
## Support
|
96
|
+
|
97
|
+
|
98
|
+
|
90
99
|
## Contributing
|
91
100
|
|
92
101
|
Bug reports and pull requests are welcome on GitHub at [https://github.com/kigster/colored2](https://github.com/kigster/colored2).
|
data/Rakefile
CHANGED
@@ -2,16 +2,48 @@
|
|
2
2
|
|
3
3
|
require 'bundler'
|
4
4
|
require 'bundler/gem_tasks'
|
5
|
-
require 'rake/clean'
|
6
|
-
|
7
|
-
CLEAN.include %w(pkg coverage *.gem)
|
8
5
|
|
9
6
|
begin
|
10
7
|
require 'rspec/core/rake_task'
|
11
8
|
RSpec::Core::RakeTask.new(:spec)
|
12
9
|
rescue LoadError => e
|
13
|
-
warn "Error loading task: #{e.message}"
|
10
|
+
warn "Error loading rspec task: #{e.message}"
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
|
14
|
+
begin
|
15
|
+
require 'rubocop/rake_task'
|
16
|
+
RuboCop::RakeTask.new(:rubocop)
|
17
|
+
rescue LoadError => e
|
18
|
+
warn "Error loading rubocop task: #{e.message}"
|
14
19
|
exit 1
|
15
20
|
end
|
16
21
|
|
17
|
-
task default: [:spec]
|
22
|
+
task default: [:spec, :rubocop]
|
23
|
+
|
24
|
+
def shell(*args)
|
25
|
+
puts "running: #{args.join(' ')}"
|
26
|
+
system(args.join(' '))
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Clean up any temp or coverage files.'
|
30
|
+
task :clean do
|
31
|
+
shell('rm -rf pkg/ tmp/ coverage/ ' )
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Install the gem locally from the pkg/*.gem file'
|
35
|
+
task gem: [:build] do
|
36
|
+
shell('gem install pkg/*')
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'Ensure permissions are not an issue'
|
40
|
+
task permissions: [:clean] do
|
41
|
+
shell("find . -type f -exec chmod 644 {} \\;")
|
42
|
+
shell("find . -type d -exec chmod 755 {} \\;")
|
43
|
+
shell("find bin -type f -exec chmod 755 {} \\; 2>/dev/null")
|
44
|
+
shell("find exe -type f -exec chmod 755 {} \\; 2>/dev/null")
|
45
|
+
shell("pwd -P && mkdir pkg && chmod -R g+r,g+x,o+r,o+x pkg")
|
46
|
+
end
|
47
|
+
|
48
|
+
desc 'Builds the gem into the pkg/ folder'
|
49
|
+
task build: :permissions
|
data/lib/colored2/codes.rb
CHANGED
data/lib/colored2/version.rb
CHANGED
data/lib/colored2.rb
CHANGED
@@ -52,7 +52,7 @@ module Colored2
|
|
52
52
|
surround_with_color(color:, color_self: true, string:, &block)
|
53
53
|
end
|
54
54
|
|
55
|
-
define_method("#{color}!"
|
55
|
+
define_method(:"#{color}!") do |string = nil, &block|
|
56
56
|
surround_with_color(color:, color_self: false, string:, &block)
|
57
57
|
end
|
58
58
|
end
|
@@ -64,7 +64,7 @@ module Colored2
|
|
64
64
|
surround_with_color(effect:, color_self: true, string:, &block)
|
65
65
|
end
|
66
66
|
|
67
|
-
define_method("#{effect}!"
|
67
|
+
define_method(:"#{effect}!") do |string = nil, &block|
|
68
68
|
surround_with_color(effect:, color_self: false, string:, &block)
|
69
69
|
end
|
70
70
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colored2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |+
|
15
15
|
This is a heavily modified fork of http://github.com/defunkt/colored gem, with many
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
|
-
rubygems_version: 3.4.
|
70
|
+
rubygems_version: 3.4.10
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: Add even more color to your life.
|