pd_ruby 0.2.0 → 0.2.2
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 +4 -4
- data/.gitignore +1 -1
- data/.ruby-version +1 -0
- data/Gemfile.lock +2 -2
- data/lib/pd_ruby.rb +14 -10
- data/lib/pd_ruby/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c68d90b455eece12a684c47419679caf08c4a21eef5f814fbc7b41c82afa942
|
4
|
+
data.tar.gz: 7486fb8a0625fceac891663a4e557d5bfd64e90c422d9cf1c414fc96809b29c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c88209f837078dd387f6675d31e389f85d233d954a5e60199f082e721f64c28596b5d1f74ae6f6a8689a2e4d32047226c3205e70ce547be0422ecb29e8cab447
|
7
|
+
data.tar.gz: 976681a5c91a20f76864dba1a2e5683bf514127b8b8a1e80c9f5dbd751c842b3f10198af29d1f1c8cf27c495651b4a36eb28b70eee3fc0bdd8cad49cd3207d4f
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.6
|
data/Gemfile.lock
CHANGED
data/lib/pd_ruby.rb
CHANGED
@@ -6,15 +6,19 @@ require 'pd_ruby/version'
|
|
6
6
|
require 'pd_ruby/helper_methods'
|
7
7
|
|
8
8
|
module PDRuby
|
9
|
-
def self.color_combinations
|
10
|
-
@color_combinations ||=
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
def self.color_combinations(contrast = true)
|
10
|
+
@color_combinations ||= if contrast
|
11
|
+
[{ background: :light_blue, color: :light_black }, { background: :light_yellow, color: :white }, { background: :red, color: :white }, { background: :green, color: :light_red }, { background: :default, color: :magenta }, { background: :light_white, color: :red }, { background: :light_yellow, color: :light_black }, { background: :black, color: :white }, { background: :light_white, color: :blue }, { background: :light_white, color: :default }, { background: :red, color: :light_black }, { background: :white, color: :light_magenta }, { background: :white, color: :cyan }, { background: :light_white, color: :cyan }, { background: :light_green, color: :white }, { background: :light_red, color: :black }, { background: :light_green, color: :light_white }, { background: :light_magenta, color: :light_black }, { background: :magenta, color: :light_black }, { background: :blue, color: :white }, { background: :light_white, color: :light_magenta }, { background: :light_white, color: :light_black }, { background: :light_yellow, color: :light_white }, { background: :white, color: :light_blue }, { background: :light_black, color: :blue }, { background: :green, color: :light_black }, { background: :light_black, color: :light_magenta }, { background: :white, color: :light_red }, { background: :light_magenta, color: :green }, { background: :light_green, color: :black }, { background: :default, color: :green }, { background: :light_cyan, color: :light_black }, { background: :black, color: :cyan }, { background: :light_cyan, color: :black }, { background: :cyan, color: :black }, { background: :white, color: :light_yellow }, { background: :blue, color: :light_black }, { background: :light_yellow, color: :black }, { background: :cyan, color: :white }, { background: :light_yellow, color: :green }, { background: :black, color: :light_blue }, { background: :light_white, color: :black }, { background: :light_red, color: :light_white }, { background: :light_cyan, color: :light_white }, { background: :light_blue, color: :black }, { background: :yellow, color: :white }, { background: :magenta, color: :black }, { background: :black, color: :yellow }, { background: :green, color: :light_magenta }, { background: :green, color: :red }, { background: :black, color: :blue }, { background: :light_white, color: :light_blue }, { background: :light_red, color: :green }, { background: :white, color: :light_green }, { background: :green, color: :blue }, { background: :light_green, color: :light_black }, { background: :white, color: :blue }, { background: :magenta, color: :green }, { background: :light_white, color: :light_green }, { background: :light_cyan, color: :white }, { background: :green, color: :black }, { background: :light_black, color: :magenta }, { background: :light_white, color: :light_red }, { background: :light_magenta, color: :default }, { background: :black, color: :light_white }, { background: :light_red, color: :white }, { background: :white, color: :light_black }, { background: :light_white, color: :light_yellow }, { background: :black, color: :light_red }, { background: :blue, color: :black }, { background: :light_green, color: :light_cyan }, { background: :magenta, color: :white }, { background: :magenta, color: :light_white }, { background: :black, color: :light_magenta }, { background: :red, color: :black }, { background: :black, color: :default }, { background: :light_red, color: :light_black }, { background: :default, color: :cyan }, { background: :light_blue, color: :light_white }, { background: :yellow, color: :black }, { background: :white, color: :yellow }, { background: :light_magenta, color: :light_white }, { background: :red, color: :green }, { background: :light_cyan, color: :light_red }, { background: :blue, color: :green }, { background: :white, color: :light_cyan }, { background: :light_magenta, color: :white }, { background: :light_blue, color: :white }, { background: :light_yellow, color: :default }, { background: :yellow, color: :light_black }, { background: :light_green, color: :default }, { background: :white, color: :red }, { background: :light_black, color: :cyan }, { background: :light_black, color: :green }, { background: :white, color: :magenta }, { background: :green, color: :light_white }, { background: :default, color: :light_magenta }, { background: :green, color: :light_yellow }, { background: :black, color: :light_yellow }, { background: :cyan, color: :light_black }, { background: :green, color: :magenta }, { background: :white, color: :black }, { background: :magenta, color: :default }, { background: :black, color: :green }, { background: :black, color: :magenta }, { background: :black, color: :light_cyan }, { background: :blue, color: :light_white }, { background: :light_red, color: :default }, { background: :light_white, color: :green }, { background: :light_white, color: :light_cyan }, { background: :light_white, color: :magenta }, { background: :default, color: :blue }, { background: :light_magenta, color: :black }, { background: :light_black, color: :red }, { background: :light_white, color: :yellow }, { background: :cyan, color: :light_white }, { background: :yellow, color: :light_white }, { background: :red, color: :light_white }, { background: :light_black, color: :light_red }, { background: :default, color: :yellow }, { background: :black, color: :red }]
|
12
|
+
else
|
13
|
+
String.colors.permutation(2).map do |background, color|
|
14
|
+
next if similar_colors?(background, color)
|
15
|
+
|
16
|
+
{
|
17
|
+
background: background,
|
18
|
+
color: color
|
19
|
+
}
|
20
|
+
end.compact.shuffle
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
def self.color_for(obj)
|
@@ -24,7 +28,7 @@ module PDRuby
|
|
24
28
|
|
25
29
|
def self.next_color_combination
|
26
30
|
@next_color_combination ||= color_combinations.dup
|
27
|
-
if @next_color_combination.
|
31
|
+
if @next_color_combination.nil?
|
28
32
|
@next_color_combination = color_combinations.dup
|
29
33
|
end
|
30
34
|
@next_color_combination.shift
|
data/lib/pd_ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pd_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Jackson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".rspec"
|
92
|
+
- ".ruby-version"
|
92
93
|
- ".travis.yml"
|
93
94
|
- CODE_OF_CONDUCT.md
|
94
95
|
- Gemfile
|
@@ -125,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
126
|
- !ruby/object:Gem::Version
|
126
127
|
version: '0'
|
127
128
|
requirements: []
|
128
|
-
rubygems_version: 3.0.
|
129
|
+
rubygems_version: 3.0.3
|
129
130
|
signing_key:
|
130
131
|
specification_version: 4
|
131
132
|
summary: Print debug statements with ease.
|