Active 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
data/.bnsignore ADDED
@@ -0,0 +1,19 @@
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
data/bin/Active CHANGED
File without changes
data/lib/services/ats.rb CHANGED
@@ -137,14 +137,14 @@ module Active
137
137
  @data[:substitution_url]
138
138
  end
139
139
 
140
- def user
141
- email = contact_email
142
- u = User.new
143
- u.email = email if Validators.email(email)
144
- u.first_name = contact_name
145
- u.phone = contact_phone
146
- u
147
- end
140
+ def user
141
+ email = contact_email
142
+ u = User.new
143
+ u.email = email if Validators.email(email)
144
+ u.first_name = contact_name
145
+ u.phone = contact_phone
146
+ u
147
+ end
148
148
 
149
149
 
150
150
  # EXAMPLE
@@ -212,19 +212,21 @@ module Active
212
212
  reg
213
213
  end
214
214
 
215
+
216
+ def self.get_asset_metadata(id)
217
+ c = Savon::Client.new("http://api.amp.active.com/asset-service/services/AssetService?wsdl")
218
+ c.request.headers["Api-Key"] = "6npky9t57235vps5cetm3s7k"
219
+ r = c.get_asset_metadata do |soap|
220
+ soap.namespace = "http://api.asset.services.active.com"
221
+ soap.body = "<context><userId></userId><applicationId></applicationId></context><assetId>#{id}</assetId>"
222
+ end
223
+ puts "==========="
224
+ puts r.to_hash[:get_asset_metadata_response][:out].inspect
225
+ return r
226
+ end
227
+
228
+
215
229
  private
216
- # def self.get_asset_metadata(id)
217
- # c = Savon::Client.new("http://api.amp.active.com/asset-service/services/AssetService?wsdl")
218
- # c.request.headers["Api-Key"] = "6npky9t57235vps5cetm3s7k"
219
- # r = c.get_asset_metadata do |soap|
220
- # soap.namespace = "http://api.asset.services.active.com"
221
- # soap.body = "<context><userId></userId><applicationId></applicationId></context><assetId>#{id}</assetId>"
222
- # end
223
- # puts "==========="
224
- # puts r.to_hash[:get_asset_metadata_response][:out].inspect
225
- # return r
226
- # end
227
- #
228
230
  # def self.get_asset_by_id(id)
229
231
  # puts "loading ATS"
230
232
  # c = Savon::Client.new("http://api.amp.active.com/asset-service/services/AssetService")
@@ -30,7 +30,7 @@ module Active
30
30
  end
31
31
 
32
32
  class Search
33
- attr_accessor :api_key, :start_date, :end_date, :location, :channels, :keywords, :search, :radius, :limit, :sort, :page, :offset, :latitude, :longitude,
33
+ attr_accessor :api_key, :start_date, :end_date, :location, :channels, :split_media_type, :keywords, :search, :radius, :limit, :sort, :page, :offset, :latitude, :longitude,
34
34
  :view, :facet, :sort, :num_results, :asset_ids, :dma, :city, :state, :country, :bounding_box
35
35
 
36
36
  attr_reader :results, :endIndex, :pageSize, :searchTime, :numberOfResults, :end_point, :meta
@@ -43,6 +43,7 @@ module Active
43
43
  self.location = data[:location]
44
44
  self.zips = data[:zips] || []
45
45
  self.channels = data[:channels] || []
46
+ self.split_media_type= data[:split_media_type] || []
46
47
  self.keywords = data[:keywords] || []
47
48
  self.radius = data[:radius] || nil
48
49
  self.limit = data[:limit] || "10"
@@ -134,6 +135,8 @@ module Active
134
135
  end
135
136
  end
136
137
  meta_data = channel_keys.collect { |channel| "meta:channel=#{Search.double_encode_channel(channel)}" }.join("+OR+")
138
+ # SPLIT MEDIA TYPE
139
+ meta_data += split_media_type.collect { |type| "+meta:splitMediaType=#{Search.double_encode_channel(type)}" }.join("+OR+")
137
140
  # ASSET IDS
138
141
  unless asset_ids.empty?
139
142
  meta_data += "+AND+" unless meta_data == ""
@@ -268,6 +271,10 @@ module Active
268
271
  # Search.new({:keywords => %w(Dog Cat Cow)})
269
272
  # Search.new({:keywords => ["Dog","Cat","Cow"]})
270
273
  #
274
+ # = Channels and MediaType =
275
+ # Search.new({:channels => [:running], :split_media_type => ["5k"]})
276
+ # for a list of channels and splitMediaTypes please see http://developer.active.com/docs/Activecom_Search_API_Reference
277
+ #
271
278
  # = Location =
272
279
  # The location will be set in this order and will override other values. For example is you set a zip code and a location only the zip will be used.
273
280
  #
data/rspec-tm ADDED
@@ -0,0 +1 @@
1
+ --rspec-version 1.3.1
data/rvmrc ADDED
@@ -0,0 +1 @@
1
+
data/spec/Active_spec.rb CHANGED
@@ -25,5 +25,4 @@ describe Active do
25
25
  Active.memcache_host "localhost:11211"
26
26
  end
27
27
 
