Active 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/Active CHANGED
File without changes
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -171,10 +171,8 @@ module Active
171
171
  # returns the best address possible by loading other data sources
172
172
  # 2. if the primary data source is unknow (ex asset_type_id is unknow ) we will return the GSA address.
173
173
  # 3. if no address but we have lat/lng we'll do a reverse look up
174
- def _address
175
- if Validators.full_address(@gsa.address)
176
- return @gsa.address
177
- end
174
+ def full_address
175
+ @primary.address
178
176
  # 3. MOVE TO A PRIVATE METHOD OR A NEW CLASS
179
177
  # if (returned_address["lat"]=="")
180
178
  # #geocode
@@ -202,6 +200,10 @@ module Active
202
200
  # end
203
201
  # end
204
202
  end
203
+
204
+ def user
205
+ @gsa.user
206
+ end
205
207
 
206
208
  def start_date
207
209
  return @gsa.start_date unless @gsa.nil?
@@ -0,0 +1,14 @@
1
+ module Active
2
+ module Services
3
+
4
+ class User
5
+ def email=(value)
6
+ @email = value
7
+ end
8
+ def email
9
+ @email
10
+ end
11
+ end
12
+
13
+ end
14
+ end
data/lib/services/gsa.rb CHANGED
@@ -129,6 +129,14 @@ module Active
129
129
  ""
130
130
  end
131
131
  end
132
+
133
+ def user
134
+ email = @data["meta"]["contactEmail"] || nil
135
+ u = User.new
136
+ u.email = email if Validators.email(email)
137
+ u
138
+ end
139
+
132
140
  # substitutionUrl could be formatted like this
133
141
  # 1. "meta":{"substitutionUrl":"vistarecreation/registrationmain.sdi?source=showAsset.sdi&activity_id=4900"}
134
142
  # 2. "meta":{"substitutionUrl":"4900"}
@@ -155,16 +155,12 @@ module Active
155
155
 
156
156
  def self.find_by_id(id) #local id
157
157
 
158
- search_hash = Digest::SHA1.hexdigest("reg_#{id}")
159
- if Active.CACHE
160
- cached_version = Active.CACHE.get(search_hash)
161
- return cached_version if cached_version
162
- end
163
-
164
158
  begin
165
159
  doc = Nokogiri::XML(open("http://apij.active.com/regcenter/event/#{id}"))
160
+ puts "////////<br/>"
161
+ puts doc.to_s
162
+ puts "////////<br/>"
166
163
  reg = RegCenter.new(Hash.from_xml(doc.to_s))
167
- Active.CACHE.set(search_hash, reg) if Active.CACHE
168
164
  rescue Exception => e
169
165
  raise RegCenterError, "Couldn't find Reg Center activity with the id of #{id} - #{e.inspect}"
170
166
  return
@@ -2,14 +2,22 @@ module Active
2
2
  module Services
3
3
  class Validators
4
4
 
5
- def self.full_address address
6
-
5
+ def self.email arg
6
+ if (arg =~ /^(\w|\.|-)+?@(\w|-)+?\.\w{2,4}($|\.\w{2,4})$/) == nil
7
+ return false
8
+ else
9
+ return true
10
+ end
7
11
  end
8
12
 
9
13
  # return true or false
10
14
  # very short check for 5 consecutive digits, no leading or trailing whitespace.
11
15
  def self.zip(arg)
12
- # arg ~= /\be(\w*)s\b/
16
+ # if (arg =~ /\be(\w*)/) != -1
17
+ # true
18
+ # else
19
+ # false
20
+ # end
13
21
  end
14
22
 
15
23
  def self.state
@@ -101,8 +101,8 @@ describe Activity do
101
101
  end
102
102
  it "should have an address from this hash with null name and address" do
