geturl 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/bin/geturl +7 -0
- data/lib/geturl/geturl-searcher.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a759830473da0d7462c68059768185b2ae2fb502179afb05ba4fc3a6106560d6
|
4
|
+
data.tar.gz: 131492d65e2bbd6a8b4f7641ec7cb127a7a1f658366ed48868263f1337998a20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d1ed7d9465bef8cb353c31169b56cc2c358e09454abc5807649ddf50581a439e9291a297e23ab1bc97e8c01e366b29059f37a3b744398911f0ae1fb1e6e1511
|
7
|
+
data.tar.gz: c8780c99dc8cf87afc7d27e7fea336e551dd0fe48b0388d9a853af9fde2c08f605b62cd1789232eb062b977aa3ce8a27686ec14fa59a9e307f2bb6d78060bdb1
|
data/bin/geturl
CHANGED
@@ -199,6 +199,13 @@ module GetUrlCli
|
|
199
199
|
puts item['url']
|
200
200
|
puts item['description'] unless item['description'].to_s.empty?
|
201
201
|
puts 'Tags: ' + item['tags'].join(', ') unless item['tags'].empty?
|
202
|
+
if @options['--show-score']
|
203
|
+
score = item['score']
|
204
|
+
scored_keywords = item['scored_keywords']
|
205
|
+
keywords_size = @arguments.size
|
206
|
+
keyword_title = (keywords_size.size == 1) ? 'keyword' : 'keywords'
|
207
|
+
puts "Score: #{score}, hitting #{scored_keywords} out of #{keywords_size} #{keyword_title}"
|
208
|
+
end
|
202
209
|
puts ''
|
203
210
|
end
|
204
211
|
|
@@ -72,7 +72,7 @@ module GetUrl
|
|
72
72
|
end
|
73
73
|
|
74
74
|
# Sort by score
|
75
|
-
@items.sort {|x, y|
|
75
|
+
@items.sort! {|x, y|
|
76
76
|
y['score'] <=> x['score'] rescue y <=> x
|
77
77
|
} if (@items.size > 1)
|
78
78
|
|
@@ -101,7 +101,7 @@ module GetUrl
|
|
101
101
|
score += get_field_score(item['url'], keyword, 50, 25)
|
102
102
|
score += get_field_score(item['description'], keyword, 30, 2)
|
103
103
|
item['tags'].to_a.each {|tag|
|
104
|
-
score += get_field_score(tag, keyword,
|
104
|
+
score += get_field_score(tag, keyword, 30, 20)
|
105
105
|
}
|
106
106
|
rescue
|
107
107
|
end
|