octopussy 0.1.2 → 0.1.3

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.2
1
+ 0.1.3
data/changelog.markdown CHANGED
@@ -1,4 +1,6 @@
1
1
  # Changelog
2
+ ## 0.1.3
3
+ * Added Download event
2
4
  ## 0.1.2
3
5
  * Added Delete event type
4
6
  * Added Public event type
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{octopussy}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
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"]
@@ -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
 
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wynn Netherland