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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/release/gem/gem_action.rb +4 -2
- data/lib/release/gem/gem_cli_action.rb +1 -0
- data/lib/release/gem/gem_engine.rb +4 -4
- data/lib/release/gem/release_infector.rb +9 -4
- data/lib/release/gem/vcs_action.rb +34 -0
- data/lib/release/gem/vcs_cli_action.rb +71 -0
- data/lib/release/gem/version.rb +1 -1
- data/templates/standard_cli_flow.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea9d324f7b793ed225472a24d957dcd38eabb8f713271d2cb524a6f1e5f1923
|
4
|
+
data.tar.gz: 6581b5e4fa0d949871b87392e97f139f30785791d93a6fa040260ba52ab312d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 970ea9b05c234620c01a03193e2a92a1c485e0019ac381ba87b3e09c0a82b6d6ba2e8abd80d911d6250e995d1fc36435000ce4f9491f3c1628b474ec78489c1f
|
7
|
+
data.tar.gz: e45f427d07988e498c13cbcf7cc95eacde6523f5e2551ea7e098f9ad6062f60b7039e24800e0c79f8da3b7010c909d5c517273f28d4d69cdc2b4aa639700feda
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
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
|
|
@@ -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?("
|
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[
|
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?("
|
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[
|
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
|
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
|
|
data/lib/release/gem/version.rb
CHANGED
@@ -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
|
-
|
21
|
+
vcs_cli_commit_new_files
|
19
22
|
|
20
23
|
# step 3 : build the gem
|
21
24
|
st, ver = build
|