release-gem 0.1.7 → 0.1.9
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 -0
- data/lib/release/gem/gemdep.rb +5 -1
- data/lib/release/gem/vcs_action.rb +25 -1
- data/lib/release/gem/vcs_cli_action.rb +12 -5
- data/lib/release/gem/version.rb +1 -1
- data/templates/standard_cli_flow.rb +23 -25
- 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: 5c0211c8dd1084dd65167ca184ca17d66d05dc7a63d4385e1a35965b0699d8b7
|
4
|
+
data.tar.gz: b2855a26a1efac3bff15429d15f9abbc6f22cb63b8743466e4d8ecea1687030d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e8738c91ae9148ee43d81bdd345eeb12e2d2b5d1de7a275173cd038196bcaac1e2cd6f6beff184994b03e83d7733e8e644615f70265cd37e537d8f736412244
|
7
|
+
data.tar.gz: 0c666a33f97bea158bed117243d901d1385d3065c62edaabc3c7df7306962d1bd1b92ca3e729265e5fafb4f6cc27e43d1cf978095c46683d4838ab10c1d70cd5
|
data/Gemfile.lock
CHANGED
@@ -63,7 +63,9 @@ module Release
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
Gem.logger.debug "About to transfer gem"
|
66
67
|
gemdepInst.transfer_gem
|
68
|
+
Gem.logger.debug "GEM transfer!"
|
67
69
|
|
68
70
|
block.call(:development_gem_temporary_promoted)
|
69
71
|
end
|
@@ -124,6 +126,8 @@ module Release
|
|
124
126
|
if $?
|
125
127
|
cp "Gem build successfully at #{Gem.format_dt(Time.now)}"
|
126
128
|
|
129
|
+
register(:version_file_path, verfile)
|
130
|
+
|
127
131
|
if block
|
128
132
|
block.call(:gem_build_successfully, @selVersion)
|
129
133
|
else
|
data/lib/release/gem/gemdep.rb
CHANGED
@@ -65,7 +65,7 @@ module Release
|
|
65
65
|
remove_dev_gem_from_gemfile
|
66
66
|
add_gem_to_gemspec(@gemConfig)
|
67
67
|
|
68
|
-
end
|
68
|
+
end # transfer_gem
|
69
69
|
|
70
70
|
def all_dev_gems_has_config?
|
71
71
|
not_configured_gem.length == 0
|
@@ -76,6 +76,7 @@ module Release
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def restore_dev_gem
|
79
|
+
Gem.logger.debug "restore_dev_gem : #{@fileHistory.inspect}"
|
79
80
|
@fileHistory.each do |k,v|
|
80
81
|
FileUtils.mv(k,"#{k}.prod")
|
81
82
|
FileUtils.cp(v,k)
|
@@ -89,6 +90,9 @@ module Release
|
|
89
90
|
ri.trigger_release_gem(&block)
|
90
91
|
end
|
91
92
|
|
93
|
+
####
|
94
|
+
# Private section
|
95
|
+
####
|
92
96
|
private
|
93
97
|
def remove_dev_gem_from_gemfile
|
94
98
|
if has_development_gem?
|
@@ -66,7 +66,7 @@ module Release
|
|
66
66
|
# block should call vcs for remove, ignore and diff
|
67
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
68
|
|
69
|
-
break if res == :done
|
69
|
+
break if not res.is_a?(GitCli::Delta::VCSItem) and res == :done
|
70
70
|
|
71
71
|
end
|
72
72
|
|
@@ -290,6 +290,30 @@ module Release
|
|
290
290
|
@ws.add_to_staging(*files)
|
291
291
|
end
|
292
292
|
|
293
|
+
def add_to_staging_if_commit_before(*files)
|
294
|
+
|
295
|
+
stgDir, stgFiles = @ws.staged_files
|
296
|
+
modDir, modFiles = @ws.modified_files
|
297
|
+
#newDir, newFiles = @ws.new_files
|
298
|
+
delDir, delFiles = @ws.deleted_files
|
299
|
+
|
300
|
+
mFiles = modFiles.map { |e| e.path }
|
301
|
+
sFiles = stgFiles.map { |e| e.path }
|
302
|
+
dFiles = delFiles.map { |e| e.path }
|
303
|
+
|
304
|
+
res = []
|
305
|
+
files.each do |f|
|
306
|
+
if (mFiles.include?(f) or dFiles.include?(f)) and not sFiles.include?(f)
|
307
|
+
res << f
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
if not_empty?(res)
|
312
|
+
@ws.add_to_staging(*res)
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
|
293
317
|
def ignore(*files)
|
294
318
|
@ws.ignore(*files)
|
295
319
|
end
|
@@ -54,19 +54,21 @@ module Release
|
|
54
54
|
|
55
55
|
end
|
56
56
|
|
57
|
-
if sel
|
57
|
+
if sel.is_a?(GitCli::Delta::VCSItem)
|
58
58
|
|
59
|
-
selOps = @prmt.select pmsg("\n What do you want to do with file '#{sel}'?") do |m|
|
59
|
+
selOps = @prmt.select pmsg("\n What do you want to do with file '#{sel.path}'?") do |m|
|
60
60
|
|
61
|
-
m.choice "Diff", :diff
|
61
|
+
m.choice "Diff", :diff if not (sel.is_a?(GitCli::Delta::NewFile) or sel.is_a?(GitCli::Delta::NewDir))
|
62
62
|
m.choice "Ignore", :ignore
|
63
63
|
m.choice "Remove from staging", :remove_from_staging if sel.is_a?(GitCli::Delta::StagedFile)
|
64
|
+
m.choice "Delete", :delete if (sel.is_a?(GitCli::Delta::NewFile) or sel.is_a?(GitCli::Delta::NewDir))
|
64
65
|
m.choice "Done", :done
|
65
66
|
end
|
66
67
|
|
67
68
|
case selOps
|
68
69
|
when :diff
|
69
|
-
|
70
|
+
st, res = @inst.diff_file(sel.path)
|
71
|
+
puts res
|
70
72
|
STDIN.getc
|
71
73
|
when :ignore
|
72
74
|
confirm = @prmt.yes?(pmsg("\n Add file '#{sel.path}' to gitignore file?"))
|
@@ -78,6 +80,11 @@ module Release
|
|
78
80
|
if confirm
|
79
81
|
@inst.remove_from_staging(sel.path)
|
80
82
|
end
|
83
|
+
when :delete
|
84
|
+
skip = @prmt.no?(pmsg("\n Delete the file '#{sel.path}' from file system? NOTE THIS CANNOT BE UNDONE! "))
|
85
|
+
if not skip
|
86
|
+
FileUtils.rm(sel.path)
|
87
|
+
end
|
81
88
|
when :done
|
82
89
|
end
|
83
90
|
|
@@ -120,7 +127,7 @@ module Release
|
|
120
127
|
|
121
128
|
@prmt.puts ""
|
122
129
|
|
123
|
-
sel = @prmt.multi_select pmsg("\n Following are new files that could be added to version control : ") do |m|
|
130
|
+
sel = @prmt.multi_select pmsg("\n Following are new files that could be added to version control.\n Don't worry if you found not all changed files are here. There will be another commit session after the build : ") do |m|
|
124
131
|
|
125
132
|
mfiles[:new].each do |k,v|
|
126
133
|
v.each do |vv|
|
data/lib/release/gem/version.rb
CHANGED
@@ -11,42 +11,40 @@ Release::Gem.engine(:gem, root: Dir.getwd) do
|
|
11
11
|
run_test(:rspec)
|
12
12
|
|
13
13
|
# to allow user to get a view on what's changed
|
14
|
+
# and allow user to ignore or remove file from staging
|
14
15
|
vcs_cli_overview_changes
|
15
16
|
|
16
|
-
|
17
|
+
# Reason to put it here is because gem build shall
|
18
|
+
# only consider files already inside git system via
|
19
|
+
# git ls-files command. Anything new that is not yet
|
20
|
+
# check in will not be packup by the gem build process
|
21
|
+
vcs_cli_commit
|
17
22
|
|
18
|
-
|
19
|
-
|
23
|
+
# step 2 : check dependency
|
24
|
+
gem_cli_release_dependencies
|
20
25
|
|
21
|
-
|
26
|
+
# step 3 : build the gem
|
27
|
+
st, ver = gem_cli_build
|
22
28
|
|
23
|
-
|
24
|
-
st, ver = build
|
29
|
+
gem_cli_dependency_restore
|
25
30
|
|
26
|
-
|
31
|
+
if st
|
32
|
+
# step 4, push the gem to rubygems
|
33
|
+
gem_cli_push(version: ver)
|
34
|
+
gem_cli_install(version: ver)
|
35
|
+
end
|
27
36
|
|
28
|
-
|
29
|
-
|
30
|
-
push(version: ver)
|
31
|
-
install(version: ver)
|
32
|
-
end
|
37
|
+
vcs_add_to_staging_if_commit_before("Gemfile.lock")
|
38
|
+
vcs_add_to_staging(value(:version_file_path))
|
33
39
|
|
34
|
-
|
40
|
+
vcs_commit("Commit after gem version #{ver} built")
|
35
41
|
|
42
|
+
# step 7 : tag the source code
|
43
|
+
vcs_cli_tag( tag: ver )
|
36
44
|
|
37
|
-
|
38
|
-
|
45
|
+
# step 8 : Push the source code
|
46
|
+
vcs_cli_push
|
39
47
|
|
40
|
-
# step 6 : commit vcs
|
41
|
-
commit
|
42
|
-
|
43
|
-
# step 7 : tag the source code
|
44
|
-
tag( tag: @selVer )
|
45
|
-
|
46
|
-
# step 8 : Push the source code
|
47
|
-
push
|
48
|
-
|
49
|
-
end # vcs_action block
|
50
48
|
rescue Release::Gem::Abort => ex
|
51
49
|
STDERR.puts "\n -- Aborted by user. Message was : #{ex.message}\n".red
|
52
50
|
rescue TTY::Reader::InputInterrupt => ex
|