octopussy 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/changelog.markdown +2 -0
- data/lib/octopussy/event.rb +5 -1
- data/octopussy.gemspec +1 -1
- data/test/test_octopussy.rb +15 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/changelog.markdown
CHANGED
data/lib/octopussy/event.rb
CHANGED
@@ -60,10 +60,14 @@ module Octopussy
|
|
60
60
|
when /PublicEvent/
|
61
61
|
event.event_type = 'public'
|
62
62
|
event.repo = Repo.new(entry.title.split(" ")[3])
|
63
|
+
when /DownloadEvent/
|
64
|
+
event.event_type = 'download'
|
65
|
+
segments = entry.title.split(' ')
|
66
|
+
event.repo = Repo.new(segments[5])
|
63
67
|
else
|
64
68
|
puts "Unknown event type: #{entry.id}"
|
65
69
|
end
|
66
|
-
event.repo = Repo.from_url(entry.links.first) unless %w(follow gist delete public).include?(event.event_type)
|
70
|
+
event.repo = Repo.from_url(entry.links.first) unless %w(follow gist delete public download).include?(event.event_type)
|
67
71
|
event
|
68
72
|
end
|
69
73
|
end
|
data/octopussy.gemspec
CHANGED
data/test/test_octopussy.rb
CHANGED
@@ -656,6 +656,21 @@ class TestOctopussy < Test::Unit::TestCase
|
|
656
656
|
event.event_type.should == 'public'
|
657
657
|
event.repo.name.should == 'bpmn2'
|
658
658
|
end
|
659
|
+
|
660
|
+
should "should create a download event from an atom entry" do
|
661
|
+
entry = Hashie::Mash.new({
|
662
|
+
:id => 'tag:github.com,2008:DownloadEvent/110645788',
|
663
|
+
:published => '2009-12-12T11:24:14-08:00',
|
664
|
+
:updated => '2009-12-12T11:24:14-08:00',
|
665
|
+
:links => ['http://github.com/tobie'],
|
666
|
+
:title => 'tobie uploaded a file to sstephenson/prototype',
|
667
|
+
:author => 'tobie'
|
668
|
+
})
|
669
|
+
|
670
|
+
event = Octopussy::Event.load_from_atom(entry)
|
671
|
+
event.event_type.should == 'download'
|
672
|
+
event.repo.name.should == 'prototype'
|
673
|
+
end
|
659
674
|
end
|
660
675
|
|
661
676
|
|