pastel 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/pastel.rb +2 -0
- data/lib/pastel/delegator.rb +12 -2
- data/lib/pastel/version.rb +1 -1
- data/spec/unit/new_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4843971da301b5bca7d4d9a6c69702859a3e9f9
|
4
|
+
data.tar.gz: d176a98f33737965a8ae4a710b19c27ad31fe021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c61ddb8e9be7aa678dde278f6229871f67ce53d60929367417fae521b35548e8cb7392bb029eb94bcceb141eca2705cb3fe214bcbc333162de591b4174b63f8
|
7
|
+
data.tar.gz: acea298f36654c11b706bf72574e3b08980212188e6e432a95dd4fb10ae169e3026e344c28b9858dc1c0daed53c05aa059281e9bfc6044f35a3bb9ccf5f3a0bc
|
data/CHANGELOG.md
CHANGED
data/lib/pastel.rb
CHANGED
data/lib/pastel/delegator.rb
CHANGED
@@ -9,8 +9,18 @@ module Pastel
|
|
9
9
|
extend Forwardable
|
10
10
|
include Equatable
|
11
11
|
|
12
|
-
def_delegators '@resolver.color', :valid?, :styles, :strip, :decorate,
|
13
|
-
|
12
|
+
def_delegators '@resolver.color', :valid?, :styles, :strip, :decorate,
|
13
|
+
:enabled?
|
14
|
+
|
15
|
+
# Create Delegator
|
16
|
+
#
|
17
|
+
# Used internally by {Pastel}
|
18
|
+
#
|
19
|
+
# @param [ColorResolver] resolver
|
20
|
+
#
|
21
|
+
# @param [DecoratorChain] base
|
22
|
+
#
|
23
|
+
# @api private
|
14
24
|
def initialize(resolver, base)
|
15
25
|
@resolver = resolver
|
16
26
|
@base = base
|
data/lib/pastel/version.rb
CHANGED
data/spec/unit/new_spec.rb
CHANGED
@@ -43,6 +43,12 @@ RSpec.describe Pastel do
|
|
43
43
|
expect(pastel.red('r', pastel.green('g'), 'r')).
|
44
44
|
to eq("\e[31mr\e[32mg\e[31mr\e[0m")
|
45
45
|
end
|
46
|
+
|
47
|
+
it "raises error when doesn't recognize color" do
|
48
|
+
expect {
|
49
|
+
pastel.uknown('unicorn')
|
50
|
+
}.to raise_error(Pastel::InvalidAttributeNameError)
|
51
|
+
end
|
46
52
|
end
|
47
53
|
|
48
54
|
describe '.valid?' do
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equatable
|