samantha 0.0.1 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9ad3e4c91268821796cfa57788c75a1d380c6d0
4
- data.tar.gz: ce84ecde8b2d9830b1d970f9a7e60ef8ef46e1c8
3
+ metadata.gz: 5bba903f9f30cab948b6fb38f05479b1ffa553ec
4
+ data.tar.gz: 51ea88e965c81de1bb55dc0fa14c8486f76e0853
5
5
  SHA512:
6
- metadata.gz: 8c32db4e18978e2f8b1c03b5b1f5359c460365a0eb65e0362552909e530e835ee6d7637d5f3982fb097eadf0003876aa610e733d86985984f9fd6604768aa65e
7
- data.tar.gz: 9aa8dff391644e88315013f7bd6502384fa58a2c2b3b3d0ad79f9604048cbb4187cd5e8859208d482f32995b3fd6b7fd0e6e87135b9f01272da4f6585b9b53a1
6
+ metadata.gz: 9429041c9eb60258b85a61ccd7fc7fefcc6f63dcbf80809eab2cebe8d8de86cddeb20dad5c62aa38dc10f272cdb7049f9ea95cf717fb4327e4ced2b869b89843
7
+ data.tar.gz: 5d8ef26e6fb6312cf7ee6705a169554c845cdca5374f26cde45529b49cb4be5645ddf6a1e573e55a10d1b0113047a2341c1e502fe0fc081849e1e9a0d5576462
data/README.md CHANGED
@@ -24,7 +24,7 @@ Samantha takes one command,
24
24
 
25
25
  `$ samantha <dir>`
26
26
 
27
- where <dir> is the directory you'd like to find hex color codes in.
27
+ where `<dir>` is the directory you'd like to find hex color codes in.
28
28
 
29
29
  ## Contributing
30
30
 
@@ -1,3 +1,3 @@
1
1
  module Samantha
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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
- @palette.colors.sort_by! { |c| c.count }
51
-
52
- color_block = " "
53
-
54
- puts Paint['', nil, nil]
50
+ color_block = "●"
55
51
 
56
- puts "#{(" Hexes in /" + dir.to_s)}"
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 "#{Paint[color_block, nil, c.hex]} │ #{c.hex.ljust(6)} #{c.count.to_s.ljust(6)}"
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.1
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-07-24 00:00:00.000000000 Z
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