fauxhai 4.0.1 → 4.0.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: 64a12aa7bdeb2226e4d8a403a02e3db017321044
4
- data.tar.gz: d99baceee5419cf1fa6660892724881f74124d5f
3
+ metadata.gz: b40f0712d3762eca576ea67090ef41691e77d75e
4
+ data.tar.gz: 53f17c72c666f8e97b05721b7a517a1435f1d1ca
5
5
  SHA512:
6
- metadata.gz: 239c3052350447947256266a455f1bd5b9d99c57988a0833a6fe44f4bdcf28c66850a5f7c6f1a1a7a10a9fd99edb58d4eed37fb5c45accbff4b60f3e7ce42f69
7
- data.tar.gz: 21e283c46705c9f19822f48f1f898c446c8cd025f7969072cdf281d60872ac82f11843524cfca40260815e23ff3279f3589a79f9f7a9c71b163ff6f181ffca69
6
+ metadata.gz: 7067d42f4ddaf456e99936e364871a20f68e90cda94014a3258633b27d3a46e50c925d2a0b078dc001dd39304e30659de6ffa9f16b7412ec2968f51a2f26a0ce
7
+ data.tar.gz: b6c618d69cbe64624d969ecb51965122cc87d18142abfbe5ededc70a69cc566c4e96f61d1f58ce27e6f1aec284561d6dae1f66d353784d4e6f046caf8aed524f
@@ -1,5 +1,9 @@
1
1
  # Fauxhai Changelog
2
2
 
3
+ ## v4.0.2 (2017-03-20)
4
+
5
+ - Link to the platforms.md file in the platform not found exception messages
6
+
3
7
  ## v4.0.1 (2017-03-09)
4
8
 
5
9
  - Added a new platforms.md file in this repo that lists all current platforms and versions available. This is generated with a new Rake task
@@ -7,6 +7,9 @@ module Fauxhai
7
7
  # The base URL for the GitHub project (raw)
8
8
  RAW_BASE = 'https://raw.githubusercontent.com/customink/fauxhai/master'
9
9
 
10
+ # A message about where to find a list of platforms
11
+ PLATFORM_LIST_MESSAGE = "A list of available platforms is available at https://github.com/customink/fauxhai/blob/master/PLATFORMS.md".freeze
12
+
10
13
  # @return [Hash] The raw ohai data for the given Mock
11
14
  attr_reader :data
12
15
 
@@ -61,7 +64,7 @@ module Fauxhai
61
64
  begin
62
65
  response = open("#{RAW_BASE}/lib/fauxhai/platforms/#{platform}/#{version}.json")
63
66
  rescue OpenURI::HTTPError
64
- raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' in any of the sources!")
67
+ raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' in any of the sources! #{PLATFORM_LIST_MESSAGE}")
65
68
  end
66
69
 
67
70
  if response.status.first.to_i == 200
@@ -72,7 +75,7 @@ module Fauxhai
72
75
  File.open(filepath, 'w') { |f| f.write(response_body) }
73
76
  return JSON.parse(response_body)
74
77
  else
75
- raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' in any of the sources!")
78
+ raise Fauxhai::Exception::InvalidPlatform.new("Could not find platform '#{platform}/#{version}' in any of the sources! #{PLATFORM_LIST_MESSAGE}")
76
79
  end
77
80
  end
78
81
  end.call
@@ -80,7 +83,7 @@ module Fauxhai
80
83
 
81
84
  def platform
82
85
  @options[:platform] ||= begin
83
- STDERR.puts "WARNING: you must specify a 'platform' and 'version' to your ChefSpec Runner and/or Fauxhai constructor, in the future omitting these will become a hard error"
86
+ STDERR.puts "WARNING: you must specify a 'platform' and 'version' to your ChefSpec Runner and/or Fauxhai constructor, in the future omitting these will become a hard error. #{PLATFORM_LIST_MESSAGE}"
84
87
  'chefspec'
85
88
  end
86
89
  end
@@ -90,7 +93,7 @@ module Fauxhai
90
93
  end
91
94
 
92
95
  def version
93
- @options[:version] ||= chefspec_version || raise(Fauxhai::Exception::InvalidVersion.new('Platform version not specified'))
96
+ @options[:version] ||= chefspec_version || raise(Fauxhai::Exception::InvalidVersion.new("Platform version not specified. #{PLATFORM_LIST_MESSAGE}"))
94
97
  end
95
98
 
96
99
  def chefspec_version
@@ -1,3 +1,3 @@
1
1
  module Fauxhai
2
- VERSION = '4.0.1'
2
+ VERSION = '4.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fauxhai
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-09 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh