lanyrd 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +16 -0
- data/LICENSE +1 -1
- data/Readme.md +22 -1
- data/lanyrd.gemspec +7 -2
- data/lib/lanyrd.rb +1 -1
- data/lib/lanyrd/client.rb +21 -12
- data/lib/lanyrd/version.rb +1 -1
- data/spec/client_spec.rb +14 -6
- metadata +15 -13
data/.travis.yml
ADDED
data/LICENSE
CHANGED
data/Readme.md
CHANGED
@@ -2,6 +2,27 @@
|
|
2
2
|
|
3
3
|
Wrapper around the Lanyrd iOS client api.
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/lanyrd.png)](http://badge.fury.io/rb/lanyrd)
|
6
|
+
[![Build Status](https://secure.travis-ci.org/andrew/lanyrd.png?branch=master)](http://travis-ci.org/andrew/lanyrd)
|
7
|
+
[![Dependency Status](https://gemnasium.com/andrew/lanyrd.png)](https://gemnasium.com/andrew/lanyrd)
|
8
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/andrew/lanyrd)
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Using rubygems:
|
13
|
+
|
14
|
+
gem install lanyrd
|
15
|
+
|
16
|
+
or bundler:
|
17
|
+
|
18
|
+
gem 'lanyrd', '~> 0.1.0'
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
@lanyrd = Lanyrd::Client.new
|
23
|
+
attendees = @lanyrd.attendees("fosdem")
|
24
|
+
profile = @lanyrd.profile("teabass")
|
25
|
+
|
5
26
|
## Development
|
6
27
|
|
7
28
|
Source hosted at [GitHub](http://github.com/andrew/lanyrd).
|
@@ -21,4 +42,4 @@ Tests can be ran with `rake spec`
|
|
21
42
|
|
22
43
|
## Copyright
|
23
44
|
|
24
|
-
Copyright (c)
|
45
|
+
Copyright (c) 2013 Andrew Nesbitt. See [LICENSE](https://github.com/andrew/lanyrd/blob/master/LICENSE) for details.
|
data/lanyrd.gemspec
CHANGED
@@ -9,8 +9,13 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.homepage = "http://github.com/andrew/lanyrd"
|
10
10
|
|
11
11
|
gem.add_dependency 'faraday', '~> 0.7'
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
# Ruby 1.8 doesn't include JSON in the std lib
|
14
|
+
if RUBY_VERSION < "1.9"
|
15
|
+
s.add_dependency 'json', '>= 1.7.5'
|
16
|
+
end
|
17
|
+
|
18
|
+
gem.add_development_dependency 'rake'
|
14
19
|
gem.add_development_dependency 'bundler', '~> 1.0'
|
15
20
|
gem.add_development_dependency 'rspec', '~> 2.6'
|
16
21
|
|
data/lib/lanyrd.rb
CHANGED
data/lib/lanyrd/client.rb
CHANGED
@@ -5,33 +5,42 @@ module Lanyrd
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def popular
|
8
|
-
get "
|
8
|
+
get "search/"
|
9
9
|
end
|
10
10
|
|
11
|
-
def event(
|
12
|
-
get "
|
11
|
+
def event(slug, year = Time.now.year)
|
12
|
+
get "#{year}/#{slug}/"
|
13
13
|
end
|
14
14
|
|
15
|
-
def speakers(
|
16
|
-
get "
|
15
|
+
def speakers(slug, year = Time.now.year)
|
16
|
+
get "#{year}/#{slug}/speakers/"
|
17
17
|
end
|
18
18
|
|
19
|
-
def attendees(
|
20
|
-
get "
|
19
|
+
def attendees(slug, year = Time.now.year)
|
20
|
+
get "#{year}/#{slug}/attendees/"
|
21
21
|
end
|
22
|
+
|
23
|
+
def schedule(slug, year = Time.now.year)
|
24
|
+
get "#{year}/#{slug}/schedule/"
|
25
|
+
end
|
26
|
+
|
27
|
+
def profile(username)
|
28
|
+
get "profile/#{username}/"
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
22
32
|
|
23
33
|
def get(path)
|
24
|
-
response =
|
34
|
+
response = connection.get path
|
25
35
|
decode response.body
|
26
36
|
end
|
27
37
|
|
28
38
|
def decode(data)
|
29
|
-
|
30
|
-
CFPropertyList.native_types(plist.value)
|
39
|
+
JSON.parse(data)
|
31
40
|
end
|
32
41
|
|
33
|
-
def
|
34
|
-
Faraday.new(:url => 'http://lanyrd.com/mobile/
|
42
|
+
def connection
|
43
|
+
Faraday.new(:url => 'http://lanyrd.com/mobile/ios2/')
|
35
44
|
end
|
36
45
|
end
|
37
46
|
end
|
data/lib/lanyrd/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -12,19 +12,27 @@ describe Lanyrd::Client do
|
|
12
12
|
@lanyrd.popular.should be_an_instance_of Hash
|
13
13
|
end
|
14
14
|
|
15
|
-
it "should return
|
16
|
-
@lanyrd.
|
15
|
+
it "should return event information" do
|
16
|
+
@lanyrd.event('fosdem').should be_an_instance_of Hash
|
17
17
|
end
|
18
18
|
|
19
|
-
it "should return event information" do
|
20
|
-
@lanyrd.event('
|
19
|
+
it "should return event information from the past" do
|
20
|
+
@lanyrd.event('bathcamp-32', 2012).should be_an_instance_of Hash
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should return speakers for an event" do
|
24
|
-
@lanyrd.speakers('
|
24
|
+
@lanyrd.speakers('fosdem').should be_an_instance_of Hash
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should return attendees for an event" do
|
28
|
-
@lanyrd.attendees('
|
28
|
+
@lanyrd.attendees('fosdem').should be_an_instance_of Hash
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should return the schedule for an event" do
|
32
|
+
@lanyrd.schedule('fosdem').should be_an_instance_of Hash
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should return profile for a user" do
|
36
|
+
@lanyrd.schedule('teabass').should be_an_instance_of Hash
|
29
37
|
end
|
30
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lanyrd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
16
|
-
requirement: &
|
16
|
+
requirement: &70111941755380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,21 +21,21 @@ dependencies:
|
|
21
21
|
version: '0.7'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70111941755380
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: rake
|
27
|
+
requirement: &70111941779500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '0'
|
33
|
-
type: :
|
33
|
+
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70111941779500
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70111941778720 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '1.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70111941778720
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &70111941776420 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '2.6'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70111941776420
|
58
58
|
description: Ruby wrapper for the Lanyrd API
|
59
59
|
email:
|
60
60
|
- andrewnez@gmail.com
|
@@ -63,6 +63,7 @@ extensions: []
|
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
65
|
- .gitignore
|
66
|
+
- .travis.yml
|
66
67
|
- Gemfile
|
67
68
|
- LICENSE
|
68
69
|
- Rakefile
|
@@ -93,10 +94,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
94
|
version: '0'
|
94
95
|
requirements: []
|
95
96
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.8.
|
97
|
+
rubygems_version: 1.8.11
|
97
98
|
signing_key:
|
98
99
|
specification_version: 3
|
99
100
|
summary: Ruby wrapper for the Lanyrd API
|
100
101
|
test_files:
|
101
102
|
- spec/client_spec.rb
|
102
103
|
- spec/spec_helper.rb
|
104
|
+
has_rdoc:
|