103
103
  g = Activity.new(GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","language":"en","title":"2010 California Wine Country Bike Tours in October | San \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","summary":"","meta":{"startDate":"2010-10-10","eventDate":"2010-10-10T00:00:00-07:00","state":"California","endDate":"2010-10-22","eventLongitude":"-122.4200000","lastModifiedDateTime":"2010-08-26 02:15:54.36","splitMediaType":"Event","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["81A4A089-CAB5-4293-BFBF-87C74A1C6370","81a4a089-cab5-4293-bfbf-87c74a1c6370"],"eventId":"1889827","participationCriteria":"All","description":"","longitude":"-122.4200000","onlineDonationAvailable":"0","substitutionUrl":"1889827","assetName":["2010 California Wine Country Bike Tours in October","2010 California Wine Country Bike Tours in October"],"eventURL":"http://www.trektravel.com/contentpage.cfm?ID\u003d703","zip":"94101","contactPhone":"866-464-8735","eventLatitude":"37.7800000","eventState":"California","sortDate":"2000-10-10","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","country":"United States","onlineRegistrationAvailable":"0","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-08-26","eventZip":"94101","UpdateDateTime":"8/18/2010 10:16:26 AM","latitude":"37.7800000","channel":"Cycling"}}')))
104
- g.address[:name].should_not be_nil
105
- g.address[:address].should_not be_nil
104
+ g.address[:name].should be_nil
105
+ g.address[:address].should be_nil
106
106
  g.address[:city].should eql("San Francisco")
107
107
  g.address[:state].should eql("California")
108
108
  g.address[:zip].should eql("94101")
@@ -124,6 +124,16 @@ describe Activity do
124
124
  # g.address[:lng].should eql("-117.2425355")
125
125
  # end
126
126
 
