ra10ke 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: 83fa905f1d1105c58cfe6f3561d9542019737caf
4
+ data.tar.gz: 76f4622224efdce92b3b09617b938f4c3819c8d1
5
+ SHA512:
6
+ metadata.gz: 75e5e36ff971ed7b5975e3182c3d8273eb3affcab0193d7566cdb1f6ee72aa0abb77b7b8bf6dfcd2e36d50f35fe09615f91e847760f7d67eb7de68de21d3eb63
7
+ data.tar.gz: 4d733a0c6d8ff32b48db4d9b35cde33ca904cb1c8216d23f56e5062fa6311ba7511e1421878629e311d05711f7045dcaed8cb0a3256a5c808ce14d2d68b78670
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ra10ke.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Dan Carley
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ ra10ke
2
+ ======
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/ra10ke.svg)](https://badge.fury.io/rb/ra10ke)
5
+
6
+ Rake tasks related to [R10K](https://github.com/puppetlabs/r10k) and
7
+ [Puppetfile](https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd).
8
+
9
+ ## Usage
10
+
11
+ Simply add the following line in your `Gemfile`:
12
+
13
+ ```ruby
14
+ require 'ra10ke'
15
+ ```
16
+
17
+ ## Rake tasks
18
+
19
+ ### r10k:syntax
20
+
21
+ Syntax check for the Puppetfile. Similar to the `r10k puppetfile check`
22
+ command.
23
+
24
+ ### r10k:dependencies
25
+
26
+ This rake task goes through the modules that are declared in the Puppetfile,
27
+ and prints outdated modules.
28
+
29
+ #### Limitations
30
+
31
+ * It works only with modules from the [Forge](https://forge.puppetlabs.com).
32
+ Git and SVN modules will be ignored.
33
+ * The version has to be specified explicitly. If it is omitted, or it is
34
+ `:latest`, the module will be ignored.
data/lib/ra10ke.rb ADDED
@@ -0,0 +1,43 @@
1
+ require 'rake'
2
+ require 'rake/tasklib'
3
+
4
+ module Ra10ke
5
+ class RakeTask < ::Rake::TaskLib
6
+ def initialize(*args)
7
+ namespace :r10k do
8
+ desc "Print outdated forge modules"
9
+ task :dependencies do
10
+ require 'r10k/puppetfile'
11
+ require 'puppet_forge'
12
+
13
+ puppetfile = R10K::Puppetfile.new('.').load
14
+
15
+ puppetfile.each do |puppet_module|
16
+ if puppet_module.class == R10K::Module::Forge
17
+ module_name = puppet_module.title.gsub('/', '-')
18
+ forge_version = PuppetForge::Module.find(module_name).current_release.version
19
+ installed_version = puppet_module.expected_version
20
+ if installed_version != forge_version
21
+ puts "#{puppet_module.title} is OUTDATED: #{installed_version} vs #{forge_version}"
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ desc "Syntax check Puppetfile"
28
+ task :syntax do
29
+ require 'r10k/action/puppetfile/check'
30
+
31
+ puppetfile = R10K::Action::Puppetfile::Check.new({
32
+ :root => ".",
33
+ :moduledir => nil,
34
+ :puppetfile => nil
35
+ }, '')
36
+ puppetfile.call
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ Ra10ke::RakeTask.new
@@ -0,0 +1,3 @@
1
+ module Ra10ke
2
+ VERSION = "0.1.0"
3
+ end
data/ra10ke.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'ra10ke/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "ra10ke"
7
+ spec.version = Ra10ke::VERSION
8
+ spec.authors = ["Theo Chatzimichos"]
9
+ spec.email = ["tampakrap@gmail.com"]
10
+ spec.description = %q{R10K and Puppetfile rake tasks}
11
+ spec.summary = %q{Syntax check for the Puppetfile, check for outdated installed puppet modules}
12
+ spec.homepage = "https://github.com/tampakrap/ra10ke"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.require_paths = ["lib"]
17
+
18
+ spec.add_dependency "rake"
19
+ spec.add_dependency "puppet_forge"
20
+ spec.add_dependency "r10k"
21
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ra10ke
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Theo Chatzimichos
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: puppet_forge
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: r10k
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: R10K and Puppetfile rake tasks
56
+ email:
57
+ - tampakrap@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - Gemfile
63
+ - LICENSE.txt
64
+ - README.md
65
+ - lib/ra10ke.rb
66
+ - lib/ra10ke/version.rb
67
+ - ra10ke.gemspec
68
+ homepage: https://github.com/tampakrap/ra10ke
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.4.5.1
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Syntax check for the Puppetfile, check for outdated installed puppet modules
92
+ test_files: []