Permalink
Browse files

specify service schemas in the classes themselves

  • Loading branch information...
1 parent 7785065 commit 7dba05c824f06377d1434598630bcb873f9b3216 @technoweenie technoweenie committed Jun 21, 2011
View
@@ -1,23 +1,23 @@
Cube
==========
-
+
Cube is a timetracking app for individuals or companies; for more details see http://cube.bitrzr.com
This service lets your broadcast commits on Cube so they can be seen in the unified project log.
-
+
Install Notes
-------------
1. domain (company domain for Google Apps account or user email address for individual accounts)
2. project (project name)
3. token (project integration token as seen in the project's Settings tab)
-
+
Developer Notes
---------------
-
+
data
- domain
- project
- token
-
+
payload
- - refer to docs/github_payload
+ - refer to docs/github_payload
View
@@ -31,7 +31,7 @@ Developer Notes
---------------
data
- - server_hostname
+ - server_url
- api_version
- username
- password
View
@@ -1,4 +1,6 @@
class Service::Acunote < Service
+ string :token
+
def receive_push
# :(
http.ssl[:verify] = false
View
@@ -1,4 +1,7 @@
class Service::AMQP < Service
+ string :host, :port, :vhost, :exchange, :username
+ password :password
+
def receive_push
# Support for specifying as host or server
data['host'] ||= data['server']
View
@@ -1,4 +1,7 @@
class Service::Bamboo < Service
+ string :base_url, :build_key, :username
+ password :password
+
def receive_push
verify_config
authenticated { |token| trigger_build(token) }
@@ -1,4 +1,8 @@
class Service::Basecamp < Service
+ string :url, :project, :category, :username
+ password :password
+ boolean :ssl
+
def receive_push
repository = payload['repository']['name']
name_with_owner = File.join(payload['repository']['owner']['name'], repository)
View
@@ -1,4 +1,6 @@
class Service::Boxcar < Service
+ string :subscribers
+
def receive_push
http_post \
"http://providers.boxcar.io/github/%s" %
View
@@ -1,4 +1,6 @@
class Service::Bugly < Service
+ string :project_id, :account_name, :token
+
def receive_push
http_post "http://#{data['account_name']}.bug.ly/changesets.json",
JSON.generate(payload),
@@ -1,4 +1,7 @@
class Service::Campfire < Service
+ string :subdomain, :room, :token
+ boolean :play_sound
+
def receive_push
raise_config_error 'Missing campfire token' if data['token'].to_s.empty?
View
@@ -1,4 +1,6 @@
class Service::CIA < Service
+ string :address, :project, :branch
+
def receive_push
repository =
if !(name = data['project'].to_s).empty?
View
@@ -1,4 +1,6 @@
class Service::CoOp < Service
+ string :group_id, :token
+
def receive_push
repository = payload['repository']['name']
payload['commits'].each do |commit|
@@ -1,4 +1,6 @@
class Service::Commitify < Service
+ string :private_key
+
def receive_push
http_post "http://commitify.appspot.com/commit",
# Private key (for private repositories, share with your developers)
@@ -1,4 +1,6 @@
class Service::ContinuityApp < Service
+ string :project_id
+
def receive_push
http_post "http://hooks.continuityapp.com/github_selfservice/v1/%d" % data['project_id'].to_i,
:payload => JSON.generate(payload)
View
@@ -1,4 +1,7 @@
class Service::Convore < Service
+ string :topic, :username
+ password :password
+
def receive_push
raise_config_error "Missing username" if data['username'].to_s == ''
View
@@ -1,4 +1,6 @@
class Service::Cube < Service
+ string :domain, :project, :token
+
def receive_push
http_post "http://cube.bitrzr.com/integration/events/github/create",
'payload' => JSON.generate(payload),
View
@@ -1,4 +1,7 @@
class Service::Email < Service
+ string :address, :secret
+ boolean :send_from_author
+
def receive_push
name_with_owner = File.join(payload['repository']['owner']['name'], payload['repository']['name'])
@@ -1,4 +1,6 @@
class Service::Flowdock < Service
+ string :token
+
def receive_push
raise_config_error "Missing token" if data['token'].to_s.empty?
@@ -1,4 +1,6 @@
class Service::FogBugz < Service
+ string :cvssubmit_url, :fb_repoid, :fb_version
+
def receive_push
if (fb_url = data['cvssubmit_url']).blank?
raise_config_error "Invalid FogBugz URL"
View
@@ -1,4 +1,6 @@
class Service::Freckle < Service
+ string :subdomain, :project_name, :token
+
def receive_push
entries, subdomain, token, project =
[], data['subdomain'].strip, data['token'].strip, data['project'].strip
@@ -1,4 +1,6 @@
class Service::FriendFeed < Service
+ string :nickname, :remotekey
+
def receive_push
repository = payload['repository']['name']
friendfeed_url = "http://friendfeed.com/api/share"
@@ -1,4 +1,6 @@
class Service::GetLocalization < Service
+ string :project_name, :project_token
+
def receive_push
project_name = data['project_name']
project_token = data['project_token']
View
@@ -1,4 +1,6 @@
class Service::Grmble < Service
+ string :room_api_url, :token
+
def receive_push
http.url_prefix = "#{data['room_api_url']}"
repository = payload[ 'repository' ][ 'name' ]
View
@@ -1,4 +1,7 @@
class Service::HipChat < Service
+ string :auth_token, :room
+ boolean :notify
+
def receive_push
# make sure we have what we need
raise_config_error "Missing 'auth_token'" if data['auth_token'].to_s == ''
View
@@ -1,4 +1,7 @@
class Service::IRC < Service
+ string :server, :port, :room, :nick
+ password :password
+ boolean :long_url, :message_without_join, :ssl, :no_colors
def receive_push
return if distinct_commits.empty?
View
@@ -28,6 +28,8 @@ def join(jid, password=nil)
end
class Service::Jabber < Service
+ string :user, :muc
+
def receive_push
# Accept any friend request
im.accept_subscriptions = true
View
@@ -1,4 +1,7 @@
class Service::Jaconda < Service
+ string :subdomain, :room_id, :room_token
+ boolean :digest
+
def receive_push
raise_config_error "Missing 'subdomain'" if data['subdomain'].to_s == ''
raise_config_error "Missing 'room_id'" if data['room_id'].to_s == ''
View
@@ -1,4 +1,7 @@
class Service::Jira < Service
+ string :server_url, :api_version, :username
+ password :password
+
def receive_push
payload['commits'].each do |commit|
next if commit['message'] =~ /^x /
@@ -38,7 +41,7 @@ def receive_push
res = http_post '%s/rest/api/%s/issue/%s/transitions' % [data['server_url'], data['api_version'], issue_id],
changeset.to_json
rescue URI::InvalidURIError
- raise_config_error "Invalid server_hostname: #{data['server_hostname']}"
+ raise_config_error "Invalid server_hostname: #{data['server_url']}"
end
end
end
@@ -1,4 +1,7 @@
class Service::Lighthouse < Service
+ string :subdomain, :project_id, :token
+ boolean :private
+
def receive_push
payload['commits'].each do |commit|
next if commit['message'] =~ /^x /
@@ -1,4 +1,6 @@
class Service::MantisBT < Service
+ string :url, :api_key
+
def receive_push
http.ssl[:verify] = false
http.url_prefix = data['url']
View
@@ -1,4 +1,6 @@
class Service::Notifo < Service
+ string :subscribers
+
def receive_push
subscribe_url = URI.parse('https://api.notifo.com/v1/subscribe_user')
http.basic_auth 'github', secrets['notifo']['apikey']
@@ -1,4 +1,6 @@
class Service::PivotalTracker < Service
+ string :token
+
def receive_push
token = data['token']
@@ -1,4 +1,7 @@
class Service::Presently < Service
+ string :subdomain, :group_name, :username
+ password :password
+
def receive_push
repository = payload['repository']['name']
View
@@ -1,4 +1,6 @@
class Service::Prowl < Service
+ string :apikey
+
def receive_push
# FIXME
http.ssl[:verify] = false
View
@@ -1,4 +1,6 @@
class Service::Redmine < Service
+ string :address, :project, :api_key
+
def receive_push
http.ssl[:verify] = false
http.url_prefix = data['address']
@@ -1,4 +1,6 @@
class Service::Rubyforge < Service
+ string :groupid, :username
+ password :password
def receive_push
repository = payload['repository']['name']
branch = payload['ref_name']
@@ -1,4 +1,6 @@
class Service::Socialcast < Service
+ string :api_domain, :group_id, :username
+ password :password
def receive_push
repository = payload['repository']['name']
group_id = (data['group_id'].nil? || data['group_id'] == '') ? '' : data['group_id']
@@ -1,4 +1,6 @@
class Service::SplendidBacon < Service
+ string :project_id, :token
+
def receive_push
token = data['token']
project_id = data['project_id']
@@ -1,4 +1,8 @@
class Service::StatusNet < Service
+ string :server, :username
+ password :password
+ boolean :digest
+
def receive_push
repository = payload['repository']['name']
statuses = Array.new
View
@@ -1,4 +1,7 @@
class Service::Talker < Service
+ string :url, :token
+ boolean :digest
+
def receive_push
repository = payload['repository']['name']
branch = payload['ref_name']
@@ -1,4 +1,7 @@
class Service::TeamCity < Service
+ string :base_url, :build_type_id, :username
+ password :password
+
def receive_push
# :(
http.ssl[:verify] = false
View
@@ -1,4 +1,6 @@
class Service::Toggl < Service
+ string :project, :api_token
+
def receive_push
http.ssl[:verify] = false
http.url_prefix = "https://www.toggl.com/api/v5"
View
@@ -1,4 +1,6 @@
class Service::Trac < Service
+ string :url, :token
+
def receive_push
http.ssl[:verify] = false
http.url_prefix = data['url']
View
@@ -1,4 +1,6 @@
class Service::Travis < Service
+ string :domain, :user, :token
+
def receive_push
http.ssl[:verify] = false
http.basic_auth user, token
View
@@ -1,4 +1,7 @@
class Service::Twitter < Service
+ string :token, :secret
+ boolean :digest
+
def receive_push
statuses = [ ]
repository = payload['repository']['name']
@@ -1,8 +1,9 @@
class Service::Unfuddle < Service
+ string :subdomain, :repo_id, :username
+ password :password
+
def receive_push
u_repoid = data['repo_id'].to_i
- u_account = "http://#{data['subdomain']}.unfuddle.com/"
-
repository = payload['repository']['name']
branch = payload['ref_name']
before = payload['before']
@@ -63,7 +64,6 @@ def receive_push
XML
begin
- url = URI.parse("%s/api/v1/repositories/%d/changesets.json" % [u_account, u_repoid.to_i])
res = http_post "/api/v1/repositories/#{u_repoid}/changesets.json" do |req|
req.headers['Content-Type'] = 'application/xml'
req.body = changeset_xml
@@ -1,4 +1,6 @@
class Service::WebTranslateIt < Service
+ string :api_key
+
def receive_push
http.ssl[:verify] = false
http_post "https://webtranslateit.com/api/projects/#{data['api_key']}/refresh_files",
View
@@ -1,4 +1,8 @@
class Service::Yammer < Service
+ string :group_id, :consumer_key, :consumer_secret,
+ :access_token, :access_secret
+ boolean :digest
+
def receive_push
statuses = [ ]
repository = payload['repository']['name']
Oops, something went wrong.

0 comments on commit 7dba05c

Please sign in to comment.