tagrity 0.3.5 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 696ef632ed7745a6825834155b3c603ccb6b7758e170f2d34f56d8de3209a98d
4
- data.tar.gz: 8aa352fc7fa43a6bbcb230e4b5585db9c1feaa9c9c4d128afbabf801f52e6af9
3
+ metadata.gz: 3fb5de46bbaabcdc5d70a7434e737e490e56aa8ee0afbbc3fb8c3400d642f472
4
+ data.tar.gz: f8cfa51ded2867daba4891d0a3327b9c73b1cc53a54730c35b5e894252c9a74d
5
5
  SHA512:
6
- metadata.gz: 0303a033ec5b38cfcc478da5ddaa489a4d79520de26459a161d08423455a3659704e339c790e8fde4d605073aa2ea8735977a3fdae6053512167044568940151
7
- data.tar.gz: 390ee08b2d2af110c2e137270c284226ef973acfbf308ae5c40b52d71f055ea48798df09cf002e351b3758b50bbbc4a5e0c63ab76d08d6b789785b69bafcee10
6
+ metadata.gz: 3b697ab9432e5d4ba53cdccb794d5b6df9d6d17f6fc1a0e589c05d100df7f1d44a83d5145019778d988170897b1ae2c7667939fd36289f5e30b6af924a47a38c
7
+ data.tar.gz: ba48ed3cc97e7e71483138a447a08103f21ba2c3b9ac33f311bf3681a9c6ce2632c9b51c5657097e9d31609bb155eadfc8ab362fe73aa0ae924c632d7812ef23
data/Gemfile.lock CHANGED
@@ -1,10 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tagrity (0.3.5)
4
+ tagrity (0.3.9)
5
5
  cli-ui (~> 1.3.0)
6
6
  listen (~> 3.2.1)
7
- pry (~> 0.9.9)
8
7
  thor (~> 0.20)
9
8
 
10
9
  GEM
@@ -13,7 +12,7 @@ GEM
13
12
  cli-ui (1.3.0)
14
13
  coderay (1.1.3)
15
14
  diff-lcs (1.3)
16
- ffi (1.13.1)
15
+ ffi (1.15.3)
17
16
  listen (3.2.1)
18
17
  rb-fsevent (~> 0.10, >= 0.10.3)
19
18
  rb-inotify (~> 0.9, >= 0.9.10)
@@ -23,7 +22,7 @@ GEM
23
22
  method_source (~> 0.8)
24
23
  slop (~> 3.4)
25
24
  rake (13.0.1)
26
- rb-fsevent (0.10.4)
25
+ rb-fsevent (0.11.0)
27
26
  rb-inotify (0.10.1)
28
27
  ffi (~> 1.0)
29
28
  ripper-tags (0.8.0)
@@ -48,6 +47,7 @@ PLATFORMS
48
47
 
49
48
  DEPENDENCIES
50
49
  bundler (~> 2.0)
50
+ pry (~> 0.9.9)
51
51
  rake (~> 13.0)
52
52
  ripper-tags (~> 0.8.0)
53
53
  rspec (~> 3.0)
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Tagrity
2
2
 
