fauxhai 4.0.1 → 4.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/fauxhai/mocker.rb +7 -4
- data/lib/fauxhai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b40f0712d3762eca576ea67090ef41691e77d75e
|
|
4
|
+
data.tar.gz: 53f17c72c666f8e97b05721b7a517a1435f1d1ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7067d42f4ddaf456e99936e364871a20f68e90cda94014a3258633b27d3a46e50c925d2a0b078dc001dd39304e30659de6ffa9f16b7412ec2968f51a2f26a0ce
|
|
7
|
+
data.tar.gz: b6c618d69cbe64624d969ecb51965122cc87d18142abfbe5ededc70a69cc566c4e96f61d1f58ce27e6f1aec284561d6dae1f66d353784d4e6f046caf8aed524f
|
data/CHANGELOG.md
CHANGED
|
@@ -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
|
data/lib/fauxhai/mocker.rb
CHANGED
|
@@ -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(
|
|
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
|
data/lib/fauxhai/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-ssh
|