vagrant-hypconfigmgmt 0.0.8 → 0.0.9

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: 6730a56af721c8c091198340255a2333d919e72e
4
- data.tar.gz: beba82b76a65bc87f9df90facfee55053520ab11
3
+ metadata.gz: d76a9d48cf7ce3ceb694c7feac30adb63563f762
4
+ data.tar.gz: d87cbd2b7618529cec72d8d3501ebef9cb9069f1
5
5
  SHA512:
6
- metadata.gz: 67044b50e77eddcbc5ef8ad55f2b7c9e3c0a68fe03fa0d9d65a983ab1f3fd32db6414f9c763cccf6af0364f6d279ce058fa82f626b1e8395245c98aa64f3904d
7
- data.tar.gz: 4191d683a66dbd775d84315279d1ccb6f8a6d8aff15442a39484017a53369a88b65961731d79ef53a6bf6bde445c08a99ae205b3eb2e5d7f6162a5f1e91d3184
6
+ metadata.gz: 437077e4c2ee8fa22904b1456cb956ee36d498b31f9aefa692bef483dcd6607b29e0563f03558d1d51752718ce29fd90599c74e0ba79dd859aa2805be3eee906
7
+ data.tar.gz: 45ccf4934e1280d519ca02ede7715a51f96d9a86e1e4c6c1012e02cad5b1b9bcb13836aa6d7695ad5ca77ff23fa504ea47320aae8f09fe1b41eaec7bd2ca5cdd
data/README.md CHANGED
@@ -11,5 +11,5 @@ Create the gemfile (package)
11
11
  ```
12
12
  $ make
13
13
  rake build
14
- vagrant-hypconfigmgmt 0.0.8 built to pkg/vagrant-hypconfigmgmt-0.0.8.gem.
14
+ vagrant-hypconfigmgmt 0.0.8 built to pkg/vagrant-hypconfigmgmt-0.0.9.gem.
15
15
  ```
@@ -5,7 +5,7 @@ DEFAULT_MAGENTO_VERSION = 2
5
5
  AVAILABLE_MAGENTO_VERSIONS = [1, 2]
6
6
 
7
7
  DEFAULT_PHP_VERSION = 7.0
8
- AVAILABLE_PHP_VERSIONS = [5.5, 7.0]
8
+ AVAILABLE_PHP_VERSIONS = [5.5, 5.6, 7.0]
9
9
 
10
10
  DEFAULT_VARNISH_STATE = false
11
11
  AVAILABLE_VARNISH_STATES = [true, false]
@@ -292,6 +292,10 @@ HEREDOC
292
292
  settings['vagrant']['box'] = 'hypernode_xenial'
293
293
  settings['vagrant']['box_url'] = 'http://vagrant.hypernode.com/customer/xenial/catalog.json'
294
294
  else
295
+ if settings['php']['version'] == 5.6
296
+ env[:ui].warning("The Precise Hypernodes don't have PHP5.6. Falling back to 5.5. Use the Xenial version of this box if you want PHP5.6")
297
+ settings['php']['version'] = 5.5
298
+ end
295
299
  case settings['php']['version']
296
300
  when 5.5
297
301
  env[:ui].info("Will use PHP 5.5. If you want PHP 7 instead change the php version in local.yml.")
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Vagrant
5
5
  module Hypconfigmgmt
6
- VERSION = "0.0.8"
6
+ VERSION = "0.0.9"
7
7
  end
8
8
  end
Binary file
@@ -13,6 +13,7 @@ describe VagrantHypconfigmgmt::Command do
13
13
  let(:ui) do
14
14
  double('ui').tap do |ui|
15
15
  allow(ui).to receive(:info) { nil }
16
+ allow(ui).to receive(:warning) { nil }
16
17
  end
17
18
  end
18
19
 
@@ -159,6 +160,80 @@ describe VagrantHypconfigmgmt::Command do
159
160
  end
160
161
  end
161
162
 
