octopussy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/changelog.markdown +3 -2
- data/lib/octopussy/event.rb +7 -4
- data/octopussy.gemspec +2 -2
- data/test/test_octopussy.rb +22 -6
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/changelog.markdown
CHANGED
data/lib/octopussy/event.rb
CHANGED
@@ -6,18 +6,19 @@ module Octopussy
|
|
6
6
|
|
7
7
|
event = Hashie::Mash.new({:user => entry.author})
|
8
8
|
event.published = (entry.published.is_a?(String) ? DateTime.parse(entry.published) : entry.published)
|
9
|
-
|
9
|
+
event.id = entry.id.split("/").pop.to_i
|
10
|
+
|
10
11
|
case entry.id
|
11
12
|
when /CreateEvent/
|
12
13
|
case entry.title
|
13
14
|
when /created tag/
|
14
|
-
event.event_type = '
|
15
|
+
event.event_type = 'tag'
|
15
16
|
event.tag = entry.links.first.split('/').pop
|
16
17
|
when /created branch/
|
17
|
-
event.event_type = '
|
18
|
+
event.event_type = 'branch'
|
18
19
|
event.branch = entry.links.first.split('/').pop
|
19
20
|
when /created repository/
|
20
|
-
event.event_type = '
|
21
|
+
event.event_type = 'repo'
|
21
22
|
end
|
22
23
|
|
23
24
|
when /MemberEvent/
|
@@ -48,6 +49,8 @@ module Octopussy
|
|
48
49
|
when /WikiEvent/
|
49
50
|
event.event_type = 'wiki'
|
50
51
|
event.page = entry.links.first.split('/').pop
|
52
|
+
when /CommitCommentEvent/
|
53
|
+
event.event_type = 'comment'
|
51
54
|
else
|
52
55
|
|
53
56
|
end
|
data/octopussy.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{octopussy}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Wynn Netherland", "Adam Stacoviak"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-15}
|
13
13
|
s.description = %q{Simple wrapper for the GitHub API v2}
|
14
14
|
s.email = %q{wynn.netherland@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/test_octopussy.rb
CHANGED
@@ -410,9 +410,10 @@ class TestOctopussy < Test::Unit::TestCase
|
|
410
410
|
event.user.should == 'pengwynn'
|
411
411
|
event.published.year.should == 2009
|
412
412
|
event.published.month.should == 12
|
413
|
+
event.id.should == 110645788
|
413
414
|
end
|
414
415
|
|
415
|
-
should "should create a
|
416
|
+
should "should create a repo event from an atom entry" do
|
416
417
|
entry = Hashie::Mash.new({
|
417
418
|
:id => 'tag:github.com,2008:CreateEvent/110645788',
|
418
419
|
:published => '2009-12-12T11:24:14-08:00',
|
@@ -423,12 +424,12 @@ class TestOctopussy < Test::Unit::TestCase
|
|
423
424
|
})
|
424
425
|
|
425
426
|
event = Octopussy::Event.load_from_atom(entry)
|
426
|
-
event.event_type.should == '
|
427
|
+
event.event_type.should == 'repo'
|
427
428
|
event.repo.username.should == 'Tanner'
|
428
429
|
event.repo.name.should == 'Team-1261---Java'
|
429
430
|
end
|
430
431
|
|
431
|
-
should "should create a
|
432
|
+
should "should create a tag event from an atom entry" do
|
432
433
|
entry = Hashie::Mash.new({
|
433
434
|
:id => 'tag:github.com,2008:CreateEvent/110645788',
|
434
435
|
:published => '2009-12-12T11:24:14-08:00',
|
@@ -439,13 +440,13 @@ class TestOctopussy < Test::Unit::TestCase
|
|
439
440
|
})
|
440
441
|
|
441
442
|
event = Octopussy::Event.load_from_atom(entry)
|
442
|
-
event.event_type.should == '
|
443
|
+
event.event_type.should == 'tag'
|
443
444
|
event.repo.username.should == 'jnunemaker'
|
444
445
|
event.repo.name.should == 'twitter'
|
445
446
|
event.tag.should == 'v0.7.10'
|
446
447
|
end
|
447
448
|
|
448
|
-
should "should create a
|
449
|
+
should "should create a branch event from an atom entry" do
|
449
450
|
entry = Hashie::Mash.new({
|
450
451
|
:id => 'tag:github.com,2008:CreateEvent/110645788',
|
451
452
|
:published => '2009-12-12T11:24:14-08:00',
|
@@ -456,7 +457,7 @@ class TestOctopussy < Test::Unit::TestCase
|
|
456
457
|
})
|
457
458
|
|
458
459
|
event = Octopussy::Event.load_from_atom(entry)
|
459
|
-
event.event_type.should == '
|
460
|
+
event.event_type.should == 'branch'
|
460
461
|
event.repo.username.should == 'Fabi'
|
461
462
|
event.repo.name.should == 'cwcore'
|
462
463
|
event.user.should == 'cwcore'
|
@@ -608,6 +609,21 @@ class TestOctopussy < Test::Unit::TestCase
|
|
608
609
|
event.repo.name.should == 'Fammel'
|
609
610
|
event.page.should == 'documentation'
|
610
611
|
end
|
612
|
+
|
613
|
+
should "should create a comment event from an atom entry" do
|
614
|
+
entry = Hashie::Mash.new({
|
615
|
+
:id => 'tag:github.com,2008:CommitCommentEvent/110645788',
|
616
|
+
:published => '2009-12-12T11:24:14-08:00',
|
617
|
+
:updated => '2009-12-12T11:24:14-08:00',
|
618
|
+
:links => ['http://github.com/fakechris/resque/commit/46f7ff1f73ae16ca8060fa3b051900562b51d5c2#-P0'],
|
619
|
+
:title => 'defunkt commented on fakechris/resque',
|
620
|
+
:author => 'defunkt'
|
621
|
+
})
|
622
|
+
|
623
|
+
event = Octopussy::Event.load_from_atom(entry)
|
624
|
+
event.event_type.should == 'comment'
|
625
|
+
event.repo.name.should == 'resque'
|
626
|
+
end
|
611
627
|
end
|
612
628
|
|
613
629
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopussy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wynn Netherland
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-12-
|
13
|
+
date: 2009-12-15 00:00:00 -06:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|