eventify 0.9.3 → 0.9.5

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: c63d0d9cbc7f993843600d90d40223b637c713dd
4
- data.tar.gz: cf89587660f384abf6408320118b05d8181d8452
3
+ metadata.gz: 2c8510879cb3cdd280c5138f101ec6cf5861aabc
4
+ data.tar.gz: 8b9aac7da8a0b182df32a0d1112d07000158fc3a
5
5
  SHA512:
6
- metadata.gz: 65e89bf490dede5ffccb6ae5f14a10763364322d7ca1bfcbc1f3314f2a18044ac9d5215d0103d72d98a4d9473517e1ee2ffc7479ff4828af947d7d3b91bfc42a
7
- data.tar.gz: c041c725f0fa5524d69002854a867fe6415e855366e683b1c8c9d8ddab34b9fe49dcff42f44fc9e181a1c553b1e27bb075ca9174248060afa2e0f0547d6b7410
6
+ metadata.gz: 320bc1f228f8ade42b13a904b8bc0f005fed6ade2cc29300bf6288b0e89e4d8749e0e293e43b065cbbdfa47ef7f1c447bb5977d8ab37faedd5be3e98a926315c
7
+ data.tar.gz: eaee8b2ebbe21673194a7dc3896379dc304ddffec236e687042891d1387fd71389d023173491201b5a807d6e49ad8b98907e124d5ec9f6bbde45c53469898714
@@ -22,7 +22,7 @@ class Eventify::Configuration
22
22
  def default_configuration
23
23
  {
24
24
  subscribers: ["user@example.org"],
25
- mail: Mail.delivery_method.settings
25
+ mail: Mail.delivery_method.settings.merge(openssl_verify_mode: "none")
26
26
  }
27
27
  end
28
28
 
@@ -5,17 +5,17 @@ module Eventify::Provider
5
5
  class Ticketpro < Base
6
6
  URL = "http://www.ticketpro.ee/jnp/rss/index.xml"
7
7
 
8
+ def initialize(event)
9
+ super
10
+ @id = @id.gsub(%r{/jnp/(ru|en)/}, "/jnp/")
11
+ @link = @link.gsub(%r{/jnp/(ru|en)/}, "/jnp/")
12
+ end
13
+
8
14
  class << self
9
15
  def fetch
10
16
  rss = SimpleRSS.parse open(URL)
11
17
  rss.entries.map { |entry| new id: entry.guid, title: entry.title, link: entry.link, date: entry.pubDate }
12
18
  end
13
19
  end
14
-
15
- alias_method :_id, :id
16
-
17
- def id
18
- _id.gsub(%r{/jnp/(ru|en)/}, "/jnp/")
19
- end
20
20
  end
21
21
  end
@@ -1,3 +1,3 @@
1
1
  class Eventify
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.5"
3
3
  end
@@ -10,7 +10,7 @@ describe Eventify::Configuration do
10
10
  it "has default settings by default" do
11
11
  configuration = Eventify::Configuration.new
12
12
  configuration[:subscribers].should == ["user@example.org"]
13
- configuration[:mail].should == Mail.delivery_method.settings
13
+ configuration[:mail].should == Mail.delivery_method.settings.merge(openssl_verify_mode: "none")
14
14
  end
15
15
 
16
16
  it "allows to override settings" do
@@ -1,92 +1,64 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Eventify::Provider::Ticketpro do
4
- context "#fetch" do
5
- it "fetches events" do
6
- stub_request(:get, Eventify::Provider::Ticketpro::URL).to_return(body: File.read(File.expand_path("../../support/ticketpro.xml", __dir__)))
7
4
 
