pastel 0.7.2 → 0.7.3
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 +5 -5
- data/CHANGELOG.md +12 -2
- data/README.md +3 -2
- data/examples/palette.rb +1 -1
- data/lib/pastel/delegator.rb +2 -1
- data/lib/pastel/version.rb +1 -1
- data/pastel.gemspec +19 -9
- metadata +26 -37
- data/.gitignore +0 -22
- data/.rspec +0 -3
- data/.travis.yml +0 -26
- data/Gemfile +0 -15
- data/appveyor.yml +0 -21
- data/assets/pastel_logo.png +0 -0
- data/assets/screenshot.png +0 -0
- data/benchmarks/nesting_speed.rb +0 -41
- data/benchmarks/speed.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5dce3343814347c2f9ed82e20bbbdba20f1b6c3ca98da42fb7998bcfbf2f4ca8
|
4
|
+
data.tar.gz: cb80f3d5e14c53d7602606af9be4ac5a7f73f4c5dc0ba3f2686b3677514fe8bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e24b3b0924de73d63deae71be57949f0cab97bf1c3918b8d119956cea21620294bb7ab0592fea42d6e2a9d45fa6f692dcec7091a5d2d1d34f10e9555eea20b4
|
7
|
+
data.tar.gz: fa59fa36a0a6209810c709d000f8fcf44ff2187274273026b9965beeafb8335b93e80bda120878260b79a5edbaaf812ca40af9adb77f98bf03dd3b44ab346826
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.7.3] - 2019-06-16
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Change gemspec to load required files directly without git
|
7
|
+
* Change to update tty-color & equatable dependency versions
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
* Fix Delegator warning
|
11
|
+
|
3
12
|
## [v0.7.2] - 2017-11-09
|
4
13
|
|
5
14
|
### Changed
|
@@ -9,7 +18,7 @@
|
|
9
18
|
## [v0.7.1] - 2017-01-09
|
10
19
|
|
11
20
|
### Changed
|
12
|
-
* Change to load
|
21
|
+
* Change to load specific files when needed
|
13
22
|
* Change to freeze ANSI attributes
|
14
23
|
* Change to directly assign enabled attribute
|
15
24
|
|
@@ -30,7 +39,7 @@
|
|
30
39
|
## [v0.6.0] - 2016-01-15
|
31
40
|
|
32
41
|
### Added
|
33
|
-
* Add helper functions #foreground?, #
|
42
|
+
* Add helper functions #foreground?, #background?, #style to ANSI module
|
34
43
|
* Add ColorParser for parsing color symbols out of text
|
35
44
|
* Add Pastel#undecorate for parsing color names out of strings
|
36
45
|
|
@@ -108,6 +117,7 @@
|
|
108
117
|
* Change gemspec to include equatable as dependency
|
109
118
|
* Change Delegator to stop creating instances and improve performance
|
110
119
|
|
120
|
+
[v0.7.3]: https://github.com/peter-murach/pastel/compare/v0.7.2...v0.7.3
|
111
121
|
[v0.7.2]: https://github.com/peter-murach/pastel/compare/v0.7.1...v0.7.2
|
112
122
|
[v0.7.1]: https://github.com/peter-murach/pastel/compare/v0.7.0...v0.7.1
|
113
123
|
[v0.7.0]: https://github.com/peter-murach/pastel/compare/v0.6.1...v0.7.0
|
data/README.md
CHANGED
@@ -214,7 +214,8 @@ pastel.styles
|
|
214
214
|
To perform translation of color name into ansi escape code use `lookup`:
|
215
215
|
|
216
216
|
```ruby
|
217
|
-
|
217
|
+
pastel.lookup(:red) # => "\e[31m"
|
218
|
+
pastel.lookup(:reset) # => "\e[0m"
|
218
219
|
```
|
219
220
|
|
220
221
|
### 2.8 Valid?
|
@@ -371,4 +372,4 @@ $ pastel green 'Unicorns & rainbows!'
|
|
371
372
|
|
372
373
|
## Copyright
|
373
374
|
|
374
|
-
Copyright (c) 2014-
|
375
|
+
Copyright (c) 2014-2018 Piotr Murach. See LICENSE for further details.
|
data/examples/palette.rb
CHANGED
data/lib/pastel/delegator.rb
CHANGED
@@ -78,7 +78,8 @@ module Pastel
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def respond_to_missing?(name, include_all = false)
|
81
|
-
resolver.color.respond_to?(name, include_all) ||
|
81
|
+
resolver.color.respond_to?(name, include_all) ||
|
82
|
+
resolver.color.valid?(name) || super
|
82
83
|
end
|
83
84
|
|
84
85
|
# Evaluate color block
|
data/lib/pastel/version.rb
CHANGED
data/pastel.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'pastel/version'
|
@@ -7,21 +6,32 @@ Gem::Specification.new do |spec|
|
|
7
6
|
spec.name = "pastel"
|
8
7
|
spec.version = Pastel::VERSION
|
9
8
|
spec.authors = ["Piotr Murach"]
|
10
|
-
spec.email = [""]
|
9
|
+
spec.email = ["me@piotrmurach.com"]
|
11
10
|
spec.summary = %q{Terminal strings styling with intuitive and clean API.}
|
12
11
|
spec.description = %q{Terminal strings styling with intuitive and clean API.}
|
13
|
-
spec.homepage = "https://github.
|
12
|
+
spec.homepage = "https://piotrmurach.github.io/tty/"
|
14
13
|
spec.license = "MIT"
|
15
|
-
|
16
|
-
|
14
|
+
if spec.respond_to?(:metadata=)
|
15
|
+
spec.metadata = {
|
16
|
+
"allowed_push_host" => "https://rubygems.org",
|
17
|
+
"bug_tracker_uri" => "https://github.com/piotrmurach/pastel/issues",
|
18
|
+
"changelog_uri" => "https://github.com/piotrmurach/pastel/blob/master/CHANGELOG.md",
|
19
|
+
"documentation_uri" => "https://www.rubydoc.info/gems/pastel",
|
20
|
+
"homepage_uri" => spec.homepage,
|
21
|
+
"source_code_uri" => "https://github.com/piotrmurach/pastel"
|
22
|
+
}
|
23
|
+
end
|
24
|
+
spec.files = Dir['{lib,spec,examples}/**/*.rb']
|
25
|
+
spec.files += Dir['tasks/*', 'pastel.gemspec']
|
26
|
+
spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
|
17
27
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
28
|
spec.test_files = spec.files.grep(%r{^spec/})
|
19
29
|
spec.require_paths = ["lib"]
|
20
30
|
|
21
|
-
spec.add_dependency 'equatable', '~> 0.
|
22
|
-
spec.add_dependency 'tty-color', '~> 0.
|
31
|
+
spec.add_dependency 'equatable', '~> 0.6'
|
32
|
+
spec.add_dependency 'tty-color', '~> 0.5'
|
23
33
|
|
24
|
-
spec.add_development_dependency 'bundler', '>= 1.5.0'
|
25
|
-
spec.add_development_dependency 'rake'
|
34
|
+
spec.add_development_dependency 'bundler', '>= 1.5.0'
|
26
35
|
spec.add_development_dependency 'rspec', '~> 3.1'
|
36
|
+
spec.add_development_dependency 'rake'
|
27
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pastel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equatable
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tty-color
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: '0.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,9 +45,6 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.5.0
|
48
|
-
- - "<"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '2.0'
|
51
48
|
type: :development
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,57 +52,45 @@ dependencies:
|
|
55
52
|
- - ">="
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: 1.5.0
|
58
|
-
- - "<"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '2.0'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
56
|
+
name: rspec
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
|
-
- - "
|
59
|
+
- - "~>"
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
61
|
+
version: '3.1'
|
68
62
|
type: :development
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
|
-
- - "
|
66
|
+
- - "~>"
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
68
|
+
version: '3.1'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
70
|
+
name: rake
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
78
72
|
requirements:
|
79
|
-
- - "
|
73
|
+
- - ">="
|
80
74
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
75
|
+
version: '0'
|
82
76
|
type: :development
|
83
77
|
prerelease: false
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
85
79
|
requirements:
|
86
|
-
- - "
|
80
|
+
- - ">="
|
87
81
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
82
|
+
version: '0'
|
89
83
|
description: Terminal strings styling with intuitive and clean API.
|
90
84
|
email:
|
91
|
-
-
|
85
|
+
- me@piotrmurach.com
|
92
86
|
executables: []
|
93
87
|
extensions: []
|
94
88
|
extra_rdoc_files: []
|
95
89
|
files:
|
96
|
-
- ".gitignore"
|
97
|
-
- ".rspec"
|
98
|
-
- ".travis.yml"
|
99
90
|
- CHANGELOG.md
|
100
|
-
- Gemfile
|
101
91
|
- LICENSE.txt
|
102
92
|
- README.md
|
103
93
|
- Rakefile
|
104
|
-
- appveyor.yml
|
105
|
-
- assets/pastel_logo.png
|
106
|
-
- assets/screenshot.png
|
107
|
-
- benchmarks/nesting_speed.rb
|
108
|
-
- benchmarks/speed.rb
|
109
94
|
- examples/palette.rb
|
110
95
|
- lib/pastel.rb
|
111
96
|
- lib/pastel/alias_importer.rb
|
@@ -142,10 +127,16 @@ files:
|
|
142
127
|
- tasks/console.rake
|
143
128
|
- tasks/coverage.rake
|
144
129
|
- tasks/spec.rake
|
145
|
-
homepage: https://github.
|
130
|
+
homepage: https://piotrmurach.github.io/tty/
|
146
131
|
licenses:
|
147
132
|
- MIT
|
148
|
-
metadata:
|
133
|
+
metadata:
|
134
|
+
allowed_push_host: https://rubygems.org
|
135
|
+
bug_tracker_uri: https://github.com/piotrmurach/pastel/issues
|
136
|
+
changelog_uri: https://github.com/piotrmurach/pastel/blob/master/CHANGELOG.md
|
137
|
+
documentation_uri: https://www.rubydoc.info/gems/pastel
|
138
|
+
homepage_uri: https://piotrmurach.github.io/tty/
|
139
|
+
source_code_uri: https://github.com/piotrmurach/pastel
|
149
140
|
post_install_message:
|
150
141
|
rdoc_options: []
|
151
142
|
require_paths:
|
@@ -161,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
152
|
- !ruby/object:Gem::Version
|
162
153
|
version: '0'
|
163
154
|
requirements: []
|
164
|
-
|
165
|
-
rubygems_version: 2.5.1
|
155
|
+
rubygems_version: 3.0.3
|
166
156
|
signing_key:
|
167
157
|
specification_version: 4
|
168
158
|
summary: Terminal strings styling with intuitive and clean API.
|
@@ -188,4 +178,3 @@ test_files:
|
|
188
178
|
- spec/unit/new_spec.rb
|
189
179
|
- spec/unit/respond_to_spec.rb
|
190
180
|
- spec/unit/undecorate_spec.rb
|
191
|
-
has_rdoc:
|
data/.gitignore
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
sudo: false
|
4
|
-
cache: bundler
|
5
|
-
before_install: "gem update bundler"
|
6
|
-
bundler_args: --without yard benchmarks
|
7
|
-
script: "bundle exec rake ci"
|
8
|
-
rvm:
|
9
|
-
- 1.9.3
|
10
|
-
- 2.0.0
|
11
|
-
- 2.1.10
|
12
|
-
- 2.2.8
|
13
|
-
- 2.3.5
|
14
|
-
- 2.4.2
|
15
|
-
- jruby-9000
|
16
|
-
- jruby-head
|
17
|
-
- ruby-head
|
18
|
-
matrix:
|
19
|
-
allow_failures:
|
20
|
-
- rvm: ruby-head
|
21
|
-
- rvm: jruby-head
|
22
|
-
fast_finish: true
|
23
|
-
branches:
|
24
|
-
only: master
|
25
|
-
notifications:
|
26
|
-
email: false
|
data/Gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :development do
|
6
|
-
gem 'yard', '~> 0.8.7'
|
7
|
-
gem 'benchmark-ips', '~> 2.0.0'
|
8
|
-
end
|
9
|
-
|
10
|
-
group :metrics do
|
11
|
-
gem 'coveralls', '~> 0.8.9'
|
12
|
-
gem 'simplecov', '~> 0.10.0'
|
13
|
-
gem 'yardstick', '~> 0.9.9'
|
14
|
-
gem 'term-ansicolor', '=1.3.2'
|
15
|
-
end
|
data/appveyor.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
---
|
2
|
-
install:
|
3
|
-
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
4
|
-
- ruby --version
|
5
|
-
- gem --version
|
6
|
-
- bundle install
|
7
|
-
build: off
|
8
|
-
test_script:
|
9
|
-
- bundle exec rake ci
|
10
|
-
environment:
|
11
|
-
matrix:
|
12
|
-
- ruby_version: "200"
|
13
|
-
- ruby_version: "200-x64"
|
14
|
-
- ruby_version: "21"
|
15
|
-
- ruby_version: "21-x64"
|
16
|
-
- ruby_version: "22"
|
17
|
-
- ruby_version: "22-x64"
|
18
|
-
- ruby_version: "23"
|
19
|
-
- ruby_version: "23-x64"
|
20
|
-
- ruby_version: "24"
|
21
|
-
- ruby_version: "24-x64"
|
data/assets/pastel_logo.png
DELETED
Binary file
|
data/assets/screenshot.png
DELETED
Binary file
|
data/benchmarks/nesting_speed.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'pastel'
|
2
|
-
require 'benchmark/ips'
|
3
|
-
|
4
|
-
pastel = Pastel.new
|
5
|
-
|
6
|
-
Benchmark.ips do |bench|
|
7
|
-
bench.config(time: 5, warmup: 2)
|
8
|
-
|
9
|
-
bench.report('regular nesting') do
|
10
|
-
pastel.red.on_green('Unicorns' +
|
11
|
-
pastel.green.on_red('will ', 'dominate' + pastel.yellow('the world!')))
|
12
|
-
end
|
13
|
-
|
14
|
-
bench.report('block nesting') do
|
15
|
-
pastel.red.on_green('Unicorns') do
|
16
|
-
green.on_red('will ', 'dominate') do
|
17
|
-
yellow('the world!')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
bench.compare!
|
23
|
-
end
|
24
|
-
|
25
|
-
# version 0.6.0
|
26
|
-
|
27
|
-
# Calculating -------------------------------------
|
28
|
-
# regular nesting 1282 i/100ms
|
29
|
-
# block nesting 1013 i/100ms
|
30
|
-
# -------------------------------------------------
|
31
|
-
# regular nesting 13881.5 (±16.3%) i/s - 67946 in 5.043220s
|
32
|
-
# block nesting 11411.6 (±25.4%) i/s - 53689 in 5.088911s
|
33
|
-
#
|
34
|
-
# Comparison:
|
35
|
-
# regular nesting: 13881.5 i/s
|
36
|
-
# block nesting: 11411.6 i/s - 1.22x slower
|
37
|
-
|
38
|
-
# version 0.5.3
|
39
|
-
|
40
|
-
# regular nesting: 2800/s
|
41
|
-
# block nesting: 2600/s
|
data/benchmarks/speed.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'pastel'
|
2
|
-
require 'benchmark/ips'
|
3
|
-
|
4
|
-
pastel = Pastel.new
|
5
|
-
|
6
|
-
Benchmark.ips do |bench|
|
7
|
-
bench.config(time: 5, warmup: 2)
|
8
|
-
|
9
|
-
bench.report('color decorate') do
|
10
|
-
pastel.decorate('string', :red, :on_green, :bold)
|
11
|
-
end
|
12
|
-
|
13
|
-
bench.report('dsl styling') do
|
14
|
-
pastel.red.on_green.bold('string')
|
15
|
-
end
|
16
|
-
|
17
|
-
bench.compare!
|
18
|
-
end
|
19
|
-
|
20
|
-
# version 0.6.0
|
21
|
-
|
22
|
-
# Calculating -------------------------------------
|
23
|
-
# color decorate 7346 i/100ms
|
24
|
-
# dsl styling 3436 i/100ms
|
25
|
-
# -------------------------------------------------
|
26
|
-
# color decorate 96062.1 (±7.9%) i/s - 484836 in 5.081126s
|
27
|
-
# dsl styling 38761.1 (±13.9%) i/s - 192416 in 5.065053s
|
28
|
-
#
|
29
|
-
# Comparison:
|
30
|
-
# color decorate: 96062.1 i/s
|
31
|
-
# dsl styling: 38761.1 i/s - 2.48x slower
|
32
|
-
|
33
|
-
# version 0.5.3
|
34
|
-
|
35
|
-
# Calculating -------------------------------------
|
36
|
-
# color decorate 1428 i/100ms
|
37
|
-
# dsl styling 1174 i/100ms
|
38
|
-
# -------------------------------------------------
|
39
|
-
# color decorate 16113.1 (±21.5%) i/s - 77112 in 5.054487s
|
40
|
-
# dsl styling 12622.9 (±20.8%) i/s - 61048 in 5.076738s
|
41
|
-
#
|
42
|
-
# Comparison:
|
43
|
-
# color decorate: 16113.1 i/s
|
44
|
-
# dsl styling: 12622.9 i/s - 1.28x slower
|
45
|
-
#
|