StrIdx 0.1.6 → 0.1.7

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/exe/stridx.rb +2 -4
  3. data/server.rb +5 -6
  4. data/stridx.gemspec +1 -1
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e79f1bebc1e56e0a1966ae5ff69b50e4048953dd338807a6c9dba1c53b1c8f34
4
- data.tar.gz: 28eea5841ce96f9460975720a43a2655f4902a9c44458a8aae01ce0b3077e67d
3
+ metadata.gz: 4d5ef6484e911e5eea742e95575fca38e86e0ff4c819e937ba7a4d9bb8457b38
4
+ data.tar.gz: fd9e7d3d3c758840ed8fd8681c67a7993ad2ac1f20e20cd9795dab4e2ddce965
5
5
  SHA512:
6
- metadata.gz: e82430abd644e876dd758ceaffb3f759e19fde2a44cc85872f01721943c42d85d2032cbde91d235d44b7921833ed044241692247c88b56f54c6ea7248f5e584e
7
- data.tar.gz: 642e16d0e6291474b007e0341bf6571576299f353bf1f5ff13a5c9966d9b1b2450de052f3ebad6f44c9ab9b341686dd41b4adf35922406e3df358c8cbabc9c31
6
+ metadata.gz: 26c852b1bfbe04de48a3872c54a8d02eb94ed9da9644d45ba5606df7c73f59cad3b7a64dd151c3ac7aae5f8bd06f9d1953c2529edbe5588d78c46a2808d2fd44
7
+ data.tar.gz: 01d6e6c07ea359a89a60d7c438275b313cb7c04061a5e46d85f784d35016c1259aa139f0510da1f5dd62f6046aa9baf72c1b350ec15c2f25928ded60672bef62
data/exe/stridx.rb CHANGED
@@ -8,7 +8,8 @@ CUR_FILE = File.basename(__FILE__)
8
8
  PID_FILE = File.expand_path("~/.config/stridx/index.pid")
9
9
  LOCK_FILE = File.expand_path("~/.config/stridx/index.lock")
10
10
 
11
-
11
+ pid_dir_path = File.expand_path("~/.config/stridx/")
12
+ FileUtils.mkdir_p(pid_dir_path)
12
13
 
13
14
  # To prevent against race condition when two process started at the same time
14
15
  def obtain_lock_or_exit
@@ -91,9 +92,6 @@ def start(daemonize: false)
91
92
  File.delete(PID_FILE) if File.exist?(PID_FILE)
92
93
  exit
93
94
  end
94
-
95
- pid_dir_path = File.expand_path("~/.config/stridx/")
96
- FileUtils.mkdir_p(pid_dir_path)
97
95
  end
98
96
 
99
97
  StrIdx::Server.start ARGV
data/server.rb CHANGED
@@ -77,22 +77,21 @@ module StrIdx
77
77
 
78
78
  # Read data from the client
79
79
  data = client.recv(1024)
80
-
81
- if data.match(/^stop$/)
80
+ if data.nil?
81
+ # puts "GOT NIL"
82
+ elsif data.match(/^stop$/)
82
83
  puts "Got stop signal. Shutting down server."
83
84
  client.close
84
85
  break
85
- end
86
-
87
86
  # puts "Received from client: #{data}"
88
- if data.match(/^find:(.*)/)
87
+ elsif data.match(/^find:(.*)/)
89
88
  query = Regexp.last_match(1)
90
89
  # TODO: not sure which is best as default:
91
90
  # res = idx.find(query)
92
91
  # res = idx.findDirs(query)
93
92
  res = idx.findFilesAndDirs(query)
94
93
  # response = res.collect { |x| flist[x[0]] }.join("\n")
95
- response = res.collect { |x| "/"+x[0] }.join("\n")
94
+ response = res.collect { |x| "/" + x[0] }.join("\n")
96
95
 
97
96
  # Send a response back to the client
98
97
  client.puts response
data/stridx.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "StrIdx"
3
- spec.version = "0.1.6"
3
+ spec.version = "0.1.7"
4
4
  spec.authors = ["Sami Sieranoja"]
5
5
  spec.email = ["sami.sieranoja@gmail.com"]
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: StrIdx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sami Sieranoja
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-11 00:00:00.000000000 Z
11
+ date: 2025-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubygems_version: 3.4.20
181
+ rubygems_version: 3.5.22
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: StrIdx