8
- events = Eventify::Provider::Ticketpro.fetch
9
- events.should == [
10
- Eventify::Provider::Ticketpro.new(
11
- title: "KGB teater-kohvik-muuseum",
12
- link: "http://www.ticketpro.ee/jnp/theatre/1080200-kgb-teater-kohvik-muuseum.html",
13
- date: Time.parse("Mon, 06 May 2013 09:33:26 +0200"),
14
- id: "http://www.ticketpro.ee/jnp/theatre/1080200-kgb-teater-kohvik-muuseum.html"
15
- ),
16
- Eventify::Provider::Ticketpro.new(
17
- title: "Danny Malando tantsumuusika orkester ( Holland )",
18
- link: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
19
- date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
20
- id: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
21
- )
22
- ]
23
- end
24
- end
25
-
26
- context "#==" do
27
- it "true between non-localized and ru localized event" do
28
- not_localized_event = Eventify::Provider::Ticketpro.new(
5
+ context "#initialize" do
6
+ it "strips en localization info from id" do
7
+ Eventify::Provider::Ticketpro.new(
29
8
  title: "Danny Malando tantsumuusika orkester ( Holland )",
30
9
  link: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
31
10
  date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
32
- id: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
33
- )
34
-
35
- ru_localized_event = Eventify::Provider::Ticketpro.new(
36
- title: "Danny Malando tantsumuusika orkester ( Holland )",
37
- link: "http://www.ticketpro.ee/jnp/ru/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
38
- date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
39
- id: "http://www.ticketpro.ee/jnp/ru/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
40
- )
41
-
42
- not_localized_event.should == ru_localized_event
11
+ id: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
12
+ ).id.should == "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
43
13
  end
44
14
 
45
- it "true between non-localized and en localized event" do
46
- not_localized_event = Eventify::Provider::Ticketpro.new(
15
+ it "strips ru localization info from id" do
16
+ Eventify::Provider::Ticketpro.new(
47
17
  title: "Danny Malando tantsumuusika orkester ( Holland )",
48
18
  link: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
49
19
  date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
50
- id: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
51
- )
20
+ id: "http://www.ticketpro.ee/jnp/ru/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
21
+ ).id.should == "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
22
+ end
52
23
 
53
- en_localized_event = Eventify::Provider::Ticketpro.new(
24
+ it "strips en localization info from link" do
25
+ Eventify::Provider::Ticketpro.new(
54
26
  title: "Danny Malando tantsumuusika orkester ( Holland )",
55
27
  link: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
56
28
  date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
57
- id: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
58
- )
59
-
60
- not_localized_event.should == en_localized_event
29
+ id: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
30
+ ).link.should == "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
61
31
  end
62
32
 
63
- it "true between ru localized and en localized event" do
64
- ru_localized_event = Eventify::Provider::Ticketpro.new(
33
+ it "strips ru localization info from link" do
34
+ Eventify::Provider::Ticketpro.new(
65
35
  title: "Danny Malando tantsumuusika orkester ( Holland )",
66
36
  link: "http://www.ticketpro.ee/jnp/ru/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
67
37
  date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
68
- id: "http://www.ticketpro.ee/jnp/ru/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
69
- )
70
-
71
- en_localized_event = Eventify::Provider::Ticketpro.new(
72
- title: "Danny Malando tantsumuusika orkester ( Holland )",
73
- link: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
74
- date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
75
- id: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
76
- )
77
-
78
- ru_localized_event.should == en_localized_event
38
+ id: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
39
+ ).link.should == "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
79
40
  end
80
41
  end
81
42
 
82
- context "#id" do
83
- it "strips out localized part of url" do
84
- Eventify::Provider::Ticketpro.new(
85
- title: "Danny Malando tantsumuusika orkester ( Holland )",
86
- link: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
87
- date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
88
- id: "http://www.ticketpro.ee/jnp/en/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
89
- ).id.should == "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
43
+ context "#fetch" do
44
+ it "fetches events" do
45
+ stub_request(:get, Eventify::Provider::Ticketpro::URL).to_return(body: File.read(File.expand_path("../../support/ticketpro.xml", __dir__)))
46
+
47
+ events = Eventify::Provider::Ticketpro.fetch
48
+ events.should == [
49
+ Eventify::Provider::Ticketpro.new(
50
+ title: "KGB teater-kohvik-muuseum",
51
+ link: "http://www.ticketpro.ee/jnp/theatre/1080200-kgb-teater-kohvik-muuseum.html",
52
+ date: Time.parse("Mon, 06 May 2013 09:33:26 +0200"),
53
+ id: "http://www.ticketpro.ee/jnp/theatre/1080200-kgb-teater-kohvik-muuseum.html"
54
+ ),
55
+ Eventify::Provider::Ticketpro.new(
56
+ title: "Danny Malando tantsumuusika orkester ( Holland )",
57
+ link: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html",
58
+ date: Time.parse("Fri, 31 May 2013 14:29:07 +0200"),
59
+ id: "http://www.ticketpro.ee/jnp/music/1095688-danny-malando-tantsumuusika-orkester-holland-.html"
60
+ )
61
+ ]
90
62
  end
91
63
  end
92
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarmo Pertman