thicket 0.1.1 → 0.1.2

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: 4442ba4df6f0ce281ca09fd2c4751350e7b13f49f1eb78ba9564335d46b469f3
4
- data.tar.gz: 5040b9341e0c53943d64efc7fcc1055eac04c4592f6a2221780d2b941890ad1b
3
+ metadata.gz: e1eb22740e372653621cb4cfc8725d08a6d32c25c2c038ea814c313a2e402fe2
4
+ data.tar.gz: f54050ce5287fe08e34eecda262a306432d0cc5fbe349e93a010fee7e59dd64c
5
5
  SHA512:
6
- metadata.gz: 442c2f8fe25e501cb4402c5cc9ea7e7a8b0d107a2a510ead969e28e83f94136c3762e795849c5a8a637eca667df4ca77871d771a57638f7392d8153a767cc218
7
- data.tar.gz: cc5139320611fd9aa2bcd798cd2ce1bc5aa15cb20739ae22d0cfeeafdbd1266d970b33ff36ed3898c5646e2a8853ff2fc5b36cc783a28f7c73e44c72e30d8058
6
+ metadata.gz: 92289582964876fa96921d9da58ddbc1a952cb4bdbcd00fe0305f70c1047209b68e51bb5624fa409b454e742f23133e4c253c26f393833ccbed02a5a89137904
7
+ data.tar.gz: faea2aaa37e7b6bb45c7ab50df1c9fee6df2e672c6baeecded45703665116aa2b5b42603ba1c3ecee2164b9c0cae38adc88c39c056bb6750abfe494bf48686ba
data/lib/thicket/log.rb CHANGED
@@ -9,6 +9,7 @@ module Thicket
9
9
 
10
10
  def initialize(options)
11
11
  @options = options
12
+ @count_parsed = 0
12
13
  end
13
14
 
14
15
  # Gets a printable version of the log for purposes of printing to a
@@ -16,7 +17,15 @@ module Thicket
16
17
  # the user.
17
18
  def print
18
19
  FileUtils.cd(git_working_directory)
19
- `#{git_log_command}`.split("\n").each { |l| puts process_git_log_line(l) }
20
+ `#{git_log_command}`.split("\n").each do |l|
21
+ puts process_git_log_line(l)
22
+
23
+ next unless @options[:limit] && @count_parsed >= @options[:limit]
24
+
25
+ puts "..."
26
+ puts "Stopped after #{@options[:limit]} commits. More commit history exists."
27
+ exit
28
+ end
20
29
  rescue Errno::EPIPE, SystemExit, Interrupt
21
30
  exit
22
31
  end
@@ -32,6 +41,7 @@ module Thicket
32
41
  process_date_time(matcher[1], line, matcher[3])
33
42
  process_message_prefix(matcher[4], line) if @options[:color_prefixes]
34
43
  process_author_name(matcher[2], line)
44
+ @count_parsed += 1
35
45
  end
36
46
 
37
47
  line
@@ -37,6 +37,11 @@ module Thicket
37
37
  @options[:project_directory] = File.expand_path(project_directory)
38
38
  end
39
39
 
40
+ opts.on("-n", "--commit-limit LIMIT", Integer, "Number of commits to parse before stopping") do |limit|
41
+ args.name = limit
42
+ @options[:limit] = limit
43
+ end
44
+
40
45
  opts.on("-a", "--all", TrueClass, "Displays all branches on all remotes.") do |all|
41
46
  args.name = all
42
47
  @options[:all] = all
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Thicket
4
4
  #:nodoc:
5
- VERSION ||= "0.1.1"
5
+ VERSION ||= "0.1.2"
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Thurlow