163
+ context "when php 5.6 is configured but no ubuntu version specified" do
164
+ let(:retrieved_settings) { { "php" => { "version" => 5.6 }, "vagrant" => Hash.new } }
165
+ it "sets the box name and box url to the right values for PHP 5.6" do
166
+ expected_settings = {
167
+ "ubuntu_version" => "precise",
168
+ "php" => {
169
+ "version" => 5.5
170
+ },
171
+ "vagrant" => {
172
+ # Falling back to php5.5, Precise Hypernodes have no PHP5.6
173
+ "box" => "hypernode_php5",
174
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
175
+ }
176
+ }
177
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
178
+ expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
179
+ # check if the ubuntu version is gotten and pretend it returns precise
180
+ expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
181
+ # check if the settings that are written back to disk contain the right box (name) and box_url
182
+ expect(subject).to receive(:update_settings).once.with(expected_settings)
183
+ # check if the user is warned about falling back to 5.5
184
+ expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
185
+ end
186
+ end
187
+
188
+ context "when php 5.6 is configured and precise ubuntu version specified" do
189
+ let(:retrieved_settings) { { "php" => { "version" => 5.6 }, "vagrant" => Hash.new, "ubuntu_version" => "precise" } }
190
+ it "sets the box name and box url to the right values for PHP 5.5" do
191
+ expected_settings = {
192
+ "ubuntu_version" => "precise",
193
+ "php" => {
194
+ # Falling back to php5.5, Precise Hypernodes have no PHP5.6
195
+ "version" => 5.5
196
+ },
197
+ "vagrant" => {
198
+ "box" => "hypernode_php5",
199
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
200
+ }
201
+ }
202
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
203
+ expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
204
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
205
+ expect(subject).to receive(:get_ubuntu_version).never
206
+ # check if the settings that are written back to disk contain the right box (name) and box_url
207
+ expect(subject).to receive(:update_settings).once.with(expected_settings)
208
+ # check if the user is warned about falling back to 5.5
209
+ expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
210
+ end
211
+ end
212
+
213
+ context "when php 5.6 is configured and xenial ubuntu version specified" do
214
+ let(:retrieved_settings) { { "php" => { "version" => 5.6 }, "vagrant" => Hash.new, "ubuntu_version" => "xenial" } }
215
+ it "sets the box name and box url to the right values for PHP 5.6" do
216
+ expected_settings = {
217
+ "ubuntu_version" => "xenial",
218
+ "php" => {
219
+ "version" => 5.6
220
+ },
221
+ "vagrant" => {
222
+ "box" => "hypernode_xenial",
223
+ "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
224
+ }
225
+ }
226
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
227
+ expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
228
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
229
+ expect(subject).to receive(:get_ubuntu_version).never
230
+ # check if the settings that are written back to disk contain the right box (name) and box_url
231
+ expect(subject).to receive(:update_settings).once.with(expected_settings)
232
+ # check that the user is not warned about falling back because we do have 5.6 on Xenial
233
+ expect(ui).to receive(:warning).never
234
+ end
235
+ end
236
+
162
237
  context "when an unknown php version is configured" do
163
238
  let(:retrieved_settings) { { "php" => { "version" => 1.0 }, "vagrant" => Hash.new } }
164
239
  it "does not set the box name and box url" do
@@ -34,7 +34,7 @@ describe VagrantHypconfigmgmt::Command do
34
34
 
35
35
  context "when the options are floats" do
36
36
  it "it casts the floats to strings and returns them separated by 'or'" do
37
- expect( subject.get_options_string([5.5, 7.0]) ).to eq("5.5 or 7.0")
37
+ expect( subject.get_options_string([5.5, 5.6, 7.0]) ).to eq("5.5 or 5.6 or 7.0")
38
38
  end
39
39
  end
40
40
 
@@ -38,6 +38,21 @@ describe VagrantHypconfigmgmt::Command do
38
38
  end
39
39
 
40
40
 
41
+ context "when PHP 5.6 is configured" do
42
+ it "it notifies the user that PHP 5.6 will be used and returns the value" do
43
+ # check if the setting is prompted for and pretend it returns a "PHP 5.6" answer
44
+ expect(subject).to receive(:get_setting).with(
45
+ env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
46
+ "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
47
+ ).and_return("5.6")
48
+ # check if the user is notified about the PHP version
49
+ expect(ui).to receive(:info).once.with(/.*PHP 5.6*/)
50
+ # check if the function returns float 5.5 if a PHP 5.5 Vagrant is to be used
51
+ expect( subject.get_php_version(env) ).to eq(5.6)
52
+ end
53
+ end
54
+
55
+
41
56
  context "when PHP 7.0 is configured" do
42
57
  it "it notifies the user that PHP 7.0 will be used and returns the value" do
43
58
  # check if the setting is prompted for and pretend it returns a "PHP 7.0" answer
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-hypconfigmgmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick van de Loo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,7 +98,7 @@ files:
98
98
  - lib/vagrant-hypconfigmgmt/command.rb
99
99
  - lib/vagrant-hypconfigmgmt/config.rb
100
100
  - lib/vagrant-hypconfigmgmt/version.rb
101
- - pkg/vagrant-hypconfigmgmt-0.0.7.gem
101
+ - pkg/vagrant-hypconfigmgmt-0.0.8.gem
102
102
  - spec/spec_helper.rb
103
103
  - spec/unit/command/call_spec.rb
104
104
  - spec/unit/command/configure_cgroup_spec.rb
Binary file