tagrity 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tagrity/cli.rb +7 -0
- data/lib/tagrity/commands/logs.rb +19 -0
- data/lib/tagrity/tag_generator.rb +1 -1
- data/lib/tagrity/tlogger.rb +5 -5
- data/lib/tagrity/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4717781c2b62a65a0b1e836f267ece7eacefadef89d0150caa8a59ee86a374b0
|
4
|
+
data.tar.gz: b96ccd3729e7fedb6b18075e75a548ee85b55abe3a31a725dbede3725cf17bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f814bc06b05a51d2b8e59ea9aa396cb880d93638b89026cb41061c2d495b2b096f7d837e5140a6961848c04de42f5b7822dbb8b24ab7b2e45a0e952c452c330
|
7
|
+
data.tar.gz: a2f2ac9ec3237032d56ee13f71853836e4a89c148ace85a729bc0103c95b85a1aadec4aaba2b05a67c383bc13bebe95b34e7aaebdcc30f1795af4796bf8a7aeb
|
data/Gemfile.lock
CHANGED
data/lib/tagrity/cli.rb
CHANGED
@@ -2,6 +2,7 @@ require 'thor'
|
|
2
2
|
require 'tagrity/commands/start'
|
3
3
|
require 'tagrity/commands/stop'
|
4
4
|
require 'tagrity/commands/status'
|
5
|
+
require 'tagrity/commands/logs'
|
5
6
|
|
6
7
|
module Tagrity
|
7
8
|
class CLI < Thor
|
@@ -21,5 +22,11 @@ module Tagrity
|
|
21
22
|
def status
|
22
23
|
Command::Status::call
|
23
24
|
end
|
25
|
+
|
26
|
+
desc "logs", "Print the logs for pwd"
|
27
|
+
option :n, type: :numeric, default: 10, desc: "the number of log lines to print"
|
28
|
+
def logs
|
29
|
+
Command::Logs::call(options['n'])
|
30
|
+
end
|
24
31
|
end
|
25
32
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'tagrity/tlogger'
|
2
|
+
|
3
|
+
module Tagrity
|
4
|
+
module Command
|
5
|
+
class Logs
|
6
|
+
class << self
|
7
|
+
def call(n)
|
8
|
+
puts `cat #{logf} | tail -n #{Integer(n)}`.split("\n")
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def logf
|
14
|
+
Tlogger.instance.logf
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/tagrity/tlogger.rb
CHANGED
@@ -16,15 +16,15 @@ module Tagrity
|
|
16
16
|
logger.error(msg)
|
17
17
|
end
|
18
18
|
|
19
|
+
def logf
|
20
|
+
# TODO this can cause duplicates, unlikely tho
|
21
|
+
"#{Helper.log_dir}/#{Dir.pwd.gsub(/\//, '--')}.log"
|
22
|
+
end
|
23
|
+
|
19
24
|
private
|
20
25
|
|
21
26
|
def logger
|
22
27
|
@logger ||= Logger.new(@fg ? STDOUT : logf, 'weekly')
|
23
28
|
end
|
24
|
-
|
25
|
-
def logf
|
26
|
-
# TODO this can cause duplicates, unlikely tho
|
27
|
-
"#{Helper.log_dir}/#{Dir.pwd.gsub(/\//, '--')}.log"
|
28
|
-
end
|
29
29
|
end
|
30
30
|
end
|
data/lib/tagrity/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam P. Regasz-Rethy
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- exe/tagrity
|
131
131
|
- lib/tagrity.rb
|
132
132
|
- lib/tagrity/cli.rb
|
133
|
+
- lib/tagrity/commands/logs.rb
|
133
134
|
- lib/tagrity/commands/start.rb
|
134
135
|
- lib/tagrity/commands/status.rb
|
135
136
|
- lib/tagrity/commands/stop.rb
|