ticketmaster-github 0.4.9 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/provider/github.rb +11 -8
- data/lib/provider/project.rb +0 -1
- data/spec/project_spec.rb +5 -9
- data/ticketmaster-github.gemspec +2 -2
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/lib/provider/github.rb
CHANGED
@@ -16,18 +16,21 @@ module TicketMaster::Provider
|
|
16
16
|
def authorize(auth = {})
|
17
17
|
@authentication ||= TicketMaster::Authenticator.new(auth)
|
18
18
|
auth = @authentication
|
19
|
+
login = auth.login || auth.username
|
19
20
|
if auth.login.blank? and auth.username.blank?
|
20
21
|
raise TicketMaster::Exception.new('Please provide at least a username')
|
21
|
-
elsif auth.token
|
22
|
-
login =
|
23
|
-
TicketMaster::Provider::Github.
|
22
|
+
elsif auth.token
|
23
|
+
TicketMaster::Provider::Github.login = login
|
24
|
+
TicketMaster::Provider::Github.user_token = auth.token
|
25
|
+
TicketMaster::Provider::Github.api = Octokit.client(:login => login, :token => auth.token)
|
26
|
+
elsif auth.password
|
27
|
+
TicketMaster::Provider::Github.login = login
|
28
|
+
TicketMaster::Provider::Github.user_token = auth.token
|
29
|
+
TicketMaster::Provider::Github.api = Octokit.client(:login => login, :password => auth.password)
|
30
|
+
else
|
31
|
+
TicketMaster::Provider::Github.login = login
|
24
32
|
TicketMaster::Provider::Github.user_token = nil
|
25
33
|
TicketMaster::Provider::Github.api = Octokit.client(:login => login)
|
26
|
-
else
|
27
|
-
token = auth.token || auth.password
|
28
|
-
TicketMaster::Provider::Github.login = auth.login || auth.username
|
29
|
-
TicketMaster::Provider::Github.user_token = auth.token
|
30
|
-
TicketMaster::Provider::Github.api = Octokit.client(:login => auth.login, :token => token)
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|
data/lib/provider/project.rb
CHANGED
data/spec/project_spec.rb
CHANGED
@@ -9,10 +9,8 @@ describe "Ticketmaster::Provider::Github::Project" do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should be able to load all projects" do
|
12
|
-
|
13
|
-
|
14
|
-
@github.projects.first.should be_an_instance_of(@klass)
|
15
|
-
end
|
12
|
+
@github.projects.should be_an_instance_of(Array)
|
13
|
+
@github.projects.first.should be_an_instance_of(@klass)
|
16
14
|
end
|
17
15
|
|
18
16
|
it "should be able to load all projects based on an array of name(id)" do
|
@@ -41,11 +39,9 @@ describe "Ticketmaster::Provider::Github::Project" do
|
|
41
39
|
end
|
42
40
|
|
43
41
|
it "should be able to find by attributes" do
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
projects.first.id.should be_eql('cored/translator')
|
48
|
-
end
|
42
|
+
projects = @github.projects(:name => 'translator')
|
43
|
+
projects.should be_an_instance_of(Array)
|
44
|
+
projects.first.id.should be_eql('cored/translator')
|
49
45
|
end
|
50
46
|
end
|
51
47
|
|
data/ticketmaster-github.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ticketmaster-github}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["HybridGroup"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-18}
|
13
13
|
s.description = %q{This provides an interface with github through the ticketmaster gem.}
|
14
14
|
s.email = %q{hong.quach@abigfisch.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ticketmaster-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- HybridGroup
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-18 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|