puppetry_toolbox 0.0.1

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: 75124dc25fb2756e29c189a1b7a0e6b3d594cfea
4
+ data.tar.gz: 9d522af7e8378052de78f984c7b0fedb8eada189
5
+ SHA512:
6
+ metadata.gz: 725cb4071e659c2270c9a89f43140fbe3c1e590b04836e930b316ba41eaad83d5d9b73091c1b47781b13d92817eb1a2e3816aa7edc5be29935b5fa6c257578fb
7
+ data.tar.gz: 10d1abb2a8c1fdb7fab2c47c24a58863c37d1cd3d35a4f977ea8efe6623c0dcdf64fdad422c5a9d46ddd025b759b0fe851e10215ee1845ecedc430f62dc93c28
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ *.swo
2
+ *.swp
3
+ Gemfile.lock
4
+ .DS_Store
5
+ .bundle
6
+ vendor
7
+ pkg
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0-p0
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # Puppetry
2
+
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require 'rake/testtask'
2
+ require 'bundler/gem_tasks'
3
+
4
+ namespace :test do
5
+ Rake::TestTask.new(:end_to_end) do |t|
6
+ t.verbose = true
7
+ t.libs << "lib"
8
+ t.libs << "test"
9
+ t.test_files = FileList["test/end_to_end/**/*_test.rb"]
10
+ #t.ruby_opts = ["-w"]
11
+ end
12
+ end
data/bin/puppetry ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'puppetry/cli'
5
+
6
+ Puppetry::CLI.start(ARGV)
@@ -0,0 +1,20 @@
1
+ require 'thor'
2
+ require 'grit'
3
+ require 'fileutils'
4
+
5
+ module Puppetry
6
+ class CLI < Thor
7
+ desc "version", "Print application's version"
8
+ def version
9
+ puts "Puppetry v#{Puppetry::Version}"
10
+ end
11
+
12
+ desc "new NAME", "Create a new module called NAME"
13
+ def new(name)
14
+ Grit::Git.new(name).clone({}, "git://github.com/stefanozanella/puppet-skeleton", name)
15
+ # This looks rather rough, but maybe it's the simplest way to erase all
16
+ # git history from the folder?
17
+ FileUtils.rm_rf File.expand_path('.git', name)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module Puppetry
2
+ Version = VERSION = '0.0.1'.freeze
3
+ end
data/lib/puppetry.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'puppetry/version'
2
+ require 'puppetry/cli'
data/puppetry.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ $:.unshift 'lib'
2
+ require 'puppetry/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "puppetry_toolbox"
6
+ s.version = Puppetry::Version
7
+ s.summary = "Puppetry is a CLI tool to aid Puppet modules development."
8
+ s.homepage = "https://github.com/stefanozanella/puppetry"
9
+ s.email = ["zanella.stefano@gmail.com"]
10
+ s.authors = ["Stefano Zanella"]
11
+
12
+ s.files = `git ls-files`.split($/)
13
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
15
+ s.require_paths = ["lib"]
16
+
17
+ s.extra_rdoc_files = ["README.md"]
18
+ s.rdoc_options = ["--charset=UTF-8"]
19
+
20
+ s.add_runtime_dependency "thor"
21
+ s.add_runtime_dependency "grit"
22
+
23
+ s.add_development_dependency "minitest"
24
+
25
+ s.description = %s{
26
+ Puppetry is a command line tool that aims at easing and uniforming
27
+ development of Puppet modules, by performing common tasks such as setting
28
+ up a new module source folder starting from a skeleton containing the
29
+ proper directory structure and useful helpers.
30
+ }
31
+ end
@@ -0,0 +1,40 @@
1
+ require 'test_helper'
2
+ require 'stringio'
3
+ require 'tmpdir'
4
+ require 'fileutils'
5
+
6
+ describe "puppetry" do
7
+ before do
8
+ @orig_stdout = $stdout
9
+ $stdout = StringIO.new
10
+ end
11
+
12
+ after do
13
+ $stdout = @orig_stdout
14
+ end
15
+
16
+ describe "version" do
17
+ it "shows the application's version" do
18
+ Puppetry::CLI.start(["version"])
19
+ $stdout.string.must_match(/#{Puppetry::VERSION}/)
20
+ end
21
+ end
22
+
23
+ describe "new" do
24
+ it "creates a new module starting from a scaffolded one" do
25
+ Dir.mktmpdir do |dir|
26
+ FileUtils.cd(dir) do
27
+ Puppetry::CLI.start(["new", "test_module"])
28
+
29
+ # test_module should exist and not be empty
30
+ assert Dir.exists?("test_module"), "Module folder test_module wasn't created"
31
+ Dir.entries("test_module").wont_be_empty
32
+ # test_module should contain at least the manifests folder
33
+ Dir.entries("test_module").must_include "manifests"
34
+ # test_module should not be a git repo (for the moment)
35
+ Dir.entries("test_module").wont_include ".git"
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,5 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/pride'
3
+ require 'minitest/spec'
4
+
5
+ require 'puppetry'
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: puppetry_toolbox
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Stefano Zanella
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
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: grit
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: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: "\n Puppetry is a command line tool that aims at easing and uniforming\n
56
+ \ development of Puppet modules, by performing common tasks such as setting\n
57
+ \ up a new module source folder starting from a skeleton containing the\n proper
58
+ directory structure and useful helpers.\n "
59
+ email:
60
+ - zanella.stefano@gmail.com
61
+ executables:
62
+ - puppetry
63
+ extensions: []
64
+ extra_rdoc_files:
65
+ - README.md
66
+ files:
67
+ - .gitignore
68
+ - .ruby-version
69
+ - Gemfile
70
+ - README.md
71
+ - Rakefile
72
+ - bin/puppetry
73
+ - lib/puppetry.rb
74
+ - lib/puppetry/cli.rb
75
+ - lib/puppetry/version.rb
76
+ - puppetry.gemspec
77
+ - test/end_to_end/puppetry_test.rb
78
+ - test/test_helper.rb
79
+ homepage: https://github.com/stefanozanella/puppetry
80
+ licenses: []
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options:
84
+ - --charset=UTF-8
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubyforge_project:
99
+ rubygems_version: 2.0.0
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: Puppetry is a CLI tool to aid Puppet modules development.
103
+ test_files:
104
+ - test/end_to_end/puppetry_test.rb
105
+ - test/test_helper.rb