geturl 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5923ac3f2d759ce88b144f13615bee62d7deb992e6b5869f0a28ec182595080c
4
- data.tar.gz: ae43f0db4b4788fec7d5defe8ffb3a6d48c4155c5b3229f33d9e030654da9038
3
+ metadata.gz: a759830473da0d7462c68059768185b2ae2fb502179afb05ba4fc3a6106560d6
4
+ data.tar.gz: 131492d65e2bbd6a8b4f7641ec7cb127a7a1f658366ed48868263f1337998a20
5
5
  SHA512:
6
- metadata.gz: ad48dc1848c152fec27faafebdf3c80a19363a8bd8b5de92341cb5b2e0abfdf2bc54ea2fddb5c72ee7c7959af9e1e30f695a91dc56ee4aa07cda9c0257b044f5
7
- data.tar.gz: 6dcd57c7636541c87c7bcac2d61fefbc0bc733b261e0db88c5f1f5a00a2bf61aaef51f37c787c60e9baa74a392cc9fa879392984b7b6beb274a102acdfc32985
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, 20, 5)
104
+ score += get_field_score(tag, keyword, 30, 20)
105
105
  }
106
106
  rescue
107
107
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geturl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taco Jan Osinga