itamae-plugin-recipe-plenv 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9e660c2afd08734cf3f7251b1a6b478ddad40af0
4
+ data.tar.gz: c22e824e8b10584a8031171d6106fc07c01b512d
5
+ SHA512:
6
+ metadata.gz: 4ccc6557e72a60bb52abf6c51f3dcdcffdaf45c4ff922d3f876ae5504c83a549ca38e121cc5479b54bc5ef4037182da90e116693e1331989e65233a334b9af40
7
+ data.tar.gz: 62d89d624529d1a0309530fe59cb55ae37e296d06a123bc51df93f08084349f3b5268d968ed8be24ca568332575ed8ed142138adbad4ad08e018da5802095b54
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-plenv.gemspec
4
+ gemspec
@@ -0,0 +1,57 @@
1
+ # Itamae::Plugin::Recipe::Plenv
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/itamae/plugin/recipe/plenv`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'itamae-plugin-recipe-plenv'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install itamae-plugin-recipe-plenv
22
+
23
+ ## Usage
24
+
25
+ Configure file:
26
+
27
+ ```json
28
+ {
29
+ "plenv" : {
30
+ "scheme" : "https",
31
+ "versions" : ["5.22.0", "5.23.2"],
32
+ "global" : "5.22.0"
33
+ }
34
+ }
35
+ ```
36
+
37
+ Add itamae recipe:
38
+ ```ruby
39
+ include_recipe 'plenv::system'
40
+ ```
41
+
42
+ You run itamae recipe:
43
+ ```console
44
+ $ bundle exec itamae local recipe.rb -j plenv.json
45
+ ```
46
+
47
+
48
+ ## Development
49
+
50
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
51
+
52
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
53
+
54
+ ## Contributing
55
+
56
+ Bug reports and pull requests are welcome on GitHub at https://github.com/katsyoshi/itamae-plugin-recipe-plenv. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
57
+
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,25 @@
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/plenv/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-plugin-recipe-plenv"
8
+ spec.version = Itamae::Plugin::Recipe::Plenv::VERSION
9
+ spec.authors = ["MATSUMOTO, Katsuyoshi"]
10
+ spec.email = ["github@katsyoshi.org"]
11
+
12
+ spec.summary = %q{itamae plugin recipe plenv}
13
+ spec.description = %q{itamae plugin recipe plenv}
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "itamae", "~> 1.2"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.10"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1 @@
1
+ require "itamae/plugin/recipe/plenv"
@@ -0,0 +1,17 @@
1
+ DEFAULT_PLENV_ROOT = "/usr/local/plenv"
2
+
3
+ def plenv_root
4
+ if node[:plenv] && node[:plenv][:plenv_root]
5
+ node[:plenv][:plenv_root]
6
+ else
7
+ DEFAULT_PLENV_ROOT
8
+ end
9
+ end
10
+
11
+ def plenv_init
12
+ <<-EOS
13
+ export PLENV_ROOT=#{plenv_root}
14
+ export PATH="#{plenv_root}/bin:${PATH}"
15
+ eval "$(plenv init -)"
16
+ EOS
17
+ end
@@ -0,0 +1,36 @@
1
+ case node[:platform]
2
+ when "debian", "ubuntu"
3
+ package "build-essential"
4
+ end
5
+
6
+ package "git"
7
+
8
+ require 'itamae/plugin/recipe/plenv'
9
+
10
+ scheme = "git"
11
+ scheme = node[:plenv][:scheme] if node[:plenv][:scheme]
12
+
13
+ git plenv_root do
14
+ repository "#{scheme}://github.com/tokuhirom/plenv.git"
15
+ end
16
+
17
+ git "#{plenv_root}/plugins/perl-build" do
18
+ repository "#{scheme}://github.com/tokuhirom/Perl-Build.git"
19
+ if node[:'perl-build'] && node[:'perl-build'][:revision]
20
+ revision node[:'perl-build'][:revision]
21
+ end
22
+ end
23
+
24
+ node[:plenv][:versions].each do |version|
25
+ execute "plenv install #{version}" do
26
+ command "#{plenv_init} plenv install #{version}"
27
+ not_if "#{plenv_init} plenv versions | grep #{version}"
28
+ end
29
+ end
30
+
31
+ node[:plenv][:global].tap do |version|
32
+ execute "plenv global #{version}" do
33
+ command "#{plenv_init} plenv global #{version}"
34
+ not_if "#{plenv_init} plenv version | grep #{version}"
35
+ end
36
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Plenv
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-plenv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - MATSUMOTO, Katsuyoshi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-08-23 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'
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'
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.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
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
+ description: itamae plugin recipe plenv
56
+ email:
57
+ - github@katsyoshi.org
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - CODE_OF_CONDUCT.md
64
+ - Gemfile
65
+ - README.md
66
+ - Rakefile
67
+ - itamae-plugin-recipe-plenv.gemspec
68
+ - lib/itamae-plugin-recipe-plenv.rb
69
+ - lib/itamae/plugin/recipe/plenv.rb
70
+ - lib/itamae/plugin/recipe/plenv/system.rb
71
+ - lib/itamae/plugin/recipe/plenv/version.rb
72
+ homepage:
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.4.5.1
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: itamae plugin recipe plenv
96
+ test_files: []