127
+ # USER
128
+ it "should have a nil user email" do
129
+ g = Activity.new(GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Cycling"}}')))
130
+ g.user.email.should be_nil
131
+ end
132
+ it "should have a valid user email" do
133
+ g = Activity.new(GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","contactEmail":"eventinfo@sfaf.org","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Cycling"}}')))
134
+ g.user.email.should eql("eventinfo@sfaf.org")
135
+ end
136
+
127
137
 
128
138
 
129
139
  end
data/spec/gsa_spec.rb CHANGED
@@ -98,8 +98,6 @@ describe GSA do
98
98
  r = s.results.first
99
99
  r.address["city"].should eql("San Francisco")
100
100
  end
101
-
102
-
103
101
  # address
104
102
  it "should have a full address" do
105
103
  g = GSA.new(JSON.parse('{"title":"Calabasas", "meta":{"location":"Oceanside Harbor","eventLongitude":"-117.3586","locationName":"Oceanside Harbor","eventAddress":"1540 Harbor Drive North", "city":"San Diego", "eventState":"CA", "eventZip":"92121", "latitude":"-22", "longitude":"222", "country":"USA" }}'))
@@ -156,6 +154,23 @@ describe GSA do
156
154
  g.address[:lat].should eql("37.77869")
157
155
  g.address[:lng].should eql("-122.4212")
158
156
  end
157
+ # USER
158
+ it "should have a nil user email" do
159
+ g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Cycling"}}'))
160
+ g.user.email.should be_nil
161
+ end
162
+ it "should have a nil user email" do
163
+ g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","language":"en","title":"Nike Women\u0026#39;s Marathon | San Francisco, California 94102 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","summary":"","meta":{"startDate":"2010-10-17","eventDate":"2010-10-17T07:00:00-07:00","location":"Union Square","tag":["event:10","Running:10"],"state":"California","eventLongitude":"-122.4212","endDate":"2010-10-17","lastModifiedDateTime":"2010-10-01 21:04:24.977","splitMediaType":["Event","Marathon"],"locationName":"Union Square","endTime":"7:00:00","mediaType":["Event","Event\\Marathon"],"city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"7:00:00","assetId":["715ED4EF-E4FF-42F2-B24B-2E4255649676","715ed4ef-e4ff-42f2-b24b-2e4255649676"],"eventId":"1854168","participationCriteria":"All","description":"","longitude":"-122.4212","onlineDonationAvailable":"0","substitutionUrl":"1854168","assetName":["Nike Women\'s Marathon","Nike Women\'s Marathon"],"eventURL":"http://inside.nike.com/blogs/nikerunning_events-en_US/?tags\u003dnike_womens_marathon_2010","zip":"94102","contactPhone":"866-786-6453","eventState":"California","sortDate":"2000-10-17","eventLatitude":"37.77869","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","seourl":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-01","eventZip":"94102","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.77869","channel":"Running"}}'))
164
+ g.user.email.should be_nil
165
+ end
166
+ it "should have a nil user email when the email is not valid" do
167
+ g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","contactEmail":"eventfaf.org","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Cycling"}}'))
168
+ g.user.email.should be_nil
169
+ end
170
+ it "should have a valid user email" do
171
+ g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","contactEmail":"eventinfo@sfaf.org","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Cycling"}}'))
172
+ g.user.email.should eql("eventinfo@sfaf.org")
173
+ end
159
174
  end
160
175
 
161
176
 
data/spec/reg_spec.rb CHANGED
@@ -15,6 +15,10 @@ describe RegCenter do
15
15
  # <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><getAssetMetadataResponse xmlns="http://api.asset.services.active.com"><out xmlns="http://api.asset.services.active.com">&lt;importSource>&lt;asset row="1" destinationID="">&lt;isSearchable>true&lt;/isSearchable>&lt;assetId>BF304447-0052-4466-A044-68D1459C5068&lt;/assetId>&lt;assetTypeId>EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65&lt;/assetTypeId>&lt;substitutionUrl>1886328&lt;/substitutionUrl>&lt;assetName>Excellence in Writing&lt;/assetName>&lt;category>Activities&lt;/category>&lt;channel>Not Specified&lt;/channel>&lt;mediaType>Recware Activities&lt;/mediaType>&lt;searchWeight>1&lt;/searchWeight>&lt;zip>92027&lt;/zip>&lt;city>Escondido&lt;/city>&lt;state>California&lt;/state>&lt;country>United States&lt;/country>&lt;startDate>2010-09-07&lt;/startDate>&lt;startTime>15:30:00&lt;/startTime>&lt;endDate>2010-09-07&lt;/endDate>&lt;endTime>15:30:00&lt;/endTime>&lt;participationCriteria>All&lt;/participationCriteria>&lt;onlineRegistrationAvailable>true&lt;/onlineRegistrationAvailable>&lt;onlineDonationAvailable>0&lt;/onlineDonationAvailable>&lt;onlineMembershipAvailable>0&lt;/onlineMembershipAvailable>&lt;avgUserRating/>&lt;userCommentText/>&lt;image1>http://www.active.com/images/events/hotrace.gif&lt;/image1>&lt;contactEmail>recreation@escondido.org&lt;/contactEmail>&lt;contactPhone>760-839-4691&lt;/contactPhone>&lt;eventResults/>&lt;location>Grove Room - East Valley Community Center&lt;/location>&lt;contactName>Escondido Community Services Department&lt;/contactName>&lt;market>San Diego&lt;/market>&lt;trackbackurl>http://www.active.com/page/Event_Details.htm?event_id=1886328&amp;amp;assetId=BF304447-0052-4466-A044-68D1459C5068&lt;/trackbackurl>&lt;seourl>http://www.active.com/not-specified-recware-activities/escondido-ca/excellence-in-writing-2010&lt;/seourl>&lt;dma>San Diego&lt;/dma>&lt;longitude>-117.0864&lt;/longitude>&lt;latitude>33.11921&lt;/latitude>&lt;/asset>&lt;/importSource></out></getAssetMetadataResponse></soap:Body></soap:Envelope>
16
16
 
17
17
  end
18
+ it "should create a new regCenter class" do
19
+ r = RegCenter.new(Hash.from_xml('<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <event> <assetID>5c6fa2f2-0434-4d6c-953d-cab9bade4f64</assetID> <eventID>1877942</eventID> <eventName>Realistic Drawing (6-12 Yrs.)</eventName> <eventDate>2010-09-16T15:30:00-07:00</eventDate> <eventTime>3:30 PM</eventTime> <eventLocation>Arts &amp; Crafts Room - Nick Rodriguez Community Center</eventLocation> <eventAddress>213 "F" Street</eventAddress> <eventCity>Antioch</eventCity> <eventState>California</eventState> <eventZip>94509</eventZip> <eventCountry>USA</eventCountry> <eventDescription>Do you love to draw?Learn how to make your drawings more realistic with projects that focus on observation,proportion,perspective,composition,light and shadow and texture.Media will include pencil,pen,charcoal,and pastel.A &amp;10 materials fee is payable to the instuctor at the first class.</eventDescription> <usatSanctioned>false</usatSanctioned> <regOnline>true</regOnline> <eventCloseDate>2010-09-16T00:00:00-07:00</eventCloseDate> <currencyCode>USD</currencyCode> <eventTypeID>1</eventTypeID> <eventType>Recware Activities</eventType> <hasEventResults>false</hasEventResults> <hasMetaResults>false</hasMetaResults> <showMap>true</showMap> <longitude>-121.8058</longitude> <latitude>38.00492</latitude> <eventContactEmail>dadams@ci.antioch.ca.us</eventContactEmail> <eventContactPhone>925-779-7070</eventContactPhone> <displayCloseDate>true</displayCloseDate> <excludedFromEmailing>false</excludedFromEmailing> <category>Activities</category> <mediaTypes> <mediaType>Recware Activities</mediaType> </mediaTypes> <channels> <channel> <primaryChannel>false</primaryChannel> </channel> </channels> <eventCategories/> <eventDetails> <eventDetail> <eventDetailsName>Ages</eventDetailsName> <eventDetailsOrder>1</eventDetailsOrder> <eventDetailsValue>6 years - 12 years 11months</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Instructor</eventDetailsName> <eventDetailsOrder>2</eventDetailsOrder> <eventDetailsValue>Nancy Roberts</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Code</eventDetailsName> <eventDetailsOrder>3</eventDetailsOrder> <eventDetailsValue>1447.401</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Classification</eventDetailsName> <eventDetailsOrder>4</eventDetailsOrder> <eventDetailsValue>Art</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Schedule</eventDetailsName> <eventDetailsOrder>5</eventDetailsOrder> <eventDetailsValue>Occurs every week on Thursday effective 9/16/10 until 10/21/10 from 3:30 PM to 4:30 PM</eventDetailsValue> </eventDetail> </eventDetails> <eventDonationLinks/> <eventSanctions/> <eventDetailsPageUrl>http://www.active.com/page/Event_Details.htm?event_id=1877942</eventDetailsPageUrl> <eventContactUrl>http://www.active.com/event_contact.cfm?event_id=1877942</eventContactUrl> </event>'))
20
+ r.title.should eql("Realistic Drawing (6-12 Yrs.)")
21
+ end
18
22
  it "should set find by id" do
19
23
  a = RegCenter.find_by_id(@valid_id)
20
24
  a.data.should_not be_nil
data/spec/search_spec.rb CHANGED
@@ -384,8 +384,8 @@ describe Search do
384
384
  it "should find events that have online regristration"
385
385
  it "should find events that do not have online regristration"
386
386
 
387
- it "should have a start date" do
388
- Search.search(:asset_id => "715ED4EF-E4FF-42F2-B24B-2E4255649676").results.first.should_not be_nil
387
+ it "should have a nil email address from GSA" do
388
+ Search.search(:asset_id => "715ED4EF-E4FF-42F2-B24B-2E4255649676").results.first.user.email.should be_nil
389
389
  # first.address["address"].should_not be_nil
390
390
  end
391
391
 
@@ -0,0 +1,24 @@
1
+ # Require the spec helper relative to this file
2
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
+ require File.join(File.dirname(__FILE__), %w[custom_matchers_spec])
4
+ require File.join(File.dirname(__FILE__), %w[ .. lib services search])
5
+ require File.join(File.dirname(__FILE__), %w[ .. lib services activity])
6
+ include Active
7
+ include Active::Services
8
+
9
+
10
+ describe Validators do
11
+
12
+ it "should find a valid email address" do
13
+ Validators.email("diney.bom-fim_23db@google.com").should be_true
14
+ Validators.email("jspooner@gmail.com").should be_true
15
+ Validators.email("jspooner@ga").should be_false
16
+ end
17
+
18
+ end
19
+
20
+
21
+
22
+
23
+
24
+
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.0.21
1
+ 0.0.22
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: 53
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 21
10
- version: 0.0.21
8
+ - 22
9
+ version: 0.0.22
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jonathan Spooner, Brian Levine
@@ -22,11 +21,9 @@ dependencies:
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,11 +49,9 @@ 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: 25
62
55
  segments:
63
56
  - 3
64
57
  - 4
@@ -76,21 +69,25 @@ extra_rdoc_files:
76
69
  - History.txt
77
70
  - README.txt
78
71
  - bin/Active
72
+ - lib/.DS_Store
73
+ - lib/services/.DS_Store
79
74
  - lib/services/search.txt
80
75
  - version.txt
81
76
  files:
82
- - .bnsignore
83
77
  - Active.gemspec
84
78
  - History.txt
85
79
  - README.txt
86
80
  - Rakefile
87
81
  - bin/Active
82
+ - lib/.DS_Store
88
83
  - lib/Active.rb
84
+ - lib/services/.DS_Store
89
85
  - lib/services/IActivity.rb
90
86
  - lib/services/active_works.rb
91
87
  - lib/services/activity.rb
92
88
  - lib/services/address.rb
93
89
  - lib/services/ats.rb
90
+ - lib/services/dto/user.rb
94
91
  - lib/services/gsa.rb
95
92
  - lib/services/reg_center.rb
96
93
  - lib/services/sanitize.rb
@@ -109,6 +106,7 @@ files:
109
106
  - spec/search_memcached_spec.rb
110
107
  - spec/search_spec.rb
111
108
  - spec/spec_helper.rb
109
+ - spec/validators_spec.rb
112
110
  - test/test_Active.rb
113
111
  - version.txt
114
112
  has_rdoc: true
@@ -122,27 +120,23 @@ rdoc_options:
122
120
  require_paths:
123
121
  - lib
124
122
  required_ruby_version: !ruby/object:Gem::Requirement
125
- none: false
126
123
  requirements:
127
124
  - - ">="
128
125
  - !ruby/object:Gem::Version
129
- hash: 3
130
126
  segments:
131
127
  - 0
132
128
  version: "0"
133
129
  required_rubygems_version: !ruby/object:Gem::Requirement
134
- none: false
135
130
  requirements:
136
131
  - - ">="
137
132
  - !ruby/object:Gem::Version
138
- hash: 3
139
133
  segments:
140
134
  - 0
141
135
  version: "0"
142
136
  requirements: []
143
137
 
144
138
  rubyforge_project: Active
145
- rubygems_version: 1.3.7
139
+ rubygems_version: 1.3.6
146
140
  signing_key:
147
141
  specification_version: 3
148
142
  summary: Search api for Active Network
data/.bnsignore DELETED
@@ -1,19 +0,0 @@
1
- # The list of files that should be ignored by Mr Bones.
2
- # Lines that start with '#' are comments.
3
- #
4
- # A .gitignore file can be used instead by setting it as the ignore
5
- # file in your Rakefile:
6
- #
7
- # Bones {
8
- # ignore_file '.gitignore'
9
- # }
10
- #
11
- # For a project with a C extension, the following would be a good set of
12
- # exclude patterns (uncomment them if you want to use them):
13
- # *.[oa]
14
- # *~
15
- announcement.txt
16
- coverage
17
- doc
18
- pkg
19
- .DS_Store