ding 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ding/cli.rb +22 -17
  3. data/lib/ding/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ed7f2cfb83b4814f611f1a4774449656a8181b7
4
- data.tar.gz: 0fa2db1d194d584ab917dfeaf389ec42dde1549a
3
+ metadata.gz: 2e05f95e97b10a2fe9ca8391de9e980d289fbb62
4
+ data.tar.gz: 38600b7149dcb9aa2707af2323a69ad9ccaa8c96
5
5
  SHA512:
6
- metadata.gz: 6dfd6a4666b3732cd31fdc0c262717b130eb6037b85af56ce2533fe76674a8ac6b98de8078a485d6df3aec80fff39e470342cf9ca05a522545fb56a878b16e57
7
- data.tar.gz: bd5695f229bbef1d5e82f11bc32d72afd0c224cf751fcde614c72f129148718d419308788cd4b608b1968b93ba2652ee2caa2ea95f7f368b706cba0cbc78c9c2
6
+ metadata.gz: 22dfc9dd2c8c3d45e682b933b7f1dd266fe9c6d4a462907ce8064d13d1e6b3a05a2a8e2575c9041b613b0ae0cf442f2919f7cdd50f2a09433e2b264f8dec62ed
7
+ data.tar.gz: 4796ecb56b0ad9da839e254abd588478162336c69992202da0308c778d273348d85fefe694c410a29e57815a96801568db45c41397ae211adacd43859643e2c3
data/lib/ding/cli.rb CHANGED
@@ -13,10 +13,10 @@ module Ding
13
13
  option :pattern, type: 'string', aliases: '-p', default: 'origin/XAP*', desc: 'specify a pattern for listing branches'
14
14
  def test
15
15
  develop_branch, testing_branch = Ding::DEVELOP_BRANCH.dup, Ding::TESTING_BRANCH.dup
16
- say "\nDing ding ding: let's merge one or more feature branches to #{testing_branch}...\n\n", :green
16
+ say "\nDing ding ding: let's merge one or more feature branches to #{testing_branch}:\n\n", :green
17
17
 
18
18
  repo = Ding::Git.new(options).tap do |r|
19
- say "> Synchronising with the remote...", :green
19
+ say "> Synchronising with the remote", :green
20
20
  r.checkout develop_branch
21
21
  r.update
22
22
  end
@@ -30,16 +30,16 @@ module Ding
30
30
  feature_branches = ask_which_item(branches, 'Which feature branch should I use?', :multiple)
31
31
 
32
32
  repo.tap do |r|
33
- say "\n> Deleting #{testing_branch}...", :green
33
+ say "\n> Deleting #{testing_branch}", :green
34
34
  r.delete_branch(testing_branch)
35
35
 
36
- say "> Checking out #{develop_branch}...", :green
36
+ say "> Checking out #{develop_branch}", :green
37
37
  r.checkout(develop_branch)
38
38
 
39
- say "> Creating #{testing_branch}...", :green
39
+ say "> Creating #{testing_branch}", :green
40
40
  r.create_branch(testing_branch)
41
41
 
42
- say "> Checking out #{testing_branch}...", :green
42
+ say "> Checking out #{testing_branch}", :green
43
43
  r.checkout(testing_branch)
44
44
 
45
45
  say "> Merging in selected feature #{feature_branches.count == 1 ? 'branch' : 'branches'}...", :green
@@ -54,7 +54,7 @@ module Ding
54
54
  end
55
55
 
56
56
  unless merge_errors
57
- say "> Pushing #{testing_branch} to the remote...", :green
57
+ say "> Pushing #{testing_branch} to the remote", :green
58
58
  r.push(testing_branch)
59
59
  else
60
60
  say "\n --> There were merge errors, ding dang it!\n\n", :red
@@ -68,6 +68,11 @@ module Ding
68
68
  say "\n --> I'm finished: ding ding ding!\n\n", :green
69
69
  end
70
70
 
71
+ desc "version", "Display current version of 'ding'"
72
+ def version
73
+ say "ding #{Ding::VERSION}\n"
74
+ end
75
+
71
76
  desc "key-gen", "Create a new private/public key pair and associated ssh config"
72
77
  option :host, type: 'string', aliases: '-h', default: 'bitbucket.org', desc: 'specify repository host for ssh config'
73
78
  option :name, type: 'string', aliases: '-n', default: nil, desc: 'name for key, defaults to host name'
@@ -76,25 +81,25 @@ module Ding
76
81
  option :type, type: 'string', aliases: '-t', default: 'rsa', desc: 'type of key to create per -t option on ssh-keygen'
77
82
  def key_gen
78
83
  key_name = options[:name] || "#{options[:host]}_#{options[:type]}"
79
- say "\nDing ding ding: let's create and configure a new ssh key #{key_name}...\n\n", :green
84
+ say "\nDing ding ding: let's create and configure a new ssh key #{key_name}:\n\n", :green
80
85
 
81
86
  Ding::Ssh.new(options).tap do |s|
82
87
  if s.ssh_key_exists?(key_name)
83
88
  if yes?("Do you want me to replace the existing key?", :yellow)
84
- say "> Removing existing key #{key_name}...", :cyan
89
+ say "> Removing existing key #{key_name}", :cyan
85
90
  s.delete_ssh_key key_name
86
- say "> Creating the replacement ssh key pair...", :cyan
91
+ say "> Creating the replacement ssh key pair", :cyan
87
92
  s.create_ssh_key key_name, ENV['USER']
88
93
  else
89
- say "> Using existing key #{key_name}...", :cyan
94
+ say "> Using existing key #{key_name}", :cyan
90
95
  end
91
96
  else
92
- say "> Creating the new ssh key pair...", :green
97
+ say "> Creating the new ssh key pair", :green
93
98
  s.create_ssh_key key_name, ENV['USER']
94
99
  end
95
- say "> Adding the private key to the ssh config...", :green
100
+ say "> Adding the private key to the ssh config", :green
96
101
  s.update_config options[:host], key_name
97
- say "> Copying the public key to the clipboard...", :green
102
+ say "> Copying the public key to the clipboard", :green
98
103
  copy_file_to_clipboard s.ssh_public_key_file(key_name)
99
104
  end
100
105
 
@@ -106,11 +111,11 @@ module Ding
106
111
 
107
112
  desc "key-show", "Copy a public ssh key signature to the system clipboard (use -v to also display the signature)"
108
113
  def key_show
109
- say "\nDing ding ding: let's copy a public key to the clipboard...\n\n", :green
114
+ say "\nDing ding ding: let's copy a public key to the clipboard:\n\n", :green
110
115
 
111
116
  Ding::Ssh.new(options).tap do |s|
112
117
  key_name = ask_which_item(s.list_ssh_keys, 'Which key do you want to copy?')
113
- say "\n> Copying the public key to the clipboard...", :green
118
+ say "\n> Copying the public key to the clipboard", :green
114
119
  copy_file_to_clipboard s.ssh_public_key_file(key_name)
115
120
  end
116
121
 
@@ -168,7 +173,7 @@ module Ding
168
173
  if options[:verbose]
169
174
  cmd << 'tee >(pbcopy)'
170
175
  else
171
- cmd << ' pbcopy'
176
+ cmd << 'pbcopy'
172
177
  end
173
178
  bash cmd
174
179
  end
data/lib/ding/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ding
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Warren Bain