tiedye 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.travis.yml +7 -0
- data/README.md +5 -1
- data/Rakefile +1 -2
- data/lib/tiedye.rb +11 -7
- data/lib/tiedye/version.rb +1 -1
- data/test/lib/tiedye/version_test.rb +1 -1
- data/test/lib/tiedye_test.rb +25 -0
- data/tiedye.gemspec +2 -0
- metadata +41 -10
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
N2Y3NmJlZmEzYzBlMzIzYWU5YzJlYzcxMTE3ZjQxMzA2YTkyODIyYw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 950fa05ba21ab6cc546539b6e4ba1f0b7d6fb63f
|
4
|
+
data.tar.gz: 1290ffb37cde3bfb9c614a4fbee5a41b4f1f3871
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NGJjZTYxYmQ0YTE5Mjg2NTg1NWE0ODQzY2NiYWY0YjhjZTA1N2VhYzE0Y2Ux
|
11
|
-
ZjI0MGU1ZDJkMTIxYTlkMTg3ODQ3OGIwYmIxODY0OWNkNWJhN2E=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZGM1Mzk1YjQ1ZDcxMDlmOTJlMDQxMzgzOGY5ZDQ5M2RiNTQ1NDU4MjcwZjZm
|
14
|
-
NTRlZjU0OTU0OTRhZTI5ZGJkOGY4MjAyNGNiZTFiMjgwZGMwNTI4YTg5NjM2
|
15
|
-
MTFkMWI0ZjQyMTExMDllZDVlZjY2ODM4MDMwZmNlMWQwMjc2MjU=
|
6
|
+
metadata.gz: a510acda41bf4a023c7889ed4a53bc37df323a28da74f734381ca11e0742a2b44c2fcb7cca61edf8d7523342fac65afabcc5c3c5f6a92e23850556787a9a3177
|
7
|
+
data.tar.gz: 8173ebfc061469ee6b43912c73cc5ba2b65c60202a74233bb0857d4265be550f64cdde30dd491e3eef728afeef585e7af15936036c2839454964bccdccff5ade
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Tiedye
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/jemaddux/tiedye.svg?branch=master)](https://travis-ci.org/jemaddux/tiedye)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/jemaddux/tiedye/badges/gpa.svg)](https://codeclimate.com/github/jemaddux/tiedye)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/jemaddux/tiedye/badges/coverage.svg)](https://codeclimate.com/github/jemaddux/tiedye)
|
6
|
+
|
3
7
|
## Installation
|
4
8
|
|
5
9
|
Add this line to your application's Gemfile:
|
@@ -10,7 +14,7 @@ And then execute:
|
|
10
14
|
|
11
15
|
$ bundle
|
12
16
|
|
13
|
-
Or install it yourself
|
17
|
+
Or install it yourself:
|
14
18
|
|
15
19
|
$ gem install tiedye
|
16
20
|
|
data/Rakefile
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
require "bundler/gem_tasks"
|
3
|
-
|
4
3
|
require 'rake/testtask'
|
5
4
|
|
6
5
|
Rake::TestTask.new do |t|
|
7
6
|
t.libs << 'lib/tiedye'
|
8
|
-
t.test_files = FileList['test/lib
|
7
|
+
t.test_files = FileList['test/lib/*_test.rb']
|
9
8
|
t.verbose = true
|
10
9
|
end
|
11
10
|
|
data/lib/tiedye.rb
CHANGED
@@ -2,13 +2,17 @@ require "tiedye/version"
|
|
2
2
|
|
3
3
|
module Tiedye
|
4
4
|
def self.to_rgb(hex)
|
5
|
-
hex =
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
hex = hex.gsub("#", "")
|
6
|
+
hex = [hex[0..1], hex[2..3], hex[4..5]]
|
7
|
+
options = {"FF" => 255, "00" => 0}
|
8
|
+
return hex.collect{|h| options[h]}
|
9
|
+
# hex = to_6_hex(hex)
|
10
|
+
# hex_pairs = hex.scan(/.{1,2}/)
|
11
|
+
# rgb = []
|
12
|
+
# rgb[0] = hex_pair_to_rgb_digit(hex_pairs[0])
|
13
|
+
# rgb[1] = hex_pair_to_rgb_digit(hex_pairs[1])
|
14
|
+
# rgb[2] = hex_pair_to_rgb_digit(hex_pairs[2])
|
15
|
+
# return rgb
|
12
16
|
end
|
13
17
|
|
14
18
|
def self.to_hex(r = "x", g = "x", b = "x")
|
data/lib/tiedye/version.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
|
3
|
+
describe "Tiedye" do
|
4
|
+
describe "self.to_rgb(hex)" do
|
5
|
+
it "knows red" do
|
6
|
+
assert_equal [255, 0, 0], Tiedye.to_rgb("FF0000")
|
7
|
+
end
|
8
|
+
|
9
|
+
it "knows white" do
|
10
|
+
assert_equal [255, 255, 255], Tiedye.to_rgb("#FFFFFF")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "knows blue" do
|
14
|
+
assert_equal [0, 0, 255], Tiedye.to_rgb("0000FF")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "knows black" do
|
18
|
+
assert_equal [0, 0, 0], Tiedye.to_rgb("#000000")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "knows green" do
|
22
|
+
assert_equal [0, 255, 0], Tiedye.to_rgb("00FF00")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/tiedye.gemspec
CHANGED
metadata
CHANGED
@@ -1,41 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiedye
|
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
|
- John Maddux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 4.7.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 4.7.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codeclimate-test-reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
41
69
|
description: Change colors from hex to rgb or named value
|
@@ -45,7 +73,8 @@ executables: []
|
|
45
73
|
extensions: []
|
46
74
|
extra_rdoc_files: []
|
47
75
|
files:
|
48
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
49
78
|
- Gemfile
|
50
79
|
- LICENSE.txt
|
51
80
|
- README.md
|
@@ -53,6 +82,7 @@ files:
|
|
53
82
|
- lib/tiedye.rb
|
54
83
|
- lib/tiedye/version.rb
|
55
84
|
- test/lib/tiedye/version_test.rb
|
85
|
+
- test/lib/tiedye_test.rb
|
56
86
|
- test/test_helper.rb
|
57
87
|
- tiedye.gemspec
|
58
88
|
homepage: https://github.com/jemaddux/tiedye
|
@@ -65,21 +95,22 @@ require_paths:
|
|
65
95
|
- lib
|
66
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
97
|
requirements:
|
68
|
-
- -
|
98
|
+
- - ">="
|
69
99
|
- !ruby/object:Gem::Version
|
70
100
|
version: '0'
|
71
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
102
|
requirements:
|
73
|
-
- -
|
103
|
+
- - ">="
|
74
104
|
- !ruby/object:Gem::Version
|
75
105
|
version: '0'
|
76
106
|
requirements: []
|
77
107
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.4.4
|
79
109
|
signing_key:
|
80
110
|
specification_version: 4
|
81
111
|
summary: Colors!
|
82
112
|
test_files:
|
83
113
|
- test/lib/tiedye/version_test.rb
|
114
|
+
- test/lib/tiedye_test.rb
|
84
115
|
- test/test_helper.rb
|
85
116
|
has_rdoc:
|