release-gem 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5f829021df7a73c3e93c06b2e4d788f103a1f0ac096d3c472a7b4cfd575122c
4
- data.tar.gz: 7c4a3acaa233d7bcff3a1ef308dbdfe3ea7b669f3418d3205072b6b2c5b9ada2
3
+ metadata.gz: dea9d324f7b793ed225472a24d957dcd38eabb8f713271d2cb524a6f1e5f1923
4
+ data.tar.gz: 6581b5e4fa0d949871b87392e97f139f30785791d93a6fa040260ba52ab312d3
5
5
  SHA512:
6
- metadata.gz: e8cc062083ef870fd5ef74eff9b9d8b05072b2348096d10fddab73c8d1ad2cf3ad81ce52dcf5c5447787103429e6c14f970189729a3873293358a432bf83aeb8
7
- data.tar.gz: 9ae8f560785f812de5578155547df4ab94deefafa4e741fb2d6b23af13f063c672ae93a75cbce10abc5067d5be7abf640d4aa46f359808ab26f9d66c5327049e
6
+ metadata.gz: 970ea9b05c234620c01a03193e2a92a1c485e0019ac381ba87b3e09c0a82b6d6ba2e8abd80d911d6250e995d1fc36435000ce4f9491f3c1628b474ec78489c1f
7
+ data.tar.gz: e45f427d07988e498c13cbcf7cc95eacde6523f5e2551ea7e098f9ad6062f60b7039e24800e0c79f8da3b7010c909d5c517273f28d4d69cdc2b4aa639700feda
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- release-gem (0.1.6)
4
+ release-gem (0.1.7)
5
5
  colorize
6
6
  git_cli
7
7
  gvcs
@@ -38,8 +38,10 @@ module Release
38
38
  block.call(:action_start, :relase_dependencies)
39
39
 
40
40
  gemdepInst.development_gem.each do |k,v|
41
- gemdepInst.infect_gem(v, k, &block)
42
- block.call(:block_until_dev_gem_done, { name: k, path: v })
41
+ res = gemdepInst.infect_gem(v, k, &block)
42
+ if res != :skip
43
+ block.call(:block_until_dev_gem_done, { name: k, path: v })
44
+ end
43
45
  end
44
46
 
45
47
 
@@ -61,6 +61,7 @@ module Release
61
61
  v[:options].each do |t|
62
62
  m.choice t, t
63
63
  end
64
+ m.choice "Skip", :skip
64
65
  end
65
66
 
66
67
  when :new_terminal_launching
@@ -53,14 +53,14 @@ module Release
53
53
  end
54
54
 
55
55
  def method_missing(mtd, *args, &block)
56
- if mtd.to_s.start_with?("gem_cli")
56
+ if mtd.to_s.start_with?("gem_cli_")
57
57
  Gem.logger.debug "Passing method '#{mtd}' to gem_cli action"
58
- pmtd = mtd.to_s[7..-1].to_sym
58
+ pmtd = mtd.to_s[8..-1].to_sym
59
59
  gem_cli_action_inst.send(pmtd, *args, &block)
60
60
 
61
- elsif mtd.to_s.start_with?("vcs_cli")
61
+ elsif mtd.to_s.start_with?("vcs_cli_")
62
62
  Gem.logger.debug "Passing method '#{mtd}' to vcs_cli action"
63
- pmtd = mtd.to_s[7..-1].to_sym
63
+ pmtd = mtd.to_s[8..-1].to_sym
64
64
  vcs_cli_action_inst.send(pmtd, *args, &block)
65
65
 
66
66
  elsif mtd.to_s.start_with?("gem_")
@@ -38,16 +38,19 @@ module Release
38
38
  poss = tu_possible_terminal
39
39
  raise ReleaseInfectorError, "No possible terminal found" if is_empty?(poss)
40
40
 
41
+ terminal = ""
41
42
  Bundler.with_clean_env do
42
43
 
43
44
  cmd = "cd #{@root} && rake gem:release"
44
- terminal = ""
45
45
  if block
46
46
  terminal = block.call(:select_terminal, name: @name, options: poss)
47
- terminal = poss.first if is_empty?(terminal)
47
+ if terminal != :skip
48
+ terminal = poss.first if is_empty?(terminal)
49
+
50
+ block.call(:new_terminal_launching, name: @name, terminal: terminal)
51
+ tu_new_terminal(terminal, cmd)
52
+ end
48
53
 
49
- block.call(:new_terminal_launching, name: @name, terminal: terminal)
50
- tu_new_terminal(terminal, cmd)
51
54
  else
52
55
  terminal = poss.first
53
56
  block.call(:new_terminal_launching, name: @name, terminal: terminal)
