Active 0.0.39 → 0.0.40
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/Active +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/services/.DS_Store +0 -0
- data/lib/services/active_works.rb +28 -26
- data/lib/services/activity.rb +19 -2
- data/spec/spec.opts +0 -0
- data/version.txt +1 -1
- metadata +14 -20
data/bin/Active
CHANGED
File without changes
|
data/lib/.DS_Store
ADDED
Binary file
|
Binary file
|
@@ -14,8 +14,7 @@ module Active
|
|
14
14
|
# need to hold on to original data
|
15
15
|
@data = HashWithIndifferentAccess.new(data) || HashWithIndifferentAccess.new
|
16
16
|
@api_data_loaded = false
|
17
|
-
@asset_type_id =
|
18
|
-
get_app_api
|
17
|
+
@asset_type_id = Activity::ACTIVE_WORKS_ASSET_TYPE_ID
|
19
18
|
end
|
20
19
|
|
21
20
|
def source
|
@@ -93,28 +92,31 @@ module Active
|
|
93
92
|
User.new
|
94
93
|
end
|
95
94
|
|
96
|
-
|
97
95
|
def category
|
98
96
|
primary_category
|
99
97
|
end
|
100
98
|
|
101
99
|
def desc
|
102
100
|
if @data.has_key?("eventDetailDto") && @data["eventDetailDto"].has_key?("description")
|
103
|
-
|
104
|
-
sanitize @data["eventDetailDto"]["description"]
|
101
|
+
sanitize( @data["eventDetailDto"]["description"] )
|
105
102
|
end
|
106
103
|
end
|
107
104
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
#
|
115
|
-
|
116
|
-
|
117
|
-
|
105
|
+
def registration_url
|
106
|
+
if @data.has_key?("eventDetailDto") && @data["eventDetailDto"].has_key?("registrationUrl")
|
107
|
+
@data["eventDetailDto"]["registrationUrl"]
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# Finds an active works event by substitution url or returns nil
|
112
|
+
def self.find_by_id(id)
|
113
|
+
begin
|
114
|
+
doc = Nokogiri::XML(open("http://apij.active.com/activeworks/event/#{id}"))
|
115
|
+
ActiveWorks.new( Hash.from_xml(doc.to_s) )
|
116
|
+
rescue
|
117
|
+
# raise ActiveWorksError, "Couldn't find ActiveWorks activity with the id of #{id}"
|
118
|
+
return nil
|
119
|
+
end
|
118
120
|
end
|
119
121
|
|
120
122
|
private
|
@@ -148,17 +150,17 @@ module Active
|
|
148
150
|
# @metadata_loaded=true
|
149
151
|
# end
|
150
152
|
|
151
|
-
|
152
|
-
# puts "loading active works api"
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
153
|
+
# def get_app_api
|
154
|
+
# # puts "loading active works api"
|
155
|
+
# begin
|
156
|
+
# doc = Nokogiri::XML(open("http://apij.active.com/activeworks/event/#{@data[:id]}"))
|
157
|
+
# @data.merge! Hash.from_xml doc.to_s
|
158
|
+
# @api_data_loaded=true
|
159
|
+
# rescue
|
160
|
+
# raise ActiveWorksError, "Couldn't find ActiveWorks activity with the id of #{id}"
|
161
|
+
# return
|
162
|
+
# end
|
163
|
+
# end
|
162
164
|
|
163
165
|
end # end ats
|
164
166
|
end
|
data/lib/services/activity.rb
CHANGED
@@ -6,11 +6,28 @@ module Active
|
|
6
6
|
class ActivityFindError < StandardError; end
|
7
7
|
|
8
8
|
class Activity < IActivity
|
9
|
+
|
10
|
+
# EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65 reg
|
11
|
+
# 3BF82BBE-CF88-4E8C-A56F-78F5CE87E4C6 reg2
|
12
|
+
# FB27C928-54DB-4ECD-B42F-482FC3C8681F ActiveNet US or Canada
|
13
|
+
# 732A256E-2A25-4A02-81B3-769615CAA7A4 Active Net US or Canada
|
14
|
+
# EC6E96A5-6900-4A0E-8B83-9AA935F45A73 Local
|
15
|
+
# DFAA997A-D591-44CA-9FB7-BF4A4C8984F1 ActiveWorks
|
16
|
+
|
17
|
+
# ecffc8b6-51ed-43af-82d3-540e607e5af5 Search Assets (This is a generic page (currently hosts Class Assets, Tournaments, and Swim Schools). This data comes from ATS.)
|
18
|
+
# 71D917DE-FA90-448A-90DA-C8852F7E03E2 tennislink.usta.com Tournaments (Tennis Tournaments, don’t know much about this one.)
|
19
|
+
# 2b22b4e6-5aa4-44d7-bf06-f7a71f9fa8a6 AW Camps (These are Foundations Camps pages. They have a SOAP service.)
|
20
|
+
# 2ba50aba-080e-4e3d-a01c-1b4f56648a2e Asset Quality DB - Thriva (These are Thriva Camps. This data come from ATS.)
|
21
|
+
|
9
22
|
REG_CENTER_ASSET_TYPE_ID = "EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65"
|
10
23
|
REG_CENTER_ASSET_TYPE_ID2 = "3BF82BBE-CF88-4E8C-A56F-78F5CE87E4C6"
|
11
24
|
ACTIVE_WORKS_ASSET_TYPE_ID = "DFAA997A-D591-44CA-9FB7-BF4A4C8984F1"
|
12
25
|
LOCAL_ASSET_TYPE_ID = "EC6E96A5-6900-4A0E-8B83-9AA935F45A73"
|
13
|
-
|
26
|
+
THRIVA = "2ba50aba-080e-4e3d-a01c-1b4f56648a2e"
|
27
|
+
AW_CAMPS = "2b22b4e6-5aa4-44d7-bf06-f7a71f9fa8a6"
|
28
|
+
TENNIS_TOURNAMENTS = "71D917DE-FA90-448A-90DA-C8852F7E03E2"
|
29
|
+
GENERIC_SEARCH = "ecffc8b6-51ed-43af-82d3-540e607e5af5"
|
30
|
+
|
14
31
|
attr_accessor :primary, :gsa, :ats
|
15
32
|
attr_reader :datasources_loaded
|
16
33
|
|
@@ -42,7 +59,7 @@ module Active
|
|
42
59
|
def source
|
43
60
|
:active
|
44
61
|
end
|
45
|
-
|
62
|
+
# todo remove
|
46
63
|
def origin
|
47
64
|
if @gsa.asset_type_id == REG_CENTER_ASSET_TYPE_ID || @gsa.asset_type_id == REG_CENTER_ASSET_TYPE_ID2
|
48
65
|
return "RegCenter id= #{@gsa.asset_id} type= #{@gsa.asset_type_id}"
|
data/spec/spec.opts
CHANGED
File without changes
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.40
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Active
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 81
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 40
|
9
|
+
version: 0.0.40
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Jonathan Spooner, Brian Levine
|
@@ -15,18 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-17 00:00:00 -08:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: savon
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
|
-
- - "
|
25
|
+
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 17
|
30
27
|
segments:
|
31
28
|
- 0
|
32
29
|
- 7
|
@@ -38,11 +35,9 @@ dependencies:
|
|
38
35
|
name: dalli
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
|
-
- - "
|
39
|
+
- - ">="
|
44
40
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 43
|
46
41
|
segments:
|
47
42
|
- 0
|
48
43
|
- 9
|
@@ -54,16 +49,14 @@ dependencies:
|
|
54
49
|
name: bones
|
55
50
|
prerelease: false
|
56
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
52
|
requirements:
|
59
53
|
- - ">="
|
60
54
|
- !ruby/object:Gem::Version
|
61
|
-
hash: 21
|
62
55
|
segments:
|
63
56
|
- 3
|
64
|
-
-
|
65
|
-
-
|
66
|
-
version: 3.
|
57
|
+
- 4
|
58
|
+
- 7
|
59
|
+
version: 3.4.7
|
67
60
|
type: :development
|
68
61
|
version_requirements: *id003
|
69
62
|
description: Search api for Active Network
|
@@ -76,13 +69,18 @@ extra_rdoc_files:
|
|
76
69
|
- History.txt
|
77
70
|
- README.txt
|
78
71
|
- bin/Active
|
72
|
+
- lib/.DS_Store
|
73
|
+
- lib/services/.DS_Store
|
74
|
+
- version.txt
|
79
75
|
files:
|
80
76
|
- Active.gemspec
|
81
77
|
- History.txt
|
82
78
|
- README.txt
|
83
79
|
- Rakefile
|
84
80
|
- bin/Active
|
81
|
+
- lib/.DS_Store
|
85
82
|
- lib/Active.rb
|
83
|
+
- lib/services/.DS_Store
|
86
84
|
- lib/services/IActivity.rb
|
87
85
|
- lib/services/_ats.rb
|
88
86
|
- lib/services/active_works.rb
|
@@ -124,27 +122,23 @@ rdoc_options:
|
|
124
122
|
require_paths:
|
125
123
|
- lib
|
126
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
125
|
requirements:
|
129
126
|
- - ">="
|
130
127
|
- !ruby/object:Gem::Version
|
131
|
-
hash: 3
|
132
128
|
segments:
|
133
129
|
- 0
|
134
130
|
version: "0"
|
135
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
-
none: false
|
137
132
|
requirements:
|
138
133
|
- - ">="
|
139
134
|
- !ruby/object:Gem::Version
|
140
|
-
hash: 3
|
141
135
|
segments:
|
142
136
|
- 0
|
143
137
|
version: "0"
|
144
138
|
requirements: []
|
145
139
|
|
146
140
|
rubyforge_project: Active
|
147
|
-
rubygems_version: 1.3.
|
141
|
+
rubygems_version: 1.3.6
|
148
142
|
signing_key:
|
149
143
|
specification_version: 3
|
150
144
|
summary: Search api for Active Network
|