kat 2.0.6 → 2.0.7

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kat/search.rb +16 -20
  3. data/lib/kat/version.rb +2 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef9cbd9bc5edfd5bcbbab270423445df0e0ffec2
4
- data.tar.gz: 57b4de26084d944ad5e369f38e8727442bad663a
3
+ metadata.gz: d6336ceffa5cab8bb90a2da89817ef8fa0dbde1a
4
+ data.tar.gz: 29c43873af002dc18a1851ec2eeb40cbe27a6643
5
5
  SHA512:
6
- metadata.gz: 509efe18911af40dfdaf17f3c86196d4990f833a500ebc2c68925d6fc0710fa86690beb266343dbb7d1134c6e171d2c578a31ded5830a2eb837378178663a135
7
- data.tar.gz: 588d18d574b744c7f026d51fcfb2da40e8e0689dc64a94bf9f2ca9722ed3c8fac230281ee0c59007d30d2eadc9b2c65f74c97465ee6044ea3ac0ac3ed0e719b7
6
+ metadata.gz: 103598e8673733f1cab5bf2431aebb1c4378b4ddf52c51feac5c0b2e61b0d4cfba8927107bfad7494325033770f4928c8cda3c6ced8d0099f7520f8672c49e51
7
+ data.tar.gz: c9f4120a505e4e17829e5d038ccfe14c4dc7b3c06afa13c76e2f7ba6552f1211f4c3379d19329d29a2dd58ac6ac0b5299251475a1bb687948c699b980db75757
@@ -42,18 +42,16 @@ module Kat
42
42
  def self.field_map(type = nil)
43
43
  return FIELD_MAP.dup unless type
44
44
 
45
- FIELD_MAP.reduce({}) do |hash, (k, v)|
46
- hash.tap do |h|
47
- case type
48
- when :select
49
- h[k] = { select: v[:select], id: v[:id] || k }
50
- when :sort
51
- h[k] = v[:sort] && h[v[:sort]] = v[:sort]
52
- h[v[:id]] = v[:sort] if v[:id]
53
- else
54
- h[k] = v[type]
55
- end if v[type]
56
- end
45
+ FIELD_MAP.each_with_object({}) do |(k, v), h|
46
+ case type
47
+ when :select
48
+ h[k] = { select: v[:select], id: v[:id] || k }
49
+ when :sort
50
+ h[k] = v[:sort] && h[v[:sort]] = v[:sort]
51
+ h[v[:id]] = v[:sort] if v[:id]
52
+ else
53
+ h[k] = v[type]
54
+ end if v[type]
57
55
  end
58
56
  end
59
57
 
@@ -246,17 +244,15 @@ module Kat
246
244
 
247
245
  if (group = opts.css('optgroup')).empty?
248
246
  # Times, languages, platforms
249
- opts.reject { |o| o.attributes.empty? }.reduce({}) do |p, o|
250
- p.tap { |p1| p1[o.text] = o.attributes['value'].value }
247
+ opts.reject { |o| o.attributes.empty? }.each_with_object({}) do |o, p|
248
+ p[o.text] = o.attributes['value'].value
251
249
  end
252
250
  else
253
251
  # Categories
254
- group.reduce({}) do |cat, og|
255
- cat.tap do |c|
256
- c[og.attributes['label'].value] = og.children.map do |o|
257
- o.attributes['value'].value
258
- end
259
- end
252
+ group.each_with_object({}) do |og, cat|
253
+ cat[og.attributes['label'].value] = og.children.reject { |o| o.attributes.empty? }.map do |o|
254
+ o.attributes['value'].value
255
+ end if og.has_attribute? 'label'
260
256
  end
261
257
  end
262
258
  rescue => e
@@ -1,7 +1,7 @@
1
1
  module Kat
2
2
  NAME = 'Kickass Torrents Search'
3
- VERSION = '2.0.6'
3
+ VERSION = '2.0.7'
4
4
  MALEVOLENT_DICTATOR_FOR_LIFE = 'Fission Xuiptz'
5
5
  AUTHOR = MALEVOLENT_DICTATOR_FOR_LIFE
6
- VERSION_STR = "#{NAME} #{VERSION} (c) 2013 #{MALEVOLENT_DICTATOR_FOR_LIFE}"
6
+ VERSION_STR = "#{ NAME } #{ VERSION } (c) 2013 #{ MALEVOLENT_DICTATOR_FOR_LIFE }"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fission Xuiptz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-05 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri