samantha 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/samantha/version.rb +1 -1
- data/lib/samantha.rb +9 -23
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bba903f9f30cab948b6fb38f05479b1ffa553ec
|
4
|
+
data.tar.gz: 51ea88e965c81de1bb55dc0fa14c8486f76e0853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9429041c9eb60258b85a61ccd7fc7fefcc6f63dcbf80809eab2cebe8d8de86cddeb20dad5c62aa38dc10f272cdb7049f9ea95cf717fb4327e4ced2b869b89843
|
7
|
+
data.tar.gz: 5d8ef26e6fb6312cf7ee6705a169554c845cdca5374f26cde45529b49cb4be5645ddf6a1e573e55a10d1b0113047a2341c1e502fe0fc081849e1e9a0d5576462
|
data/README.md
CHANGED
data/lib/samantha/version.rb
CHANGED
data/lib/samantha.rb
CHANGED
@@ -5,11 +5,11 @@ module Samantha
|
|
5
5
|
|
6
6
|
class Palette
|
7
7
|
attr_accessor :colors
|
8
|
-
|
8
|
+
|
9
9
|
def initialize()
|
10
10
|
@colors = []
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def add_color(color)
|
14
14
|
a = @colors.detect { |c| c.hex == color.hex }
|
15
15
|
if a == nil
|
@@ -19,10 +19,10 @@ module Samantha
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
class Color
|
24
24
|
attr_accessor :hex, :count
|
25
|
-
|
25
|
+
|
26
26
|
def initialize(hex, count)
|
27
27
|
@hex = hex
|
28
28
|
@count = count
|
@@ -34,7 +34,7 @@ module Samantha
|
|
34
34
|
def initialize()
|
35
35
|
@palette = Palette.new
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def find_colors(dir)
|
39
39
|
Dir["#{dir}/*"].each do |f|
|
40
40
|
File.open(f) do |f|
|
@@ -47,28 +47,14 @@ module Samantha
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
color_block = " "
|
53
|
-
|
54
|
-
puts Paint['', nil, nil]
|
50
|
+
color_block = "●"
|
55
51
|
|
56
|
-
puts
|
52
|
+
puts Paint['', nil, nil]
|
57
53
|
|
58
|
-
puts
|
59
|
-
|
60
|
-
puts "╭──────────────┬────────┬────────╮"
|
61
|
-
puts "│ │ Hex │ Uses │"
|
62
|
-
puts "├──────────────┼────────┼────────┤"
|
63
|
-
|
64
54
|
@palette.colors.each do |c|
|
65
|
-
puts "
|
66
|
-
puts "├──────────────┼────────┼────────┤"
|
55
|
+
puts "#{Paint[color_block, c.hex, nil]} ##{c.hex.ljust(6)} #{c.count.to_s.ljust(6)}"
|
67
56
|
end
|
68
|
-
|
69
|
-
puts "│ Total │ │ #{@palette.colors.length.to_s.ljust(6)} │"
|
70
|
-
puts "╰──────────────┴────────┴────────╯"
|
71
|
-
|
57
|
+
|
72
58
|
puts
|
73
59
|
|
74
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samantha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flip Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,10 +65,10 @@ files:
|
|
65
65
|
- LICENSE.txt
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
|
+
- bin/samantha
|
68
69
|
- lib/samantha.rb
|
69
70
|
- lib/samantha/version.rb
|
70
71
|
- samantha.gemspec
|
71
|
-
- bin/samantha
|
72
72
|
homepage: ''
|
73
73
|
licenses:
|
74
74
|
- MIT
|