ayadn 1.3.0 → 1.3.1

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: 68be7f0b81c33d2647ee698be5d787d3ab302b23
4
- data.tar.gz: dee94c175ef19fead20537823adb02e293817cfe
3
+ metadata.gz: d736e86cdb69874e27906957e9ad71185ae53521
4
+ data.tar.gz: 09dc0ace08944ac1695e27b24dc4ac291b10a24c
5
5
  SHA512:
6
- metadata.gz: 1b41aee21510a8dc7baec12d9cd874c304fc39bd2be299e4df82c58a19e44100f11caa7fe71a2f3bad5f385c64aa5cbfb72c72dc7d9ab3f869ff80a535b6dd08
7
- data.tar.gz: b116e88c21e37e31d29532f679a444301535cf5cd4902d5bbae7077a52bde198ed003da610cc6f5078c9b44639c297d961a46c937db0aca9ae5eff23dcab19f3
6
+ metadata.gz: a5c4cc013686503eaf64804723a1f2b0c16ade27f5dbcaeeed44cf5d8d3f5eb2d38ea01d4058eaef3d4cbcd89fbf5e5f9b398388f2ed46f25567f7d826300a00
7
+ data.tar.gz: ba846c19082b1380a21bcddf8ffd8153ea2e09bbc67aa8e48e3478f8305f435bb8d287b716bbb5ee384892fd4730caf1e9847d8f0c730688de44ec0cf6c1a2db
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.3.1 - 'Nico'
2
+
3
+ - NiceRank threshold is a float again. Default value is 2.1
4
+
1
5
  # 1.3.0 - 'K'
2
6
 
3
7
  - Updated the NiceRank API url
@@ -35,9 +35,9 @@ module Ayadn
35
35
  Debug.db all_dbs
36
36
 
37
37
  all_dbs.each do |db|
38
- db.flush
39
- db.compact
40
- db.close
38
+ db.flush
39
+ db.compact
40
+ db.close
41
41
  end
42
42
  end
43
43
 
@@ -854,7 +854,7 @@ module Ayadn
854
854
 
855
855
  ayadn set nicerank filter_unranked true
856
856
 
857
- ayadn set timeline show_nicerank true
857
+ ayadn set nicerank threshold 2.1
858
858
  \n\n
859
859
  USAGE
860
860
  end
data/lib/ayadn/set.rb CHANGED
@@ -162,7 +162,7 @@ module Ayadn
162
162
  Logs.create_logger
163
163
  unless Settings.options[:nicerank]
164
164
  Settings.options[:nicerank] = {
165
- threshold: 2,
165
+ threshold: 2.1,
166
166
  cache: 48,
167
167
  filter: true,
168
168
  filter_unranked: false
@@ -173,7 +173,7 @@ module Ayadn
173
173
  end
174
174
  end
175
175
  def log(args)
176
- x = "New value for '#{args[0]}' in 'NiceRank' => #{args[1]}"
176
+ x = "New value for '#{args[0]}' in 'NiceRank' => #{"%1.1f" % args[1].to_f}"
177
177
  puts "\n#{x}\n".color(:cyan)
178
178
  Logs.rec.info x
179
179
  end
@@ -187,7 +187,7 @@ module Ayadn
187
187
  Settings.options[:nicerank][:filter_unranked] = Validators.boolean(value)
188
188
  end
189
189
  def threshold value
190
- Settings.options[:nicerank][:threshold] = value.to_f
190
+ Settings.options[:nicerank][:threshold] = Validators.threshold value
191
191
  end
192
192
  def cache value
193
193
  Settings.options[:nicerank][:cache] = Validators.cache_range value.to_i
@@ -249,6 +249,14 @@ module Ayadn
249
249
  abort(Status.cache_range)
250
250
  end
251
251
  end
252
+ def self.threshold value
253
+ value = value.to_f
254
+ if value > 0 and value < 5
255
+ value
256
+ else
257
+ abort(Status.threshold)
258
+ end
259
+ end
252
260
  def self.timer(t)
253
261
  t = t.to_i
254
262
  t >= 1 ? t : 3
@@ -377,7 +385,7 @@ module Ayadn
377
385
  def show_nicerank value
378
386
  unless Settings.options[:nicerank]
379
387
  Settings.options[:nicerank] = {
380
- threshold: 2,
388
+ threshold: 2.1,
381
389
  filter: true,
382
390
  filter_unranked: false
383
391
  }
@@ -483,5 +491,9 @@ module Ayadn
483
491
  def debug(color)
484
492
  Settings.options[:colors][:debug] = color.to_sym
485
493
  end
494
+
495
+ def nicerank(color)
496
+ Settings.options[:colors][:nicerank] = color.to_sym
497
+ end
486
498
  end
487
499
  end
@@ -203,7 +203,7 @@ module Ayadn
203
203
  timer: 3
204
204
  },
205
205
  nicerank: {
206
- threshold: 2,
206
+ threshold: 2.1,
207
207
  cache: 48,
208
208
  filter: true,
209
209
  filter_unranked: false
data/lib/ayadn/status.rb CHANGED
@@ -247,6 +247,9 @@ module Ayadn
247
247
  def self.cache_range
248
248
  "\nPlease enter a number of hours between 1 and 168.\n\n".color(:red)
249
249
  end
250
+ def self.threshold
251
+ "\nPlease enter a value between 0.1 and 3.5, example: 2.1\n\n".color(:red)
252
+ end
250
253
  def self.must_be_in_index
251
254
  "\nNumber must be in the range of the indexed posts.\n".color(:red)
252
255
  end
data/lib/ayadn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Ayadn
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ayadn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-09 00:00:00.000000000 Z
11
+ date: 2014-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor