tagrity 0.2.19 → 0.3.0
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 +8 -0
- data/lib/tagrity/commands/start.rb +2 -2
- data/lib/tagrity/tag_generator.rb +24 -14
- data/lib/tagrity/version.rb +1 -1
- data/sample_config.yml +1 -10
- 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: c8cf024d8db7d37c89470057cac689c6b8ecb165c0a06f578ae2ff163e7da773
|
4
|
+
data.tar.gz: d4161a7c9722ae5c378512acf2b56549c44b4f4ec68b358cb031d340be4d0f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a95c25a3efe7427e0a6466d3cecab2a8fb99fc3f897239b69817b75bee1a9bd3ecaadbcc5b8531613fbec0af78ac19d9778fc693d1324a35d4955c19407d44
|
7
|
+
data.tar.gz: f793bfd50e1a87a7f715c3f1731fb6b803ed155f08eaa4acc26ed92a36c237059afeb27a800da311480978206c085cac691b5014873aaf09f1ea50085790c874
|
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
@@ -0,0 +1,8 @@
|
|
1
|
+
# TODO
|
2
|
+
|
3
|
+
* Better error handling
|
4
|
+
* Delete old tags before doing --append (similar to ripper-tags funtionality, but do it for all ctags-alikes)
|
5
|
+
* Restart process which were terminated due to a system shutdown
|
6
|
+
* 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
|
@@ -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}")
|
@@ -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| !check_git || generate_tags?(file)}
|
37
47
|
.group_by { |file| @config.command_for_extension(file.split('.').last) }
|
38
48
|
.each do |cmd, fnames|
|
39
49
|
Tempfile.create do |tmpf|
|
@@ -67,7 +77,7 @@ module Tagrity
|
|
67
77
|
private
|
68
78
|
|
69
79
|
def generate_tags?(file)
|
70
|
-
|
80
|
+
return 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.0
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -141,6 +141,7 @@ 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
|