worklogger 2.5.6 → 2.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/post-commit +19 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac95938498d7ad4515ae5457e404d893d20370e1
|
4
|
+
data.tar.gz: 238020631efe4ab84e2cb1e38178cc393effd3bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f036c9e17b74f7d3023fb5f7d68222c96770e15a6460a74034f8993cad5bc496b9f774daf7831c07d9ebbd40299c8db0bf0240695c4685ad3ecaa2a704ce893a
|
7
|
+
data.tar.gz: c9a0ba0c646e2496eed1075ae8614dcb8f005873055e13432da90eb3240e61d3ac84b299755cd020846db973573295c76719c3c5fdb874619039a79b48fd351d
|
data/lib/post-commit
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
|
3
|
-
MESSAGE=$(git log -1 HEAD --pretty=format:%s)
|
2
|
+
INITIAL_MESSAGE=$(git log -1 HEAD --pretty=format:%s)
|
4
3
|
|
5
4
|
prefix="issue="
|
6
|
-
MESSAGE=${
|
5
|
+
MESSAGE=${INITIAL_MESSAGE#$prefix}
|
7
6
|
ISSUE_KEY=$(echo $MESSAGE| cut -d ' ' -f 1)
|
8
7
|
JIRA_USER_NAME=$USER_NAME
|
9
8
|
JIRA_PASSWORD=$PASSWORD
|
@@ -14,6 +13,21 @@ TIME_SPENT=$(echo $MESSAGE | grep -o "$time_spent.*" | cut -d " " -f 1 | cut -d
|
|
14
13
|
|
15
14
|
COMMIT_MSG=$(echo $MESSAGE | cut -d " " -f3-)
|
16
15
|
|
16
|
+
# contains(string, substring)
|
17
|
+
#
|
18
|
+
# Returns 0 if the specified string contains the specified substring,
|
19
|
+
# otherwise returns 1.
|
20
|
+
contains() {
|
21
|
+
string=$1
|
22
|
+
substring=$2
|
23
|
+
if test "${string#*$substring}" != "$string"
|
24
|
+
then
|
25
|
+
return 0 # $substring is in $string
|
26
|
+
else
|
27
|
+
return 1 # $substring is not in $string
|
28
|
+
fi
|
29
|
+
}
|
30
|
+
|
17
31
|
jira_rest_get_issues(){
|
18
32
|
ruby <<EOF
|
19
33
|
require 'rubygems'
|
@@ -23,6 +37,7 @@ ruby <<EOF
|
|
23
37
|
require 'uri'
|
24
38
|
require 'date'
|
25
39
|
|
40
|
+
puts 'A system developed by Vivek Tripathi lets you add a worklog with the description same as comment'
|
26
41
|
issue_key = "$1"
|
27
42
|
time_spent = "$2"
|
28
43
|
commit_message = "$3"
|
@@ -87,4 +102,4 @@ ruby <<EOF
|
|
87
102
|
EOF
|
88
103
|
}
|
89
104
|
|
90
|
-
jira_rest_get_issues $ISSUE_KEY $TIME_SPENT "$COMMIT_MSG" $JIRA_USER_NAME $JIRA_PASSWORD $CORPORATE_URL
|
105
|
+
contains "echo $INITIAL_MESSAGE" "issue=" && jira_rest_get_issues $ISSUE_KEY $TIME_SPENT "$COMMIT_MSG" $JIRA_USER_NAME $JIRA_PASSWORD $CORPORATE_URL
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worklogger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vivek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Git to JIRA work logger
|
14
14
|
email: vivek.tripathi@softway.com
|