openstudio_measure_tester 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
  SHA1:
3
- metadata.gz: cf7807726298de144c1f44ded68e11af9b389c38
4
- data.tar.gz: afa2d01a892ea3fb49a5e4d93555b40974873d35
3
+ metadata.gz: 115113315811da74ef6a2d39bf2ed2f617d091c4
4
+ data.tar.gz: d0b4058a1a1751da72781357e0325f3a0acf53d7
5
5
  SHA512:
6
- metadata.gz: 5e10be74cad42b0c28d455d2dca57c9dad75a3cc8e6f3d85436c7c2f8af64361afcd926595d00005339a7c3c720f1408630cb0b155e39a658215f8ee4ccdbb87
7
- data.tar.gz: 2ca984e2587912994d06f0ca7d779c6b3fa2acb96730769e3928c423750e8285706814ec4529e68b7668df9cf9e234e599f2bf7638d3da3dd504fcd2d47a5024
6
+ metadata.gz: 64bffbc0f06b6e17c9616c2eeeb7daf4bc010962637eb7f50c527d48964048a78266f9c25858f0797026032f5618280086503aff85e91c216e7138630601b285
7
+ data.tar.gz: 32b3638d6c38aab842e68c4dda5d2d0e44f53661a9238a1db7b8ed11405a498b973ec3f02c7548aba66368d2d989f664a06ac97ae6ee87f4babbec5d35ea5f1d
@@ -1,8 +1,11 @@
1
+ # Version 0.1.2
2
+
3
+ * Do not crash when the current measure is not in a Git repository
4
+
1
5
  # Version 0.1.1
2
6
 
3
7
  * Check for the existence of the LICENSE.md file in the root of the measures
4
8
 
5
-
6
9
  # Version 0.1
7
10
 
8
11
  * Initial release of the OpenStudio Tester Gem.
@@ -39,15 +39,21 @@ module OpenStudioMeasureTester
39
39
  @results = {}
40
40
 
41
41
  # get the repository info
42
- # TODO add failsafe
43
- g = Git.open(Dir.pwd)
44
- config = g.config
45
- repo_name = config['remote.origin.url'] ? config['remote.origin.url'].split('/').last.chomp('.git') : nil
46
- current_branch = g.branch.name ? g.branch.name : nil
47
- logs = g.log
48
- sha = nil
49
- if !logs.empty?
50
- sha = logs.first.sha
42
+ repo_name = 'unknown'
43
+ current_branch = 'unknown'
44
+ sha = 'unknown'
45
+ begin
46
+ g = Git.open(Dir.pwd)
47
+ config = g.config
48
+ repo_name = config['remote.origin.url'] ? config['remote.origin.url'].split('/').last.chomp('.git') : nil
49
+ current_branch = g.branch.name ? g.branch.name : nil
50
+ logs = g.log
51
+ sha = nil
52
+ if !logs.empty?
53
+ sha = logs.first.sha
54
+ end
55
+ rescue StandardError => error
56
+ puts "Could not find .git for measure(s), will not be able to report git information"
51
57
  end
52
58
 
53
59
  # check if the results data already exist, and if so, then load the file now to keep the results
@@ -27,5 +27,5 @@
27
27
  ########################################################################################################################
28
28
 
29
29
  module OpenStudioMeasureTester
30
- VERSION = '0.1.1'.freeze
30
+ VERSION = '0.1.2'.freeze
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio_measure_tester
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
  - Nicholas Long