murmurs 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +26 -39
  2. data/bin/murmurs +1 -1
  3. data/lib/murmurs.rb +2 -4
  4. metadata +4 -20
data/README.md CHANGED
@@ -1,48 +1,17 @@
1
1
  Murmurs
2
2
  ================
3
3
 
4
- Murmurs is a rubygem provides commands to post a murmur message to your Mingle project.
5
- And Git post-receive hook to post murmurs when new commits pushed to Git server.
4
+ Murmurs is a rubygem for integrating Git with your Mingle project.
6
5
 
7
- Ruby 1.9+ is required.
8
-
9
- Installation
10
- ----------------
11
-
12
- gem install murmurs
13
-
14
- A command 'murmurs' will be installed. (In some OS, the script name maybe changed to murmurs1.9 for ruby 1.9)
6
+ Ruby 1.9+ is required. Windows is not supported.
15
7
 
16
8
  Usage
17
9
  ----------------
18
10
 
19
- For posting a murmur on your Mingle project, you need specify:
20
-
21
- 1. Mingle murmurs URL. It is pointing to your Mingle site and project murmurs api endpoint.
22
- Example: https://site-name.mingle-api.thoughtworks.com/api/v2/projects/your_project/murmurs.xml
23
- 2. Mingle uses HMAC auth access key id and HMAC auth access secret key. Every user can generate one HMAC secret key from his or her profile page under the HMAC Auth Key tab.
24
- For further information about Mingle user access key id and secret key, please read:
25
- http://www.thoughtworks.com/products/docs/mingle/current/help/configuring_hmac_authentication.html
26
-
27
- Example:
28
-
29
- murmurs -m https://site-name.mingle-api.thoughtworks.com/api/v2/projects/your_project/murmurs.xml -k mingle_access_key_id -s mingle_access_secure_key "Murmurs Git integration is done. Our git commits will stream to our project's Murmurs."
30
-
31
- You can also setup environment variables for the configurations needed as follows:
32
-
33
- export MINGLE_MURMURS_URL=https://site-name.mingle-api.thoughtworks.com/api/v2/projects/your_project/murmurs.xml
34
- export MINGLE_ACCESS_KEY_ID=mingle_access_key_id
35
- export MINGLE_ACCESS_SECRET_KEY=mingle_access_secret_key
36
-
37
- So that you don't need to specify them when you murmur something:
38
-
39
- murmurs "text"
11
+ What you need from your Mingle site/project:
40
12
 
41
- Type "murmurs -h" for full help.
42
-
43
- Integrating Mingle Murmurs with Git
44
- ----------------
45
- Murmurs gem can be used to integrate with Git. Use the following instructions to setup your git server so that it murmurs everytime something has been pushed to the server.
13
+ 1. Mingle project murmurs URL. You can get it by substituting your site name and project identifier to the following URL: https://<your-site>.mingle-api.thoughtworks.com/api/v2/projects/<your-project>/murmurs.xml
14
+ 2. HMAC auth access key id and access secret key to access your Mingle project. You can get it from existing team member, or create a new user and add the user to your project. The HMAC auth access key id and access secret key is generated at "HMAC Auth Key" tab on user's profile page. For further information about Mingle user access key id and secret key, please read: http://www.thoughtworks.com/products/docs/mingle/current/help/configuring_hmac_authentication.html
46
15
 
47
16
  On your Git server:
48
17
 
@@ -50,14 +19,32 @@ On your Git server:
50
19
  install rubygems if there was no one installed with ruby
51
20
  gem install murmurs
52
21
 
53
- murmurs gem should install a new command 'murmurs'
22
+ murmurs gem should install a new command 'murmurs' (In some OS, the script name maybe changed to murmurs1.9 for ruby 1.9).
54
23
 
55
- Install the git hook for post-receive:
24
+ Install the git hook post-receive (you may need to execute as the user having write permission to the git repository path) on Git server:
56
25
 
57
26
  murmurs -a <git repository path>
58
27
 
59
28
  Then, in the git repository, setup the following configs:
60
29
 
