middleman-hashicorp 0.3.34 → 0.3.35
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/lib/middleman-hashicorp/extension.rb +9 -7
- data/lib/middleman-hashicorp/version.rb +1 -1
- data/spec/unit/helper_spec.rb +28 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2c7a885e60c254c12acb316b53cabc7717496ba1f983da5d58ba6b945c069ac
|
4
|
+
data.tar.gz: 7f9a6224170edaed847f424251ea2655a73dac302b48d43ee3ecd622df623821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8534412acabb03191b17a3468273b661d9fdcecc615b0c233a523a0d3658819879ed0ca6fcb4d0ddb50f4bddae4588862f8221403718e88603471d77ca611148
|
7
|
+
data.tar.gz: e3bccac8d724eb0c7fd5caef1cae6eb7f8c1b26c873ccd21dcedf1f74aa66ba934d5661e08358f64fe28ce7c77257e616393fcf4e086b65230b001509ce0f636
|
@@ -153,17 +153,19 @@ class Middleman::HashiCorpExtension < ::Middleman::Extension
|
|
153
153
|
#
|
154
154
|
def pretty_os(os)
|
155
155
|
case os
|
156
|
-
when
|
157
|
-
"
|
158
|
-
when
|
156
|
+
when "darwin"
|
157
|
+
"macOS"
|
158
|
+
when "freebsd"
|
159
159
|
"FreeBSD"
|
160
|
-
when
|
160
|
+
when "openbsd"
|
161
161
|
"OpenBSD"
|
162
|
-
when
|
162
|
+
when "netbsd"
|
163
163
|
"NetBSD"
|
164
|
-
when
|
164
|
+
when "archlinux"
|
165
|
+
"Arch Linux"
|
166
|
+
when "linux"
|
165
167
|
"Linux"
|
166
|
-
when
|
168
|
+
when "windows"
|
167
169
|
"Windows"
|
168
170
|
else
|
169
171
|
os.capitalize
|
data/spec/unit/helper_spec.rb
CHANGED
@@ -93,4 +93,32 @@ class Middleman::HashiCorpExtension
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
96
|
+
|
97
|
+
describe "#pretty_os" do
|
98
|
+
before(:each) do
|
99
|
+
app = middleman_app
|
100
|
+
@instance = Middleman::HashiCorpExtension.new(app,
|
101
|
+
releases_enabled: false,
|
102
|
+
)
|
103
|
+
@instance.app = app
|
104
|
+
end
|
105
|
+
|
106
|
+
[
|
107
|
+
["darwin", "macOS"],
|
108
|
+
["freebsd", "FreeBSD"],
|
109
|
+
["openbsd", "OpenBSD"],
|
110
|
+
["netbsd", "NetBSD"],
|
111
|
+
["archlinux", "Arch Linux"],
|
112
|
+
["linux", "Linux"],
|
113
|
+
["windows", "Windows"],
|
114
|
+
].each do |given, expected|
|
115
|
+
it "converts #{given} to #{expected}" do
|
116
|
+
expect(@instance.app.pretty_os(given)).to eq(expected)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should capitalize unknown OS" do
|
121
|
+
expect(@instance.app.pretty_os("hashicorplinux")).to eq("Hashicorplinux")
|
122
|
+
end
|
123
|
+
end
|
96
124
|
end
|