scout-essentials 1.6.10 → 1.6.12
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 +4 -4
- data/.vimproject +2 -0
- data/VERSION +1 -1
- data/lib/scout/annotation/annotation_module.rb +8 -2
- data/lib/scout/cmd.rb +1 -1
- data/lib/scout/indiferent_hash.rb +18 -1
- data/lib/scout/log/color.rb +2 -0
- data/lib/scout/open/sync.rb +84 -0
- data/lib/scout/open.rb +1 -0
- data/lib/scout/path/find.rb +16 -7
- data/lib/scout/resource/sync.rb +24 -0
- data/lib/scout/resource/util.rb +1 -2
- data/lib/scout/resource.rb +2 -1
- data/lib/scout/simple_opt/get.rb +2 -0
- data/scout-essentials.gemspec +8 -4
- data/test/scout/open/test_sync.rb +55 -0
- data/test/scout/path/test_find.rb +9 -2
- data/test/scout/resource/test_sync.rb +32 -0
- data/test/scout/resource/test_util.rb +5 -0
- data/test/scout/test_resource.rb +2 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37db5fc1f54a8e4c5483742f27cb13d761195505e5f90e19e373e50e7cd3dd86
|
4
|
+
data.tar.gz: beac010288c378947a16a318c62386e63e2d16b042a441a3e2bedac3e8d99bc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc32848c270767fe4b8579a48c60d9b3e0e0b0ae3ad3ed479030c7fb3630f9dd56bf10bc0d68eb972d8a3ae2d604f3f41b05165c6a45f395910b720054832f5c
|
7
|
+
data.tar.gz: b06ee0dd075feff9193b418b6d6b4a764c96efe6e0b99ad4829365cd45e272d3f31ed5526a393dd39087f8f734711debd4842a78f270db1613dab849b704d3cf
|
data/.vimproject
CHANGED
@@ -66,6 +66,7 @@ scout-essentials=/$PWD filter="*.rb *.txt *.md *.conf *.yaml" {
|
|
66
66
|
remote.rb
|
67
67
|
stream.rb
|
68
68
|
util.rb
|
69
|
+
sync.rb
|
69
70
|
bgzf.rb
|
70
71
|
}
|
71
72
|
tmpfile.rb
|
@@ -76,6 +77,7 @@ scout-essentials=/$PWD filter="*.rb *.txt *.md *.conf *.yaml" {
|
|
76
77
|
produce.rb
|
77
78
|
scout.rb
|
78
79
|
software.rb
|
80
|
+
sync.rb
|
79
81
|
util.rb
|
80
82
|
}
|
81
83
|
config.rb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.12
|
@@ -1,8 +1,10 @@
|
|
1
|
+
require 'scout/log'
|
1
2
|
module Annotation
|
2
3
|
module AnnotationModule
|
3
4
|
def annotation(*attrs)
|
4
5
|
annotations = self.instance_variable_get("@annotations")
|
5
|
-
|
6
|
+
attrs -= annotations
|
7
|
+
annotations.concat attrs
|
6
8
|
attrs.each do |a|
|
7
9
|
self.attr_accessor a
|
8
10
|
end
|
@@ -13,8 +15,11 @@ module Annotation
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def included(mod)
|
18
|
+
attrs = self.instance_variable_get("@annotations")
|
16
19
|
mod.instance_variable_set(:@annotations, []) unless mod.instance_variables.include?(:@annotations)
|
17
|
-
|
20
|
+
annotations = mod.instance_variable_get(:@annotations)
|
21
|
+
attrs -= annotations
|
22
|
+
annotations.concat attrs
|
18
23
|
end
|
19
24
|
|
20
25
|
def extended(obj)
|
@@ -24,6 +29,7 @@ module Annotation
|
|
24
29
|
obj.annotation_types << self
|
25
30
|
|
26
31
|
annotations = obj.instance_variable_get(:@annotations)
|
32
|
+
attrs -= annotations
|
27
33
|
annotations.concat attrs
|
28
34
|
end
|
29
35
|
|
data/lib/scout/cmd.rb
CHANGED
@@ -115,10 +115,27 @@ module IndiferentHash
|
|
115
115
|
def keys_to_sym!
|
116
116
|
string_keys = keys.select{|k| String === k}
|
117
117
|
string_keys.each do |key|
|
118
|
-
|
118
|
+
begin
|
119
|
+
self[key.to_sym] = self.delete(key)
|
120
|
+
rescue
|
121
|
+
next
|
122
|
+
end
|
119
123
|
end
|
120
124
|
end
|
121
125
|
|
126
|
+
def keys_to_sym
|
127
|
+
new = IndiferentHash.setup({})
|
128
|
+
self.keys.each do |key|
|
129
|
+
begin
|
130
|
+
skey = key.is_a?(String) ? key.to_sym : key
|
131
|
+
rescue
|
132
|
+
skey = key
|
133
|
+
end
|
134
|
+
new[skey] = self[key]
|
135
|
+
end
|
136
|
+
new
|
137
|
+
end
|
138
|
+
|
122
139
|
def prety_print
|
123
140
|
Misc.format_definition_list(self, sep: "\n")
|
124
141
|
end
|
data/lib/scout/log/color.rb
CHANGED
@@ -0,0 +1,84 @@
|
|
1
|
+
module Open
|
2
|
+
|
3
|
+
def self.rsync(source, target, options = {})
|
4
|
+
excludes, files, hard_link, test, print, delete, source_server, target_server, other = IndiferentHash.process_options options,
|
5
|
+
:excludes, :files, :hard_link, :test, :print, :delete, :source, :target, :other
|
6
|
+
|
7
|
+
excludes ||= %w(.save .crap .source tmp filecache open-remote)
|
8
|
+
excludes = excludes.split(/,\s*/) if excludes.is_a?(String) and not excludes.include?("--exclude")
|
9
|
+
|
10
|
+
if File.directory?(source) || source.end_with?("/")
|
11
|
+
source += "/" unless source.end_with? '/'
|
12
|
+
target += "/" unless target.end_with? '/'
|
13
|
+
end
|
14
|
+
|
15
|
+
if source == target && ! (source_server || target_server)
|
16
|
+
Log.warn "Asking to rsync local file with itself"
|
17
|
+
return
|
18
|
+
end
|
19
|
+
|
20
|
+
if target_server
|
21
|
+
target_uri = [target_server, "'" + target + "'"] * ":"
|
22
|
+
else
|
23
|
+
target_uri = "'" + target + "'"
|
24
|
+
end
|
25
|
+
|
26
|
+
if source_server
|
27
|
+
source_uri = [source_server, "'" + source + "'"] * ":"
|
28
|
+
else
|
29
|
+
source_uri = "'" + source + "'"
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
if target_server
|
34
|
+
CMD.cmd("ssh #{target_server} mkdir -p '#{File.dirname(target)}'")
|
35
|
+
else
|
36
|
+
Open.mkdir File.dirname(target)
|
37
|
+
end
|
38
|
+
|
39
|
+
Log.low "Migrating #{source} #{files.length} files to #{target} - #{Misc.fingerprint(files)}}" if files
|
40
|
+
|
41
|
+
|
42
|
+
rsync_args = %w(-avztHP --copy-unsafe-links --omit-dir-times)
|
43
|
+
rsync_args << "--link-dest '#{source}'" if hard_link && ! source_server
|
44
|
+
rsync_args << excludes.collect{|s| "--exclude '#{s}'" } if excludes and excludes.any?
|
45
|
+
rsync_args << "-nv" if test
|
46
|
+
if files
|
47
|
+
tmp_files = TmpFile.tmp_file 'rsync_files-'
|
48
|
+
Open.write(tmp_files, files * "\n")
|
49
|
+
rsync_args << "--files-from='#{tmp_files}'"
|
50
|
+
end
|
51
|
+
|
52
|
+
cmd = "rsync #{rsync_args * " "} #{source_uri} #{target_uri}"
|
53
|
+
case other
|
54
|
+
when String
|
55
|
+
cmd << " " << other
|
56
|
+
when Array
|
57
|
+
cmd << " " << other * " "
|
58
|
+
end
|
59
|
+
cmd << " && rm -Rf #{source}" if delete && ! files
|
60
|
+
|
61
|
+
if print
|
62
|
+
cmd
|
63
|
+
else
|
64
|
+
CMD.cmd_log(cmd, :log => Log::HIGH)
|
65
|
+
|
66
|
+
if delete && files
|
67
|
+
remove_files = files.collect{|f| File.join(source, f) }
|
68
|
+
dirs = remove_files.select{|f| File.directory? f }
|
69
|
+
remove_files.each do |file|
|
70
|
+
next if dirs.include? file
|
71
|
+
Open.rm file
|
72
|
+
end
|
73
|
+
|
74
|
+
dirs.each do |dir|
|
75
|
+
FileUtils.rmdir dir if Dir.glob(dir).empty?
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.sync(...)
|
82
|
+
rsync(...)
|
83
|
+
end
|
84
|
+
end
|
data/lib/scout/open.rb
CHANGED
data/lib/scout/path/find.rb
CHANGED
@@ -117,13 +117,17 @@ module Path
|
|
117
117
|
def self.load_path_maps(filename)
|
118
118
|
Path.setup(filename) unless Path === filename
|
119
119
|
if filename.exist?
|
120
|
+
filename = filename.find
|
120
121
|
begin
|
122
|
+
Log.debug "Loading search_paths from #{filename}"
|
121
123
|
YAML.load(filename.read).each do |where, location|
|
122
|
-
|
124
|
+
add_path where.to_sym, location
|
123
125
|
end
|
124
126
|
rescue
|
125
127
|
Log.error "Error loading search_paths from #{filename}: " << $!.message
|
126
128
|
end
|
129
|
+
else
|
130
|
+
Log.debug "Could not find search_paths file #{filename}"
|
127
131
|
end
|
128
132
|
end
|
129
133
|
|
@@ -132,18 +136,22 @@ module Path
|
|
132
136
|
end
|
133
137
|
|
134
138
|
def _subpath
|
135
|
-
@subpath ||= _parts.length > 1 ? _parts[1..-1] * "/" :
|
139
|
+
@subpath ||= _parts.length > 1 ? _parts[1..-1] * "/" : nil
|
136
140
|
end
|
137
141
|
|
138
142
|
def _toplevel
|
139
|
-
@toplevel ||= _parts
|
143
|
+
@toplevel ||= _parts[0]
|
140
144
|
end
|
141
145
|
|
142
146
|
SLASH = "/"[0]
|
143
147
|
DOT = "."[0]
|
144
|
-
def located?
|
148
|
+
def self.located?(path)
|
145
149
|
# OPEN RESOURCE
|
146
|
-
|
150
|
+
path.slice(0,1) == SLASH || (path.slice(0,1) == DOT && path.slice(1,2) == SLASH)
|
151
|
+
end
|
152
|
+
|
153
|
+
def located?
|
154
|
+
Path.located?(self)
|
147
155
|
end
|
148
156
|
|
149
157
|
def annotate_found_where(found, where)
|
@@ -180,10 +188,11 @@ module Path
|
|
180
188
|
end
|
181
189
|
|
182
190
|
def self.exists_file_or_alternatives(file)
|
183
|
-
|
191
|
+
file = file.dup if Path === file
|
192
|
+
return file if Open.exist?(file) or Open.directory?(file)
|
184
193
|
%w(gz bgz zip).each do |extension|
|
185
194
|
alt_file = file + '.' + extension
|
186
|
-
return alt_file if
|
195
|
+
return alt_file if Open.exist?(alt_file) or Open.directory?(alt_file)
|
187
196
|
end
|
188
197
|
nil
|
189
198
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'scout/open/sync'
|
2
|
+
module Resource
|
3
|
+
def self.sync(path, map = nil, options = {})
|
4
|
+
resource = IndiferentHash.process_options options,
|
5
|
+
:resource
|
6
|
+
|
7
|
+
map = 'user' if map.nil?
|
8
|
+
resource = path.pkgdir if resource.nil? and path.is_a?(Path) and path.pkgdir.is_a?(Resource)
|
9
|
+
resource = Resource.default_resource if resource.nil?
|
10
|
+
|
11
|
+
target = resource.identify(path).find(map)
|
12
|
+
|
13
|
+
if File.exist?(path)
|
14
|
+
real_paths = [path]
|
15
|
+
else
|
16
|
+
path = Path.setup(path, pkgdir: resource) unless path.is_a?(Path)
|
17
|
+
real_paths = path.directory? ? path.find_all : path.glob_all
|
18
|
+
end
|
19
|
+
|
20
|
+
real_paths.each do |source|
|
21
|
+
Open.sync(source, target, options)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/scout/resource/util.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Resource
|
2
2
|
def identify(path)
|
3
|
+
path = Path.setup path unless Path === path
|
3
4
|
return path unless path.located?
|
4
5
|
path_maps = path.path_maps if Path === path
|
5
6
|
path_maps ||= self.path_maps || Path.path_maps
|
@@ -30,8 +31,6 @@ module Resource
|
|
30
31
|
m.named_captures.include?(c) ? m[c] : nil
|
31
32
|
}.compact * "/"
|
32
33
|
|
33
|
-
#unlocated.gsub!(/\/+/,'/')
|
34
|
-
|
35
34
|
if self.subdir && ! self.subdir.empty?
|
36
35
|
subdir = self.subdir
|
37
36
|
subdir += "/" unless subdir.end_with?("/")
|
data/lib/scout/resource.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative 'resource/path'
|
|
5
5
|
require_relative 'resource/open'
|
6
6
|
require_relative 'resource/util'
|
7
7
|
require_relative 'resource/software'
|
8
|
+
require_relative 'resource/sync'
|
8
9
|
|
9
10
|
module Resource
|
10
11
|
extend Annotation
|
@@ -14,7 +15,7 @@ module Resource
|
|
14
15
|
attr_accessor :default_resource
|
15
16
|
|
16
17
|
def default_resource
|
17
|
-
@default_resource
|
18
|
+
@default_resource
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
data/lib/scout/simple_opt/get.rb
CHANGED
data/scout-essentials.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: scout-essentials 1.6.
|
5
|
+
# stub: scout-essentials 1.6.12 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "scout-essentials".freeze
|
9
|
-
s.version = "1.6.
|
9
|
+
s.version = "1.6.12".freeze
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Miguel Vazquez".freeze]
|
14
|
-
s.date = "2025-04-
|
14
|
+
s.date = "2025-04-16"
|
15
15
|
s.description = "Things a scout can use anywhere".freeze
|
16
16
|
s.email = "mikisvaz@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
|
|
64
64
|
"lib/scout/open/lock/lockfile.rb",
|
65
65
|
"lib/scout/open/remote.rb",
|
66
66
|
"lib/scout/open/stream.rb",
|
67
|
+
"lib/scout/open/sync.rb",
|
67
68
|
"lib/scout/open/util.rb",
|
68
69
|
"lib/scout/path.rb",
|
69
70
|
"lib/scout/path/digest.rb",
|
@@ -81,6 +82,7 @@ Gem::Specification.new do |s|
|
|
81
82
|
"lib/scout/resource/produce/rake.rb",
|
82
83
|
"lib/scout/resource/scout.rb",
|
83
84
|
"lib/scout/resource/software.rb",
|
85
|
+
"lib/scout/resource/sync.rb",
|
84
86
|
"lib/scout/resource/util.rb",
|
85
87
|
"lib/scout/simple_opt.rb",
|
86
88
|
"lib/scout/simple_opt/accessor.rb",
|
@@ -110,6 +112,7 @@ Gem::Specification.new do |s|
|
|
110
112
|
"test/scout/open/test_lock.rb",
|
111
113
|
"test/scout/open/test_remote.rb",
|
112
114
|
"test/scout/open/test_stream.rb",
|
115
|
+
"test/scout/open/test_sync.rb",
|
113
116
|
"test/scout/open/test_util.rb",
|
114
117
|
"test/scout/path/test_digest.rb",
|
115
118
|
"test/scout/path/test_find.rb",
|
@@ -120,6 +123,7 @@ Gem::Specification.new do |s|
|
|
120
123
|
"test/scout/resource/test_path.rb",
|
121
124
|
"test/scout/resource/test_produce.rb",
|
122
125
|
"test/scout/resource/test_software.rb",
|
126
|
+
"test/scout/resource/test_sync.rb",
|
123
127
|
"test/scout/resource/test_util.rb",
|
124
128
|
"test/scout/simple_opt/test_doc.rb",
|
125
129
|
"test/scout/simple_opt/test_get.rb",
|
@@ -142,7 +146,7 @@ Gem::Specification.new do |s|
|
|
142
146
|
]
|
143
147
|
s.homepage = "http://github.com/mikisvaz/scout-essentials".freeze
|
144
148
|
s.licenses = ["MIT".freeze]
|
145
|
-
s.rubygems_version = "3.6.
|
149
|
+
s.rubygems_version = "3.6.6".freeze
|
146
150
|
s.summary = "Scout essential tools".freeze
|
147
151
|
|
148
152
|
s.specification_version = 4
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
2
|
+
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
3
|
+
|
4
|
+
class TestOpenSync < Test::Unit::TestCase
|
5
|
+
def test_rsync_basic
|
6
|
+
TmpFile.with_file do |source|
|
7
|
+
TmpFile.with_file do |target|
|
8
|
+
Open.write(source, 'payload')
|
9
|
+
Open.rsync(source, target)
|
10
|
+
assert_equal 'payload', Open.read(target)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_rsync_dir
|
16
|
+
TmpFile.with_path do |source|
|
17
|
+
TmpFile.with_path do |target|
|
18
|
+
Open.write(source.file, 'payload')
|
19
|
+
Open.rsync(source, target)
|
20
|
+
assert_equal 'payload', Open.read(target.file)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_rsync_excludes
|
26
|
+
TmpFile.with_path do |source|
|
27
|
+
TmpFile.with_path do |target|
|
28
|
+
Open.write(source.file, 'payload')
|
29
|
+
Open.write(source.tmp_dir.tmp_file, 'decoy')
|
30
|
+
Open.rsync(source, target, excludes: 'tmp_dir')
|
31
|
+
assert_equal 'payload', Open.read(target.file)
|
32
|
+
refute Open.exist?(target.tmp_dir.tmp_file)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_rsync_remote
|
38
|
+
TmpFile.with_path do |source|
|
39
|
+
Open.write(source.file, 'payload')
|
40
|
+
cmd = Open.rsync(source, 'remote:target', print: true)
|
41
|
+
assert cmd.end_with?('remote:target/\'')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_sync_alias
|
46
|
+
TmpFile.with_path do |source|
|
47
|
+
TmpFile.with_path do |target|
|
48
|
+
Open.write(source.file, 'payload')
|
49
|
+
Open.sync(source, target)
|
50
|
+
assert_equal 'payload', Open.read(target.file)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
@@ -10,8 +10,8 @@ class TestPathFind < Test::Unit::TestCase
|
|
10
10
|
assert_equal "data/some_file", path._subpath
|
11
11
|
|
12
12
|
path = Path.setup("data", 'scout')
|
13
|
-
assert_equal "", path._toplevel
|
14
|
-
assert_equal
|
13
|
+
assert_equal "data", path._toplevel
|
14
|
+
assert_equal nil, path._subpath
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_find_local
|
@@ -138,5 +138,12 @@ class TestPathFind < Test::Unit::TestCase
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
end
|
141
|
+
|
142
|
+
def test_single
|
143
|
+
file = Path.setup('foo')
|
144
|
+
assert_equal 'foo', file._toplevel
|
145
|
+
assert_equal nil, file._subpath
|
146
|
+
assert_equal '/usr/local/foo/scout/', file.find(:local)
|
147
|
+
end
|
141
148
|
end
|
142
149
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
2
|
+
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
3
|
+
|
4
|
+
require 'scout'
|
5
|
+
class TestResourceSync < Test::Unit::TestCase
|
6
|
+
def test_sync_file
|
7
|
+
TmpFile.with_path do |source|
|
8
|
+
TmpFile.with_path do |target|
|
9
|
+
Open.write(source.file, 'payload')
|
10
|
+
Misc.in_dir target.find do
|
11
|
+
Resource.sync(source.file, :current)
|
12
|
+
end
|
13
|
+
|
14
|
+
assert_equal 'payload', Open.read(target[Resource.identify(source)].file)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_sync_dir
|
20
|
+
TmpFile.with_path do |source|
|
21
|
+
TmpFile.with_path do |target|
|
22
|
+
Open.write(source.file, 'payload')
|
23
|
+
Misc.in_dir target.find do
|
24
|
+
Resource.sync(source, :current)
|
25
|
+
end
|
26
|
+
|
27
|
+
assert_equal 'payload', Open.read(target[Resource.identify(source)].file)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -10,6 +10,11 @@ class TestResourceUtil < Test::Unit::TestCase
|
|
10
10
|
assert_equal 'share/data/somedir/somepath', Scout.identify(path)
|
11
11
|
end
|
12
12
|
|
13
|
+
def test_identify_dir
|
14
|
+
path = Path.setup('share/data/somedir/').find
|
15
|
+
assert_equal 'share/data/somedir', Scout.identify(path)
|
16
|
+
end
|
17
|
+
|
13
18
|
def test_identify_with_subdir
|
14
19
|
m = Module.new
|
15
20
|
m.extend Resource
|
data/test/scout/test_resource.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
|
2
2
|
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
|
3
3
|
|
4
|
+
require 'scout'
|
4
5
|
require 'scout/resource/scout'
|
5
6
|
class TestResourceUnit < Test::Unit::TestCase
|
6
7
|
module TestResource
|
@@ -22,5 +23,6 @@ class TestResourceUnit < Test::Unit::TestCase
|
|
22
23
|
assert_equal 'share/databases/DATABASE/FILE', Resource.identify('/usr/local/share/scout/databases/DATABASE/FILE')
|
23
24
|
assert_equal 'share/databases/DATABASE/FILE', Resource.identify(File.join(ENV["HOME"], '.scout/share/databases/DATABASE/FILE'))
|
24
25
|
assert_equal 'share/databases/DATABASE/FILE', Resource.identify('/usr/local/share/scout/databases/DATABASE/FILE')
|
26
|
+
assert_equal 'share/databases/DATABASE/FILE', Resource.identify('/usr/local/share/scout/databases/DATABASE/FILE/')
|
25
27
|
end
|
26
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout-essentials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-04-
|
10
|
+
date: 2025-04-16 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: shoulda
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- lib/scout/open/lock/lockfile.rb
|
175
175
|
- lib/scout/open/remote.rb
|
176
176
|
- lib/scout/open/stream.rb
|
177
|
+
- lib/scout/open/sync.rb
|
177
178
|
- lib/scout/open/util.rb
|
178
179
|
- lib/scout/path.rb
|
179
180
|
- lib/scout/path/digest.rb
|
@@ -191,6 +192,7 @@ files:
|
|
191
192
|
- lib/scout/resource/produce/rake.rb
|
192
193
|
- lib/scout/resource/scout.rb
|
193
194
|
- lib/scout/resource/software.rb
|
195
|
+
- lib/scout/resource/sync.rb
|
194
196
|
- lib/scout/resource/util.rb
|
195
197
|
- lib/scout/simple_opt.rb
|
196
198
|
- lib/scout/simple_opt/accessor.rb
|
@@ -220,6 +222,7 @@ files:
|
|
220
222
|
- test/scout/open/test_lock.rb
|
221
223
|
- test/scout/open/test_remote.rb
|
222
224
|
- test/scout/open/test_stream.rb
|
225
|
+
- test/scout/open/test_sync.rb
|
223
226
|
- test/scout/open/test_util.rb
|
224
227
|
- test/scout/path/test_digest.rb
|
225
228
|
- test/scout/path/test_find.rb
|
@@ -230,6 +233,7 @@ files:
|
|
230
233
|
- test/scout/resource/test_path.rb
|
231
234
|
- test/scout/resource/test_produce.rb
|
232
235
|
- test/scout/resource/test_software.rb
|
236
|
+
- test/scout/resource/test_sync.rb
|
233
237
|
- test/scout/resource/test_util.rb
|
234
238
|
- test/scout/simple_opt/test_doc.rb
|
235
239
|
- test/scout/simple_opt/test_get.rb
|
@@ -267,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
271
|
- !ruby/object:Gem::Version
|
268
272
|
version: '0'
|
269
273
|
requirements: []
|
270
|
-
rubygems_version: 3.6.
|
274
|
+
rubygems_version: 3.6.6
|
271
275
|
specification_version: 4
|
272
276
|
summary: Scout essential tools
|
273
277
|
test_files: []
|