3
- [![Build Status](https://travis-ci.com/RRethy/tagrity.svg?branch=master)](https://travis-ci.com/RRethy/tagrity)
4
-
5
3
  Automatically regenerate your tags on file changes.
6
4
 
7
5
  ## Installation
@@ -16,9 +14,9 @@ $ gem install tagrity
16
14
  tagrity start
17
15
  ```
18
16
 
19
- That's it! It will monitor pwd and index any files which change. Check out [Configuration](#configuration) to restrict which files get indexed.
17
+ That's it! It will monitor the current directory and generate tags for any files which change and are not ignored by git.
20
18
 
21
- To stop watching pwd, use
19
+ To stop watching the current directory, use
22
20
 
23
21
  ```sh
24
22
  tagrity stop
@@ -30,6 +28,30 @@ To view directories being watched, use
30
28
  tagrity status
31
29
  ```
32
30
 
31
+ ## Less Quick Start
32
+
33
+ When your computer is restarted, the process watching the directories will be killed. Add the following to your `~/.bashrc` (or `~/.zshrc`, etc.) to revive any killed processes automatically.
34
+
35
+ ```sh
36
+ (tagrity revive &) &> /dev/null
37
+ ```
38
+
39
+ To stop watching a directory that isn't the current working directory (but shows up in `tagrity status`), you can use:
40
+
41
+ ```sh
42
+ tagrity stop --dir <path>
43
+ ```
44
+
45
+ Where `<path>` is a relative or absolute path. You may be tempted to run `tagrity status` to get the pid and then kill it with `kill <pid>`. However, while this will work, `tagrity revive` will restart these processes (with different pids of course). `tagrity stop` will kill the process and stop `tagrity revive` from starting it up again.
46
+
47
+ To get info on what tags are being generated, you can run:
48
+
49
+ ```sh
50
+ tagrity logs
51
+ ```
52
+
53
+ For a full set of subcommands, try `tagrity help`.
54
+
33
55
  ## Configuration
34
56
 
35
57
  Configuration can be done through use of a local `.tagrity_config.yml` file that looks like the following:
@@ -76,8 +98,7 @@ extensions_whitelist: [rb, c, h, js]
76
98
  extensions_blacklist: [erb, html, txt]
77
99
 
78
100
  # which paths (relative to pwd) to ignore
79
- # It's usually better to avoid this since tagrity integrates with git by
80
- # default using the strategy specified by git_strategy
101
+ # this is usually not needed since tagrity doesn't index files ignored by git
81
102
  #
82
103
  # Default: []
83
104
  excluded_paths: [vendor, node_modules]
@@ -89,9 +110,11 @@ excluded_paths: [vendor, node_modules]
89
110
  Commands:
90
111
  tagrity help [COMMAND] # Describe available commands or one specific command
91
112
  tagrity logs # Print the logs for pwd
113
+ tagrity revive # Restart any tagrity processes that died
92
114
  tagrity start # Start watching pwd
93
115
  tagrity status # List running tagrity processes and the directories being watched
94
- tagrity stop # Stop watching pwd
116
+ tagrity stop # Stop watching a directory (default to pwd)
117
+ tagrity version # print tagrity version
95
118
  ```
96
119
 
97
120
  ### start
@@ -113,7 +136,11 @@ Start watching pwd
113
136
  Usage:
114
137
  tagrity stop
115
138
 
116
- Stop watching pwd
139
+ Options:
140
+ [--dir=DIR] # directory to stop watching.
141
+ # Default: /Users/rethy/ruby/tagrity
142
+
143
+ Stop watching a directory (default to pwd)
117
144
  ```
118
145
 
119
146
  ### status
data/lib/tagrity/cli.rb CHANGED
@@ -20,9 +20,10 @@ module Tagrity
20
20
  Command::Start::call(options['fg'], options['fresh'])
21
21
  end
22
22
 
23
- desc "stop", "Stop watching pwd"
23
+ desc "stop", "Stop watching a directory (default to pwd)"
24
+ option :dir, type: :string, default: Dir.pwd, desc: "directory to stop watching."
24
25
  def stop()
25
- Command::Stop::call
26
+ Command::Stop::call(options['dir'])
26
27
  end
27
28
 
28
29
  desc "status", "List running tagrity processes and the directories being watched"
@@ -15,7 +15,7 @@ module Tagrity
15
15
  dir = Dir.pwd
16
16
  assert_not_running(dir)
17
17
 
18
- Process.daemon(true) unless fg
18
+ Process.daemon({nochdir: true}) unless fg
19
19
  logger.fg = fg
20
20
 
21
21
  tag_generator = Provider.provide(:tag_generator)
@@ -6,16 +6,16 @@ module Tagrity
6
6
  module Command
7
7
  class Stop
8
8
  class << self
9
- def call
10
- dir = Dir.pwd
9
+ def call(dir)
11
10
  pid_files = PidFile.alive_pid_files(dir: dir)
12
11
  if pid_files.empty?
13
12
  puts ::CLI::UI.fmt "{{red:#{"😕 tagrity doesn't seem to be watching #{dir}"}}}"
14
13
  else
15
14
  pid_files.each do |pid_file|
16
15
  pid_file.delete
17
- puts ::CLI::UI.fmt "{{green:#{"Successfully killed #{pid_file.pid}"}}}"
18
- logger.info("Successfully killed #{pid_file.pid}")
16
+ msg = "Successfully killed #{pid_file.pid} for dir #{dir}"
17
+ puts ::CLI::UI.fmt "{{green:#{msg}}}"
18
+ logger.info(msg)
19
19
  end
20
20
  end
21
21
  end
@@ -2,7 +2,6 @@ require 'tmpdir'
2
2
  require 'tempfile'
3
3
  require 'fileutils'
4
4
  require 'tagrity/helper'
5
- require 'pry'
6
5
 
7
6
  module Tagrity
8
7
  class TagGenerator
@@ -1,3 +1,3 @@
1
1
  module Tagrity
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.10"
3
3
  end
data/sample_config.yml CHANGED
@@ -33,8 +33,7 @@ extensions_whitelist: [rb, c, h, js]
33
33
  extensions_blacklist: [erb, html, txt]
34
34
 
35
35
  # which paths (relative to pwd) to ignore
36
- # It's usually better to avoid this since tagrity integrates with git by
37
- # default using the strategy specified by git_strategy
36
+ # this is usually not needed since tagrity doesn't index files ignored by git
38
37
  #
39
38
  # Default: []
40
39
  excluded_paths: [vendor, node_modules]
data/tagrity.gemspec CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "rake", "~> 13.0"
35
35
  spec.add_development_dependency "rspec", "~> 3.0"
36
36
  spec.add_development_dependency "ripper-tags", "~> 0.8.0"
37
- spec.add_dependency "pry", "~> 0.9.9"
37
+ spec.add_development_dependency "pry", "~> 0.9.9"
38
38
  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.5
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam P. Regasz-Rethy
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-29 00:00:00.000000000 Z
11
+ date: 2021-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -115,7 +115,7 @@ dependencies:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: 0.9.9
118
- type: :runtime
118
+ type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
@@ -141,7 +141,6 @@ files:
141
141
  - LICENSE.txt
142
142
  - README.md
143
143
  - Rakefile
144
- - TODO.md
145
144
  - bin/console
146
145
  - bin/setup
147
146
  - exe/tagrity
@@ -179,7 +178,7 @@ metadata:
179
178
  homepage_uri: https://github.com/RRethy/tagrity
180
179
  source_code_uri: https://github.com/RRethy/tagrity
181
180
  changelog_uri: https://github.com/RRethy/tagrity/blob/master/CHANGELOG.md
182
- post_install_message:
181
+ post_install_message:
183
182
  rdoc_options: []
184
183
  require_paths:
185
184
  - lib
@@ -194,8 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
193
  - !ruby/object:Gem::Version
195
194
  version: '0'
196
195
  requirements: []
197
- rubygems_version: 3.1.2
198
- signing_key:
196
+ rubygems_version: 3.0.3
197
+ signing_key:
199
198
  specification_version: 4
200
199
  summary: Update tags on file changes.
201
200
  test_files: []
data/TODO.md DELETED
@@ -1,5 +0,0 @@
1
- # TODO
2
-
3
- * Better error handling
4
- * Restart process which were terminated due to a system shutdown
5
- * Will have to add `tagrity stop <pid>` instead of forcing users to use `kill <pid>`