tagrity 0.2.18 → 0.3.3
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/.travis.yml +2 -2
- data/Gemfile.lock +1 -1
- data/README.md +4 -13
- data/TODO.md +5 -0
- data/lib/tagrity/cli.rb +6 -0
- data/lib/tagrity/commands/revive.rb +11 -0
- data/lib/tagrity/commands/start.rb +2 -2
- data/lib/tagrity/pid_file.rb +14 -0
- data/lib/tagrity/tag_generator.rb +26 -16
- data/lib/tagrity/version.rb +1 -1
- data/sample_config.yml +1 -10
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feac80617071ba8f1e51552d8ecf49d3c0464d09f0caf5d58f0fbd983f9a4b61
|
4
|
+
data.tar.gz: 2e1b979a98041aaaf2c9c3929cec40e95735b53dc0a1aaebfe83bf4fb4662d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e1d0a0f06f2f5ed7dca379180466dfe791d03fcbe45451f0960f2050a94e2f36ce5edc0c4fa1d3225cdad545fcbb2b5f170bbb9fb0834eadb5aa90995516a4d
|
7
|
+
data.tar.gz: d9b49c8551382fe60cc9c2a4fde328f6a0140294cf60c257f450afd0581f5057944fc73cc1b70dbf0eb1123eefa21c881b75dbee68dcedc79814d69b2706c63a
|
data/.travis.yml
CHANGED
@@ -3,9 +3,9 @@ sudo: false
|
|
3
3
|
language: ruby
|
4
4
|
cache: bundler
|
5
5
|
rvm:
|
6
|
-
- 2.
|
6
|
+
- 2.7.1
|
7
7
|
before_install:
|
8
|
-
- gem install bundler -v 2.
|
8
|
+
- gem install bundler -v 2.1.4
|
9
9
|
- gem install ripper-tags -v 0.8.1
|
10
10
|
- brew unlink python@2
|
11
11
|
- brew install --HEAD universal-ctags/universal-ctags/universal-ctags
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -32,19 +32,19 @@ tagrity status
|
|
32
32
|
|
33
33
|
## Configuration
|
34
34
|
|
35
|
-
Configuration can be done through use of a
|
35
|
+
Configuration can be done through use of a local `.tagrity_config.yml` file that looks like the following:
|
36
36
|
|
37
|
-
**NOTE:** Tagrity will look for a global config file at `$XDG_CONFIG_HOME/tagrity/tagrity_config.yml` (usually this will be `~/.config/tagrity/tagrity_config.yml`). This
|
37
|
+
**NOTE:** Tagrity will also look for a global config file at `$XDG_CONFIG_HOME/tagrity/tagrity_config.yml` (usually this will be `~/.config/tagrity/tagrity_config.yml`). This will be overriden by a local config file.
|
38
38
|
|
39
39
|
**NOTE:** Tagrity needs to be restarted for configuration changes to take effect.
|
40
40
|
|
41
|
-
[`tagrity_config.yml`](https://github.com/RRethy/tagrity/blob/master/sample_config.yml)
|
41
|
+
[Sample `tagrity_config.yml`](https://github.com/RRethy/tagrity/blob/master/sample_config.yml)
|
42
42
|
|
43
43
|
```yaml
|
44
44
|
# which command to use to generate tags for a specific file extension
|
45
45
|
# overrides default_command
|
46
46
|
# tag generation commands must support --append, -f, -L
|
47
|
-
# NOTE: Exuberant-ctags does NOT satisfy this, instead use Universal-ctags
|
47
|
+
# NOTE: Exuberant-ctags does NOT satisfy this requirement, instead use Universal-ctags
|
48
48
|
#
|
49
49
|
# Default: empty
|
50
50
|
extension_commands:
|
@@ -75,15 +75,6 @@ extensions_whitelist: [rb, c, h, js]
|
|
75
75
|
# Default: []
|
76
76
|
extensions_blacklist: [erb, html, txt]
|
77
77
|
|
78
|
-
# how to integrate with git
|
79
|
-
# git_strategy: TRACKED | IGNORED | NA
|
80
|
-
# TRACKED: only index files tracked by git
|
81
|
-
# IGNORED: only index files which are not ignored by git
|
82
|
-
# NA: don't use git, index all files under pwd
|
83
|
-
#
|
84
|
-
# Default: NA
|
85
|
-
git_strategy: IGNORED
|
86
|
-
|
87
78
|
# which paths (relative to pwd) to ignore
|
88
79
|
# It's usually better to avoid this since tagrity integrates with git by
|
89
80
|
# default using the strategy specified by git_strategy
|
data/TODO.md
ADDED
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
|
@@ -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
|
@@ -34,11 +34,11 @@ module Tagrity
|
|
34
34
|
) do |modified, added, removed|
|
35
35
|
unless modified.empty?
|
36
36
|
logger.info("modified absolute path: #{modified}")
|
37
|
-
tag_generator.generate(modified)
|
37
|
+
tag_generator.generate(modified, true)
|
38
38
|
end
|
39
39
|
unless added.empty?
|
40
40
|
logger.info("added absolute path: #{added}")
|
41
|
-
tag_generator.generate(added)
|
41
|
+
tag_generator.generate(added, true)
|
42
42
|
end
|
43
43
|
unless removed.empty?
|
44
44
|
logger.info("removed absolute path: #{removed}")
|
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)
|
@@ -14,26 +14,36 @@ module Tagrity
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def generate_all
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
files = []
|
18
|
+
if Helper.git_dir?
|
19
|
+
untracked_files = `git ls-files --others --exclude-standard 2> /dev/null`.split("\n")
|
20
|
+
if $?.exitstatus != 0
|
21
|
+
@logger.error("Failed to get a listing of all untracked files under pwd for use with --fresh.")
|
22
|
+
untracked_files = []
|
23
|
+
end
|
24
|
+
tracked_files = `git ls-files 2> /dev/null`.split("\n")
|
25
|
+
if $?.exitstatus != 0
|
26
|
+
@logger.error("Failed to get a listing of all tracked files under pwd for use with --fresh.")
|
27
|
+
tracked_files = []
|
28
|
+
end
|
29
|
+
files = tracked_files.concat untracked_files
|
22
30
|
else
|
23
|
-
|
31
|
+
files = `find * -type f 2> /dev/null`.split("\n")
|
24
32
|
end
|
25
|
-
files
|
26
|
-
|
27
|
-
generate(files)
|
28
|
-
else
|
29
|
-
@logger.error("Failed to get a listing of all files under pwd for use with --fresh. Used #{cmd}.")
|
33
|
+
if not files.empty? and File.exists?(tagf)
|
34
|
+
File.delete(tagf)
|
30
35
|
end
|
36
|
+
|
37
|
+
generate(files, false)
|
31
38
|
end
|
32
39
|
|
33
|
-
def generate(files)
|
40
|
+
def generate(files, check_git)
|
34
41
|
return if files.empty?
|
42
|
+
if not Helper.git_dir?
|
43
|
+
check_git = false
|
44
|
+
end
|
35
45
|
files
|
36
|
-
.select { |file| generate_tags?(file)}
|
46
|
+
.select { |file| generate_tags?(file, check_git) }
|
37
47
|
.group_by { |file| @config.command_for_extension(file.split('.').last) }
|
38
48
|
.each do |cmd, fnames|
|
39
49
|
Tempfile.create do |tmpf|
|
@@ -42,7 +52,7 @@ module Tagrity
|
|
42
52
|
if $?.exitstatus == 0
|
43
53
|
@logger.info("{#{cmd}} generated tags for #{fnames} into #{tagf}")
|
44
54
|
else
|
45
|
-
@logger.
|
55
|
+
@logger.error("{#{cmd}} failed (#{$?.exitstatus}) to generate tags for #{fnames} into #{tagf}")
|
46
56
|
end
|
47
57
|
end
|
48
58
|
end
|
@@ -66,8 +76,8 @@ module Tagrity
|
|
66
76
|
|
67
77
|
private
|
68
78
|
|
69
|
-
def generate_tags?(file)
|
70
|
-
|
79
|
+
def generate_tags?(file, check_git)
|
80
|
+
return (!check_git || !Helper.file_ignored?(file)) && indexable?(file)
|
71
81
|
end
|
72
82
|
|
73
83
|
def indexable?(file)
|
data/lib/tagrity/version.rb
CHANGED
data/sample_config.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# which command to use to generate tags for a specific file extension
|
2
2
|
# overrides default_command
|
3
3
|
# tag generation commands must support --append, -f, -L
|
4
|
-
# NOTE: Exuberant-ctags does NOT satisfy this, instead use Universal-ctags
|
4
|
+
# NOTE: Exuberant-ctags does NOT satisfy this requirement, instead use Universal-ctags
|
5
5
|
#
|
6
6
|
# Default: empty
|
7
7
|
extension_commands:
|
@@ -32,15 +32,6 @@ extensions_whitelist: [rb, c, h, js]
|
|
32
32
|
# Default: []
|
33
33
|
extensions_blacklist: [erb, html, txt]
|
34
34
|
|
35
|
-
# how to integrate with git
|
36
|
-
# git_strategy: TRACKED | IGNORED | NA
|
37
|
-
# TRACKED: only index files tracked by git
|
38
|
-
# IGNORED: only index files which are not ignored by git
|
39
|
-
# NA: don't use git, index all files under pwd
|
40
|
-
#
|
41
|
-
# Default: NA
|
42
|
-
git_strategy: IGNORED
|
43
|
-
|
44
35
|
# which paths (relative to pwd) to ignore
|
45
36
|
# It's usually better to avoid this since tagrity integrates with git by
|
46
37
|
# default using the strategy specified by git_strategy
|
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.
|
4
|
+
version: 0.3.3
|
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-
|
11
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -141,12 +141,14 @@ files:
|
|
141
141
|
- LICENSE.txt
|
142
142
|
- README.md
|
143
143
|
- Rakefile
|
144
|
+
- TODO.md
|
144
145
|
- bin/console
|
145
146
|
- bin/setup
|
146
147
|
- exe/tagrity
|
147
148
|
- lib/tagrity.rb
|
148
149
|
- lib/tagrity/cli.rb
|
149
150
|
- lib/tagrity/commands/logs.rb
|
151
|
+
- lib/tagrity/commands/revive.rb
|
150
152
|
- lib/tagrity/commands/start.rb
|
151
153
|
- lib/tagrity/commands/status.rb
|
152
154
|
- lib/tagrity/commands/stop.rb
|