esr-rim 1.4.0 → 1.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG +33 -0
- data/Rakefile +56 -56
- data/lib/rim/command/sync.rb +89 -89
- data/lib/rim/command_helper.rb +144 -143
- data/lib/rim/dirty_check.rb +9 -2
- data/lib/rim/file_helper.rb +0 -2
- data/lib/rim/git.rb +9 -1
- data/lib/rim/info_helper.rb +5 -1
- data/lib/rim/info_module_helper.rb +5 -0
- 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 -152
- data/lib/rim/rim.rb +94 -94
- data/lib/rim/rim_info.rb +2 -0
- data/lib/rim/sync_helper.rb +150 -150
- data/lib/rim/sync_module_helper.rb +107 -107
- data/lib/rim/upload_helper.rb +69 -69
- data/lib/rim/upload_module_helper.rb +163 -162
- data/lib/rim/version.rb +1 -2
- 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 +10 -17
- data/test/dirty_check/dir1/file2 +0 -1
- data/test/dirty_check/file1 +0 -1
- data/test/dirty_check/ign_file1 +0 -1
- data/test/rim_info/mod1/dir1/file2 +0 -1
- data/test/rim_info/mod1/file1 +0 -1
- data/test/rim_info/unrelated_file +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.
|
4
|
+
version: 1.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- ESR Labs
|
7
|
+
- ESR Labs GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-29 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
|
@@ -69,9 +69,6 @@ files:
|
|
69
69
|
- lib/rim/upload_module_helper.rb
|
70
70
|
- lib/rim/version.rb
|
71
71
|
- test/command_helper_test.rb
|
72
|
-
- test/dirty_check/dir1/file2
|
73
|
-
- test/dirty_check/file1
|
74
|
-
- test/dirty_check/ign_file1
|
75
72
|
- test/dirty_check_test.rb
|
76
73
|
- test/file_helper_test.rb
|
77
74
|
- test/git_test.rb
|
@@ -79,9 +76,6 @@ files:
|
|
79
76
|
- test/manifest_test_dir/manifest.rim
|
80
77
|
- test/manifest_test_dir/subdir/only_to_keep_folder_in_git.txt
|
81
78
|
- test/processor_test.rb
|
82
|
-
- test/rim_info/mod1/dir1/file2
|
83
|
-
- test/rim_info/mod1/file1
|
84
|
-
- test/rim_info/unrelated_file
|
85
79
|
- test/rim_info_test.rb
|
86
80
|
- test/status_builder_test.rb
|
87
81
|
- test/sync_helper_test.rb
|
@@ -95,25 +89,24 @@ licenses: []
|
|
95
89
|
metadata: {}
|
96
90
|
post_install_message:
|
97
91
|
rdoc_options:
|
98
|
-
- --main
|
92
|
+
- "--main"
|
99
93
|
- README.md
|
100
|
-
- -x
|
94
|
+
- "-x"
|
101
95
|
- test
|
102
96
|
require_paths:
|
103
97
|
- lib
|
104
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
99
|
requirements:
|
106
|
-
- -
|
100
|
+
- - ">="
|
107
101
|
- !ruby/object:Gem::Version
|
108
102
|
version: '0'
|
109
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
104
|
requirements:
|
111
|
-
- -
|
105
|
+
- - ">="
|
112
106
|
- !ruby/object:Gem::Version
|
113
107
|
version: '0'
|
114
108
|
requirements: []
|
115
|
-
|
116
|
-
rubygems_version: 2.4.8
|
109
|
+
rubygems_version: 3.1.4
|
117
110
|
signing_key:
|
118
111
|
specification_version: 4
|
119
112
|
summary: RIM - multi git tool
|
data/test/dirty_check/dir1/file2
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
more content
|
data/test/dirty_check/file1
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
some content
|
data/test/dirty_check/ign_file1
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ignored stuff
|
@@ -1 +0,0 @@
|
|
1
|
-
some other content
|
data/test/rim_info/mod1/file1
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
some content
|
@@ -1 +0,0 @@
|
|
1
|
-
anything
|