pry-popularity 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.
- data/lib/pry-popularity.rb +9 -5
- metadata +3 -3
data/lib/pry-popularity.rb
CHANGED
@@ -9,7 +9,6 @@ class PryPopularity
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def process
|
12
|
-
# TODO accept arg for other file
|
13
12
|
lines = File.readlines Pry.config.history.file
|
14
13
|
popularity = Hash.new 0
|
15
14
|
$stderr.print <<-EOT
|
@@ -28,7 +27,7 @@ Found #{lines.size} history lines, scoring (each dot is 100 lines):
|
|
28
27
|
else
|
29
28
|
'[ruby code]'
|
30
29
|
end
|
31
|
-
|
30
|
+
end
|
32
31
|
popularity[thing] += 1
|
33
32
|
count += 1
|
34
33
|
if 0 == count % 100
|
@@ -37,7 +36,7 @@ Found #{lines.size} history lines, scoring (each dot is 100 lines):
|
|
37
36
|
end
|
38
37
|
$stderr.puts
|
39
38
|
|
40
|
-
report =
|
39
|
+
report = "pry-popularity results:\n"
|
41
40
|
popularity.sort_by{|k,v| v}.each do |thing, score|
|
42
41
|
report += "#{score} × #{thing}\n"
|
43
42
|
end
|
@@ -46,11 +45,16 @@ Found #{lines.size} history lines, scoring (each dot is 100 lines):
|
|
46
45
|
if opts.present? :gist
|
47
46
|
require 'jist'
|
48
47
|
res = Jist.gist report, :filename => 'pry-popularity'
|
49
|
-
output.puts
|
48
|
+
output.puts <<-EOT
|
49
|
+
Gisted at
|
50
|
+
#{res['html_url']}
|
51
|
+
Feel free to add to:
|
52
|
+
https://github.com/rking/pry-popularity/wiki/List/_edit
|
53
|
+
EOT
|
50
54
|
else
|
51
55
|
warn '(Note that you can run with -g, A.K.A. --gist)'
|
52
56
|
end
|
53
|
-
bangs = '!' * rand(4)
|
57
|
+
bangs = '!' * (1+rand(4))
|
54
58
|
"You're a cool guy"+bangs
|
55
59
|
end
|
56
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-popularity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ bindir: bin
|
|
12
12
|
cert_chain: []
|
13
13
|
date: 2012-12-19 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
|
-
description: Sort pry input history by frequency of use
|
15
|
+
description: Sort pry input history by frequency of use (git revision c83b52e)
|
16
16
|
email: pry-popularity@sharpsaw.org
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
@@ -43,6 +43,6 @@ rubyforge_project:
|
|
43
43
|
rubygems_version: 1.8.24
|
44
44
|
signing_key:
|
45
45
|
specification_version: 3
|
46
|
-
summary: Sort pry input history by frequency of use
|
46
|
+
summary: Sort pry input history by frequency of use (git revision c83b52e)
|
47
47
|
test_files: []
|
48
48
|
has_rdoc:
|