specinfra 2.35.1 → 2.36.0

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: 14e06d19c0a3038546153e4085ad0becd03b94f9
4
- data.tar.gz: ccc0e91ca160daf01e681b277f82976d76edfd46
3
+ metadata.gz: ba72337ccaf4712a530e15f891406045d124b271
4
+ data.tar.gz: 273a5118e176f1bc48aa8057b6c4e46b3eadf20d
5
5
  SHA512:
6
- metadata.gz: 8ea4a629909c618faf67f9b9c3a4e966059f3e066db749b290a18620f7b90c5bdf4eca337e677a196ee174ffd6fec8b5427bdccdc0a770b2e6a5a486c61834a7
7
- data.tar.gz: c436115f88456d1c30b4fcc62a377a5f4f6bf4052cc6248f9b2361436eb97594d98a0d389e5b0db45d575b79396ce5948ab16379ce1fceee70c96a3d455cf183
6
+ metadata.gz: d63e38da22c28976d54e5b33f75a6f433862b0ccc2f1e1406898c29c87e6108309fd48ea5e8673de1339726e745472d73990c9c997836eba262e68870e06628e
7
+ data.tar.gz: 4e078c7326cf195ea3392c5f211279d29638069bbca6239d85254e863d13ee5ea496563ceeb6e9e948f48724fc0de1c7f3ef7398bf6646233aa8ada548d6415f
@@ -100,6 +100,10 @@ require 'specinfra/command/fedora/base/service'
100
100
  require 'specinfra/command/fedora/v15'
101
101
  require 'specinfra/command/fedora/v15/service'
102
102
 
103
+ # Amazon Linux (inherit RedHat)
104
+ require 'specinfra/command/amazon'
105
+ require 'specinfra/command/amazon/base'
106
+
103
107
  # AIX (inherit Base)
104
108
  require 'specinfra/command/aix'
105
109
  require 'specinfra/command/aix/base'
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Amazon;end
2
+
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Amazon::Base < Specinfra::Command::Redhat::Base
2
+ end
@@ -16,7 +16,11 @@ class Specinfra::Helper::DetectOs::Redhat < Specinfra::Helper::DetectOs
16
16
 
17
17
  { :family => 'redhat', :release => release }
18
18
  elsif run_command('ls /etc/system-release').success?
19
- { :family => 'redhat', :release => nil } # Amazon Linux
19
+ line = run_command('cat /etc/system-release').stdout
20
+ if line =~ /release (\d[\d.]*)/
21
+ release = $1
22
+ end
23
+ { :family => 'amazon', :release => release }
20
24
  end
21
25
  end
22
26
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.35.1"
2
+ VERSION = "2.36.0"
3
3
  end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, { :family => 'amazon', :release => nil }
5
+
6
+ describe Specinfra.command.send(:create_command_class, 'interface') do
7
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) }
8
+ end
9
+
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, { :family => 'amazon' }
4
+
5
+ describe get_command(:check_package_is_installed, 'httpd') do
6
+ it { should eq 'rpm -q httpd' }
7
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, :family => 'amazon'
5
+
6
+ describe get_command(:enable_service, 'httpd') do
7
+ it { should eq 'chkconfig httpd on' }
8
+ end
9
+
10
+ describe get_command(:disable_service, 'httpd') do
11
+ it { should eq 'chkconfig httpd off' }
12
+ end
13
+
14
+ describe get_command(:start_service, 'httpd') do
15
+ it { should eq 'service httpd start' }
16
+ end
17
+
18
+ describe get_command(:stop_service, 'httpd') do
19
+ it { should eq 'service httpd stop' }
20
+ end
21
+
22
+ describe get_command(:restart_service, 'httpd') do
23
+ it { should eq 'service httpd restart' }
24
+ end
25
+
26
+ describe get_command(:reload_service, 'httpd') do
27
+ it { should eq 'service httpd reload' }
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.35.1
4
+ version: 2.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -152,6 +152,8 @@ files:
152
152
  - lib/specinfra/command/alpine/base.rb
153
153
  - lib/specinfra/command/alpine/base/package.rb
154
154
  - lib/specinfra/command/alpine/base/process.rb
155
+ - lib/specinfra/command/amazon.rb
156
+ - lib/specinfra/command/amazon/base.rb
155
157
  - lib/specinfra/command/arch.rb
156
158
  - lib/specinfra/command/arch/base.rb
157
159
  - lib/specinfra/command/arch/base/file.rb
@@ -394,6 +396,9 @@ files:
394
396
  - spec/backend/exec/build_command_spec.rb
395
397
  - spec/backend/exec/env_spec.rb
396
398
  - spec/backend/ssh/build_command_spec.rb
399
+ - spec/command/amazon/interface_spec.rb
400
+ - spec/command/amazon/package_spec.rb
401
+ - spec/command/amazon/service_spec.rb
397
402
  - spec/command/base/file_spec.rb
398
403
  - spec/command/base/group_spec.rb
399
404
  - spec/command/base/localhost_spec.rb
@@ -460,6 +465,9 @@ test_files:
460
465
  - spec/backend/exec/build_command_spec.rb
461
466
  - spec/backend/exec/env_spec.rb
462
467
  - spec/backend/ssh/build_command_spec.rb
468
+ - spec/command/amazon/interface_spec.rb
469
+ - spec/command/amazon/package_spec.rb
470
+ - spec/command/amazon/service_spec.rb
463
471
  - spec/command/base/file_spec.rb
464
472
  - spec/command/base/group_spec.rb
465
473
  - spec/command/base/localhost_spec.rb