scout-essentials 1.6.9 → 1.6.10
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/VERSION +1 -1
- data/lib/scout/open/final.rb +52 -0
- data/lib/scout/open/util.rb +0 -51
- data/lib/scout/resource/util.rb +3 -3
- data/scout-essentials.gemspec +3 -3
- data/test/scout/resource/test_util.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0744ff3212ce233d71a90debd83ef37b8bbe6e7b59e1e96fc5a11410a2cdd9f7
|
4
|
+
data.tar.gz: 2a6dcc56bb12d626bb83b04adf4c4a333cb75affa5b7bd82dcd52232c7c9aec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bffec594af7e3b20eba03d717eb3ca2a1efdf4f3e51d3e4fd581aecf0b343a6f6e792e4faaf33b93a3087327d36b4bacbed5264e2c816545ceb936ca0dfb2f71
|
7
|
+
data.tar.gz: decc1173a098ffa0c459ebee50efb3b8a37c222d43fa669f6df82b34d04c2a773dc91a72c1d446320df015343ed8cef9cc548f65fa265289234fcc8ee7d0ecac
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.10
|
data/lib/scout/open/final.rb
CHANGED
@@ -140,4 +140,56 @@ module Open
|
|
140
140
|
nil
|
141
141
|
end
|
142
142
|
end
|
143
|
+
|
144
|
+
def self.ln_s(source, target, options = {})
|
145
|
+
source = source.find if Path === source
|
146
|
+
target = target.find if Path === target
|
147
|
+
|
148
|
+
target = File.join(target, File.basename(source)) if File.directory? target
|
149
|
+
FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
|
150
|
+
FileUtils.rm target if File.exist?(target)
|
151
|
+
FileUtils.rm target if File.symlink?(target)
|
152
|
+
FileUtils.ln_s source, target
|
153
|
+
end
|
154
|
+
|
155
|
+
def self.ln(source, target, options = {})
|
156
|
+
source = source.find if Path === source
|
157
|
+
target = target.find if Path === target
|
158
|
+
source = File.realpath(source) if File.symlink?(source)
|
159
|
+
|
160
|
+
FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
|
161
|
+
FileUtils.rm target if File.exist?(target)
|
162
|
+
FileUtils.rm target if File.symlink?(target)
|
163
|
+
FileUtils.ln source, target
|
164
|
+
end
|
165
|
+
|
166
|
+
def self.ln_h(source, target, options = {})
|
167
|
+
source = source.find if Path === source
|
168
|
+
target = target.find if Path === target
|
169
|
+
|
170
|
+
FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
|
171
|
+
FileUtils.rm target if File.exist?(target)
|
172
|
+
begin
|
173
|
+
CMD.cmd("ln -L '#{ source }' '#{ target }'")
|
174
|
+
rescue ProcessFailed
|
175
|
+
Log.debug "Could not hard link #{source} and #{target}: #{$!.message.gsub("\n", '. ')}"
|
176
|
+
CMD.cmd("cp -L '#{ source }' '#{ target }'")
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def self.link(source, target, options = {})
|
181
|
+
begin
|
182
|
+
Open.ln(source, target, options)
|
183
|
+
rescue
|
184
|
+
Log.debug "Could not make regular link, trying symbolic: #{Misc.fingerprint(source)} -> #{Misc.fingerprint(target)}"
|
185
|
+
Open.ln_s(source, target, options)
|
186
|
+
end
|
187
|
+
nil
|
188
|
+
end
|
189
|
+
|
190
|
+
def self.link_dir(source, target)
|
191
|
+
Log.debug "Copy with hard-links #{Log.fingerprint source}->#{Log.fingerprint target}"
|
192
|
+
FileUtils.cp_lr(source, target)
|
193
|
+
end
|
194
|
+
|
143
195
|
end
|
data/lib/scout/open/util.rb
CHANGED
@@ -125,57 +125,6 @@ module Open
|
|
125
125
|
Pathname.new(File.expand_path(file)).realpath.to_s
|
126
126
|
end
|
127
127
|
|
128
|
-
def self.ln_s(source, target, options = {})
|
129
|
-
source = source.find if Path === source
|
130
|
-
target = target.find if Path === target
|
131
|
-
|
132
|
-
target = File.join(target, File.basename(source)) if File.directory? target
|
133
|
-
FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
|
134
|
-
FileUtils.rm target if File.exist?(target)
|
135
|
-
FileUtils.rm target if File.symlink?(target)
|
136
|
-
FileUtils.ln_s source, target
|
137
|
-
end
|
138
|
-
|
139
|
-
def self.ln(source, target, options = {})
|
140
|
-
source = source.find if Path === source
|
141
|
-
target = target.find if Path === target
|
142
|
-
source = File.realpath(source) if File.symlink?(source)
|
143
|
-
|
144
|
-
FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
|
145
|
-
FileUtils.rm target if File.exist?(target)
|
146
|
-
FileUtils.rm target if File.symlink?(target)
|
147
|
-
FileUtils.ln source, target
|
148
|
-
end
|
149
|
-
|
150
|
-
def self.ln_h(source, target, options = {})
|
151
|
-
source = source.find if Path === source
|
152
|
-
target = target.find if Path === target
|
153
|
-
|
154
|
-
FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
|
155
|
-
FileUtils.rm target if File.exist?(target)
|
156
|
-
begin
|
157
|
-
CMD.cmd("ln -L '#{ source }' '#{ target }'")
|
158
|
-
rescue ProcessFailed
|
159
|
-
Log.debug "Could not hard link #{source} and #{target}: #{$!.message.gsub("\n", '. ')}"
|
160
|
-
CMD.cmd("cp -L '#{ source }' '#{ target }'")
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
def self.link(source, target, options = {})
|
165
|
-
begin
|
166
|
-
Open.ln(source, target, options)
|
167
|
-
rescue
|
168
|
-
Log.debug "Could not make regular link, trying symbolic: #{Misc.fingerprint(source)} -> #{Misc.fingerprint(target)}"
|
169
|
-
Open.ln_s(source, target, options)
|
170
|
-
end
|
171
|
-
nil
|
172
|
-
end
|
173
|
-
|
174
|
-
def self.link_dir(source, target)
|
175
|
-
Log.debug "Copy with hard-links #{Log.fingerprint source}->#{Log.fingerprint target}"
|
176
|
-
FileUtils.cp_lr(source, target)
|
177
|
-
end
|
178
|
-
|
179
128
|
def self.list(file)
|
180
129
|
file = file.produce_and_find if Path === file
|
181
130
|
Open.read(file).split("\n")
|
data/lib/scout/resource/util.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Resource
|
2
2
|
def identify(path)
|
3
|
-
return path unless path.
|
3
|
+
return path unless path.located?
|
4
4
|
path_maps = path.path_maps if Path === path
|
5
5
|
path_maps ||= self.path_maps || Path.path_maps
|
6
|
-
path = File.expand_path(path)
|
6
|
+
path = File.expand_path(path) if path.start_with?("/")
|
7
7
|
path += "/" if File.directory?(path)
|
8
8
|
|
9
9
|
map_order ||= (path_maps.keys & Path.basic_map_order) + (path_maps.keys - Path.basic_map_order)
|
@@ -30,7 +30,7 @@ module Resource
|
|
30
30
|
m.named_captures.include?(c) ? m[c] : nil
|
31
31
|
}.compact * "/"
|
32
32
|
|
33
|
-
unlocated.gsub!(/\/+/,'/')
|
33
|
+
#unlocated.gsub!(/\/+/,'/')
|
34
34
|
|
35
35
|
if self.subdir && ! self.subdir.empty?
|
36
36
|
subdir = self.subdir
|
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.10 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.10".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-
|
14
|
+
s.date = "2025-04-08"
|
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 = [
|
@@ -35,5 +35,14 @@ class TestResourceUtil < Test::Unit::TestCase
|
|
35
35
|
assert_equal path2, Resource.relocate(path1)
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
def ___test_s3
|
40
|
+
require 'scout-camp'
|
41
|
+
require 'scout/aws/s3'
|
42
|
+
p = Path.setup("s3://bucket/var/jobs/workflow/task/job.txt")
|
43
|
+
p.path_maps = {:bucket => 's3://bucket/{TOPLEVEL}/{SUBPATH}'}
|
44
|
+
|
45
|
+
assert_equal 'var/jobs/workflow/task/job.txt', Resource.identify(p)
|
46
|
+
end
|
38
47
|
end
|
39
48
|
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: shoulda
|