itamae-plugin-recipe-nm_chruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e885470e244cba3a78062ea5b7872911e683b293
4
+ data.tar.gz: cb90d0df52eed2995978ecd13716f8dbfddec3c2
5
+ SHA512:
6
+ metadata.gz: 5bf6f2b99d1247f66b57310e5ebb54431178f4504721591f4badcbf38077836dbe7fe0f429355f9c06ded95f0c42bb6a742e60fbec6654bfb72cdd2bf14a0128
7
+ data.tar.gz: 898795250e7ed0994df576bf499d985783e469006fb59e8d99dc7de07e4f0e41002c0159cdcd54eb4331158d67074c88ef0498088c242960035c2b8a84174870
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-nm_chruby.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Itamae::Plugin::Recipe::NmChruby
2
+
3
+ This installs chruby and ruby-install.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-plugin-recipe-nm_chruby'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install itamae-plugin-recipe-nm_chruby
20
+
21
+ ## Super simple usage
22
+
23
+ ```ruby
24
+ include_recipe 'nm_chruby::system'
25
+ ```
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/namusyaka/itamae-plugin-recipe-nm_chruby/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ require 'rake'
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ task :spec => 'spec:all'
6
+ task :default => :spec
7
+
8
+ namespace :spec do
9
+ targets = []
10
+ Dir.glob('./spec/*').each do |dir|
11
+ next unless File.directory?(dir)
12
+ targets << File.basename(dir)
13
+ end
14
+ platforms = %w[sl6 ubuntu1404]
15
+
16
+ task :all => targets
17
+ task :default => :all
18
+
19
+ targets.each do |target|
20
+ platforms.each do |platform|
21
+ desc "Run serverspec tests to #{target} in #{platform}"
22
+ RSpec::Core::RakeTask.new(target.to_sym) do |t|
23
+ ENV['TARGET_HOST'] = "#{platform}_#{target}"
24
+ t.pattern = "spec/#{target}/*_spec.rb"
25
+ end
26
+ end
27
+ end
28
+ end
data/Vagrantfile ADDED
@@ -0,0 +1,29 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ VAGRANTFILE_API_VERSION = "2"
5
+
6
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7
+
8
+ config.vm.define :sl6_user do |c|
9
+ c.vm.box = "sl6"
10
+ c.vm.box_url = 'http://files.rutan.info/box/scientific-6-5-x64-virtualbox.box'
11
+ c.vm.network :private_network, ip: '192.168.33.11'
12
+ end
13
+ config.vm.define :sl6_system do |c|
14
+ c.vm.box = "sl6"
15
+ c.vm.box_url = 'http://files.rutan.info/box/scientific-6-5-x64-virtualbox.box'
16
+ c.vm.network :private_network, ip: '192.168.33.12'
17
+ end
18
+
19
+ config.vm.define :ubuntu1404_user do |c|
20
+ c.vm.box = "ubuntu1404"
21
+ c.vm.box_url = 'https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box'
22
+ c.vm.network :private_network, ip: '192.168.33.21'
23
+ end
24
+ config.vm.define :ubuntu1404_system do |c|
25
+ c.vm.box = "ubuntu1404"
26
+ c.vm.box_url = 'https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box'
27
+ c.vm.network :private_network, ip: '192.168.33.22'
28
+ end
29
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'itamae/plugin/recipe/nm_chruby/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-plugin-recipe-nm_chruby"
8
+ spec.version = Itamae::Plugin::Recipe::NmChruby::VERSION
9
+ spec.authors = ["namusyaka"]
10
+ spec.email = ["namusyaka@gmail.com"]
11
+
12
+ spec.summary = %q{itamae plugin for the chruby utility}
13
+ spec.description = spec.summary
14
+ spec.homepage = "https://github.com/namusyaka/itamae-plugin-recipe-nm_chruby"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_dependency "itamae", "~> 1.2.4"
30
+
31
+ spec.add_development_dependency "bundler", "~> 1.9"
32
+ spec.add_development_dependency "rake", "~> 10.0"
33
+ spec.add_development_dependency "serverspec", "~> 2.3.0"
34
+ end
@@ -0,0 +1,28 @@
1
+ node[:nm_chruby] ||= {}
2
+
3
+ packages = []
4
+ packages << 'gcc'
5
+ packages << 'git'
6
+
7
+ case node[:platform]
8
+ when %r(debian|ubuntu)
9
+ packages << 'build-essential'
10
+ packages << 'libffi-dev'
11
+ packages << 'libgdbm-dev'
12
+ packages << 'libncurses5-dev'
13
+ packages << 'libreadline6-dev'
14
+ packages << 'libssl-dev'
15
+ packages << 'libyaml-dev'
16
+ packages << 'zlib1g-dev'
17
+ when %r(redhat|fedora)
18
+ packages << 'automake'
19
+ packages << 'gdbm-devel'
20
+ packages << 'libffi-devel'
21
+ packages << 'libyaml-devel'
22
+ packages << 'openssl-devel'
23
+ packages << 'ncurses-devel'
24
+ packages << 'readline-devel'
25
+ packages << 'zlib-devel'
26
+ end
27
+
28
+ packages.each { |package_name| package package_name }
@@ -0,0 +1,24 @@
1
+ define :chruby_install, user: nil do
2
+ params = self.params
3
+
4
+ git params[:name] do
5
+ repository "https://github.com/postmodern/chruby.git"
6
+ user params[:user] if params[:user]
7
+ end
8
+
9
+ execute "setup.sh" do
10
+ command "cd #{params[:name]}; sh scripts/setup.sh"
11
+ user params[:user] if params[:user]
12
+ end
13
+
14
+ ruby_install_path = "#{params[:name]}/ruby-install"
15
+
16
+ git ruby_install_path do
17
+ repository "https://github.com/postmodern/ruby-install.git"
18
+ user params[:user] if params[:user]
19
+ end
20
+
21
+ execute "make install" do
22
+ command "cd #{ruby_install_path}; sudo make install"
23
+ end
24
+ end
@@ -0,0 +1,6 @@
1
+ include_recipe './resource.rb'
2
+ include_recipe './common.rb'
3
+
4
+ CHRUBY_ROOT ||= '/usr/local/chruby'
5
+
6
+ chruby_install CHRUBY_ROOT
@@ -0,0 +1,3 @@
1
+ if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
2
+ source /usr/local/share/chruby/chruby.sh
3
+ fi
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module NmChruby
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require "itamae/plugin/recipe/nm_chruby/version"
2
+
3
+ module Itamae
4
+ module Plugin
5
+ module Recipe
6
+ module NmChruby
7
+ # Your code goes here...
8
+ end
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-nm_chruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - namusyaka
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: itamae
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.9'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.9'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: serverspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.3.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 2.3.0
69
+ description: itamae plugin for the chruby utility
70
+ email:
71
+ - namusyaka@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .rspec
78
+ - .travis.yml
79
+ - Gemfile
80
+ - README.md
81
+ - Rakefile
82
+ - Vagrantfile
83
+ - itamae-plugin-recipe-nm_chruby.gemspec
84
+ - lib/itamae/plugin/recipe/nm_chruby.rb
85
+ - lib/itamae/plugin/recipe/nm_chruby/common.rb
86
+ - lib/itamae/plugin/recipe/nm_chruby/resource.rb
87
+ - lib/itamae/plugin/recipe/nm_chruby/system.rb
88
+ - lib/itamae/plugin/recipe/nm_chruby/templates/chruby_profile.erb
89
+ - lib/itamae/plugin/recipe/nm_chruby/version.rb
90
+ homepage: https://github.com/namusyaka/itamae-plugin-recipe-nm_chruby
91
+ licenses: []
92
+ metadata:
93
+ allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.0.14
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: itamae plugin for the chruby utility
114
+ test_files: []