@@ -58,6 +61,8 @@ module Release
58
61
 
59
62
  end
60
63
 
64
+ terminal
65
+
61
66
  end
62
67
 
63
68
  def is_release_gem_installed?
@@ -42,6 +42,40 @@ module Release
42
42
  instance_eval(&block) if block
43
43
  end
44
44
 
45
+ def overview_changes(&block)
46
+
47
+ res = :done
48
+ if block
49
+
50
+ loop do
51
+
52
+ stgDir, stgFiles = @ws.staged_files
53
+ modDir, modFiles = @ws.modified_files
54
+ newDir, newFiles = @ws.new_files
55
+ delDir, delFiles = @ws.deleted_files
56
+
57
+ modFiles.delete_if { |f| stgFiles.include?(f) }
58
+ modDir.delete_if { |f| stgDir.include?(f) }
59
+
60
+ newFiles.delete_if { |f| stgFiles.include?(f) }
61
+ newDir.delete_if { |f| stgDir.include?(f) }
62
+
63
+ delFiles.delete_if { |f| stgFiles.include?(f) }
64
+ delDir.delete_if { |f| stgDir.include?(f) }
65
+
66
+ # block should call vcs for remove, ignore and diff
67
+ res = block.call(:select_files_to_manage, { modified: { files: modFiles, dirs: modDir }, new: { files: newFiles, dirs: newDir }, deleted: { files: delFiles, dirs: delDir }, staged: { files: stgFiles, dirs: stgDir }, vcs: self } )
68
+
69
+ break if res == :done
70
+
71
+ end
72
+
73
+ end
74
+
75
+ res
76
+
77
+ end
78
+
45
79
  #
46
80
  # Special operation since the gem build will only include files from
47
81
  # git ls-files
@@ -20,6 +20,77 @@ module Release
20
20
  instance_eval(&block) if block
21
21
  end
22
22
 
23
+ def overview_changes(*args, &block)
24
+ @inst.overview_changes do |ops, *args|
25
+ preset = false
26
+ if block
27
+ res = block.call(ops, *args)
28
+ if res.nil?
29
+ preset = true
30
+ else
31
+ res
32
+ end
33
+ else
34
+ preset = true
35
+ end
36
+
37
+ if preset
38
+ case ops
39
+ when :select_files_to_manage
40
+ mfiles = args.first
41
+
42
+ sel = @prmt.select pmsg("\n Following are files that could be managed : ") do |m|
43
+
44
+ [:staged, :modified, :new, :deleted].each do |cat|
45
+ mfiles[cat].each do |k,v|
46
+ v.each do |vv|
47
+ m.choice vv, vv
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+ m.choice "Done", :done
54
+
55
+ end
56
+
57
+ if sel != :done
58
+
59
+ selOps = @prmt.select pmsg("\n What do you want to do with file '#{sel}'?") do |m|
60
+
61
+ m.choice "Diff", :diff
62
+ m.choice "Ignore", :ignore
63
+ m.choice "Remove from staging", :remove_from_staging if sel.is_a?(GitCli::Delta::StagedFile)
64
+ m.choice "Done", :done
65
+ end
66
+
67
+ case selOps
68
+ when :diff
69
+ puts @inst.diff_file(sel.path)
70
+ STDIN.getc
71
+ when :ignore
72
+ confirm = @prmt.yes?(pmsg("\n Add file '#{sel.path}' to gitignore file?"))
73
+ if confirm
74
+ @inst.ignore(sel.path)
75
+ end
76
+ when :remove_from_staging
77
+ confirm = @prmt.yes?(pmsg("\n Remove file '#{sel.path}' from staging?"))
78
+ if confirm
79
+ @inst.remove_from_staging(sel.path)
80
+ end
81
+ when :done
82
+ end
83
+
84
+ end
85
+
86
+ sel
87
+
88
+ end
89
+ end
90
+
91
+ end
92
+ end # overview_changes
93
+
23
94
  def commit_new_files(*args, &block)
24
95
  res = @inst.commit_new_files do |ops, *args|
25
96
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Release
4
4
  module Gem
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.7"
6
6
  end
7
7
  end
@@ -10,12 +10,15 @@ Release::Gem.engine(:gem, root: Dir.getwd) do
10
10
  # step 1 : run test
11
11
  run_test(:rspec)
12
12
 
13
+ # to allow user to get a view on what's changed
14
+ vcs_cli_overview_changes
15
+
13
16
  gem_cli_action do
14
17
 
15
18
  # step 2 : check dependency
16
19
  release_dependencies
17
20
 
18
- vcs_commit_new_files
21
+ vcs_cli_commit_new_files
19
22
 
20
23
  # step 3 : build the gem
21
24
  st, ver = build
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: release-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris