thicket 0.1.3 → 0.1.4

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: a742bf5e45b011a1a3d4441df3f4697e2f0b7b1fa8682a9ae9a75aaba49a83f7
4
- data.tar.gz: d4b5d04c35d18b686fc85b48410f02531a61720d02516d5df780e9cd09c1f17c
3
+ metadata.gz: 78d11e58027823d2bc19891269bdcf93c6b8d5ed8396cef5fe275f75282e27c9
4
+ data.tar.gz: 99e6feb765c64cb6359b8014d26014812620d76185424695fa07103cf480c57f
5
5
  SHA512:
6
- metadata.gz: e60e346a1be1cbb45e1357b4c0a9f878e17c860f9011bb2e60f1026fe0ca6cec80194bcf5560dc72955e1dd34b29212c7ef1acfaadc80d040c2b32235004a9db
7
- data.tar.gz: 99b51417d4452422a9dcd529f54bebd6a5d191f54c424d4105736bcc8b288da43d33a7a5338c67f16243862c13dd66d28c870d204254212f46894429978d1e73
6
+ metadata.gz: 99a311df3ab8cddbc14ac9d9d52f16a51762c9505f9eca6aae22a069eb486b351e6cdc45bc935a53e806bc83111f9daf8579ff8d4bad7561b3bd359529117143
7
+ data.tar.gz: 4130465a692a997d098b30f776c7bfe46ed04bf1c53c93f927fb6c7066dd9569ce1eea4e32668f183570dd24d65627643f2883f900ba8b8ee3f9ba2848cfddae
data/lib/thicket/log.rb CHANGED
@@ -5,7 +5,7 @@ require "time"
5
5
 
6
6
  module Thicket
7
7
  class Log
8
- LOG_PARSE_REGEX = /[a-f0-9]{7}.+?m(.+?) .+?m\{([\w ]+)\}.+?m (?:\((.+?)\))?.+?m(.+$)/.freeze
8
+ LOG_PARSE_REGEX = /[a-f0-9]{7}.+?m(.+?) .+?m\{(.+?)\}.+?m (?:\((.+?)\))?.+?m(.+$)/.freeze
9
9
 
10
10
  def initialize(options)
11
11
  @options = options
@@ -40,9 +40,9 @@ module Thicket
40
40
  @padding_char = @padding_char == " " ? "-" : " "
41
41
 
42
42
  line.match(LOG_PARSE_REGEX) do |matcher|
43
- process_date_time(matcher[1], line, matcher[3])
44
- process_message_prefix(matcher[4], line) if @options[:color_prefixes]
45
- process_author_name(matcher[2], line)
43
+ line = process_date_time(matcher[1], line, matcher[3])
44
+ line = process_message_prefix(matcher[4], line) if @options[:color_prefixes]
45
+ line = process_author_name(matcher[2], line)
46
46
  @count_parsed += 1
47
47
  end
48
48
 
@@ -57,7 +57,8 @@ module Thicket
57
57
  quantity = (seconds_ago / measure.length).floor
58
58
  to_sub = +"#{quantity}#{measure.abbreviation}".rjust(3)
59
59
  to_sub << "\e[31m" if have_refs # add color if we have refs in this line
60
- line.sub!(time_string, to_sub)
60
+
61
+ line.sub(time_string, to_sub)
61
62
  end
62
63
 
63
64
  # Takes an input log string and commit message, finds commit messages
@@ -66,8 +67,10 @@ module Thicket
66
67
  prefix_regex = %r{^(?=.*[0-9])([A-Z\d-]+?[: \/])}
67
68
  message.match(prefix_regex) do |matcher|
68
69
  prefix = matcher[1]
69
- line.sub!(/([^\/])#{prefix}/, "\\1\e[30m#{prefix}\e[m")
70
+ return line.sub(/([^\/])#{prefix}/, "\\1\e[30m#{prefix}\e[m")
70
71
  end
72
+
73
+ line
71
74
  end
72
75
 
73
76
  # Takes an input log string and commit author, and moves it from the normal
@@ -81,7 +84,7 @@ module Thicket
81
84
  total_length = strip_color(line).length
82
85
  spaces_needed = terminal_width - total_length - author.length - 2
83
86
  if spaces_needed < 0
84
- line = +"#{line[0...-spaces_needed - 5]}... "
87
+ line = +"#{line[0...-spaces_needed - 5]}... "
85
88
  else
86
89
  line << " \e[30m"
87
90
  line << @padding_char * spaces_needed
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Thicket
4
4
  #:nodoc:
5
- VERSION ||= "0.1.3"
5
+ VERSION ||= "0.1.4"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thicket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Thurlow