itamae-plugin-recipe-pyenv 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: e9b0bf3f631ceaf8a59e675274c2fc3c2ed9d556
4
+ data.tar.gz: 4ba3ef756d5ce65f80d07804ec6aff67331798e6
5
+ SHA512:
6
+ metadata.gz: 1a377d52a2fdbb32737d6e05a45d14715cc7235b33fc7926f7da41875d884a50f646520004a673e37455b1270930a3d43ebb1a3af377004d4da5f2d60f3be836
7
+ data.tar.gz: f2ec170316e62b77214779855b0ec787a4ad9bacad9e4a9935594fa06c7f1a3564cdc58de7899b3ad493ea83c9528149493af87a1f0e5474c9cf04e0f4cb5d69
@@ -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-pyenv.gemspec
4
+ gemspec
@@ -0,0 +1,56 @@
1
+ # Itamae::Plugin::Recipe::Pyenv
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/pyenv`. 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-pyenv'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install itamae-plugin-recipe-pyenv
22
+
23
+ ## Usage
24
+
25
+ You write config file:
26
+
27
+ ```json
28
+ {
29
+ "pyenv" : {
30
+ "scheme" : "git", // set scheme your using git clone protocol, git or https
31
+ "versions" : ["2.7.5", "3.4.3"],
32
+ "global" : "3.4.3"
33
+ }
34
+ }
35
+ ```
36
+
37
+ Add your itamae recipe:
38
+ ```ruby
39
+ include_recipe 'plenv::system'
40
+ ```
41
+
42
+ Exec script:
43
+ ```console
44
+ $ bundle exec itamae local recipe.rb -j plenv.json
45
+ ```
46
+
47
+ ## Development
48
+
49
+ 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.
50
+
51
+ 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).
52
+
53
+ ## Contributing
54
+
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/itamae-plugin-recipe-pyenv. 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.
56
+
@@ -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,24 @@
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/pyenv/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-plugin-recipe-pyenv"
8
+ spec.version = Itamae::Plugin::Recipe::Pyenv::VERSION
9
+ spec.authors = ["MATSUMOTO, Katsuyoshi"]
10
+ spec.email = ["github@katsyoshi.org"]
11
+
12
+ spec.summary = %q{itamae plugin recipe pyenv}
13
+ spec.description = %q{itamae plugin recipe pyenv}
14
+ spec.homepage = "https://github.com/katsyoshi/itamae-plugin-recipe-pyenv"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "itamae", "~> 1.2"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1 @@
1
+ require "itamae/plugin/recipe/pyenv"
@@ -0,0 +1,17 @@
1
+ DEFAULT_PYENV_ROOT = "/usr/local/pyenv"
2
+
3
+ def pyenv_root
4
+ if node[:pyenv] && node[:pyenv][:pyenv_root]
5
+ node[:pyenv][:pyenv_root]
6
+ else
7
+ DEFAULT_PYENV_ROOT
8
+ end
9
+ end
10
+
11
+ def pyenv_init
12
+ <<-EOS
13
+ export PYENV_ROOT=#{pyenv_root}
14
+ export PATH="#{pyenv_root}/bin:$PATH"
15
+ eval "$(pyenv init -)"
16
+ EOS
17
+ end
@@ -0,0 +1,29 @@
1
+ case node[:platform]
2
+ when "debian", "ubuntu"
3
+ package "build-essential"
4
+ end
5
+
6
+ package "git"
7
+
8
+ require "itamae/plugin/recipe/pyenv"
9
+
10
+ scheme = "git"
11
+ scheme = node[:pyenv][:scheme] if node[:pyenv][:scheme]
12
+
13
+ git pyenv_root do
14
+ repository "#{scheme}://github.com/yyuu/pyenv.git"
15
+ end
16
+
17
+ node[:pyenv][:versions].each do |version|
18
+ execute "pyenv install #{version}" do
19
+ command "#{pyenv_init} pyenv install #{version}"
20
+ not_if "#{pyenv_init} pyenv versions | grep #{version}"
21
+ end
22
+ end
23
+
24
+ node[:pyenv][:global].tap do |version|
25
+ execute "pyenv global #{version}" do
26
+ command "#{pyenv_init} pyenv install #{version}"
27
+ not_if "#{pyenv_init} pyenv version | grep #{version}"
28
+ end
29
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Pyenv
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-pyenv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - MATSUMOTO, Katsuyoshi
8
+ autorequire:
9
+ bindir: bin
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 pyenv
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-pyenv.gemspec
68
+ - lib/itamae-plugin-recipe-pyenv.rb
69
+ - lib/itamae/plugin/recipe/pyenv.rb
70
+ - lib/itamae/plugin/recipe/pyenv/system.rb
71
+ - lib/itamae/plugin/recipe/pyenv/version.rb
72
+ homepage: https://github.com/katsyoshi/itamae-plugin-recipe-pyenv
73
+ licenses: []
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.4.5.1
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: itamae plugin recipe pyenv
95
+ test_files: []