tagrity 0.3.1 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/TODO.md +1 -3
- data/lib/tagrity/cli.rb +8 -1
- data/lib/tagrity/commands/revive.rb +11 -0
- data/lib/tagrity/commands/stop.rb +4 -4
- data/lib/tagrity/pid_file.rb +14 -0
- data/lib/tagrity/tag_generator.rb +1 -1
- data/lib/tagrity/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f336a964ceb069f321079515fd53727a559cba27bd4847dfb4365ac36801d5e6
|
4
|
+
data.tar.gz: 5b7933793a67a70b24f0dff75a364995250fae7cf7ff370439b302431d356d6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61165ba9fd0cca34745880a57a6c0bbcb2238cff025f4ccf49f4ca1d50744ff755d96d94ed98e31deafe35d7aae9cf5994385d150ba6ed0fd03b720d0910e395
|
7
|
+
data.tar.gz: c6eab58ef68547cb2aab02679c4e3f8fa070a39c9997c0ff3cef8e5a20bdb04ee391d611f4733a6bec47f9a2cbd5649a97443ee1fed0eeb2f95d46ee0aece2d9
|
data/Gemfile.lock
CHANGED
data/TODO.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# TODO
|
2
2
|
|
3
3
|
* Better error handling
|
4
|
-
* Delete old tags before doing --append (similar to ripper-tags funtionality, but do it for all ctags-alikes)
|
5
4
|
* Restart process which were terminated due to a system shutdown
|
6
5
|
* Will have to add `tagrity stop <pid>` instead of forcing users to use `kill <pid>`
|
7
|
-
*
|
8
|
-
* Better --fresh for git repos
|
6
|
+
* Document new changes for revive and stop
|
data/lib/tagrity/cli.rb
CHANGED
@@ -3,6 +3,7 @@ require 'tagrity/commands/start'
|
|
3
3
|
require 'tagrity/commands/stop'
|
4
4
|
require 'tagrity/commands/status'
|
5
5
|
require 'tagrity/commands/logs'
|
6
|
+
require 'tagrity/commands/revive'
|
6
7
|
require 'tagrity/version'
|
7
8
|
|
8
9
|
module Tagrity
|
@@ -20,8 +21,9 @@ module Tagrity
|
|
20
21
|
end
|
21
22
|
|
22
23
|
desc "stop", "Stop watching pwd"
|
24
|
+
option :dir, type: :string, default: Dir.pwd, desc: "directory to stop watching."
|
23
25
|
def stop()
|
24
|
-
Command::Stop::call
|
26
|
+
Command::Stop::call(options['dir'])
|
25
27
|
end
|
26
28
|
|
27
29
|
desc "status", "List running tagrity processes and the directories being watched"
|
@@ -35,5 +37,10 @@ module Tagrity
|
|
35
37
|
def logs
|
36
38
|
Command::Logs::call(options['n'], options['debug'])
|
37
39
|
end
|
40
|
+
|
41
|
+
desc "revive", "Restart any tagrity processes that died"
|
42
|
+
def revive
|
43
|
+
Command::Revive::call
|
44
|
+
end
|
38
45
|
end
|
39
46
|
end
|
@@ -6,16 +6,16 @@ module Tagrity
|
|
6
6
|
module Command
|
7
7
|
class Stop
|
8
8
|
class << self
|
9
|
-
def call
|
10
|
-
dir = Dir.pwd
|
9
|
+
def call(dir)
|
11
10
|
pid_files = PidFile.alive_pid_files(dir: dir)
|
12
11
|
if pid_files.empty?
|
13
12
|
puts ::CLI::UI.fmt "{{red:#{"😕 tagrity doesn't seem to be watching #{dir}"}}}"
|
14
13
|
else
|
15
14
|
pid_files.each do |pid_file|
|
16
15
|
pid_file.delete
|
17
|
-
|
18
|
-
|
16
|
+
msg = "Successfully killed #{pid_file.pid} for dir #{dir}"
|
17
|
+
puts ::CLI::UI.fmt "{{green:#{msg}}}"
|
18
|
+
logger.info(msg)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/lib/tagrity/pid_file.rb
CHANGED
@@ -36,6 +36,20 @@ module Tagrity
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def revive_dead_pids
|
40
|
+
Dir.glob("#{Helper.run_dir}/*").reduce([]) do |pid_files, path|
|
41
|
+
pid = pid_from_path(path)
|
42
|
+
dir = File.read(path)
|
43
|
+
|
44
|
+
if not Helper.alive?(pid)
|
45
|
+
File.delete(path)
|
46
|
+
Dir.chdir(File.realdirpath(dir)) do
|
47
|
+
Process.spawn('tagrity start')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
39
53
|
private
|
40
54
|
|
41
55
|
def same_dirs?(dir1, dir2)
|
@@ -52,7 +52,7 @@ module Tagrity
|
|
52
52
|
if $?.exitstatus == 0
|
53
53
|
@logger.info("{#{cmd}} generated tags for #{fnames} into #{tagf}")
|
54
54
|
else
|
55
|
-
@logger.
|
55
|
+
@logger.error("{#{cmd}} failed (#{$?.exitstatus}) to generate tags for #{fnames} into #{tagf}")
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
data/lib/tagrity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tagrity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam P. Regasz-Rethy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/tagrity.rb
|
149
149
|
- lib/tagrity/cli.rb
|
150
150
|
- lib/tagrity/commands/logs.rb
|
151
|
+
- lib/tagrity/commands/revive.rb
|
151
152
|
- lib/tagrity/commands/start.rb
|
152
153
|
- lib/tagrity/commands/status.rb
|
153
154
|
- lib/tagrity/commands/stop.rb
|