gocd_pre_push 0.1 → 1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e62b1ae6f0a965700f1ec1fa11ea79aeeba4b61
4
- data.tar.gz: 4026f6539c4676e7bfc1578a3966765e18e51456
3
+ metadata.gz: 118b9de888a0e3734b6b3d56ff173d26fee6c366
4
+ data.tar.gz: 734664b906d5ef9bb70ee872385a530f722424db
5
5
  SHA512:
6
- metadata.gz: 5082e006398330e88ab4e17a68580e571f087c58d32ab914efb45f33149167145ed468280a9169facc97414380752a28fbe2cdba1ba06d6f19820d51df5ce719
7
- data.tar.gz: 666e8d3a9af59719db1a87e521cf50687166767967d119427a549b194ec916e4f87ceb59b00fc006acb27d1920dc9df85257818e7e340a87a3b6b99ced1d9ee1
6
+ metadata.gz: 0639c4eea984b17e8292ed2ffa1b483f9cde2a89f784dcfac225d920df51c2239ae957bd5ea9867d7e3c26663bb340b0fc2c27b772ef435e1c17cb9698d906cc
7
+ data.tar.gz: 333fca15a0a30118c234c89f814e4547350b19f5fdb599437519531524b4181a6ea8e257753a93d3c361d281487565b7efe135f0d9d48956fa6577a89b8829b6
data/bin/gocd_pre_push CHANGED
@@ -7,6 +7,12 @@ require_relative '../lib/gocd_pre_push/pretty_printer.rb'
7
7
 
8
8
  include GOCD_PRE_PUSH::PrettyPrinter
9
9
 
10
+ def create_symlink
11
+ print_info "Creating symlink ./.git/hooks => hooks"
12
+ print_info "Your old hooks will be saved inside ./.git/hooks.old\n"
13
+ symlink_git_hooks
14
+ end
15
+
10
16
  def execute
11
17
  if ARGV[0] == 'create'
12
18
  print_info "Creating pre-push hook.."
@@ -16,14 +22,16 @@ def execute
16
22
  print_info "Adding executable permission to pre-push hook.."
17
23
  `sudo chmod 777 hooks/pre-push`
18
24
  print_success "Please update the pre-push hook with your gocd server url, username and password\n"
19
- print_info "Creating symlink ./.git/hooks => hooks"
20
- print_info "Your old hooks will be saved inside ./.git/hooks.old\n"
21
- symlink_git_hooks
25
+ create_symlink
22
26
 
23
27
  print_success "Adding pipelines.yml, change the pipelines as per your requirement!\n"
24
28
  File.write('pipelines.yml', pipelines)
29
+ elsif ARGV[0] == 'use_hooks'
30
+ create_symlink
25
31
  else
26
- print_info "Right usage is: gocd_pre_push create\n"
32
+ print_info "Right usage is:"
33
+ print_info "gocd_pre_push create => For first time setup"
34
+ print_info "gocd_pre_push use_hooks => To use the already created hooks\n"
27
35
  end
28
36
  end
29
37
 
@@ -1,3 +1,3 @@
1
1
  module GOCD_PRE_PUSH
2
- VERSION = '0.1'
2
+ VERSION = '1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gocd_pre_push
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajit Singh