esr-rim 1.3.8 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG +25 -0
- data/Rakefile +56 -56
- data/lib/rim/command/sync.rb +89 -89
- data/lib/rim/command_helper.rb +143 -143
- data/lib/rim/dirty_check.rb +9 -2
- data/lib/rim/file_helper.rb +0 -2
- data/lib/rim/git.rb +13 -1
- data/lib/rim/manifest/helper.rb +82 -82
- data/lib/rim/manifest/json_reader.rb +41 -41
- data/lib/rim/manifest/manifest.json +7 -7
- data/lib/rim/module_helper.rb +57 -57
- data/lib/rim/module_info.rb +43 -43
- data/lib/rim/processor.rb +152 -155
- data/lib/rim/rim.rb +94 -94
- data/lib/rim/rim_info.rb +26 -2
- data/lib/rim/sync_helper.rb +150 -150
- data/lib/rim/sync_module_helper.rb +107 -106
- data/lib/rim/upload_helper.rb +69 -69
- data/lib/rim/upload_module_helper.rb +163 -162
- data/lib/rim/version.rb +1 -1
- data/test/command_helper_test.rb +83 -83
- data/test/file_helper_test.rb +132 -132
- data/test/manifest_helper_test.rb +29 -29
- data/test/manifest_test_dir/manifest.rim +9 -9
- data/test/processor_test.rb +32 -32
- data/test/sync_helper_test.rb +296 -296
- data/test/sync_module_helper_test.rb +126 -126
- data/test/upload_helper_test.rb +403 -403
- data/test/upload_module_helper_test.rb +92 -92
- metadata +9 -12
- data/test/upload_helper_test/remote_git/mod1/readme.txt +0 -1
- data/test/upload_helper_test/remote_ws/readme +0 -1
- data/test/upload_helper_test/ws/readme +0 -1
@@ -1,92 +1,92 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
2
|
-
$:.unshift File.join(File.dirname(__FILE__))
|
3
|
-
|
4
|
-
require 'minitest/autorun'
|
5
|
-
require 'rim/git'
|
6
|
-
require 'rim/dirty_check'
|
7
|
-
require 'rim/module_info'
|
8
|
-
require 'rim/rim_info'
|
9
|
-
require 'rim/upload_module_helper'
|
10
|
-
require 'test_helper'
|
11
|
-
require 'fileutils'
|
12
|
-
|
13
|
-
class UploadModuleHelperTest < Minitest::Test
|
14
|
-
include FileUtils
|
15
|
-
include TestHelper
|
16
|
-
|
17
|
-
def setup
|
18
|
-
@logger = Logger.new($stdout)
|
19
|
-
@logger.level = Logger::ERROR unless ARGV.include? "debug"
|
20
|
-
RIM::GitSession.logger = @logger
|
21
|
-
test_dir = empty_test_dir("upload_module_helper_test")
|
22
|
-
@remote_git_dir = File.join(test_dir, "remote_git")
|
23
|
-
FileUtils.mkdir(@remote_git_dir)
|
24
|
-
RIM::git_session(@remote_git_dir) do |s|
|
25
|
-
s.execute("git init")
|
26
|
-
s.execute("git checkout -B testbr")
|
27
|
-
write_file(@remote_git_dir, "readme.txt")
|
28
|
-
s.execute("git add .")
|
29
|
-
s.execute("git commit -m \"Initial commit\"")
|
30
|
-
s.execute("git checkout -B master")
|
31
|
-
write_file(@remote_git_dir, "readme2.txt")
|
32
|
-
s.execute("git add .")
|
33
|
-
s.execute("git commit -m \"Second commit\"")
|
34
|
-
s.execute("git checkout --detach master")
|
35
|
-
@initial_rev = s.rev_sha1("HEAD")
|
36
|
-
end
|
37
|
-
@ws_dir = File.join(test_dir, "ws")
|
38
|
-
FileUtils.mkdir(@ws_dir)
|
39
|
-
RIM::git_session(@ws_dir) do |s|
|
40
|
-
s.execute("git init")
|
41
|
-
`echo '.rim' >> #{File.join(@ws_dir, ".gitignore")}`
|
42
|
-
s.execute("git checkout -B master")
|
43
|
-
write_file(@ws_dir, "initial.txt")
|
44
|
-
s.execute("git add .")
|
45
|
-
s.execute("git commit -m \"Initial commit\"")
|
46
|
-
@initial_ws_rev = s.rev_sha1("HEAD")
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def teardown
|
51
|
-
remove_test_dirs
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_files_are_uploaded_to_branch
|
55
|
-
mod_dir = File.join(@ws_dir, "module")
|
56
|
-
FileUtils.mkdir_p(mod_dir)
|
57
|
-
write_file(mod_dir, "readme.txt")
|
58
|
-
rim_info = RIM::RimInfo.new
|
59
|
-
rim_info.revision_sha1 = @initial_rev
|
60
|
-
rim_info.target_revision = "testbr"
|
61
|
-
rim_info.to_dir(mod_dir)
|
62
|
-
revs = []
|
63
|
-
RIM::git_session(@ws_dir) do |s|
|
64
|
-
s.execute("git add --all #{@ws_dir}")
|
65
|
-
s.execute("git commit -m \"Initial workspace commit\"")
|
66
|
-
write_file(@ws_dir, "nomodulefile.txt")
|
67
|
-
s.execute("git add --all #{@ws_dir}")
|
68
|
-
s.execute("git commit -m \"Added non module file\"")
|
69
|
-
revs.push(s.rev_sha1("HEAD"))
|
70
|
-
write_file(mod_dir, "second.txt")
|
71
|
-
s.execute("git add --all #{@ws_dir}")
|
72
|
-
s.execute("git commit -m \"Added module file\"")
|
73
|
-
revs.push(s.rev_sha1("HEAD"))
|
74
|
-
end
|
75
|
-
info = RIM::ModuleInfo.new("file://" + @remote_git_dir, "module", "testbr")
|
76
|
-
cut = RIM::UploadModuleHelper.new(@ws_dir, info, true, @logger)
|
77
|
-
cut.upload(nil, revs)
|
78
|
-
RIM::git_session(@remote_git_dir) do |s|
|
79
|
-
s.execute("git checkout testbr")
|
80
|
-
end
|
81
|
-
assert File.exists?(File.join(@remote_git_dir, "readme.txt"))
|
82
|
-
assert File.exists?(File.join(@remote_git_dir, "second.txt"))
|
83
|
-
end
|
84
|
-
|
85
|
-
def write_file(dir, name)
|
86
|
-
FileUtils.mkdir_p(dir)
|
87
|
-
File.open(File.join(dir, name), "w") do |f|
|
88
|
-
f.write("Content of #{name}\n")
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
2
|
+
$:.unshift File.join(File.dirname(__FILE__))
|
3
|
+
|
4
|
+
require 'minitest/autorun'
|
5
|
+
require 'rim/git'
|
6
|
+
require 'rim/dirty_check'
|
7
|
+
require 'rim/module_info'
|
8
|
+
require 'rim/rim_info'
|
9
|
+
require 'rim/upload_module_helper'
|
10
|
+
require 'test_helper'
|
11
|
+
require 'fileutils'
|
12
|
+
|
13
|
+
class UploadModuleHelperTest < Minitest::Test
|
14
|
+
include FileUtils
|
15
|
+
include TestHelper
|
16
|
+
|
17
|
+
def setup
|
18
|
+
@logger = Logger.new($stdout)
|
19
|
+
@logger.level = Logger::ERROR unless ARGV.include? "debug"
|
20
|
+
RIM::GitSession.logger = @logger
|
21
|
+
test_dir = empty_test_dir("upload_module_helper_test")
|
22
|
+
@remote_git_dir = File.join(test_dir, "remote_git")
|
23
|
+
FileUtils.mkdir(@remote_git_dir)
|
24
|
+
RIM::git_session(@remote_git_dir) do |s|
|
25
|
+
s.execute("git init")
|
26
|
+
s.execute("git checkout -B testbr")
|
27
|
+
write_file(@remote_git_dir, "readme.txt")
|
28
|
+
s.execute("git add .")
|
29
|
+
s.execute("git commit -m \"Initial commit\"")
|
30
|
+
s.execute("git checkout -B master")
|
31
|
+
write_file(@remote_git_dir, "readme2.txt")
|
32
|
+
s.execute("git add .")
|
33
|
+
s.execute("git commit -m \"Second commit\"")
|
34
|
+
s.execute("git checkout --detach master")
|
35
|
+
@initial_rev = s.rev_sha1("HEAD")
|
36
|
+
end
|
37
|
+
@ws_dir = File.join(test_dir, "ws")
|
38
|
+
FileUtils.mkdir(@ws_dir)
|
39
|
+
RIM::git_session(@ws_dir) do |s|
|
40
|
+
s.execute("git init")
|
41
|
+
`echo '.rim' >> #{File.join(@ws_dir, ".gitignore")}`
|
42
|
+
s.execute("git checkout -B master")
|
43
|
+
write_file(@ws_dir, "initial.txt")
|
44
|
+
s.execute("git add .")
|
45
|
+
s.execute("git commit -m \"Initial commit\"")
|
46
|
+
@initial_ws_rev = s.rev_sha1("HEAD")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def teardown
|
51
|
+
remove_test_dirs
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_files_are_uploaded_to_branch
|
55
|
+
mod_dir = File.join(@ws_dir, "module")
|
56
|
+
FileUtils.mkdir_p(mod_dir)
|
57
|
+
write_file(mod_dir, "readme.txt")
|
58
|
+
rim_info = RIM::RimInfo.new
|
59
|
+
rim_info.revision_sha1 = @initial_rev
|
60
|
+
rim_info.target_revision = "testbr"
|
61
|
+
rim_info.to_dir(mod_dir)
|
62
|
+
revs = []
|
63
|
+
RIM::git_session(@ws_dir) do |s|
|
64
|
+
s.execute("git add --all #{@ws_dir}")
|
65
|
+
s.execute("git commit -m \"Initial workspace commit\"")
|
66
|
+
write_file(@ws_dir, "nomodulefile.txt")
|
67
|
+
s.execute("git add --all #{@ws_dir}")
|
68
|
+
s.execute("git commit -m \"Added non module file\"")
|
69
|
+
revs.push(s.rev_sha1("HEAD"))
|
70
|
+
write_file(mod_dir, "second.txt")
|
71
|
+
s.execute("git add --all #{@ws_dir}")
|
72
|
+
s.execute("git commit -m \"Added module file\"")
|
73
|
+
revs.push(s.rev_sha1("HEAD"))
|
74
|
+
end
|
75
|
+
info = RIM::ModuleInfo.new("file://" + @remote_git_dir, "module", "testbr")
|
76
|
+
cut = RIM::UploadModuleHelper.new(@ws_dir, info, true, @logger)
|
77
|
+
cut.upload(nil, revs)
|
78
|
+
RIM::git_session(@remote_git_dir) do |s|
|
79
|
+
s.execute("git checkout testbr")
|
80
|
+
end
|
81
|
+
assert File.exists?(File.join(@remote_git_dir, "readme.txt"))
|
82
|
+
assert File.exists?(File.join(@remote_git_dir, "second.txt"))
|
83
|
+
end
|
84
|
+
|
85
|
+
def write_file(dir, name)
|
86
|
+
FileUtils.mkdir_p(dir)
|
87
|
+
File.open(File.join(dir, name), "w") do |f|
|
88
|
+
f.write("Content of #{name}\n")
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esr-rim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ESR Labs AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: subcommand
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.0.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.6
|
27
27
|
description: RIM lets you work with multiple git repositories from within one single
|
@@ -83,34 +83,31 @@ files:
|
|
83
83
|
- test/test_helper.rb
|
84
84
|
- test/unit_tests.rb
|
85
85
|
- test/upload_helper_test.rb
|
86
|
-
- test/upload_helper_test/remote_git/mod1/readme.txt
|
87
|
-
- test/upload_helper_test/remote_ws/readme
|
88
|
-
- test/upload_helper_test/ws/readme
|
89
86
|
- test/upload_module_helper_test.rb
|
90
87
|
homepage: http://github.com/esrlabs/esr-rim
|
91
88
|
licenses: []
|
92
89
|
metadata: {}
|
93
90
|
post_install_message:
|
94
91
|
rdoc_options:
|
95
|
-
- --main
|
92
|
+
- "--main"
|
96
93
|
- README.md
|
97
|
-
- -x
|
94
|
+
- "-x"
|
98
95
|
- test
|
99
96
|
require_paths:
|
100
97
|
- lib
|
101
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
99
|
requirements:
|
103
|
-
- -
|
100
|
+
- - ">="
|
104
101
|
- !ruby/object:Gem::Version
|
105
102
|
version: '0'
|
106
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
104
|
requirements:
|
108
|
-
- -
|
105
|
+
- - ">="
|
109
106
|
- !ruby/object:Gem::Version
|
110
107
|
version: '0'
|
111
108
|
requirements: []
|
112
109
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.7.7
|
114
111
|
signing_key:
|
115
112
|
specification_version: 4
|
116
113
|
summary: RIM - multi git tool
|
@@ -1 +0,0 @@
|
|
1
|
-
Content.
|
@@ -1 +0,0 @@
|
|
1
|
-
Content
|
@@ -1 +0,0 @@
|
|
1
|
-
Content
|