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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c8510879cb3cdd280c5138f101ec6cf5861aabc
|
4
|
+
data.tar.gz: 8b9aac7da8a0b182df32a0d1112d07000158fc3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 320bc1f228f8ade42b13a904b8bc0f005fed6ade2cc29300bf6288b0e89e4d8749e0e293e43b065cbbdfa47ef7f1c447bb5977d8ab37faedd5be3e98a926315c
|
7
|
+
data.tar.gz: eaee8b2ebbe21673194a7dc3896379dc304ddffec236e687042891d1387fd71389d023173491201b5a807d6e49ad8b98907e124d5ec9f6bbde45c53469898714
|
@@ -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
|
data/lib/eventify/version.rb
CHANGED
@@ -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
|
-
|
9
|
-
|
10
|
-
|
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 "
|
46
|
-
|
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
|
-
|
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/
|
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 "
|
64
|
-
|
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/
|
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 "#
|
83
|
-
it "
|
84
|
-
Eventify::Provider::Ticketpro.
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
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
|