puppeteer 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in puppeteer.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 AbhishekKr
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 ADDED
@@ -0,0 +1,37 @@
1
+ # Puppeteer
2
+
3
+ Puppeteer is there to ease out Puppet-izing the infrastructure.
4
+ Automate the automation development.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'puppeteer'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install puppeteer
19
+
20
+ ## Usage
21
+
22
+ Currently it just allows creating Puppet Module with full directory structure and creates skeleton *pp file.
23
+ Example:
24
+ $ puppeteer module myapp
25
+ $ puppeteer module myapp::config
26
+ $ puppeteer module myapp::config::params
27
+ ~~~ just to quickly check what's all available
28
+ $ puppeteer
29
+
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
3
+
4
+ require 'puppeteer'
5
+
6
+ case ARGV[0]
7
+ when 'module'
8
+ Puppeteer.module ARGV[1], (ARGV[2] || Dir.pwd)
9
+ else
10
+ puts <<-HELP
11
+ \e[1m\e[31mPuppet-eer ver.#{Puppeteer::VERSION}\e[0m
12
+ \e[33m
13
+ $ puppeteer module $ModuleName <$ModulePath>
14
+ \e[32m_____
15
+ \e[33m.....more to come
16
+ \e[0m
17
+ HELP
18
+ end
@@ -0,0 +1,35 @@
1
+ require "puppeteer/version"
2
+ require "puppeteer/screenplay"
3
+
4
+ module Puppeteer
5
+
6
+ def self.module_structure
7
+ ['files', 'lib', 'spec','templates', 'tests']
8
+ end
9
+
10
+ def self.module(namespace,
11
+ module_path = File.expand_path(File.dirname __FILE__),
12
+ dir_struct = module_structure
13
+ )
14
+ dirs = []
15
+ dirs << File.join(module_path, namespace.split(/::/)[0])
16
+ dirs << File.join(dirs[0], 'manifests')
17
+ namespace.split(/::/)[1..-2].each_with_index do |nam, idx|
18
+ dirs << File.join(dirs[idx+1], nam)
19
+ end
20
+ dirs.each {|dir| Dir.mkdir dir unless File.directory?(dir) }
21
+ dir_struct.each {|mdir|
22
+ dir = File.join(dirs[0], mdir)
23
+ Dir.mkdir dir unless File.directory?(dir)
24
+ }
25
+
26
+ unless namespace.match(/::/)
27
+ init_pp = File.join dirs[-1], 'init.pp'
28
+ else
29
+ puts File.join(dirs[-1], namespace.split(/::/)[-1])
30
+ init_pp = "#{File.join dirs[-1], namespace.split(/::/)[-1]}.pp"
31
+ end
32
+
33
+ Screenplay.create_pp namespace, init_pp
34
+ end
35
+ end
@@ -0,0 +1,26 @@
1
+ require 'erb'
2
+
3
+ module Puppeteer
4
+ module Screenplay
5
+ attr_accessor :pp_name, :pp_config
6
+
7
+ def self.erb(fylname)
8
+ dir = File.dirname(File.expand_path(__FILE__))
9
+ file_erb = File.join dir, 'templates', fylname
10
+ template = File.open(file_erb, 'r').read
11
+ ERB.new(template)
12
+ end
13
+
14
+ def self.default_manifest
15
+ @pp_config ||= "# module :: #{@pp_name.split(/::/).join(' > ')}"
16
+ manifest_dat = erb('manifests_pp.erb').result(binding)
17
+ return manifest_dat
18
+ end
19
+
20
+ def self.create_pp(namespace, fylname)
21
+ @pp_name = namespace
22
+ fyldata = default_manifest
23
+ File.open(fylname, 'w') {|fyl| fyl.write(fyldata) }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ class <%= @pp_name %> {
2
+ <%= @pp_config %>
3
+ }
@@ -0,0 +1,3 @@
1
+ module Puppeteer
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'puppeteer/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "puppeteer"
7
+ gem.version = Puppeteer::VERSION
8
+ gem.authors = ["abhishekkr"]
9
+ gem.email = ["abhikumar163@gmail.com"]
10
+ gem.homepage = "https://github.com/abhishekkr/rubygem_puppeteer"
11
+ gem.summary = %q{Puppeteer has been started to: ease [Puppet Configuration], [CRUD of puppet-modules-parts], [...] ~~~~~ https://raw.github.com/abhishekkr/rubygem_puppeteer/master/README}
12
+ gem.description = %q{Puppeteer is there to ease out Puppet-izing the infrastructure. Automate the automation development.}
13
+
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ gem.require_paths = ["lib"]
17
+
18
+ gem.executables = %w( puppeteer )
19
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: puppeteer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - abhishekkr
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Puppeteer is there to ease out Puppet-izing the infrastructure. Automate
15
+ the automation development.
16
+ email:
17
+ - abhikumar163@gmail.com
18
+ executables:
19
+ - puppeteer
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - .gitignore
24
+ - Gemfile
25
+ - LICENSE
26
+ - README
27
+ - Rakefile
28
+ - bin/puppeteer
29
+ - lib/puppeteer.rb
30
+ - lib/puppeteer/screenplay.rb
31
+ - lib/puppeteer/templates/manifests_pp.erb
32
+ - lib/puppeteer/version.rb
33
+ - puppeteer.gemspec
34
+ homepage: https://github.com/abhishekkr/rubygem_puppeteer
35
+ licenses: []
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 1.8.24
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: ! 'Puppeteer has been started to: ease [Puppet Configuration], [CRUD of puppet-modules-parts],
58
+ [...] ~~~~~ https://raw.github.com/abhishekkr/rubygem_puppeteer/master/README'
59
+ test_files: []