git_curate 0.6.3 → 0.6.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: 3210c7e8b48389447db001fa0b444b930a764a2c8c390a61827a2d6f01436d3b
4
- data.tar.gz: 3b31eb0d7f14f5cc6cad363de5feb41aa9b38c2f3cea985b7ea309bfc0201f2d
3
+ metadata.gz: 104be2a4415dd003c7c407d28ffcabb1eda79e0f8276e7be30aa5387592fe0ef
4
+ data.tar.gz: 2636466a92daeda271e41ebd4b10003f10703f792f1b41c0f5757089ed7aa932
5
5
  SHA512:
6
- metadata.gz: 9c9d9b44f67a34b792045029656cf8c2e5f916d2325c45e6a2cf23989fd4d2c40431107b61405ad05dab21a0b8c80bf8e6ce3051689ca61a0429f0ca0c822ec3
7
- data.tar.gz: 4178cf08ef5e4785cb42ec4d9437f1b0079e0adaa5ad8c56f87c25ba00ab6f678a0d1dde64ba57630b43f4376b149aeab7eeb332de28ef7c9cc4419f16137160
6
+ metadata.gz: 4cf19b5538b1a996c29e260e7d576e9f12dade39bc506c008946aaec2ef4f2042fe2b4f85b7c66fe1c87c9db5d1c69815ded3e38496226bfc5f6354ef62ae07b
7
+ data.tar.gz: 0521c60590d20e6fd36aecc5b8759a38c7d30077043e1b64d33cab6d8d200fb179af6091a52c24be8a63352af82128bbef0d7a317ff5b96ad9e74a1f579280aa
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ### v0.6.4
4
+
5
+ * Fix breakage on Ruby <= 2.3 due to unsupported Regex #match? method.
6
+
3
7
  ### v0.6.3
4
8
 
5
- * Fix formatting oof output on Windows.
9
+ * Fix formatting of output on Windows.
6
10
 
7
11
  ### v0.6.2
8
12
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_curate (0.6.3)
4
+ git_curate (0.6.4)
5
5
  highline (= 2.0.2)
6
6
  tabulo (= 1.5.1)
7
7
  tty-screen (= 0.7.0)
@@ -9,10 +9,24 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
+ diff-lcs (1.3)
12
13
  highline (2.0.2)
13
14
  rake (12.3.2)
14
15
  rake-version (1.0.1)
15
16
  rake (> 11.1)
17
+ rspec (3.8.0)
18
+ rspec-core (~> 3.8.0)
19
+ rspec-expectations (~> 3.8.0)
20
+ rspec-mocks (~> 3.8.0)
21
+ rspec-core (3.8.2)
22
+ rspec-support (~> 3.8.0)
23
+ rspec-expectations (3.8.4)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.8.0)
26
+ rspec-mocks (3.8.1)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.8.0)
29
+ rspec-support (3.8.2)
16
30
  tabulo (1.5.1)
17
31
  tty-screen (= 0.7.0)
18
32
  unicode-display_width (= 1.6.0)
@@ -27,6 +41,7 @@ DEPENDENCIES
27
41
  git_curate!
28
42
  rake (~> 12.3)
29
43
  rake-version (~> 1.0)
44
+ rspec (~> 3.0)
30
45
 
31
46
  BUNDLED WITH
32
47
  2.0.1
data/README.md CHANGED
@@ -68,7 +68,7 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/matt-ha
68
68
  To start working on `git_curate`, `git clone` and `cd` into your fork of the repo, then run `bin/setup` to
69
69
  install dependencies.
70
70
 
71
- For a list of Rake tasks that are available in the development environment, run `rake -T`.
71
+ To run the test suite, run `rake spec`. For a list of other Rake tasks, run `rake -T`.
72
72
 
73
73
  ## License
74
74
 
data/Rakefile CHANGED
@@ -1,6 +1,12 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
2
3
  require "rake-version"
3
4
 
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
8
+
4
9
  RakeVersion::Tasks.new do |v|
5
10
  v.copy "lib/git_curate/version.rb"
11
+ v.copy "README.md", all: true
6
12
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
@@ -5,7 +5,9 @@ require "optparse"
5
5
 
6
6
  def main
7
7
  parser = GitCurate::CLIParser.new
8
- parser.parse(ARGV)
8
+ continue = parser.parse(ARGV)
9
+ return unless continue
10
+
9
11
  runner = GitCurate::Runner.new(parser.parsed_options)
10
12
  runner.run
11
13
  rescue OptionParser::InvalidOption
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "bundler"
36
36
  spec.add_development_dependency "rake", "~> 12.3"
37
37
  spec.add_development_dependency "rake-version", "~> 1.0"
38
+ spec.add_development_dependency "rspec", "~> 3.0"
38
39
  end
@@ -1,3 +1,5 @@
1
+ require "open3"
2
+
1
3
  module GitCurate
2
4
 
3
5
  class Branch
@@ -14,7 +16,7 @@ module GitCurate
14
16
  end
15
17
 
16
18
  def current?
17
- @current ||= /^\*\s+/.match?(@raw_name)
19
+ @current ||= (/^\*\s+/ =~ @raw_name)
18
20
  end
19
21
 
20
22
  def displayable_name(pad:)
@@ -26,15 +28,15 @@ module GitCurate
26
28
  end
27
29
 
28
30
  def last_author
29
- `git log -n1 --format=format:%an #{proper_name}`
31
+ Open3.capture2("git log -n1 --format=format:%an #{proper_name}").first
30
32
  end
31
33
 
32
34
  def last_commit_date
33
- `git log -n1 --date=short --format=format:%cd #{proper_name}`
35
+ Open3.capture2("git log -n1 --date=short --format=format:%cd #{proper_name}").first
34
36
  end
35
37
 
36
38
  def last_subject
37
- `git log -n1 --format=format:%s #{proper_name}`
39
+ Open3.capture2("git log -n1 --format=format:%s #{proper_name}").first
38
40
  end
39
41
 
40
42
  end
@@ -10,6 +10,8 @@ module GitCurate
10
10
  @parsed_options = {}
11
11
  end
12
12
 
13
+ # Sets @parsed_options according to the options received, and return truthy
14
+ # if and only if the program should continue after the options are passed.
13
15
  def parse(options)
14
16
  opt_parser = OptionParser.new do |opts|
15
17
  opts.banner = <<-EOF
@@ -36,16 +38,17 @@ module GitCurate
36
38
 
37
39
  opts.on("-h", "Print this help message") do
38
40
  puts opts
39
- exit
41
+ return false
40
42
  end
41
43
 
42
44
  opts.on("-v", "--version", "Print the currently installed version of this program") do
43
45
  puts "git curate v#{GitCurate::VERSION} #{GitCurate::COPYRIGHT}"
44
- exit
46
+ return false
45
47
  end
46
48
  end
47
49
 
48
50
  opt_parser.parse!(options)
51
+ return true
49
52
  end
50
53
  end
51
54
  end
@@ -1,3 +1,3 @@
1
1
  module GitCurate
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_curate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Harvey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-08 00:00:00.000000000 Z
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
97
111
  description: Step through local git branches from the command line, keeping or deleting
98
112
  each.
99
113
  email: