feed2email 0.9.0 → 0.9.1

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
  SHA1:
3
- metadata.gz: e90ae1ad818a1966844926f7653f068a284a13d3
4
- data.tar.gz: 1f6ed9ac284fc677ca57d89cbcbf6a29543a1a19
3
+ metadata.gz: e69b799d3cbd8ab553fedc851e4439103379867e
4
+ data.tar.gz: ec73447b756ec375b735a827c9a843de960829ac
5
5
  SHA512:
6
- metadata.gz: 7654f7a35ae49c97c79e39b4141d0e2ef52aa952db6c953a4d31550ea50606937ff3c862b94617e1132e64fd42c82ab84dadceb7dfbadc43e6b5a852acdb44e9
7
- data.tar.gz: 685064935abc8fbe1a6ec02be6fb2223dfdf7d8ed192cc1262839650f1f61538e6f760c90bb368f298fdb0127e5e9c895dcb08c01bd539993b5ccc703daa0a1e
6
+ metadata.gz: 58ff89046e9cd04c210e9467ff31ccc176dffbe12a537a48d15bd21d857527ce70c55fd4be162fc4bf061942c7b91e54e0944b44baf52c080d273cd0b0f95cd6
7
+ data.tar.gz: 4c83c6c595369c8a50ff535b18cd00a6b36387c26c4f3b0ccd1620097d57301db68438926e362a772d25629641c06a0f26efd13e13a73c56dbbedd891c92662c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.9.1
2
+
3
+ * Fix feed type detection for secure feed URLs in OPML export
4
+
1
5
  ### 0.9.0
2
6
 
3
7
  * Change data backend from YAML to SQLite3
data/lib/feed2email.rb CHANGED
@@ -11,6 +11,10 @@ module Feed2Email
11
11
  root.join('config.yml').to_s
12
12
  end
13
13
 
14
+ def self.database_path
15
+ root.join('feed2email.db').to_s
16
+ end
17
+
14
18
  def self.logger
15
19
  @logger ||= Logger.new(
16
20
  config['log_path'], config['log_level'], config['log_shift_age'],
@@ -2,40 +2,20 @@ require 'sequel'
2
2
  require 'feed2email'
3
3
 
4
4
  module Feed2Email
5
- def self.database
6
- @database
7
- end
8
-
9
- def self.database=(database)
10
- @database = database
11
- end
12
-
13
- def self.database_path
14
- root.join('feed2email.db').to_s
15
- end
16
-
17
5
  class Database
18
6
  def self.setup
19
- return if Feed2Email.database
20
-
21
- Feed2Email.database = new(
22
- adapter: 'sqlite',
23
- database: Feed2Email.database_path,
24
- loggers: [Feed2Email.logger],
7
+ new(
8
+ adapter: 'sqlite',
9
+ database: Feed2Email.database_path,
10
+ loggers: [Feed2Email.logger],
25
11
  sql_log_level: :debug
26
12
  )
27
- Feed2Email.database.setup
28
13
  end
29
14
 
30
15
  def initialize(connect_options)
31
16
  @connect_options = connect_options
32
- end
33
-
34
- def setup
35
- unless connection
36
- setup_connection
37
- setup_schema
38
- end
17
+ setup_connection
18
+ setup_schema
39
19
  end
40
20
 
41
21
  private
@@ -44,8 +24,6 @@ module Feed2Email
44
24
 
45
25
  def connection; @connection end
46
26
 
47
- def path; connect_options[:database] end
48
-
49
27
  def setup_connection
50
28
  @connection = Sequel::Model.db = Sequel.connect(connect_options)
51
29
  end
@@ -71,5 +49,7 @@ module Feed2Email
71
49
  Time :updated_at
72
50
  end
73
51
  end
52
+
53
+ setup
74
54
  end
75
55
  end
@@ -9,8 +9,6 @@ require 'feed2email/loggable'
9
9
  require 'feed2email/version'
10
10
 
11
11
  module Feed2Email
12
- Database.setup
13
-
14
12
  if config['send_method'] == 'smtp'
15
13
  require 'feed2email/smtp_connection'
16
14
  SMTPConnection.setup
@@ -14,8 +14,6 @@ require 'feed2email/redirection_checker'
14
14
  require 'feed2email/version'
15
15
 
16
16
  module Feed2Email
17
- Database.setup
18
-
19
17
  class Feed < Sequel::Model(:feeds)
20
18
  plugin :dirty
21
19
  plugin :timestamps
@@ -56,11 +56,11 @@ module Feed2Email
56
56
 
57
57
  loop do
58
58
  uri = URI.parse(url)
59
+ http = Net::HTTP.new(uri.host, uri.port)
60
+ http.use_ssl = (uri.scheme == 'https')
59
61
 
60
62
  begin
61
- response = Net::HTTP.start(uri.host, uri.port) {|http|
62
- http.head(uri.request_uri)
63
- }
63
+ response = http.head(uri.request_uri)
64
64
  rescue
65
65
  break
66
66
  end
@@ -1,3 +1,3 @@
1
1
  module Feed2Email
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feed2email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aggelos Orfanakos