tagrity 0.1.7 → 0.1.8
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/Gemfile.lock +1 -1
- data/lib/tagrity/cli.rb +5 -43
- data/lib/tagrity/commands/start.rb +26 -11
- data/lib/tagrity/commands/stop.rb +5 -1
- data/lib/tagrity/config_file.rb +86 -62
- data/lib/tagrity/helper.rb +9 -8
- data/lib/tagrity/provider.rb +0 -7
- data/lib/tagrity/tag_generator.rb +24 -11
- data/lib/tagrity/tlogger.rb +30 -0
- data/lib/tagrity/version.rb +1 -1
- data/sample_config.yml +27 -17
- metadata +4 -5
- data/.byebug_history +0 -4
- data/lib/tagrity/file_callbacks.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a5d0a4c40bcbeae4ad0312f0336030675f804a28a8a171d1963254c46efcc6a
|
4
|
+
data.tar.gz: f42987fb3804c6159d032653e04c9310ce22c3b6b369e61e196c69adc0d196e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4287ece1c8614b48c799ba21cbb694a38989433f4b96c7e57afb498ea066792a4831f10a701279b4599315c95ca62e69b373797b922cbeca4b1bc321388f3592
|
7
|
+
data.tar.gz: 58f1ee384271f30b5ebc5693fc6de8a9ae8dda286a9e39f03f28940478fb4a1eab9efe74171a73e92993107b22437e1e3a6ba03050b4e9d8280630f4216f0943
|
data/Gemfile.lock
CHANGED
data/lib/tagrity/cli.rb
CHANGED
@@ -5,59 +5,21 @@ require 'tagrity/commands/status'
|
|
5
5
|
|
6
6
|
module Tagrity
|
7
7
|
class CLI < Thor
|
8
|
-
desc "start", "Start watching
|
9
|
-
option :
|
10
|
-
option :tagf, desc: "filename (relative) to generate tags into (default: 'tags')."
|
11
|
-
option :fg, type: :boolean, desc: "keep the tagrity process running in the foreground"
|
8
|
+
desc "start", "Start watching pwd"
|
9
|
+
option :fg, type: :boolean, default: false, desc: "keep the tagrity process running in the foreground"
|
12
10
|
option :fresh, type: :boolean, default: false, desc: "index the whole codebase before watching the file system. This will be slow if the codebase is large."
|
13
|
-
option :git, type: :boolean, default: true, desc: "only index files which are being tracked by git"
|
14
|
-
option :configfile, desc: "See README for more info."
|
15
|
-
option :ext_cmds, type: :hash, desc: "which <command> to use to generate tags based on the file extension. <command> must support -f and --append"
|
16
|
-
option :default_cmd, desc: "the default <command> to be used to generate tags (default: 'ctags'). <command> must support -f and --append"
|
17
|
-
option :excluded_exts, type: :array, desc: "which file extensions to not generate tags for."
|
18
|
-
option :excluded_paths, type: :array, desc: "which paths to ignore. Usually better to ignore this since by default only file tracked by git are indexed."
|
19
11
|
def start()
|
20
|
-
|
21
|
-
Command::Start::call(dir, fg?, fresh?)
|
12
|
+
Command::Start::call(options['fg'], options['fresh'])
|
22
13
|
end
|
23
14
|
|
24
|
-
desc "stop", "Stop watching
|
25
|
-
option :dir
|
15
|
+
desc "stop", "Stop watching pwd"
|
26
16
|
def stop()
|
27
|
-
Command::Stop::call
|
17
|
+
Command::Stop::call
|
28
18
|
end
|
29
19
|
|
30
20
|
desc "status", "List running tagrity processes and the directories being watched"
|
31
21
|
def status
|
32
22
|
Command::Status::call
|
33
23
|
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def dir
|
38
|
-
dir = options[:dir] || Dir.pwd
|
39
|
-
raise Errno::ENOENT, "No such directory - #{dir}" unless Dir.exists?(dir)
|
40
|
-
dir
|
41
|
-
end
|
42
|
-
|
43
|
-
def fg?
|
44
|
-
options[:fg]
|
45
|
-
end
|
46
|
-
|
47
|
-
def fresh?
|
48
|
-
options[:fresh]
|
49
|
-
end
|
50
|
-
|
51
|
-
def setup_config
|
52
|
-
ConfigFile.instance.init(
|
53
|
-
configfile: options[:configfile],
|
54
|
-
default_cmd: options[:default_cmd],
|
55
|
-
tagf: options[:tagf],
|
56
|
-
ext_cmds: options[:ext_cmds],
|
57
|
-
excluded_exts: options[:excluded_exts],
|
58
|
-
excluded_paths: options[:excluded_paths],
|
59
|
-
git: options[:git]
|
60
|
-
)
|
61
|
-
end
|
62
24
|
end
|
63
25
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'listen'
|
2
2
|
require 'tagrity/pid_file'
|
3
3
|
require 'tagrity/helper'
|
4
|
-
require 'tagrity/file_callbacks'
|
5
4
|
require 'tagrity/provider'
|
5
|
+
require 'tagrity/tlogger'
|
6
6
|
|
7
7
|
module Tagrity
|
8
8
|
module Command
|
@@ -10,32 +10,43 @@ module Tagrity
|
|
10
10
|
class ErrorProcessAlreadyRunning < StandardError; end
|
11
11
|
|
12
12
|
class << self
|
13
|
-
def call(
|
13
|
+
def call(fg, fresh)
|
14
|
+
dir = Dir.pwd
|
14
15
|
assert_not_running(dir)
|
15
16
|
|
16
17
|
Process.daemon(nochdir: true) unless fg
|
17
18
|
|
18
|
-
|
19
|
+
tag_generator = Provider.provide(:tag_generator)
|
19
20
|
PidFile.write(PidFile.new(dir, Process.pid))
|
20
21
|
|
21
|
-
|
22
|
+
logger.fg = fg
|
23
|
+
logger.info("Watching #{dir} with process pid #{Process.pid}")
|
24
|
+
|
25
|
+
tag_generator.generate_all if fresh
|
22
26
|
|
23
27
|
listener = Listen.to(
|
24
28
|
dir,
|
25
29
|
relative: true,
|
26
30
|
) do |modified, added, removed|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
unless modified.empty?
|
32
|
+
logger.info("modified absolute path: #{modified}")
|
33
|
+
tag_generator.generate(modified)
|
34
|
+
end
|
35
|
+
unless added.empty?
|
36
|
+
logger.info("added absolute path: #{added}")
|
37
|
+
tag_generator.generate(added)
|
38
|
+
end
|
39
|
+
unless removed.empty?
|
40
|
+
logger.info("removed absolute path: #{removed}")
|
41
|
+
tag_generator.delete_files_tags(removed)
|
42
|
+
end
|
33
43
|
end
|
34
44
|
listener.start
|
35
45
|
sleep
|
36
46
|
rescue ErrorProcessAlreadyRunning => e
|
37
|
-
|
47
|
+
logger.error(e.message)
|
38
48
|
rescue Interrupt => e
|
49
|
+
logger.info("Process interrupted. Killing #{Process.pid}")
|
39
50
|
PidFile.delete(dir)
|
40
51
|
end
|
41
52
|
|
@@ -48,6 +59,10 @@ module Tagrity
|
|
48
59
|
raise ErrorProcessAlreadyRunning, "Error: tagrity is already watching #{dir} with process #{pids}"
|
49
60
|
end
|
50
61
|
end
|
62
|
+
|
63
|
+
def logger
|
64
|
+
@logger ||= Tlogger.instance
|
65
|
+
end
|
51
66
|
end
|
52
67
|
end
|
53
68
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
+
require 'tagrity/tlogger'
|
2
|
+
|
1
3
|
module Tagrity
|
2
4
|
module Command
|
3
5
|
class Stop
|
4
6
|
class << self
|
5
|
-
def call
|
7
|
+
def call
|
8
|
+
dir = Dir.pwd
|
6
9
|
pid_files = PidFile.alive_pid_files(dir: dir)
|
7
10
|
if pid_files.empty?
|
8
11
|
puts "😕 tagrity doesn't seem to be watching #{dir}"
|
@@ -10,6 +13,7 @@ module Tagrity
|
|
10
13
|
pid_files.each do |pid_file|
|
11
14
|
pid_file.delete
|
12
15
|
puts "Successfully killed #{pid_file.pid}"
|
16
|
+
Tlogger.instance.info("Successfully killed #{pid_file.pid}")
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
data/lib/tagrity/config_file.rb
CHANGED
@@ -7,105 +7,129 @@ module Tagrity
|
|
7
7
|
include Singleton
|
8
8
|
|
9
9
|
class ErrorTagFileNotWritable < StandardError; end
|
10
|
-
class ErrorGitNotExecutable < StandardError; end
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
11
|
+
CONFIG_FNAME = 'tagrity_config.yml'
|
12
|
+
LOCAL_CONFIG_PATH = File.expand_path("./.#{CONFIG_FNAME}")
|
13
|
+
GLOBAL_CONFIG_PATH = File.expand_path("#{ENV['XDG_CONFIG_HOME'] || "#{ENV['HOME']}/.config"}/tagrity/#{CONFIG_FNAME}")
|
14
|
+
|
15
|
+
def init
|
16
|
+
ensure_extension_commands
|
17
|
+
ensure_default_command
|
18
|
+
ensure_tagf
|
19
|
+
ensure_extensions_whitelist
|
20
|
+
ensure_extensions_blacklist
|
21
|
+
ensure_git_strategy
|
22
|
+
ensure_excluded_paths
|
23
|
+
end
|
24
|
+
|
25
|
+
def command_for_extension(extension)
|
26
|
+
cmd = extension_commands[extension]
|
27
|
+
if cmd.nil?
|
28
|
+
default_command
|
29
|
+
else
|
30
|
+
cmd
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def ignore_extension?(extension)
|
35
|
+
unless extensions_whitelist.empty?
|
36
|
+
return !extensions_whitelist.include?(extension)
|
37
|
+
end
|
38
|
+
|
39
|
+
extensions_blacklist.include?(extension)
|
29
40
|
end
|
30
41
|
|
31
|
-
def
|
32
|
-
|
33
|
-
return @config['default_cmd'] if ft_cmd.nil? || !Helper.is_executable?(ft_cmd)
|
34
|
-
ft_cmd
|
42
|
+
def path_ignored?(path)
|
43
|
+
excluded_paths.any? { |pat| /#{pat}/ =~ path }
|
35
44
|
end
|
36
45
|
|
37
|
-
def
|
38
|
-
|
46
|
+
def respect_git?
|
47
|
+
git_strategy != 'NA'
|
39
48
|
end
|
40
49
|
|
41
|
-
def
|
42
|
-
|
50
|
+
def extension_commands
|
51
|
+
config['extension_commands']
|
52
|
+
end
|
53
|
+
|
54
|
+
def default_command
|
55
|
+
config['default_command']
|
43
56
|
end
|
44
57
|
|
45
58
|
def tagf
|
46
|
-
|
59
|
+
config['tagf']
|
47
60
|
end
|
48
61
|
|
49
|
-
def
|
50
|
-
|
62
|
+
def extensions_whitelist
|
63
|
+
config['extensions_whitelist']
|
64
|
+
end
|
65
|
+
|
66
|
+
def extensions_blacklist
|
67
|
+
config['extensions_blacklist']
|
68
|
+
end
|
69
|
+
|
70
|
+
def git_strategy
|
71
|
+
config['git_strategy']
|
72
|
+
end
|
73
|
+
|
74
|
+
def excluded_paths
|
75
|
+
config['excluded_paths']
|
51
76
|
end
|
52
77
|
|
53
78
|
def to_s
|
54
|
-
|
79
|
+
config.to_s
|
55
80
|
end
|
56
81
|
|
57
82
|
private
|
58
83
|
|
59
|
-
def
|
60
|
-
|
84
|
+
def ensure_extension_commands
|
85
|
+
ensure_option('extension_commands', {})
|
61
86
|
end
|
62
87
|
|
63
|
-
def
|
64
|
-
|
88
|
+
def ensure_default_command
|
89
|
+
ensure_option('default_command', 'ctags')
|
65
90
|
end
|
66
91
|
|
67
|
-
def
|
68
|
-
|
92
|
+
def ensure_tagf
|
93
|
+
ensure_option('tagf', 'tags')
|
94
|
+
if File.exists?(tagf) && !File.writable?(tagf)
|
95
|
+
raise ErrorTagFileNotWritable, "#{tagf} must be writable to be used as the tag file."
|
96
|
+
end
|
69
97
|
end
|
70
98
|
|
71
|
-
def
|
72
|
-
|
99
|
+
def ensure_extensions_whitelist
|
100
|
+
ensure_option('whitelist_extensions', [])
|
73
101
|
end
|
74
102
|
|
75
|
-
def
|
76
|
-
|
77
|
-
if File.exists?(@config['tagf']) && !File.writable?(@config['tagf'])
|
78
|
-
raise ErrorTagFileNotWritable, "#{@config['tagf']} must be writable to be used as the tag file."
|
79
|
-
end
|
103
|
+
def ensure_extensions_blacklist
|
104
|
+
ensure_option('blacklist_extensions', [])
|
80
105
|
end
|
81
106
|
|
82
|
-
def
|
83
|
-
|
84
|
-
if @config['git'] && !Helper.is_executable?('git')
|
85
|
-
raise ErrorGitNotExecutable, "'git' must be executable to use the --git option."
|
86
|
-
end
|
107
|
+
def ensure_git_strategy
|
108
|
+
ensure_option('git_strategy', 'TRACKED')
|
87
109
|
end
|
88
110
|
|
89
|
-
def
|
90
|
-
|
91
|
-
@config[key] = local_val
|
92
|
-
end
|
93
|
-
return if @config.key?(key) && !@config[key].nil? && @config[key].is_a?(default.class)
|
94
|
-
@config[key] = default
|
111
|
+
def ensure_excluded_paths
|
112
|
+
ensure_option('extension_commands', [])
|
95
113
|
end
|
96
114
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
100
|
-
|
115
|
+
def ensure_option(name, default)
|
116
|
+
if config[name].nil? || !config[name].is_a?(default.class)
|
117
|
+
config[name] = default
|
118
|
+
end
|
101
119
|
end
|
102
120
|
|
103
|
-
def
|
104
|
-
|
121
|
+
def config
|
122
|
+
@config ||= read_config
|
105
123
|
end
|
106
124
|
|
107
|
-
def
|
108
|
-
|
125
|
+
def read_config
|
126
|
+
if File.readable?(LOCAL_CONFIG_PATH)
|
127
|
+
@config = YAML.load_file(LOCAL_CONFIG_PATH)
|
128
|
+
elsif File.readable?(GLOBAL_CONFIG_PATH)
|
129
|
+
@config = YAML.load_file(GLOBAL_CONFIG_PATH)
|
130
|
+
else
|
131
|
+
@config = {}
|
132
|
+
end
|
109
133
|
end
|
110
134
|
end
|
111
135
|
end
|
data/lib/tagrity/helper.rb
CHANGED
@@ -10,6 +10,11 @@ module Tagrity
|
|
10
10
|
RUN_DIR
|
11
11
|
end
|
12
12
|
|
13
|
+
def log_dir
|
14
|
+
ensure_data_dirs
|
15
|
+
LOG_DIR
|
16
|
+
end
|
17
|
+
|
13
18
|
def is_executable?(cmd)
|
14
19
|
!%x{command -v #{cmd}}.empty?
|
15
20
|
end
|
@@ -28,21 +33,16 @@ module Tagrity
|
|
28
33
|
end
|
29
34
|
|
30
35
|
def is_git_dir?
|
31
|
-
return @is_git_dir unless @is_git_dir.nil?
|
32
36
|
`git rev-parse --git-dir &> /dev/null`
|
33
|
-
|
34
|
-
@is_git_dir = true
|
35
|
-
else
|
36
|
-
@is_git_dir = false
|
37
|
-
end
|
37
|
+
$?.exitstatus == 0
|
38
38
|
end
|
39
39
|
|
40
|
-
def
|
40
|
+
def file_ignored?(file)
|
41
41
|
`git check-ignore -q #{file} &> /dev/null`
|
42
42
|
$?.exitstatus == 0
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def file_tracked?(file)
|
46
46
|
`git ls-files --error-unmatch #{file} &> /dev/null`
|
47
47
|
$?.exitstatus == 0
|
48
48
|
end
|
@@ -51,6 +51,7 @@ module Tagrity
|
|
51
51
|
|
52
52
|
def ensure_data_dirs
|
53
53
|
FileUtils.mkdir_p(RUN_DIR)
|
54
|
+
FileUtils.mkdir_p(LOG_DIR)
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
data/lib/tagrity/provider.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'tagrity/file_callbacks'
|
2
1
|
require 'tagrity/config_file'
|
3
2
|
require 'tagrity/tag_generator'
|
4
3
|
|
@@ -7,17 +6,11 @@ module Tagrity
|
|
7
6
|
class << self
|
8
7
|
def provide(want)
|
9
8
|
case want
|
10
|
-
when :file_callbacks
|
11
|
-
provide_file_callbacks
|
12
9
|
when :tag_generator
|
13
10
|
provide_tag_generator
|
14
11
|
end
|
15
12
|
end
|
16
13
|
|
17
|
-
def provide_file_callbacks
|
18
|
-
FileCallbacks.new(provide(:tag_generator))
|
19
|
-
end
|
20
|
-
|
21
14
|
def provide_tag_generator
|
22
15
|
TagGenerator.new
|
23
16
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'tmpdir'
|
2
2
|
require 'tempfile'
|
3
3
|
require 'fileutils'
|
4
|
-
require 'pry'
|
5
4
|
require 'tagrity/helper'
|
5
|
+
require 'tagrity/tlogger'
|
6
6
|
|
7
7
|
module Tagrity
|
8
8
|
class TagGenerator
|
@@ -17,15 +17,16 @@ module Tagrity
|
|
17
17
|
if File.exists?(tagf)
|
18
18
|
File.delete(tagf)
|
19
19
|
end
|
20
|
-
if check_git?
|
21
|
-
|
20
|
+
cmd = if check_git?
|
21
|
+
'git ls-files 2> /dev/null'
|
22
22
|
else
|
23
|
-
|
23
|
+
'find * 2> /dev/null'
|
24
24
|
end
|
25
|
+
files = `#{cmd}`.split
|
25
26
|
if $?.exitstatus == 0
|
26
27
|
generate(files)
|
27
28
|
else
|
28
|
-
|
29
|
+
logger.error("Failed to get a listing of all files under pwd for use with --fresh. Used #{cmd}.")
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
@@ -33,15 +34,15 @@ module Tagrity
|
|
33
34
|
return if files.empty?
|
34
35
|
files
|
35
36
|
.select { |file| generate_tags?(file) }
|
36
|
-
.group_by { |file| @config.
|
37
|
+
.group_by { |file| @config.command_for_extension(file.partition('.').last) }
|
37
38
|
.each do |cmd, fnames|
|
38
39
|
Tempfile.create do |tmpf|
|
39
40
|
IO::write(tmpf.path, fnames.join("\n"))
|
40
41
|
system(cmd, '-f', tagf, '--append', '-L', tmpf.path, out: File::NULL)
|
41
42
|
if $?.exitstatus == 0
|
42
|
-
|
43
|
+
logger.info("{#{cmd}} generated tags for #{fnames} into #{tagf}")
|
43
44
|
else
|
44
|
-
|
45
|
+
logger.info("{#{cmd}} failed to generate tags for #{fnames} into #{tagf}")
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
@@ -59,7 +60,7 @@ module Tagrity
|
|
59
60
|
end
|
60
61
|
tmpf.rewind
|
61
62
|
FileUtils.mv(tmpf.path, tagf, force: true)
|
62
|
-
|
63
|
+
logger.info("Deleted tags for #{files} from #{tagf}")
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
@@ -74,7 +75,15 @@ module Tagrity
|
|
74
75
|
end
|
75
76
|
|
76
77
|
def copacetic_with_git?(file)
|
77
|
-
|
78
|
+
return true if !check_git?
|
79
|
+
case @config.git_strategy
|
80
|
+
when 'TRACKED'
|
81
|
+
Helper.file_tracked?(file)
|
82
|
+
when 'IGNORED'
|
83
|
+
!Helper.file_ignored?(file)
|
84
|
+
else
|
85
|
+
false
|
86
|
+
end
|
78
87
|
end
|
79
88
|
|
80
89
|
def check_git?
|
@@ -82,7 +91,7 @@ module Tagrity
|
|
82
91
|
end
|
83
92
|
|
84
93
|
def is_file_excluded(fname)
|
85
|
-
@config.
|
94
|
+
@config.ignore_extension?(fname.partition('.').last) || @config.path_ignored?(fname)
|
86
95
|
end
|
87
96
|
|
88
97
|
def assert_executables
|
@@ -96,5 +105,9 @@ module Tagrity
|
|
96
105
|
def tagf
|
97
106
|
@config.tagf
|
98
107
|
end
|
108
|
+
|
109
|
+
def logger
|
110
|
+
Tlogger.instance
|
111
|
+
end
|
99
112
|
end
|
100
113
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
require 'logger'
|
3
|
+
require 'tagrity/helper'
|
4
|
+
|
5
|
+
module Tagrity
|
6
|
+
class Tlogger
|
7
|
+
include Singleton
|
8
|
+
|
9
|
+
attr_writer :fg
|
10
|
+
|
11
|
+
def info(msg)
|
12
|
+
logger.info(msg)
|
13
|
+
end
|
14
|
+
|
15
|
+
def error(msg)
|
16
|
+
logger.error(msg)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def logger
|
22
|
+
@logger ||= Logger.new(@fg ? STDOUT : logf, 'weekly')
|
23
|
+
end
|
24
|
+
|
25
|
+
def logf
|
26
|
+
# TODO this can cause duplicates, unlikely tho
|
27
|
+
"#{Helper.log_dir}/#{Dir.pwd.gsub(/\//, '--')}.log"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/tagrity/version.rb
CHANGED
data/sample_config.yml
CHANGED
@@ -1,31 +1,41 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
# <file extension>: <command to use to generate tags for this file extension>
|
1
|
+
# which command to use to generate tags for a specific file extension
|
2
|
+
# overrides default_command
|
3
|
+
# commands must support --append, -f, -L
|
5
4
|
# DEFAULT: empty
|
6
|
-
|
5
|
+
extension_commands:
|
7
6
|
rb: ripper-tags
|
8
7
|
c: ctags
|
9
8
|
go: gotags
|
10
9
|
|
11
|
-
#
|
12
|
-
#
|
10
|
+
# default command to generate tags
|
11
|
+
# command must support --append, -f, -L
|
13
12
|
# DEFAULT: ctags
|
14
|
-
|
13
|
+
default_command: ctags
|
15
14
|
|
16
|
-
#
|
17
|
-
# tagf: <filename>
|
15
|
+
# filename (relative to pwd) to generate tags into
|
18
16
|
# DEFAULT: tags
|
19
17
|
tagf: tags
|
20
18
|
|
21
|
-
#
|
22
|
-
#
|
19
|
+
# list of extensions to exclusively generate tags for
|
20
|
+
# this will take precendence over extensions_blacklist if it is non-empty
|
23
21
|
# DEFAULT: []
|
24
|
-
|
22
|
+
extensions_whitelist: [rb, c, h, js]
|
25
23
|
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
|
24
|
+
# list of extensions to not generate tags for
|
25
|
+
# this can will be ignored if extensions_whitelist is non-empty
|
26
|
+
# DEFAULT: []
|
27
|
+
extensions_blacklist: [erb, html, txt]
|
28
|
+
|
29
|
+
# how to integrate with git
|
30
|
+
# git_strategy: TRACKED | IGNORED | NA
|
31
|
+
# TRACKED: only index files tracked by git
|
32
|
+
# IGNORED: don't index files which are ignored by git
|
33
|
+
# NA: don't use git, index all files under pwd
|
34
|
+
# DEFAULT: TRACKED
|
35
|
+
git_strategy: TRACKED
|
36
|
+
|
37
|
+
# which paths (relative to pwd) to ignore
|
38
|
+
# It's usually better to avoid this since tagrity integrates with git by
|
39
|
+
# default using the strategy specified by git_strategy
|
30
40
|
# DEFAULT: []
|
31
41
|
excluded_paths: [vendor, node_modules]
|
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.1.
|
4
|
+
version: 0.1.8
|
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: 2019-12-
|
11
|
+
date: 2019-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -116,7 +116,6 @@ executables:
|
|
116
116
|
extensions: []
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
|
-
- ".byebug_history"
|
120
119
|
- ".gitignore"
|
121
120
|
- ".rspec"
|
122
121
|
- ".travis.yml"
|
@@ -135,11 +134,11 @@ files:
|
|
135
134
|
- lib/tagrity/commands/status.rb
|
136
135
|
- lib/tagrity/commands/stop.rb
|
137
136
|
- lib/tagrity/config_file.rb
|
138
|
-
- lib/tagrity/file_callbacks.rb
|
139
137
|
- lib/tagrity/helper.rb
|
140
138
|
- lib/tagrity/pid_file.rb
|
141
139
|
- lib/tagrity/provider.rb
|
142
140
|
- lib/tagrity/tag_generator.rb
|
141
|
+
- lib/tagrity/tlogger.rb
|
143
142
|
- lib/tagrity/version.rb
|
144
143
|
- sample_config.yml
|
145
144
|
- tagrity.gemspec
|
@@ -165,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
164
|
- !ruby/object:Gem::Version
|
166
165
|
version: '0'
|
167
166
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
167
|
+
rubygems_version: 3.0.6
|
169
168
|
signing_key:
|
170
169
|
specification_version: 4
|
171
170
|
summary: Regenerate tags on file changes.
|
data/.byebug_history
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'tagrity/tag_generator'
|
2
|
-
require 'tagrity/config_file'
|
3
|
-
|
4
|
-
module Tagrity
|
5
|
-
class FileCallbacks
|
6
|
-
def initialize(tag_generator)
|
7
|
-
@tag_generator = tag_generator
|
8
|
-
end
|
9
|
-
|
10
|
-
def on_fresh
|
11
|
-
@tag_generator.generate_all
|
12
|
-
end
|
13
|
-
|
14
|
-
def on_files_modified(files)
|
15
|
-
@tag_generator.generate(files)
|
16
|
-
end
|
17
|
-
|
18
|
-
def on_files_added(files)
|
19
|
-
@tag_generator.generate(files)
|
20
|
-
end
|
21
|
-
|
22
|
-
def on_files_removed(files)
|
23
|
-
@tag_generator.delete_files_tags(files)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|