transmission-rss 1.0.0.alpha2 → 1.0.0.beta1

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: 6549e5b8d06f19b6c8ff392677d66f0a5519ac73d39192522388eb0ed2b1bceb
4
- data.tar.gz: 0fbd398d1a32c27b573a45228cdfd8b920010a627b3f3e46461a6ecd981750bb
3
+ metadata.gz: 06335ae55c5547575753c5e83595a32918b5acf583ee8a89e6ccbd4ba016dcac
4
+ data.tar.gz: b6132be027c0be9bfd3570a0d39f0230bbeade5d0aa9a34e5d6c2e157c0acce0
5
5
  SHA512:
6
- metadata.gz: e14bfa9e9f86b4e52e1738d55752fa852bb4416eb0827be329db5688d5c13f1ca75a6f11df23388d5ed5242110b5704260fbf7ba460b28c06495062b742f3302
7
- data.tar.gz: cfe725811a2ecbe457dfbda0451f59e99b6da4c5b48343db4753d7c4897976336b7c0d20eb45a6a6443284b7fea29bcda507990c62b6e40fe16dbce3b3d3b623
6
+ metadata.gz: 83ab6f33442032dda0d7366291b91ab70cd866e8d2666bb49489ade302a3ca41010fef97a04af0e8fce2572a8be0c4a3f335b7ba52a34e9bb46b6e1e8ca553a9
7
+ data.tar.gz: 0deda4306c1937d5124344566c51f155f2b7befa1cff4a7dc67ac740ca854a033ff32d0da21ad2e4b3165a45afb350c3b41c792bd44a14198773d4a306ffad01
@@ -3,7 +3,8 @@ $:.unshift(File.dirname(__FILE__))
3
3
  module TransmissionRSS
4
4
  end
5
5
 
6
- require 'transmission-rss/core_ext/object'
6
+ require 'transmission-rss/core_ext/Array'
7
+ require 'transmission-rss/core_ext/Object'
7
8
 
8
9
  Dir.glob($:.first + '/**/*.rb').each do |lib|
9
10
  require lib
@@ -39,6 +39,9 @@ module TransmissionRSS
39
39
  end
40
40
 
41
41
  check_deprecated
42
+ check_warnings
43
+
44
+ self
42
45
  end
43
46
 
44
47
  def merge_defaults!
@@ -99,11 +102,30 @@ module TransmissionRSS
99
102
  private
100
103
 
101
104
  def check_deprecated
105
+ warnings = false
106
+
102
107
  DEPRECATED.each do |key, value|
103
108
  if self[key.to_s]
104
109
  @log.warn('[DEPRECATED] option %s, use %s' % [key, value])
110
+ warnings = true
105
111
  end
106
112
  end
113
+
114
+ warnings
115
+ end
116
+
117
+ def check_warnings
118
+ return false unless self['feeds']
119
+
120
+ warnings = false
121
+
122
+ urls = self['feeds'].map { |feed| feed['url'] }
123
+ urls.duplicates.each do |duplicate|
124
+ @log.warn('Duplicate URL definition: %s' % duplicate)
125
+ warnings = true
126
+ end
127
+
128
+ warnings
107
129
  end
108
130
  end
109
131
  end
@@ -0,0 +1,5 @@
1
+ class Array
2
+ def duplicates
3
+ self.group_by { |e| e }.select { |k, v| v.size > 1 }.map(&:first)
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module TransmissionRSS
2
- VERSION = '1.0.0.alpha2'
2
+ VERSION = '1.0.0.beta1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transmission-rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha2
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - henning mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-01 00:00:00.000000000 Z
11
+ date: 2018-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open_uri_redirections
@@ -69,9 +69,10 @@ files:
69
69
  - lib/transmission-rss/callback.rb
70
70
  - lib/transmission-rss/client.rb
71
71
  - lib/transmission-rss/config.rb
72
- - lib/transmission-rss/core_ext/object.rb
72
+ - lib/transmission-rss/core_ext/Array.rb
73
+ - lib/transmission-rss/core_ext/Hash.rb
74
+ - lib/transmission-rss/core_ext/Object.rb
73
75
  - lib/transmission-rss/feed.rb
74
- - lib/transmission-rss/hash.rb
75
76
  - lib/transmission-rss/log.rb
76
77
  - lib/transmission-rss/seen_file.rb
77
78
  - lib/transmission-rss/version.rb