esr-rim 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b33d85be666d5c844f3cea2badd20b014e513ba4
4
- data.tar.gz: 5f33ff002ac05cf4c3d387bda151e0e8f21658fb
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ N2NkZDZjMGM5MmViZTZjYzdmY2Y1NDU2NTk0NWU5MGZjZGY4N2E0Yw==
5
+ data.tar.gz: !binary |-
6
+ N2I0ZTgwMThkMjk0MDFiNGI1NzBkOGJhNDEzYTc4NjFkOWExM2NlMw==
5
7
  SHA512:
6
- metadata.gz: 74d2e60c72834483f12dbc892ab25e87997d75913ad88caa979af85467bb89c42b98c06b7900ff88520da55082b563eeb721f6ea98bdbe0bb7f747ca3bb36478
7
- data.tar.gz: a941d0d2b90bd32a6d5ea5221dacd399769bb6de2e9e81d81ff796faf9d92e143754ed1f312c70ab72a437132ebbdaca1ba7dfce8ac1a97c370fb87c271ea38e
8
+ metadata.gz: !binary |-
9
+ MDgxMTYzMTU2ZjdiMTZiMjU5YjljNTM1NGFjZTRjNDE2YTI0N2ExYzZhMGZl
10
+ NGZkODZjM2Q3MTdiOGI5NmE2OTkzOTk3NzQzNDFiMTQ3ZmEwMDIwMDk4MDYz
11
+ ZWYxNjkwNzNhYTlmYmE1OGQzZDlmNDFmOWQ2NWVmYjhkYzdhNjg=
12
+ data.tar.gz: !binary |-
13
+ ZDFiY2Q0YmNlMTE1NDFmN2IyNWQ0YjkzNzk2MDA5MjMxOTQ5OGU2ZTM3Yjdj
14
+ ZjdlOTczOGM5ZWU1ODVlZGNhY2JjYmEyNzE0NTU1ZWYzZWY0ODE3YWYwZjI2
15
+ ZmRhZmJiMmQyYTI3ZGVjOTk4NmM5MzM2NmY4NjhiMDViNTAxYmE=
data/CHANGELOG CHANGED
@@ -80,3 +80,8 @@
80
80
 
81
81
  * added support for rimming subdirectories from module gits
82
82
  * added rim info command
83
+
84
+ # 1.3.1
85
+
86
+ * fixed sync with manifests and extended to support of subdirectories
87
+
@@ -45,7 +45,7 @@ class CommandHelper < Processor
45
45
  def modules_from_manifest(path)
46
46
  manifest = read_manifest(path)
47
47
  manifest.modules.each do |mod|
48
- add_unique_module_info(create_module_info(mod.remote_path, mod.local_path, mod.target_revision, mod.ignores))
48
+ add_unique_module_info(create_module_info(mod.remote_path, mod.local_path, mod.target_revision, mod.ignores, mod.subdir))
49
49
  end
50
50
  true
51
51
  end
@@ -28,7 +28,8 @@ module Manifest
28
28
  :remote_path => mod["remote_path"],
29
29
  :local_path => mod["local_path"],
30
30
  :target_revision => mod["target_revision"],
31
- :ignores => mod["ignores"]
31
+ :ignores => mod["ignores"],
32
+ :subdir => mod["subdir"]
32
33
  ))
33
34
  end
34
35
  end
@@ -18,12 +18,14 @@ class Module
18
18
  attr_reader :local_path
19
19
  attr_reader :target_revision
20
20
  attr_reader :ignores
21
+ attr_reader :subdir
21
22
 
22
23
  def initialize(args = {})
23
24
  @remote_path = args[:remote_path]
24
25
  @local_path = args[:local_path]
25
26
  @target_revision = args[:target_revision]
26
27
  @ignores = args[:ignores]
28
+ @subdir = args[:subdir]
27
29
  end
28
30
  end
29
31
 
@@ -2,7 +2,7 @@ module RIM
2
2
 
3
3
  module Version
4
4
 
5
- Version = "1.3.0"
5
+ Version = "1.3.1"
6
6
 
7
7
  end
8
8
 
