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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a5d0a4c40bcbeae4ad0312f0336030675f804a28a8a171d1963254c46efcc6a
4
- data.tar.gz: f42987fb3804c6159d032653e04c9310ce22c3b6b369e61e196c69adc0d196e3
3
+ metadata.gz: 4717781c2b62a65a0b1e836f267ece7eacefadef89d0150caa8a59ee86a374b0
4
+ data.tar.gz: b96ccd3729e7fedb6b18075e75a548ee85b55abe3a31a725dbede3725cf17bb5
5
5
  SHA512:
6
- metadata.gz: 4287ece1c8614b48c799ba21cbb694a38989433f4b96c7e57afb498ea066792a4831f10a701279b4599315c95ca62e69b373797b922cbeca4b1bc321388f3592
7
- data.tar.gz: 58f1ee384271f30b5ebc5693fc6de8a9ae8dda286a9e39f03f28940478fb4a1eab9efe74171a73e92993107b22437e1e3a6ba03050b4e9d8280630f4216f0943
6
+ metadata.gz: 2f814bc06b05a51d2b8e59ea9aa396cb880d93638b89026cb41061c2d495b2b096f7d837e5140a6961848c04de42f5b7822dbb8b24ab7b2e45a0e952c452c330
7
+ data.tar.gz: a2f2ac9ec3237032d56ee13f71853836e4a89c148ace85a729bc0103c95b85a1aadec4aaba2b05a67c383bc13bebe95b34e7aaebdcc30f1795af4796bf8a7aeb
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tagrity (0.1.7)
4
+ tagrity (0.1.8)
5
5
  listen (~> 3.0)
6
6
  pry (~> 0.9.9)
7
7
  thor (~> 0.20)
@@ -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
@@ -22,7 +22,7 @@ module Tagrity
22
22
  else
23
23
  'find * 2> /dev/null'
24
24
  end
25
- files = `#{cmd}`.split
25
+ files = `#{cmd}`.split("\n")
26
26
  if $?.exitstatus == 0
27
27
  generate(files)
28
28
  else
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Tagrity
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
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