specinfra 2.0.0.beta37 → 2.0.0.beta38

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fcd303d98c81eca8dfb80bffd2a40c31a9c9600
4
- data.tar.gz: de2bfe1fd3fd2af870df63d43d800231e6fb7c4f
3
+ metadata.gz: 60e39a9acb4823ac00ff500c25aac712864afb95
4
+ data.tar.gz: de0970a4443c83606403c92d1d58ef4d938a0597
5
5
  SHA512:
6
- metadata.gz: bcf11bf4e7a0e5b1b21e3b79a2ceb351dd92682a78f5e515c7e6b0a0ce323ccb6bc3b2868c6660b0c2055abb5c02b3e06d4ef6cd0720234c0f8be27cd7edd439
7
- data.tar.gz: d79c7ea5476f36ccf543654a61ed3b1faf8785f70e53c7b6ed4e5e8e6572564406cf2091c6a7e2265074e573c1750df3a54f50b83649e08acff6fbe76576196e
6
+ metadata.gz: 7522cfbd716e5b09a38b45c3060f2e09d61a3264cd3099240380f5c9fb69c0071bf51ac220fba24bed543312fba39033b85526d86d70b6f58a88c67553869df0
7
+ data.tar.gz: 07507396ca2dd332d387a13e84b72eeeff9a833207f617d1976c8d669719e2c87aff4974d7dc5b5e360d1a81b33abe7ffacaf8363c4a9b26602fdb89ee2a1a0a
@@ -12,7 +12,8 @@ class Specinfra::Command::Arch::Base::Package < Specinfra::Command::Linux::Base:
12
12
  "pacman -Qi #{package} | grep Version | awk '{print $3}'"
13
13
  end
14
14
 
15
- def install(package)
15
+ def install(package, version=nil)
16
+ # Pacman doesn't support to install specific version.
16
17
  "pacman -S --noconfirm #{package}"
17
18
  end
18
19
 
@@ -17,7 +17,8 @@ class Specinfra::Command::Darwin::Base::Package < Specinfra::Command::Base::Pack
17
17
  cmd = "#{cmd} | grep '^version: #{escape(version)}'" if version
18
18
  end
19
19
 
20
- def install(package)
20
+ def install(package, version=nil)
21
+ # Homebrew doesn't support to install specific version.
21
22
  cmd = "brew install '#{package}'"
22
23
  end
23
24
  end
@@ -12,8 +12,13 @@ class Specinfra::Command::Debian::Base::Package < Specinfra::Command::Linux::Bas
12
12
 
13
13
  alias :check_is_installed_by_apt :check_is_installed
14
14
 
15
- def install(package)
16
- "DEBIAN_FRONTEND='noninteractive' apt-get -y install #{package}"
15
+ def install(package, version=nil)
16
+ if version
17
+ full_package = "#{package}=#{version}"
18
+ else
19
+ full_package = package
20
+ end
21
+ "DEBIAN_FRONTEND='noninteractive' apt-get -y install #{full_package}"
17
22
  end
18
23
 
19
24
  def get_version(package, opts=nil)
@@ -8,7 +8,7 @@ class Specinfra::Command::Freebsd::Base::Package < Specinfra::Command::Base::Pac
8
8
  end
9
9
  end
10
10
 
11
- def install(package)
11
+ def install(package, version=nil)
12
12
  "pkg_add -r install #{package}"
13
13
  end
14
14
 
@@ -8,7 +8,7 @@ class Specinfra::Command::Freebsd::V10::Package < Specinfra::Command::Freebsd::B
8
8
  end
9
9
  end
10
10
 
11
- def install(package)
11
+ def install(package, version=nil)
12
12
  "pkg install -y #{package}"
13
13
  end
14
14
 
@@ -10,8 +10,8 @@ class Specinfra::Command::Nixos::Base::Package < Specinfra::Command::Linux::Base
10
10
 
11
11
  alias :check_is_installed_by_nix :check_is_installed
12
12
 
13
- def install(package)
13
+ def install(package, version=nil)
14
14
  "nix-env -i #{package}"
15
15
  end
16
- end
16
+ end
17
17
  end
@@ -8,7 +8,7 @@ class Specinfra::Command::Openbsd::Base::Package < Specinfra::Command::Base::Pac
8
8
  end
9
9
  end
10
10
 
11
- def install(package)
11
+ def install(package, version=nil)
12
12
  "pkg_add #{package}"
13
13
  end
14
14
  end
@@ -14,8 +14,13 @@ class Specinfra::Command::Redhat::Base::Package < Specinfra::Command::Linux::Bas
14
14
  "rpm -qi #{package} | grep Version | awk '{print $3}'"
15
15
  end
16
16
 
17
- def install(package)
18
- cmd = "yum -y install #{package}"
17
+ def install(package, version=nil)
18
+ if version
19
+ full_package = "#{package}-#{version}"
20
+ else
21
+ full_package = package
22
+ end
23
+ cmd = "yum -y install #{full_package}"
19
24
  end
20
25
  end
21
26
  end
@@ -10,7 +10,7 @@ class Specinfra::Command::Suse::Base::Package < Specinfra::Command::Linux::Base:
10
10
 
11
11
  alias :check_is_installed_by_rpm :check_is_installed
12
12
 
13
- def install(package)
13
+ def install(package, version=nil)
14
14
  cmd = "zypper -n install #{package}"
15
15
  end
16
16
 
@@ -36,7 +36,7 @@ class Specinfra::Command::Windows::Base::File < Specinfra::Command::Windows::Bas
36
36
  end
37
37
 
38
38
  def get_content(file)
39
- "[Io.File]::ReadAllText('#{file}')"
39
+ %Q![Io.File]::ReadAllText("#{file}")!
40
40
  end
41
41
 
42
42
  def check_is_accessible_by_user(file, user, access)
@@ -73,7 +73,7 @@ class Specinfra::Command::Windows::Base::File < Specinfra::Command::Windows::Bas
73
73
 
74
74
  def check_contains(file, pattern)
75
75
  Backend::PowerShell::Command.new do
76
- exec "[Io.File]::ReadAllText('#{file}') -match '#{convert_regexp(pattern)}'"
76
+ exec %Q![[Io.File]::ReadAllText("#{file}") -match '#{convert_regexp(pattern)}'!
77
77
  end
78
78
  end
79
79
 
@@ -82,7 +82,7 @@ class Specinfra::Command::Windows::Base::File < Specinfra::Command::Windows::Bas
82
82
  to ||= '$'
83
83
  Backend::PowerShell::Command.new do
84
84
  using 'crop_text.ps1'
85
- exec %Q[(CropText -text ([Io.File]::ReadAllText('#{file}')) -fromPattern '#{convert_regexp(from)}' -toPattern '#{convert_regexp(to)}') -match '#{pattern}']
85
+ exec %Q!(CropText -text ([Io.File]::ReadAllText("#{file}")) -fromPattern '#{convert_regexp(from)}' -toPattern '#{convert_regexp(to)}') -match '#{pattern}'!
86
86
  end
87
87
  end
88
88
 
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta37"
2
+ VERSION = "2.0.0.beta38"
3
3
  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.beta37
4
+ version: 2.0.0.beta38
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-08-20 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh