hiptest-publisher 0.9.6 → 0.9.7

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: a381b154c461535ecc7d576b9a8ec51d79f8c1b3
4
- data.tar.gz: d3d49e9f2b2afd0d50fa969311a22991552ecd41
3
+ metadata.gz: fd7605662ca83f41503ad95b2a506451ac5b501e
4
+ data.tar.gz: dc4237ee6f5843a22fbb989de9f12f274d90dca0
5
5
  SHA512:
6
- metadata.gz: 129e588aaa6ce5505ca5e9cb6c927dd324541f11a2994da1afefdddc2c08c32ae65a998e4968da745ee825851919cfeeb93f09d294b09fa9264c7c95006a7d42
7
- data.tar.gz: b374547133e83f8c350657560a4bdef122e78a8c29bb427df83da6a84210ce63793e9c423507b05b38a93c38b2935e340ddd0fd664ee8836b9e0b9fae26e515d
6
+ metadata.gz: 1b66828000929f3d5bf98d776f84d2544fc0db8c79527a90db405e2cd668d35e019f21e0faac6cb1a8a8325efbf93a988d9c5571f487af5437ea1f3d270da030
7
+ data.tar.gz: 928a8581fb2cda37e2c5f70888b36e3d5ba41a5b8a19e7ad49b4590ee4dec59c50ebbb0d5edff387b7e8ebcd20899e858a8fdb6f77245990ce26f98931306329
@@ -1,5 +1,7 @@
1
1
  require 'pathname'
2
2
 
3
+ require 'hiptest-publisher/utils'
4
+
3
5
  module Hiptest
4
6
  class CliOptionError < StandardError
5
7
  end
@@ -61,7 +63,7 @@ module Hiptest
61
63
 
62
64
  def check_push_file
63
65
  if cli_options.push
64
- agnostic_path = cli_options.push.gsub('\\', '/')
66
+ agnostic_path = clean_path(cli_options.push)
65
67
  globbed_files = Dir.glob(agnostic_path)
66
68
 
67
69
  if globbed_files.length == 0
@@ -77,7 +79,9 @@ module Hiptest
77
79
  end
78
80
 
79
81
  def check_output_directory
80
- parent = first_existing_parent(cli_options.output_directory)
82
+ output_directory = clean_path(cli_options.output_directory)
83
+
84
+ parent = first_existing_parent(output_directory)
81
85
  if !parent.writable?
82
86
  if parent.realpath === Pathname.new(cli_options.output_directory).cleanpath
83
87
  raise CliOptionError, "Error with --output-directory: the directory \"#{@cli_options.output_directory}\" is not writable"
@@ -107,9 +111,11 @@ module Hiptest
107
111
 
108
112
  def check_xml_file
109
113
  if cli_options.xml_file
110
- if !File.readable?(cli_options.xml_file)
114
+ xml_path = clean_path(cli_options.xml_file)
115
+
116
+ if !File.readable?(xml_path)
111
117
  raise CliOptionError, "Error with --xml-file: the file \"#{cli_options.xml_file}\" does not exist or is not readable"
112
- elsif !File.file?(cli_options.xml_file)
118
+ elsif !File.file?(xml_path)
113
119
  raise CliOptionError, "Error with --xml-file: the file \"#{cli_options.xml_file}\" is not a regular file"
114
120
  end
115
121
  end
@@ -3,6 +3,8 @@ require 'io/console'
3
3
  require 'open-uri'
4
4
  require 'openssl'
5
5
  require 'net/http/post/multipart'
6
+ require 'pathname'
7
+
6
8
 
7
9
  def hiptest_publisher_path
8
10
  Gem.loaded_specs['hiptest-publisher'].full_gem_path
@@ -113,3 +115,7 @@ def push_results(options)
113
115
  http.request(req)
114
116
  end
115
117
  end
118
+
119
+ def clean_path(path)
120
+ Pathname.new(path).cleanpath.to_s
121
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiptest-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiptest R&D