28
- end
29
-
28
+ end
data/spec/reg_spec.rb CHANGED
@@ -79,7 +79,11 @@ describe RegCenter do
79
79
  r.user.email.should eql("rnrsj@eliteracing.com")
80
80
  end
81
81
 
82
-
82
+ # it "should get asset metadata" do
83
+ # a = RegCenter.get_asset_metadata(@valid_id)
84
+ # a.should be_valid
85
+ # end
86
+
83
87
  it "should set find by id" do
84
88
  a = RegCenter.find_by_id(@valid_id)
85
89
  a.data.should_not be_nil
data/spec/search_spec.rb CHANGED
@@ -136,6 +136,16 @@ describe Search do
136
136
  uri.query.should have_param("meta:channel=#{value}")
137
137
  end
138
138
  end
139
+
140
+ it "should pass the channel of Running and splitMediaType of 5k" do
141
+ key = :running
142
+ value = "Running"
143
+ uri = URI.parse( Search.new({:channels => [key], :split_media_type => ["5k"]}).end_point )
144
+ uri.query.should have_param("meta:channel=#{value}")
145
+ uri.query.should have_param("meta:splitMediaType=5k")
146
+ # SHOULD NOT SEE "++"
147
+ pending
148
+ end
139
149
 
140
150
  it "should send a valid start and end date" do
141
151
  uri = URI.parse( Search.new().end_point )
@@ -406,14 +416,9 @@ describe Search do
406
416
  Search.search(location).results.should_not be_empty
407
417
  pending
408
418
  end
409
- it "shoule be near this location"
410
419
  end
411
420
 
412
- describe "Address" do
413
- it "should have a valid address, city, state, zip, lat, lng if the event was from ?___ATS__"
414
- it "should have a valid address, city, state, zip, lat, lng if the event was from ?___Works__"
415
- it "should have a valid address, city, state, zip, lat, lng if the event was from ?___NET__"
416
- end
421
+
417
422
 
418
423
  end
419
424
 
data/spec/spec.opts ADDED
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --format progress
3
+ --loadby mtime
4
+ --reverse
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.0.28
1
+ 0.0.29
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Active
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 37
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 28
9
- version: 0.0.28
9
+ - 29
10
+ version: 0.0.29
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jonathan Spooner, Brian Levine
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-11-02 00:00:00 -07:00
18
+ date: 2010-12-08 00:00:00 -08:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: savon
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 17
27
30
  segments:
28
31
  - 0
29
32
  - 7
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: dalli
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 43
41
46
  segments:
42
47
  - 0
43
48
  - 9
@@ -49,9 +54,11 @@ dependencies:
49
54
  name: bones
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 25
55
62
  segments:
56
63
  - 3
57
64
  - 4
@@ -69,19 +76,16 @@ extra_rdoc_files:
69
76
  - History.txt
70
77
  - README.txt
71
78
  - bin/Active
72
- - lib/.DS_Store
73
- - lib/services/.DS_Store
74
79
  - lib/services/search.txt
75
80
  - version.txt
76
81
  files:
82
+ - .bnsignore
77
83
  - Active.gemspec
78
84
  - History.txt
79
85
  - README.txt
80
86
  - Rakefile
81
87
  - bin/Active
82
- - lib/.DS_Store
83
88
  - lib/Active.rb
84
- - lib/services/.DS_Store
85
89
  - lib/services/IActivity.rb
86
90
  - lib/services/_ats.rb
87
91
  - lib/services/active_works.rb
@@ -95,6 +99,8 @@ files:
95
99
  - lib/services/search.rb
96
100
  - lib/services/search.txt
97
101
  - lib/services/validators.rb
102
+ - rspec-tm
103
+ - rvmrc
98
104
  - spec/.DS_Store
99
105
  - spec/Active_spec.rb
100
106
  - spec/activeworks_spec.rb
@@ -106,6 +112,7 @@ files:
106
112
  - spec/reg_spec.rb
107
113
  - spec/search_memcached_spec.rb
108
114
  - spec/search_spec.rb
115
+ - spec/spec.opts
109
116
  - spec/spec_helper.rb
110
117
  - spec/validators_spec.rb
111
118
  - test/test_Active.rb
@@ -121,23 +128,27 @@ rdoc_options:
121
128
  require_paths:
122
129
  - lib
123
130
  required_ruby_version: !ruby/object:Gem::Requirement
131
+ none: false
124
132
  requirements:
125
133
  - - ">="
126
134
  - !ruby/object:Gem::Version
135
+ hash: 3
127
136
  segments:
128
137
  - 0
129
138
  version: "0"
130
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
+ none: false
131
141
  requirements:
132
142
  - - ">="
133
143
  - !ruby/object:Gem::Version
144
+ hash: 3
134
145
  segments:
135
146
  - 0
136
147
  version: "0"
137
148
  requirements: []
138
149
 
139
150
  rubyforge_project: Active
140
- rubygems_version: 1.3.6
151
+ rubygems_version: 1.3.7
141
152
  signing_key:
142
153
  specification_version: 3
143
154
  summary: Search api for Active Network
data/lib/.DS_Store DELETED
Binary file
Binary file