specinfra 2.0.0.beta13 → 2.0.0.beta14

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: 5c02ea87aab8e7f7ed23696adbe6f4c943179cd8
4
- data.tar.gz: ec24615f39351a0e8b94b85196e3ea00becb2ae9
3
+ metadata.gz: 26a24975924d84841a016386588bb54c094b94da
4
+ data.tar.gz: b0e847c24fb0dd945b0f68018ec54372eb6bdfc3
5
5
  SHA512:
6
- metadata.gz: b5639ff7909fc512270dc42c47f609b67635367b8faa5917316729e40c1506a36922d91d17f26a63fa670bac6942e7a4239f9e0e68fa46f3d7cdb81da59ee0ff
7
- data.tar.gz: abc23375ee803df39d37accd78cd054f229706dfb6aa8632ef2adeb2e8d0512627d88249fe85543d424b1e63a580c524d7e1437e2b458f7f057c049899b0554b
6
+ metadata.gz: 5437fca57eea9b86e5a3d885c32bc48e1f8c4fe55a9606421e02b9d55736a9e40542a63b0810f3f4aae646dfae75b778a9f3892d77f1d165848e68d2e3adbd21
7
+ data.tar.gz: b3b5647f3d39399cc0bf073aa6958e1666f88a79a758e5f0f89142a341dd56e22130d1a8f213b3f1cf4ffa642a218b11720d6c8ac8132bc4da70c51b384d1cfc
@@ -14,7 +14,7 @@ module Specinfra
14
14
  Specinfra::Configuration
15
15
  end
16
16
 
17
- def commands
17
+ def command
18
18
  Specinfra::Command::Base.new
19
19
  end
20
20
  end
@@ -20,7 +20,7 @@ module Specinfra
20
20
  end
21
21
 
22
22
  def check_zero(cmd, *args)
23
- run_command(Specinfra.commands.send(cmd, *args)).success?
23
+ run_command(Specinfra.command.send(cmd, *args)).success?
24
24
  end
25
25
 
26
26
  def method_missing(meth, *args, &block)
@@ -28,7 +28,7 @@ module Specinfra
28
28
  if meth.to_s =~ /^check/
29
29
  backend.check_zero(meth, *args)
30
30
  else
31
- backend.run_command(Specinfra.commands.send(meth, *args))
31
+ backend.run_command(Specinfra.command.send(meth, *args))
32
32
  end
33
33
  else
34
34
  Specinfra::Command::Processor.send(meth, *args)
@@ -4,12 +4,12 @@ module Specinfra::Command
4
4
  if meth.to_s =~ /^check/
5
5
  backend.check_zero(meth, *args)
6
6
  else
7
- backend.run_command(Specinfra.commands.send(meth, *args))
7
+ backend.run_command(Specinfra.command.send(meth, *args))
8
8
  end
9
9
  end
10
10
 
11
11
  def self.check_service_is_running(service)
12
- ret = backend.run_command(Specinfra.commands.check_service_is_running(service))
12
+ ret = backend.run_command(Specinfra.command.check_service_is_running(service))
13
13
 
14
14
  # In Ubuntu, some services are under upstart and "service foo status" returns
15
15
  # exit status 0 even though they are stopped.
@@ -18,14 +18,14 @@ module Specinfra::Command
18
18
 
19
19
  # If the service is not registered, check by ps command
20
20
  if ret.exit_status == 1
21
- ret = backend.run_command(Specinfra.commands.check_process_is_running(service))
21
+ ret = backend.run_command(Specinfra.command.check_process_is_running(service))
22
22
  end
23
23
 
24
24
  ret.success?
25
25
  end
26
26
 
27
27
  def self.check_service_is_monitored_by_monit(process)
28
- ret = backend.run_command(Specinfra.commands.check_service_is_monitored_by_monit(process))
28
+ ret = backend.run_command(Specinfra.command.check_service_is_monitored_by_monit(process))
29
29
  return false unless ret.stdout != nil && ret.success?
30
30
 
31
31
  retlines = ret.stdout.split(/[\r\n]+/).map(&:strip)
@@ -36,7 +36,7 @@ module Specinfra::Command
36
36
  end
37
37
 
38
38
  def self.check_file_is_readable(file, by_whom)
39
- mode = sprintf('%04s',backend.run_command(Specinfra.commands.get_file_mode(file)).stdout.strip)
39
+ mode = sprintf('%04s',backend.run_command(Specinfra.command.get_file_mode(file)).stdout.strip)
40
40
  mode = mode.split('')
41
41
  mode_octal = mode[0].to_i * 512 + mode[1].to_i * 64 + mode[2].to_i * 8 + mode[3].to_i * 1
42
42
  case by_whom
@@ -52,7 +52,7 @@ module Specinfra::Command
52
52
  end
53
53
 
54
54
  def self.check_file_is_writable(file, by_whom)
55
- mode = sprintf('%04s',backend.run_command(Specinfra.commands.get_file_mode(file)).stdout.strip)
55
+ mode = sprintf('%04s',backend.run_command(Specinfra.command.get_file_mode(file)).stdout.strip)
56
56
  mode = mode.split('')
57
57
  mode_octal = mode[0].to_i * 512 + mode[1].to_i * 64 + mode[2].to_i * 8 + mode[3].to_i * 1
58
58
  case by_whom
@@ -68,7 +68,7 @@ module Specinfra::Command
68
68
  end
69
69
 
70
70
  def self.check_file_is_executable(file, by_whom)
71
- mode = sprintf('%04s',backend.run_command(Specinfra.commands.get_file_mode(file)).stdout.strip)
71
+ mode = sprintf('%04s',backend.run_command(Specinfra.command.get_file_mode(file)).stdout.strip)
72
72
  mode = mode.split('')
73
73
  mode_octal = mode[0].to_i * 512 + mode[1].to_i * 64 + mode[2].to_i * 8 + mode[3].to_i * 1
74
74
  case by_whom
@@ -84,7 +84,7 @@ module Specinfra::Command
84
84
  end
85
85
 
86
86
  def self.check_file_is_mounted(path, expected_attr, only_with)
87
- ret = backend.run_command(Specinfra.commands.check_file_is_mounted(path))
87
+ ret = backend.run_command(Specinfra.command.check_file_is_mounted(path))
88
88
  if expected_attr.nil? || ret.failure?
89
89
  return ret.success?
90
90
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta13"
2
+ VERSION = "2.0.0.beta14"
3
3
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  set :os, { :family => nil }
4
4
 
5
- describe Specinfra.commands.check_file_is_directory('/tmp') do
5
+ describe Specinfra.command.check_file_is_directory('/tmp') do
6
6
  after do
7
7
  property[:os_by_host] = nil
8
8
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  property[:os_by_host] = {}
4
4
  set :os, { :family => 'redhat', :release => 7 }
5
5
 
6
- describe Specinfra.commands.command_class('interface').create do
6
+ describe Specinfra.command.command_class('interface').create do
7
7
  it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) }
8
8
  end
9
9
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  property[:os_by_host] = {}
4
4
  set :os, { :family => 'redhat' }
5
5
 
6
- describe Specinfra.commands.check_package_is_installed('httpd') do
6
+ describe Specinfra.command.check_package_is_installed('httpd') do
7
7
  after do
8
8
  property[:os_by_host] = nil
9
9
  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.0.0.beta13
4
+ version: 2.0.0.beta14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-30 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh