esr-rim 1.3.9 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.3.9
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
- - ESR Labs AG
7
+ - ESR Labs GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-24 00:00:00.000000000 Z
11
+ date: 2021-06-24 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
@@ -89,25 +89,24 @@ licenses: []
89
89
  metadata: {}
90
90
  post_install_message:
91
91
  rdoc_options:
92
- - --main
92
+ - "--main"
93
93
  - README.md
94
- - -x
94
+ - "-x"
95
95
  - test
96
96
  require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ! '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ! '>='
105
+ - - ">="
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubyforge_project:
110
- rubygems_version: 2.4.8
109
+ rubygems_version: 3.1.2
111
110
  signing_key:
112
111
  specification_version: 4
113
112
  summary: RIM - multi git tool