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 CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/changelog.markdown CHANGED
@@ -1,5 +1,6 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.2
4
+ * Added Comment event type
3
5
  ## 0.0.1 Initial version
4
-
5
- * GitHub v2 API complete
6
+ * GitHub v2 API complete
@@ -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 = 'create_tag'
15
+ event.event_type = 'tag'
15
16
  event.tag = entry.links.first.split('/').pop
16
17
  when /created branch/
17
- event.event_type = 'create_branch'
18
+ event.event_type = 'branch'
18
19
  event.branch = entry.links.first.split('/').pop
19
20
  when /created repository/
20
- event.event_type = 'create_repo'
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.0"
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}
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 = [
@@ -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 create_repo event from an atom entry" do
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 == 'create_repo'
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 create_tag event from an atom entry" do
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 == 'create_tag'
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 create_branch event from an atom entry" do
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 == 'create_branch'
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.0
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-12 00:00:00 -06:00
13
+ date: 2009-12-15 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency