upcoming-api 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/upcoming/auth.rb +2 -2
- data/lib/upcoming/category.rb +6 -2
- data/lib/upcoming/event.rb +12 -0
- data/lib/upcoming/metro.rb +4 -4
- data/test/test_category.rb +10 -1
- metadata +50 -36
data/Rakefile
CHANGED
@@ -17,13 +17,13 @@ require 'rake/gempackagetask'
|
|
17
17
|
|
18
18
|
spec = Gem::Specification.new do |s|
|
19
19
|
s.name = "upcoming-api"
|
20
|
-
s.version = "0.
|
20
|
+
s.version = "0.2"
|
21
21
|
s.author = "Larry Myers"
|
22
22
|
s.email = "larry@larrymyers.com"
|
23
23
|
s.homepage = "http://rubyforge.org/projects/upcoming-api/"
|
24
24
|
s.platform = Gem::Platform::RUBY
|
25
25
|
s.summary = "A ruby library for using the Upcoming.org REST API."
|
26
|
-
s.files = FileList["{
|
26
|
+
s.files = FileList["{test,lib}/**/*","Rakefile","README"].to_a
|
27
27
|
s.require_path = "lib"
|
28
28
|
s.autorequire = "event"
|
29
29
|
s.test_files = FileList["test/test*.rb"].to_a
|
data/lib/upcoming/auth.rb
CHANGED
data/lib/upcoming/category.rb
CHANGED
@@ -7,13 +7,17 @@ module Upcoming
|
|
7
7
|
attr_reader :id, :name, :description
|
8
8
|
|
9
9
|
def initialize(id, name, description)
|
10
|
-
@id = id
|
10
|
+
@id = id.to_i
|
11
11
|
@name = name
|
12
12
|
@description = description
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.info(category_id)
|
16
|
-
|
16
|
+
Category.list.each do |cat|
|
17
|
+
return cat if cat.id == category_id.to_i
|
18
|
+
end
|
19
|
+
|
20
|
+
nil
|
17
21
|
end
|
18
22
|
|
19
23
|
def self.list
|
data/lib/upcoming/event.rb
CHANGED
@@ -56,6 +56,18 @@ module Upcoming
|
|
56
56
|
# TODO get country info for event
|
57
57
|
end
|
58
58
|
|
59
|
+
def add_tags(tag_list)
|
60
|
+
# TODO implement add_tag
|
61
|
+
end
|
62
|
+
|
63
|
+
def remove_tag(tag)
|
64
|
+
# TODO implement remove_tag
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.get_info(event_id)
|
68
|
+
# TODO get event info by event id
|
69
|
+
end
|
70
|
+
|
59
71
|
def self.search(params)
|
60
72
|
params[:method] = 'event.search' if params[:method].nil?
|
61
73
|
|
data/lib/upcoming/metro.rb
CHANGED
@@ -41,19 +41,19 @@ module Upcoming
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.get_info(metro_id)
|
44
|
-
# TODO implement
|
44
|
+
# TODO implement get_info
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.get_infos(metro_id_list)
|
48
|
-
# TODO implement
|
48
|
+
# TODO implement get_infos
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.get_by_lat_lon(lat,lon)
|
52
|
-
# TODO implement
|
52
|
+
# TODO implement get_by_lat_lon
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.list_by_state(state_id)
|
56
|
-
# TODO implement
|
56
|
+
# TODO implement list_by_state
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.states(country_id)
|
data/test/test_category.rb
CHANGED
@@ -9,8 +9,17 @@ class TestCategory < Test::Unit::TestCase
|
|
9
9
|
|
10
10
|
assert_not_nil(cats)
|
11
11
|
assert_not_equal(0, cats.size)
|
12
|
-
assert_match(/^\d+$/, cats[0].id)
|
12
|
+
assert_match(/^\d+$/, cats[0].id.to_s)
|
13
13
|
assert_instance_of(String, cats[0].name)
|
14
14
|
assert_instance_of(String, cats[0].description)
|
15
15
|
end
|
16
|
+
|
17
|
+
def test_get_single_category
|
18
|
+
cat1 = Upcoming::Category.list[0]
|
19
|
+
cat2 = Upcoming::Category.info(cat1.id)
|
20
|
+
|
21
|
+
assert_equal(cat1.id, cat2.id)
|
22
|
+
assert_equal(cat1.name, cat2.name)
|
23
|
+
assert_equal(cat1.description, cat2.description)
|
24
|
+
end
|
16
25
|
end
|
metadata
CHANGED
@@ -1,34 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: upcoming-api
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date: 2007-12-24 00:00:00 -05:00
|
8
|
-
summary: A ruby library for using the Upcoming.org REST API.
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: larry@larrymyers.com
|
12
|
-
homepage: http://rubyforge.org/projects/upcoming-api/
|
13
|
-
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire: event
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: "0.2"
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- Larry Myers
|
8
|
+
autorequire: event
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-01-13 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: larry@larrymyers.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
31
24
|
files:
|
25
|
+
- test/test_auth.rb
|
26
|
+
- test/test_category.rb
|
27
|
+
- test/test_country.rb
|
28
|
+
- test/test_event.rb
|
29
|
+
- test/test_metro.rb
|
30
|
+
- test/test_request.rb
|
31
|
+
- test/test_state.rb
|
32
32
|
- lib/upcoming
|
33
33
|
- lib/upcoming/auth.rb
|
34
34
|
- lib/upcoming/category.rb
|
@@ -41,6 +41,32 @@ files:
|
|
41
41
|
- lib/upcoming.rb
|
42
42
|
- Rakefile
|
43
43
|
- README
|
44
|
+
has_rdoc: true
|
45
|
+
homepage: http://rubyforge.org/projects/upcoming-api/
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
version:
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: "0"
|
62
|
+
version:
|
63
|
+
requirements: []
|
64
|
+
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 1.0.1
|
67
|
+
signing_key:
|
68
|
+
specification_version: 2
|
69
|
+
summary: A ruby library for using the Upcoming.org REST API.
|
44
70
|
test_files:
|
45
71
|
- test/test_auth.rb
|
46
72
|
- test/test_category.rb
|
@@ -49,15 +75,3 @@ test_files:
|
|
49
75
|
- test/test_metro.rb
|
50
76
|
- test/test_request.rb
|
51
77
|
- test/test_state.rb
|
52
|
-
rdoc_options: []
|
53
|
-
|
54
|
-
extra_rdoc_files:
|
55
|
-
- README
|
56
|
-
executables: []
|
57
|
-
|
58
|
-
extensions: []
|
59
|
-
|
60
|
-
requirements: []
|
61
|
-
|
62
|
-
dependencies: []
|
63
|
-
|