serverkit-rbenv 0.0.3 → 0.1.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: 709acb9d58e07439596a17a403db811381a91296
4
- data.tar.gz: d8c87f06041fe10b51a3c4e25a63a5bb4007e88b
3
+ metadata.gz: 39add0e459763d84b5ccefc786b613f63b047bea
4
+ data.tar.gz: 641ad6126ee65e64ca453d4283ea366e7fae489e
5
5
  SHA512:
6
- metadata.gz: 11cb48444db66d4fc6485f2e788f9828df56a3e65803a362e1d57949fc70f1b548a9a3ca0539e01dac26592ad4d9f1ea69c43a1a08990bac98d5bfe84d857cce
7
- data.tar.gz: 46fe4fe5a2d44c42f406a88707b43ab7f3a8d435831023755bae3313376f1d1dbeffb43804670ee9044a1b4ca7bcda46cfbde8c762649a7d53289562e2a5d0b1
6
+ metadata.gz: c2772e4dd9a97ed977e28273aceb08ee02c305f86a512b7104673520954a15acaccb4450c6e1b9350f8b59b81ba53863d36b9a3326999655b81d9a42b5223e12
7
+ data.tar.gz: 23af430bc153be2819788bee196cb874025d347628a15a2a43e35f399e1227afe371dc61b481f14ba2794d53ea2c28b98ef1c5936c6552ea61fd8e800c56ce0b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.0
2
+ - Add rbenv_dependent_packages resource
3
+
1
4
  ## 0.0.3
2
5
  - Fix bug of missing requirement of serverkit
3
6
 
data/README.md CHANGED
@@ -28,3 +28,12 @@ resources:
28
28
  version: 2.2.0
29
29
  global: true
30
30
  ```
31
+
32
+ ### rbenv_dependent_packages
33
+ Install denpendent packages to install rbenv.
34
+
35
+ #### Example
36
+ ```yml
37
+ resources:
38
+ - type: rbenv_dependent_packages
39
+ ```
@@ -1,5 +1,5 @@
1
1
  module Serverkit
2
2
  module Rbenv
3
- VERSION = "0.0.3"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -1,2 +1,3 @@
1
1
  require "serverkit/rbenv/version"
2
+ require "serverkit/resources/rbenv_dependent_packages"
2
3
  require "serverkit/resources/rbenv_ruby"
@@ -0,0 +1,95 @@
1
+ require "serverkit/resources/base"
2
+
3
+ module Serverkit
4
+ module Resources
5
+ class RbenvDependentPackages < Base
6
+ PACKAGE_NAMES_FOR_APT = %w[
7
+ autoconf
8
+ bison
9
+ build-essential
10
+ git
11
+ libffi-dev
12
+ libgdbm-dev
13
+ libgdbm3
14
+ libncurses5-dev
15
+ libreadline6-dev
16
+ libssl-dev
17
+ libyaml-dev
18
+ zlib1g-dev
19
+ ]
20
+
21
+ PACKAGE_NAMES_FOR_PACMAN = %w[
22
+ base-devel
23
+ libffi
24
+ libyaml
25
+ openssl
26
+ zlib
27
+ ]
28
+
29
+ PACKAGE_NAMES_FOR_YUM = %w[
30
+ gcc
31
+ gdbm-devel
32
+ git
33
+ libffi-devel
34
+ libyaml-devel
35
+ ncurses-devel
36
+ openssl-devel
37
+ readline-devel
38
+ zlib-devel
39
+ ]
40
+
41
+ PACKAGE_NAMES_FOR_ZYPPER = %w[
42
+ automake
43
+ gcc
44
+ gdbm-devel
45
+ libffi-devel
46
+ libyaml-devel
47
+ ncurses-devel
48
+ openssl-devel
49
+ readline-devel
50
+ zlib-devel
51
+ ]
52
+
53
+ # @note Override
54
+ def apply
55
+ packages.each(&:apply)
56
+ end
57
+
58
+ # @note Override
59
+ def check
60
+ packages.all?(&:check)
61
+ end
62
+
63
+ private
64
+
65
+ # @return [Array<Serverkit::Resources::Package>]
66
+ def packages
67
+ package_names.map do |package_name|
68
+ Serverkit::Resources::Package.new(@recipe, "name" => package_name).tap do |package|
69
+ package.backend = backend
70
+ end
71
+ end
72
+ end
73
+
74
+ # @todo
75
+ # @return [Array<String>]
76
+ # @example ["gcc", "git", "gdbm-devel", ...]
77
+ def package_names
78
+ @package_names ||= begin
79
+ case get_command_from_identifier(:install_package, "dummy")
80
+ when /\bapt-get\b/
81
+ PACKAGE_NAMES_FOR_APT
82
+ when /\bpacman\b/
83
+ PACKAGE_NAMES_FOR_PACMAN
84
+ when /\byum\b/
85
+ PACKAGE_NAMES_FOR_YUM
86
+ when /\bzypper\b/
87
+ PACKAGE_NAMES_FOR_ZYPPER
88
+ else
89
+ []
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverkit-rbenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverkit
@@ -69,6 +69,7 @@ files:
69
69
  - bin/setup
70
70
  - lib/serverkit/rbenv.rb
71
71
  - lib/serverkit/rbenv/version.rb
72
+ - lib/serverkit/resources/rbenv_dependent_packages.rb
72
73
  - lib/serverkit/resources/rbenv_ruby.rb
73
74
  - serverkit-rbenv.gemspec
74
75
  homepage: https://github.com/r7kamura/serverkit-rbenv