boxen-module-maker 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWJkYTVmODdmODY1MWMzYjU2Y2VmOTk5NDFhZjI1Y2IyNmVjMzg3YQ==
4
+ MDYyZTUyYTczZTVlYjQ2MzNlMjAzNTg0MWQ4YjRjMjllYjk1OTA5YQ==
5
5
  data.tar.gz: !binary |-
6
- NGQ4NjY4NmRmMDQ1OWM0MDdkMjI5Yzc2NWYyNjM5OGVjNDlmNjRiMQ==
6
+ NjI0YTBiMmZhNTA2MzlmMTlmZDUyZjM1YmUxM2JiODkxZWJmMjU0Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZGJhZGQxYjkwODZhMThmYTdjOTNmNjg1NDgzZTBlZmJkYzIwM2NmOWMzNWM1
10
- NzdhMTkzNjZjNGMxN2RhZjdlMDgxZmM3ZmU3MzZhOWM1OTRlZTMxOGNhNWZl
11
- ZDkwOTZhOTVlYTRmNjI2ZGY1YzQ3M2Y1MDE1Y2YxYWU1Y2Q2ZTU=
9
+ NTg2ZDBlMzI2YzhiYTQ3Yjk3YzViM2Y3MjlhZWI5NjNhNjU0ZDYwMmQ0ZGFm
10
+ ZTMzZGYzYjM1MDIxNDNjMjU0NzRkMjk0ZjJjMTYwMDk5YTQzOWVlNGE1MmM5
11
+ YjUzMGEwZDEwYjNjYmIxNmQ4YTg0NGRhZTcwYTQ5YzA0NDlhY2I=
12
12
  data.tar.gz: !binary |-
