wc 0.96.0 → 0.97.0
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.
- data/VERSION +1 -1
- data/lib/wc.rb +45 -5
- data/wc.gemspec +3 -3
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.97.0
|
data/lib/wc.rb
CHANGED
@@ -57,13 +57,53 @@ class Wc
|
|
57
57
|
if @words == -1
|
58
58
|
cloud_items = @sorted
|
59
59
|
else
|
60
|
-
|
60
|
+
cloud_items = @sorted[0..@words-1]
|
61
61
|
end
|
62
|
+
max = @sorted.first[1]
|
63
|
+
min = @sorted.last[1]
|
64
|
+
|
65
|
+
range = max - min
|
66
|
+
interval = (1.0 * range)/10
|
67
|
+
|
68
|
+
r0=min+interval
|
69
|
+
r1=r0+interval
|
70
|
+
r2=r1+interval
|
71
|
+
r3=r2+interval
|
72
|
+
r4=r3+interval
|
73
|
+
r5=r4+interval
|
74
|
+
r6=r5+interval
|
75
|
+
r7=r6+interval
|
76
|
+
r8=r7+interval
|
77
|
+
r9=r8+interval
|
78
|
+
r10=r9+interval
|
79
|
+
|
62
80
|
ret = "<dl>"
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
81
|
+
|
82
|
+
cloud_items.each { |elem|
|
83
|
+
if (elem[1]>r10)
|
84
|
+
c="tag9"
|
85
|
+
elsif (elem[1] > r9)
|
86
|
+
c="tag8"
|
87
|
+
elsif (elem[1] > r8)
|
88
|
+
c="tag7"
|
89
|
+
elsif (elem[1] > r7)
|
90
|
+
c="tag6"
|
91
|
+
elsif (elem[1] > r6)
|
92
|
+
c="tag5"
|
93
|
+
elsif (elem[1] > r5)
|
94
|
+
c="tag4"
|
95
|
+
elsif (elem[1] > r4)
|
96
|
+
c="tag3"
|
97
|
+
elsif (elem[1] > r3)
|
98
|
+
c="tag2"
|
99
|
+
elsif (elem[1] > r2)
|
100
|
+
c="tag1"
|
101
|
+
else
|
102
|
+
c="tag0"
|
103
|
+
end
|
104
|
+
|
105
|
+
ret+="<dt class=\""+c+"\">" + elem[0] +"</dt>"
|
106
|
+
|
67
107
|
}
|
68
108
|
ret += "</dl>"
|
69
109
|
ret
|
data/wc.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{wc}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.97.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paolo Perego"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-20}
|
13
13
|
s.default_executable = %q{wc}
|
14
14
|
s.description = %q{your ruby word counter experience}
|
15
15
|
s.email = %q{thesp0nge@gmail.com}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 411
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 97
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.97.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paolo Perego
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-20 00:00:00 +02:00
|
19
19
|
default_executable: wc
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|