tbgit 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tbgit/version.rb +1 -1
  3. data/lib/tbspec.rb +14 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8bba5a81f9d15e8ddf62a5588599be8d8dc20bd
4
- data.tar.gz: 06006d1182bf97073237ed11519cc68fe93ddb42
3
+ metadata.gz: 9371c3b3beaa50e8be81c12a67101e97399e2b83
4
+ data.tar.gz: 487cdd223ff3fd3029c6238a44f7bd0dfa8b42b9
5
5
  SHA512:
6
- metadata.gz: b0cb40f51daa2c3e955c0dabf07691754190917ad975fa7c5a40d76dcafa4cbb385c68679b5da4548978b4737932627c09ae6c65345e3f3142f5b82f66e06b81
7
- data.tar.gz: 326413c17f9f36162955555aac79e810837e0454daba65b917c7954cecd1788e07659c53b94950bd838c1a519dc86f749f515e60e1c6a03ae3c7bf66c0e218cc
6
+ metadata.gz: 1a2cc682892b625dc26ec5dfe86f9103a07101fec0c05ffe7ae54b39a557a09fefe8eb58540ec5990726232e0f62264a479c0fd1867376ae4db3d65659ce8a6b
7
+ data.tar.gz: 2abc3a5699de3d3ae77a14e69af813e07317abf83e50a45c8cee9299036719196d2309b42da7471f71823ff7c0f02a571d0a1821be78dbf1f5ca56f7d0064533
data/lib/tbgit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tbgit
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/lib/tbspec.rb CHANGED
@@ -38,6 +38,10 @@ class TBSpec
38
38
  options[:all] = a
39
39
  end
40
40
 
41
+ opts.on("--most-recent", "Use this option to spec the student with the most recent commit.") do |m|
42
+ options[:most_recent] = m
43
+ end
44
+
41
45
  opts.on_tail("-h", "--help", "Show this message") do
42
46
  puts opts
43
47
  exit
@@ -81,7 +85,16 @@ class TBSpec
81
85
 
82
86
  all = false
83
87
  student = ""
84
- if options[:student]==nil && !options[:all]
88
+ if options[:most_recent]
89
+ most_recent_file = Tempfile.new("recent")
90
+
91
+ command = "git for-each-ref --sort=-committerdate refs/heads/ --format='%(refname:short)' >> " + most_recent_file.path
92
+ system command
93
+ puts command
94
+ array = IO.readlines(most_recent_file)
95
+
96
+ student = array[0].chomp
97
+ elsif options[:student]==nil && !options[:all]
85
98
  puts "Please specify a student to spec. Type 'all' to spec all students"
86
99
  student = $stdin.gets.chomp
87
100
  elsif options[:student]!=nil && !options[:all]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tbgit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Proctor