@@ -0,0 +1,83 @@
1
+ $:.unshift File.join(File.dirname(__FILE__),"..","lib")
2
+ $:.unshift File.join(File.dirname(__FILE__))
3
+
4
+ require 'minitest/autorun'
5
+ require 'rim/command_helper'
6
+ require 'test_helper'
7
+ require 'fileutils'
8
+ require 'json'
9
+
10
+ class CommandHelperTest < Minitest::Test
11
+ include FileUtils
12
+ include TestHelper
13
+
14
+ class TestCommand < RIM::CommandHelper
15
+
16
+ attr_reader :module_infos
17
+
18
+ def initialize(*args)
19
+ super
20
+ @module_infos = []
21
+ end
22
+
23
+ def add_module_info(module_info)
24
+ @module_infos << module_info
25
+ end
26
+
27
+ end
28
+
29
+ def setup
30
+ @test_dir = empty_test_dir("command_helper_test")
31
+ @ws_dir = File.join(@test_dir, "ws")
32
+ @logger = Logger.new($stdout)
33
+ @logger.level = Logger::ERROR unless ARGV.include? "debug"
34
+ RIM::GitSession.logger = @logger
35
+ end
36
+
37
+ def teardown
38
+ remove_test_dirs
39
+ end
40
+
41
+ def test_create_module_info
42
+ cut = RIM::CommandHelper.new(@ws_dir, @logger)
43
+ mi = cut.create_module_info('ssh://gerrit/bsw/test', File.join(@ws_dir, 'sub/test'), 'master', ['CMakeLists.txt', 'OtherPattern*'], 'subdir')
44
+ assert(mi.remote_url == 'ssh://gerrit/bsw/test')
45
+ assert(mi.remote_branch_format == 'refs/for/%s')
46
+ assert(mi.local_path == 'sub/test')
47
+ assert(mi.target_revision == 'master')
48
+ assert(mi.ignores == ['CMakeLists.txt', 'OtherPattern*'])
49
+ assert(mi.subdir == 'subdir')
50
+ end
51
+
52
+ def test_modules_from_manifest
53
+ manifest = {
54
+ 'modules' => [
55
+ { 'remote_path' => 'ssh://gerrit/bsw/test', 'local_path' => File.join(@ws_dir, 'sub/test'), 'target_revision' => 'master', 'ignores' => ['CMakeLists.txt', 'OtherPattern*'], 'subdir' => 'test/subdir'},
56
+ { 'remote_path' => '../file/test', 'local_path' => File.join(@ws_dir, 'sub/file_test'), 'target_revision' => 'branch' }
57
+ ]
58
+ }
59
+
60
+ manifest_file = File.join(@test_dir, 'manifest.json')
61
+ File.open(manifest_file, 'w') do |file|
62
+ file << manifest.to_json
63
+ end
64
+ cut = TestCommand.new(@ws_dir, @logger)
65
+ cut.modules_from_manifest(manifest_file)
66
+ assert(cut.module_infos.size == 2)
67
+ mi = cut.module_infos[0]
68
+ assert(mi.remote_url == 'ssh://gerrit/bsw/test')
69
+ assert(mi.remote_branch_format == 'refs/for/%s')
70
+ assert(mi.local_path == 'sub/test')
71
+ assert(mi.target_revision == 'master')
72
+ assert(mi.ignores == ['CMakeLists.txt', 'OtherPattern*'])
73
+ assert(mi.subdir == 'test/subdir')
74
+ mi = cut.module_infos[1]
75
+ assert(mi.remote_url == '../file/test')
76
+ assert(mi.remote_branch_format == 'refs/for/%s')
77
+ assert(mi.local_path == 'sub/file_test')
78
+ assert(mi.target_revision == 'branch')
79
+ assert(mi.ignores == [])
80
+ assert(mi.subdir.nil?)
81
+ end
82
+
83
+ 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.0
4
+ version: 1.3.1
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: 2016-06-13 00:00:00.000000000 Z
11
+ date: 2016-06-28 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
@@ -34,6 +34,10 @@ extra_rdoc_files:
34
34
  - README.md
35
35
  - CHANGELOG
36
36
  files:
37
+ - CHANGELOG
38
+ - README.md
39
+ - Rakefile
40
+ - bin/rim
37
41
  - lib/rim/command/command.rb
38
42
  - lib/rim/command/info.rb
39
43
  - lib/rim/command/status.rb
@@ -64,6 +68,7 @@ files:
64
68
  - lib/rim/upload_helper.rb
65
69
  - lib/rim/upload_module_helper.rb
66
70
  - lib/rim/version.rb
71
+ - test/command_helper_test.rb
67
72
  - test/dirty_check_test.rb
68
73
  - test/file_helper_test.rb
69
74
  - test/git_test.rb
@@ -79,10 +84,6 @@ files:
79
84
  - test/unit_tests.rb
80
85
  - test/upload_helper_test.rb
81
86
  - test/upload_module_helper_test.rb
82
- - README.md
83
- - CHANGELOG
84
- - Rakefile
85
- - bin/rim
86
87
  homepage: http://esrlabs.com
87
88
  licenses: []
88
89
  metadata: {}
@@ -96,17 +97,17 @@ require_paths:
96
97
  - lib
97
98
  required_ruby_version: !ruby/object:Gem::Requirement
98
99
  requirements:
99
- - - '>='
100
+ - - ! '>='
100
101
  - !ruby/object:Gem::Version
101
102
  version: '0'
102
103
  required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  requirements:
104
- - - '>='
105
+ - - ! '>='
105
106
  - !ruby/object:Gem::Version
106
107
  version: '0'
107
108
  requirements: []
108
109
  rubyforge_project:
109
- rubygems_version: 2.0.3
110
+ rubygems_version: 2.4.8
110
111
  signing_key:
111
112
  specification_version: 4
112
113
  summary: RIM - multi git tool