61
- git config hooks.minglemurmursurl "https://your-site.mingle-api.thoughtworks.com/api/v2/projects/your_project/murmurs.xml"
30
+ git config hooks.minglemurmursurl "https://<your-site>.mingle-api.thoughtworks.com/api/v2/projects/<your-project>/murmurs.xml"
62
31
  git config hooks.mingleaccesskeyid <Mingle user access key id>
63
32
  git config hooks.mingleaccesssecretkey <Mingle user access secret key>
33
+
34
+ After installed, try push a new commit to the server, and you should see something like the followings in your console:
35
+
36
+ remote: murmur => your-project@your-site.mingle-api.thoughtworks.com
37
+
38
+ Note, the post-receive hook installed will never block you push commits to server, because Git calls the hook after the push work is done.
39
+
40
+ Test Git integration
41
+ -------------------
42
+
43
+ To confirm you can post a murmur o your Mingle project from the Git server with the configurations, you can run the following command:
44
+
45
+ murmurs -m https://site-name.mingle-api.thoughtworks.com/api/v2/projects/your_project/murmurs.xml -k mingle_access_key_id -s mingle_access_secure_key "This is a test."
46
+
47
+ Type "murmurs -h" for full details.
48
+
49
+
50
+ So before you integrate Git server with your Mingle project, you can test the configurations on your Git server first, for example:
data/bin/murmurs CHANGED
@@ -26,7 +26,7 @@ http://www.thoughtworks.com/products/docs/mingle/current/help/configuring_hmac_a
26
26
 
27
27
  GIT_INTALLATION_NOTES = %Q{
28
28
  Please setup the following git config:
29
- git config hooks.minglemurmursurl "https://<your_site>.mingle.thoughtworks.com/api/v2/pro
29
+ git config hooks.minglemurmursurl "https://<your-site>.mingle-api.thoughtworks.com/api/v2/projects/<your-project>/murmurs.xml"
30
30
  git config hooks.mingleaccesskeyid "MINGLE ACCESS KEY ID"
31
31
  git config hooks.mingleaccesssecretkey "MINGLE ACCESS SECRET KEY"
32
32
 
data/lib/murmurs.rb CHANGED
@@ -2,7 +2,6 @@ require 'net/http'
2
2
  require 'net/https'
3
3
  require 'time'
4
4
  require 'api-auth'
5
- require 'json'
6
5
  require 'murmurs/git'
7
6
 
8
7
  module Murmurs
@@ -26,7 +25,7 @@ module Murmurs
26
25
  end
27
26
  else
28
27
  validate_murmurs_url!(url)
29
- http_post(url, {:murmur => {:body => msg}}, options)
28
+ http_post(url, "{\"murmur\":{\"body\":#{msg.inspect}}}", options)
30
29
  end
31
30
  end
32
31
 
@@ -54,7 +53,7 @@ module Murmurs
54
53
  end
55
54
  end
56
55
 
57
- def http_post(url, params, options={})
56
+ def http_post(url, body, options={})
58
57
  uri = URI.parse(url)
59
58
  http = Net::HTTP.new(uri.host, uri.port)
60
59
  if uri.scheme == 'https'
@@ -63,7 +62,6 @@ module Murmurs
63
62
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
64
63
  end
65
64
  end
66
- body = params.to_json
67
65
 
68
66
  request = Net::HTTP::Post.new(uri.request_uri)
69
67
  request.body = body
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: murmurs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-10 00:00:00.000000000 Z
12
+ date: 2014-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: api-auth
@@ -27,22 +27,6 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.0.3
30
- - !ruby/object:Gem::Dependency
31
- name: json
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: 1.8.1
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 1.8.1
46
30
  description: ! 'Post murmur to your Mingle project from command line.
47
31
 
48
32
  Git post-receive hook to post murmurs when new commits pushed to Git server.
@@ -74,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
58
  version: '0'
75
59
  segments:
76
60
  - 0
77
- hash: -1940277211336045179
61
+ hash: 716371937611647900
78
62
  required_rubygems_version: !ruby/object:Gem::Requirement
79
63
  none: false
80
64
  requirements:
@@ -83,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
67
  version: '0'
84
68
  segments:
85
69
  - 0
86
- hash: -1940277211336045179
70
+ hash: 716371937611647900
87
71
  requirements: []
88
72
  rubyforge_project:
89
73
  rubygems_version: 1.8.23