eycloud-helper-common 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/ChangeLog.md +5 -0
- data/Gemfile +3 -0
- data/README.md +21 -0
- data/Rakefile +2 -0
- data/eycloud-helper-common.gemspec +22 -0
- data/libraries/ruby_block.rb +50 -0
- data/metadata.json +13 -0
- data/metadata.rb +7 -0
- metadata +71 -0
data/.gitignore
ADDED
data/ChangeLog.md
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Common recipe for EY Cloud
|
2
|
+
|
3
|
+
DESCRIPTION HERE
|
4
|
+
|
5
|
+
`ruby_block` is provided for recipes wanting to run on Chef 0.6 as well as modern Chef.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
INSTALLATION HERE
|
10
|
+
|
11
|
+
## Contributing
|
12
|
+
|
13
|
+
1. Fork it
|
14
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
15
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
16
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
17
|
+
5. Create new Pull Request
|
18
|
+
|
19
|
+
## License
|
20
|
+
|
21
|
+
MIT LICENSE
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
version = "0.1.0" # TODO get from metadata.json or .rb
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "eycloud-helper-common"
|
8
|
+
s.version = version
|
9
|
+
s.authors = ["Dr Nic Williams"]
|
10
|
+
s.email = ["drnicwilliams@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Common recipe for EY Cloud} # TODO from metadata
|
13
|
+
s.description = %q{Common recipe for EY Cloud} # TODO from metadata long_description
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
# s.add_dependency("eycloud-helper-cronjobs")
|
21
|
+
s.add_development_dependency("rake")
|
22
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# RubyBlock (ruby_block) implementation that supports chef 0.6 + chef 0.10
|
2
|
+
class Chef
|
3
|
+
class Resource
|
4
|
+
class RubyBlock < Chef::Resource
|
5
|
+
if Chef::VERSION == '0.6.0.2'
|
6
|
+
def initialize(name, collection=nil, node = nil)
|
7
|
+
super(name, collection, node)
|
8
|
+
init
|
9
|
+
end
|
10
|
+
else
|
11
|
+
def initialize(name, run_context=nil)
|
12
|
+
super(name, run_context)
|
13
|
+
init
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def init
|
18
|
+
@resource_name = :ruby_block
|
19
|
+
@action = :create
|
20
|
+
@allowed_actions.push(:create)
|
21
|
+
end
|
22
|
+
|
23
|
+
def block(&block)
|
24
|
+
if block
|
25
|
+
@block = block
|
26
|
+
else
|
27
|
+
@block
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
class Chef
|
36
|
+
class Provider
|
37
|
+
class RubyBlock < Chef::Provider
|
38
|
+
def load_current_resource
|
39
|
+
true
|
40
|
+
end
|
41
|
+
|
42
|
+
def action_create
|
43
|
+
@new_resource.block.call
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
Chef::Platform.platforms[:default].merge! :ruby_block => Chef::Provider::RubyBlock
|
50
|
+
|
data/metadata.json
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"name": "common",
|
3
|
+
"description": "Common recipe for EY Cloud",
|
4
|
+
"long_description": "",
|
5
|
+
"license": "MIT",
|
6
|
+
"maintainer": "Dr Nic Williams",
|
7
|
+
"maintainer_email": "drnicwilliams@gmail.com",
|
8
|
+
"version": "0.1.0",
|
9
|
+
"attributes": {
|
10
|
+
},
|
11
|
+
"dependencies": {
|
12
|
+
}
|
13
|
+
}
|
data/metadata.rb
ADDED
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: eycloud-helper-common
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dr Nic Williams
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &70239993552200 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70239993552200
|
25
|
+
description: Common recipe for EY Cloud
|
26
|
+
email:
|
27
|
+
- drnicwilliams@gmail.com
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- ChangeLog.md
|
34
|
+
- Gemfile
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- eycloud-helper-common.gemspec
|
38
|
+
- libraries/ruby_block.rb
|
39
|
+
- metadata.json
|
40
|
+
- metadata.rb
|
41
|
+
homepage: ''
|
42
|
+
licenses: []
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
hash: 1166039801459079574
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
hash: 1166039801459079574
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 1.8.17
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Common recipe for EY Cloud
|
71
|
+
test_files: []
|