tagrity 0.3.0 → 0.3.5

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: c8cf024d8db7d37c89470057cac689c6b8ecb165c0a06f578ae2ff163e7da773
4
- data.tar.gz: d4161a7c9722ae5c378512acf2b56549c44b4f4ec68b358cb031d340be4d0f34
3
+ metadata.gz: 696ef632ed7745a6825834155b3c603ccb6b7758e170f2d34f56d8de3209a98d
4
+ data.tar.gz: 8aa352fc7fa43a6bbcb230e4b5585db9c1feaa9c9c4d128afbabf801f52e6af9
5
5
  SHA512:
6
- metadata.gz: b9a95c25a3efe7427e0a6466d3cecab2a8fb99fc3f897239b69817b75bee1a9bd3ecaadbcc5b8531613fbec0af78ac19d9778fc693d1324a35d4955c19407d44
7
- data.tar.gz: f793bfd50e1a87a7f715c3f1731fb6b803ed155f08eaa4acc26ed92a36c237059afeb27a800da311480978206c085cac691b5014873aaf09f1ea50085790c874
6
+ metadata.gz: 0303a033ec5b38cfcc478da5ddaa489a4d79520de26459a161d08423455a3659704e339c790e8fde4d605073aa2ea8735977a3fdae6053512167044568940151
7
+ data.tar.gz: 390ee08b2d2af110c2e137270c284226ef973acfbf308ae5c40b52d71f055ea48798df09cf002e351b3758b50bbbc4a5e0c63ab76d08d6b789785b69bafcee10
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tagrity (0.2.19)
4
+ tagrity (0.3.5)
5
5
  cli-ui (~> 1.3.0)
6
6
  listen (~> 3.2.1)
7
7
  pry (~> 0.9.9)
data/TODO.md CHANGED
@@ -1,8 +1,5 @@
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
- * Watch local and global config for changes and reload automatically
8
- * Better --fresh for git repos
@@ -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
@@ -35,5 +36,10 @@ module Tagrity
35
36
  def logs
36
37
  Command::Logs::call(options['n'], options['debug'])
37
38
  end
39
+
40
+ desc "revive", "Restart any tagrity processes that died"
41
+ def revive
42
+ Command::Revive::call
43
+ end
38
44
  end
39
45
  end
@@ -0,0 +1,11 @@
1
+ module Tagrity
2
+ module Command
3
+ class Revive
4
+ class << self
5
+ def call
6
+ PidFile.revive_dead_pids
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -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)
@@ -43,7 +43,7 @@ module Tagrity
43
43
  check_git = false
44
44
  end
45
45
  files
46
- .select { |file| !check_git || generate_tags?(file)}
46
+ .select { |file| generate_tags?(file, check_git) }
47
47
  .group_by { |file| @config.command_for_extension(file.split('.').last) }
48
48
  .each do |cmd, fnames|
49
49
  Tempfile.create do |tmpf|
@@ -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.info("{#{cmd}} failed (#{$?.exitstatus}) to generate tags for #{fnames} into #{tagf}")
55
+ @logger.error("{#{cmd}} failed (#{$?.exitstatus}) to generate tags for #{fnames} into #{tagf}")
56
56
  end
57
57
  end
58
58
  end
@@ -76,8 +76,8 @@ module Tagrity
76
76
 
77
77
  private
78
78
 
79
- def generate_tags?(file)
80
- return indexable?(file)
79
+ def generate_tags?(file, check_git)
80
+ return (!check_git || !Helper.file_ignored?(file)) && indexable?(file)
81
81
  end
82
82
 
83
83
  def indexable?(file)
@@ -1,3 +1,3 @@
1
1
  module Tagrity
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.5"
3
3
  end
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.0
4
+ version: 0.3.5
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-28 00:00:00.000000000 Z
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