Permalink
Browse files

Added Bugly service

  • Loading branch information...
1 parent de6e882 commit 710caab76ac5a674559b77d809e114373c9dcd4c @stiang stiang committed Jan 2, 2011
Showing with 45 additions and 0 deletions.
  1. +1 −0 CONTRIBUTORS
  2. +34 −0 docs/bugly
  3. +10 −0 services/bugly.rb
View
@@ -44,3 +44,4 @@ Thanks to the following people for making this possible
- Marco Borromeo
- Raine Virta
- Christian Legnitto
+- Stian Grytøyr
View
@@ -0,0 +1,34 @@
+Bugly
+=====
+
+Bugly is a hosted bug and issue tracker. Integrating it with GitHub
+allows you to associate commits with issues and see commits in all
+timelines.
+
+
+Install Notes
+-------------
+
+ 1. 'token' (REQUIRED) is an API token with read/write access to the
+ account/project. Go to Control Panel, Users, click on a user,
+ click the API Tokens tab, then click New token to create a new token.
+
+ 2. 'account_name' (REQUIRED) is your Bugly account name. It would be
+ 'foobar' in the following URL: http://foobar.bug.ly/
+
+ 3. 'project_id' (OPTIONAL) is the ID of the Bugly project to associate
+ all commits with. If no project_id is provided, commits will only
+ appear in the account-wide timeline, not project timelines. The ID
+ would be '321' in this URL: http://foo.bug.ly/projects/321-MyProject
+
+
+Developer Notes
+---------------
+
+data
+ - token
+ - account_name
+ - project_id
+
+payload
+ - refer to docs/github_payload
View
@@ -0,0 +1,10 @@
+service :bugly do |data, payload|
+ account = "http://#{data['account_name']}.bug.ly"
+ query_string = "?service=github&project_id=#{data['project_id']}"
+ url = URI.parse("#{account}/changesets.json#{query_string}")
+ req = Net::HTTP::Post.new(url.request_uri)
+ req.body = JSON.generate(payload)
+ req.initialize_http_header({"X-BuglyToken" => data['token']})
+ req.set_content_type('application/json')
+ Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
+end

0 comments on commit 710caab

Please sign in to comment.