13
- MWUwMjNiMjM0YjJmZTg1NDcxZGQzNjc0YmM0NzhhMDExOWZkY2QyYzE2ZjJm
14
- NzkyZGE5M2Q3MDhiNzk5NTMzNWE1ZjM2ZjBkYzY3ZDVlM2Y0OTU3NTA2OTE4
15
- ODE5MjA5YzRhYmM0MTJhYWE4NjUyNDAxMWQyMjA2MzZkZGUzOTE=
13
+ ODBkODExN2JiZDgxMzAyMmFkOTIzZTA0OTViOTFkMzU0YjZmMjE3YjhlM2Nj
14
+ MWVmYzFjYTZmOGFlY2Y4Njc4ZjgzZjIxZGY1ZTkyZjc5M2UxMTFlNjAwZWUz
15
+ YjAzMTViM2JjMGRhYTU2ZmM3ZmU1NDgwODc2Nzg0OTUzZTkwNzg=
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
@@ -0,0 +1,49 @@
1
+ # rcov generated
2
+ coverage
3
+ coverage.data
4
+
5
+ # rdoc generated
6
+ rdoc
7
+
8
+ # yard generated
9
+ doc
10
+ .yardoc
11
+
12
+ # bundler
13
+ .bundle
14
+
15
+ # jeweler generated
16
+ pkg
17
+
18
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
19
+ #
20
+ # * Create a file at ~/.gitignore
21
+ # * Include files you want ignored
22
+ # * Run: git config --global core.excludesfile ~/.gitignore
23
+ #
24
+ # After doing this, these files will be ignored in all your git projects,
25
+ # saving you from having to 'pollute' every project you touch with them
26
+ #
27
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
28
+ #
29
+ # For MacOS:
30
+ #
31
+ #.DS_Store
32
+
33
+ # For TextMate
34
+ #*.tmproj
35
+ #tmtags
36
+
37
+ # For emacs:
38
+ #*~
39
+ #\#*
40
+ #.\#*
41
+
42
+ # For vim:
43
+ #*.swp
44
+
45
+ # For redcar:
46
+ #.redcar
47
+
48
+ # For rubinius:
49
+ #*.rbc
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ boxen-module-maker (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.3)
10
+ rspec (2.13.0)
11
+ rspec-core (~> 2.13.0)
12
+ rspec-expectations (~> 2.13.0)
13
+ rspec-mocks (~> 2.13.0)
14
+ rspec-core (2.13.1)
15
+ rspec-expectations (2.13.0)
16
+ diff-lcs (>= 1.1.3, < 2.0)
17
+ rspec-mocks (2.13.1)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ boxen-module-maker!
24
+ rspec
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Peter M Souter
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = boxen-module-maker
2
+
3
+ A gem for creating boxen modules easier! :)
4
+
5
+ == Contributing to boxen-module-maker
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2013 Peter M Souter. See LICENSE.txt for
18
+ further details.
19
+
@@ -0,0 +1,8 @@
1
+ require 'rspec/core/rake_task'
2
+ RSpec::Core::RakeTask.new(:spec) do |spec|
3
+ spec.rspec_opts = '--color --format=documentation -I lib -I spec'
4
+ spec.pattern = "spec/**/*_spec.rb"
5
+ end
6
+
7
+ task :default => [:spec]
8
+
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
4
+
5
+ require 'boxen-module-maker'
6
+
7
+ exit BoxenModuleMaker::Bin.new(ARGV).run
@@ -0,0 +1,23 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require 'boxen-module-maker/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'boxen-module-maker'
7
+ spec.version = BoxenModuleMaker::Version::STRING
8
+ spec.platform = Gem::Platform::RUBY
9
+ spec.authors = ['Peter M Souter']
10
+ spec.email = ['p.morsou@gmail.com']
11
+ spec.summary = 'Tool to make new boxen modules easily'
12
+ spec.description = 'Get your boxen modules up and running easily'
13
+ spec.homepage = 'https://github.com/petems/boxen-module-maker'
14
+ spec.license = 'MIT'
15
+
16
+ spec.add_development_dependency 'rspec'
17
+
18
+ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ spec.files = `git ls-files`.split("\n")
20
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+
22
+ spec.require_path = 'lib'
23
+ end
@@ -0,0 +1,4 @@
1
+ require 'boxen-module-maker/bin'
2
+
3
+ class BoxenModuleMaker
4
+ end
@@ -0,0 +1,69 @@
1
+ require 'fileutils'
2
+ require 'git'
3
+ require 'erb'
4
+
5
+ class BoxenModuleMaker
6
+ class Bin
7
+
8
+ def initialize(args)
9
+ @args = args
10
+ @target_dir = "puppet-#{@args[0]}"
11
+ @application_name = args[0]
12
+ end
13
+
14
+ def run
15
+ if @args[0].nil?
16
+ abort "boxen-module-maker: Please specify the name of the module you wish to make"
17
+ elsif @args.length > 1
18
+ abort "boxen-module-maker: Too many arguments, one at a time please."
19
+ end
20
+
21
+ module_name = "puppet-#{@args[0]}"
22
+ if File.exists?(module_name)
23
+ warn "boxen-module-maker: [SKIPPING] '#{module_name}' already exists"
24
+ return 1
25
+ elsif File.exists?(module_name.downcase)
26
+ warn "boxen-module-maker: [SKIPPING] '#{module_name.downcase}' exists, which could conflict with `#{module_name}'"
27
+ return 1
28
+ else
29
+ puts "boxen-module-maker: [CREATE FOLDER] Making '#{module_name}'"
30
+ create_folder_loud(module_name)
31
+ get_boxen_template(module_name)
32
+ return 0
33
+ end
34
+ end
35
+
36
+ def get_boxen_template(target_dir)
37
+ Dir.chdir(target_dir) do
38
+ begin
39
+ @repo = Git.init()
40
+ rescue Git::GitExecuteError => e
41
+ raise GitInitFailed, "Encountered an error during gitification. Maybe the repo already exists, or has already been pushed to?"
42
+ end
43
+
44
+ @repo.add_remote('template', 'https://github.com/boxen/puppet-template.git')
45
+ @repo.remote('template').fetch
46
+ @repo.checkout('master')
47
+
48
+ # Remote remove is broken on ruby-git right now...
49
+ # https://github.com/schacon/ruby-git/pull/42
50
+ # Time for a hacky fix! :D
51
+ cmd = 'git remote remove template'
52
+ value = `#{cmd}`
53
+
54
+ begin
55
+ @repo.add('.')
56
+ rescue Git::GitExecuteError => e
57
+ #raise GitAddFailed, "There was some problem adding this directory to the git changeset"
58
+ raise
59
+ end
60
+ end
61
+ end
62
+
63
+ def create_folder_loud(folder_name)
64
+ FileUtils.mkdir_p(folder_name)
65
+ $stdout.puts "\tcreate\t#{folder_name}"
66
+ end
67
+
68
+ end
69
+ end
@@ -0,0 +1,8 @@
1
+ module BoxenModuleMaker
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ TINY = 1
6
+ STRING= [MAJOR, MINOR, TINY].join('.')
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe "BoxenModuleMaker" do
4
+ it "sanity check" do
5
+ puts "looks like all the files are parsing! :D"
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'rspec'
4
+ require 'rspec/autorun'
5
+
6
+ RSpec.configure do |config|
7
+
8
+ end
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'boxen-module-maker'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestBoxenModuleMaker < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxen-module-maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter M Souter
@@ -27,10 +27,27 @@ dependencies:
27
27
  description: Get your boxen modules up and running easily
28
28
  email:
29
29
  - p.morsou@gmail.com
30
- executables: []
30
+ executables:
31
+ - boxen-module-maker
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
- files: []
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - LICENSE.txt
40
+ - README.rdoc
41
+ - Rakefile
42
+ - bin/boxen-module-maker
43
+ - boxen-module-maker.gemspec
44
+ - lib/boxen-module-maker.rb
45
+ - lib/boxen-module-maker/bin.rb
46
+ - lib/boxen-module-maker/version.rb
47
+ - spec/boxen-module-maker_spec.rb
48
+ - spec/spec_helper.rb
49
+ - test/helper.rb
50
+ - test/test_boxen-module-maker.rb
34
51
  homepage: https://github.com/petems/boxen-module-maker
35
52
  licenses:
36
53
  - MIT
@@ -55,4 +72,8 @@ rubygems_version: 2.0.3
55
72
  signing_key:
56
73
  specification_version: 4
57
74
  summary: Tool to make new boxen modules easily
58
- test_files: []
75
+ test_files:
76
+ - spec/boxen-module-maker_spec.rb
77
+ - spec/spec_helper.rb
78
+ - test/helper.rb
79
+ - test/test_boxen-module-maker.rb