worklogger 2.5.6 → 2.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/post-commit +19 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 834b37d067d3086c53a3f2c67d69255daec299b7
4
- data.tar.gz: 5f3c161416652c76e81a3a74e5640a405c804bfe
3
+ metadata.gz: ac95938498d7ad4515ae5457e404d893d20370e1
4
+ data.tar.gz: 238020631efe4ab84e2cb1e38178cc393effd3bc
5
5
  SHA512:
6
- metadata.gz: 86c0adedff24ff55771e8393a9bf3c1b5f7220fb704fc6be4ec2f08d8a7ac8aea2f88f8bfa6705abd7e366c4f7a8afaba324ee31280d7f28206c06890be23b6e
7
- data.tar.gz: f5509f4b1a37f051bdf9e985fa849f6fa0c2fb0a804db3841af94719abeafa4f6cd3c9cf723bd0f4a1bb29062fc1ed7027f9fe82b5bce79f1f1adb30d6d510ef
6
+ metadata.gz: f036c9e17b74f7d3023fb5f7d68222c96770e15a6460a74034f8993cad5bc496b9f774daf7831c07d9ebbd40299c8db0bf0240695c4685ad3ecaa2a704ce893a
7
+ data.tar.gz: c9a0ba0c646e2496eed1075ae8614dcb8f005873055e13432da90eb3240e61d3ac84b299755cd020846db973573295c76719c3c5fdb874619039a79b48fd351d
data/lib/post-commit CHANGED
@@ -1,9 +1,8 @@
1
1
  #!/bin/bash
2
- echo 'A system developed by Vivek Tripathi lets you add a worklog with the description same as comment'
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=${MESSAGE#$prefix}
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.6
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: 2015-12-26 00:00:00.000000000 Z
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