Permalink
Browse files

Merge pull request #435 from zapnap/master

expose platform information in web hook payload
  • Loading branch information...
2 parents af3ca7c + 0c5cbb7 commit 16a976cc1df79b8b14e54f98e06703979939f237 @sferik sferik committed Jul 8, 2012
Showing with 3 additions and 0 deletions.
  1. +1 −0 app/models/rubygem.rb
  2. +1 −0 test/unit/rubygem_test.rb
  3. +1 −0 test/unit/web_hook_test.rb
View
@@ -121,6 +121,7 @@ def payload(version=versions.most_recent, host_with_port=HOST)
'downloads' => downloads,
'version' => version.number,
'version_downloads' => version.downloads_count,
+ 'platform' => version.platform,
'authors' => version.authors,
'info' => version.info,
'project_uri' => "http://#{host_with_port}/gems/#{name}",
@@ -254,6 +254,7 @@ class RubygemTest < ActiveSupport::TestCase
assert_equal @rubygem.downloads, hash["downloads"]
assert_equal @rubygem.versions.most_recent.number, hash["version"]
assert_equal @rubygem.versions.most_recent.downloads_count, hash["version_downloads"]
+ assert_equal @rubygem.versions.most_recent.platform, hash["platform"]
assert_equal @rubygem.versions.most_recent.authors, hash["authors"]
assert_equal @rubygem.versions.most_recent.info, hash["info"]
assert_equal "http://#{HOST}/gems/#{@rubygem.name}", hash["project_uri"]
@@ -147,6 +147,7 @@ class WebHookTest < ActiveSupport::TestCase
payload = MultiJson.load(@job.payload)
assert_equal "foogem", payload['name']
assert_equal "3.2.1", payload['version']
+ assert_equal 'ruby', payload['platform']
assert_equal "DESC", payload["info"]
assert_equal "AUTHORS", payload["authors"]
assert_equal 42, payload["downloads"]

0 comments on commit 16a976c

Please sign in to comment.