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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 436d0d9af10e33b0f6b4ec2b2ce17588d63186816531374b3d2dec409404b9a4
4
- data.tar.gz: 5c8c7b93a1b0331018e71926052348f2341f4d947609176aeea39818938a6dfe
3
+ metadata.gz: c8cf024d8db7d37c89470057cac689c6b8ecb165c0a06f578ae2ff163e7da773
4
+ data.tar.gz: d4161a7c9722ae5c378512acf2b56549c44b4f4ec68b358cb031d340be4d0f34
5
5
  SHA512:
6
- metadata.gz: 70d5afd1da1dab096030fbd7de53f41327eaac0a220a9f7abf9920f5a69388ff37fdd4e546f2877a391662350675339ae340681d08ff898d95e07855ceec14b8
7
- data.tar.gz: a5054c37893487fbb09809b4587b5b3b7f5e1b7e3a69d2144df2d882ef8edd2307203766c6a5bf4910f3bc0dfa592a7a9b4b1d7cdf791527eb9d444e00b251a7
6
+ metadata.gz: b9a95c25a3efe7427e0a6466d3cecab2a8fb99fc3f897239b69817b75bee1a9bd3ecaadbcc5b8531613fbec0af78ac19d9778fc693d1324a35d4955c19407d44
7
+ data.tar.gz: f793bfd50e1a87a7f715c3f1731fb6b803ed155f08eaa4acc26ed92a36c237059afeb27a800da311480978206c085cac691b5014873aaf09f1ea50085790c874
@@ -3,9 +3,9 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.6.3
6
+ - 2.7.1
7
7
  before_install:
8
- - gem install bundler -v 2.0.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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tagrity (0.2.18)
4
+ tagrity (0.2.19)
5
5
  cli-ui (~> 1.3.0)
6
6
  listen (~> 3.2.1)
7
7
  pry (~> 0.9.9)
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 `tagrity_config.yml` file that looks like the following:
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 can be overridden by a local config in the current directory under the name `.tagrity_config.yml`.
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
- if File.exists?(tagf)
18
- File.delete(tagf)
19
- end
20
- cmd = if check_git?
21
- 'git ls-files 2> /dev/null'
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
- 'find * -type f 2> /dev/null'
31
+ files = `find * -type f 2> /dev/null`.split("\n")
24
32
  end
25
- files = `#{cmd}`.split("\n")
26
- if $?.exitstatus == 0
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
- copacetic_with_git?(file) && indexable?(file)
80
+ return indexable?(file)
71
81
  end
72
82
 
73
83
  def indexable?(file)
@@ -1,3 +1,3 @@
1
1
  module Tagrity
2
- VERSION = "0.2.19"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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.2.19
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-06-19 00:00:00.000000000 Z
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