scout-essentials 1.7.0 → 1.7.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,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddef0a88617b32cc676a5ae3e03630ef0ee05739dfa921065955b19dfd7035fd
4
- data.tar.gz: e0d38a56a2403172c0014c6988a8d01d682b78a73bbd0deb5e0943368456d3f9
3
+ metadata.gz: b525f579cb1dfea91f74e339b0cefcc9713567e0555da3e8943cbf5e05a3a8fa
4
+ data.tar.gz: 75ebc6504a1aa544134f6cd83f472f4cc056d86f093eb96eea450d96e3220603
5
5
  SHA512:
6
- metadata.gz: 0be0e7ac6382006df3a332ee4779391e6d00e8b51dffa8d4e225a921814b139b3601c4706ae738ba1d828ab04f2abdc830f17fb48429acfe21b304f07318e5a0
7
- data.tar.gz: 4b47a4c814ad20f5f8fb81385cdd6ae45d371fae6a8529af244b07da2fb6b7a93fb4654a9c382a96d1b5dbe991c218b848b64872e3253f2b506d617e4a7518ad
6
+ metadata.gz: e21bc777bae26f177ecad2aa4bcee2cd2d4b3b715b9d5fa509def84ed17ab007ff63b1f09734f506242b31d350e47f8600cbcc1a0dd544fd9932331c53572c3f
7
+ data.tar.gz: 3caf9cce8f443aaf892815e9ef0930490956ef53c26800b49dd12175a59ac01c34fd77bc82a492e6e64b17f6acb3e633bd95a4cf4b9ca11575b3851baf8e6169
data/.vimproject CHANGED
@@ -22,6 +22,7 @@ scout-essentials=/$PWD filter="*.rb *.txt *.md *.conf *.yaml" {
22
22
  system.rb
23
23
  math.rb
24
24
  hook.rb
25
+ matching.rb
25
26
  }
26
27
  named_array.rb
27
28
  indiferent_hash.rb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.7.1
@@ -2,7 +2,7 @@ module Misc
2
2
  def self._convert_match_condition(condition)
3
3
  return true if condition == 'true'
4
4
  return false if condition == 'false'
5
- return condition.to_regexp if condition[0] == "/"
5
+ return Regexp.new(condition[1..-2]) if condition[0] == "/"
6
6
  return [:cmp, $1, $2.to_f] if condition =~ /^([<>]=?)(.*)/
7
7
  return [:invert, _convert_match_condition(condition[1..-1].strip)] if condition[0] == "!"
8
8
  #return {$1 => $2.to_f} if condition =~ /^([<>]=?)(.*)/
@@ -13,6 +13,9 @@ module Misc
13
13
  def self.match_value(value, condition)
14
14
  condition = _convert_match_condition(condition.strip) if String === condition
15
15
 
16
+ return true if value.nil? && condition.nil?
17
+ return false if value.nil?
18
+
16
19
  case condition
17
20
  when Regexp
18
21
  !! value.match(condition)
@@ -8,7 +8,7 @@ module Open
8
8
  return Open.ssh(file, options) if Open.ssh?(file)
9
9
  return Open.wget(file, options) if Open.remote?(file)
10
10
 
11
- File.open(file, mode)
11
+ File.open(File.expand_path(file), mode)
12
12
  end
13
13
 
14
14
  def self.file_write(file, content, mode = 'w')
@@ -117,7 +117,7 @@ module Open
117
117
 
118
118
  def self.exists?(file)
119
119
  file = file.find if Path === file
120
- File.exist?(file)
120
+ File.exist?(File.expand_path(file))
121
121
  end
122
122
 
123
123
  def self.ctime(file)
@@ -181,11 +181,14 @@ module Path
181
181
  @toplevel ||= _parts[0]
182
182
  end
183
183
 
184
+ HOME = "~"[0]
184
185
  SLASH = "/"[0]
185
186
  DOT = "."[0]
186
187
  def self.located?(path)
187
188
  # OPEN RESOURCE
188
- path.slice(0,1) == SLASH || (path.slice(0,1) == DOT && path.slice(1,1) == SLASH)
189
+ path.slice(0,1) == SLASH ||
190
+ (path.slice(0,1) == HOME && path.slice(1,1) == SLASH) ||
191
+ (path.slice(0,1) == DOT && path.slice(1,1) == SLASH)
189
192
  end
190
193
 
191
194
  def located?
@@ -237,14 +240,14 @@ module Path
237
240
 
238
241
  def find(where = nil)
239
242
  if located?
240
- if File.exist?(self)
241
- return self if located?
243
+ if File.exist?(File.expand_path(self))
244
+ return self.annotate(File.expand_path(self))
242
245
  else
243
246
  found = Path.exists_file_or_alternatives(self)
244
247
  if found
245
248
  return self.annotate(found)
246
249
  else
247
- return self if located?
250
+ return self
248
251
  end
249
252
  end
250
253
  end
@@ -23,7 +23,7 @@ module Path
23
23
  extension = ''
24
24
  end
25
25
 
26
- post_fix = "--#{filename.length}@#{length}_#{Misc.digest(filename)[0..4]}" + extension
26
+ post_fix = "--#{filename.length}--#{Misc.digest(filename)[0..4]}" + extension
27
27
 
28
28
  filename = filename[0..(length - post_fix.length - 1)] << post_fix
29
29
  else
@@ -97,7 +97,7 @@ module SOPT
97
97
 
98
98
  name = SOPT.input_format(name, type.to_sym, default, shortcut)
99
99
  Misc.format_definition_list_item(name, description)
100
- end * "\n"
100
+ end.compact * "\n"
101
101
  end
102
102
 
103
103
 
@@ -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.7.0 ruby lib
5
+ # stub: scout-essentials 1.7.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "scout-essentials".freeze
9
- s.version = "1.7.0".freeze
9
+ s.version = "1.7.1".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-06-05"
14
+ s.date = "2025-06-12"
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 = [
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.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-06-05 00:00:00.000000000 Z
10
+ date: 2025-06-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: shoulda