itamae-skeleton 0.1.0

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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 716380e9c74167f1ac5313848e63ff795a9a0e17
4
+ data.tar.gz: c3bc9362013ed7c7d4072e1efd262b2b788ee9e4
5
+ SHA512:
6
+ metadata.gz: fb776a9a74235321b889af55e6683ea5de4e218023db6676969c622b830d7f56c4ac2068250e15b08bc90d0359b515c0eaafb17628c3278aea94105104bdb0c8
7
+ data.tar.gz: 1e48d8da9fcfba571315b3228f227fa17766d340337e65c29a8d28fbde54364d43b6e4f5f3f7d2ab09b1c815dfa8b547380e5d6d6055214404695a2024f385c9
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-skeleton.gemspec
4
+ gemspec
@@ -0,0 +1,33 @@
1
+ # ItamaeSkeleton
2
+
3
+ Generating Itamae skeleton tool.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-skeleton'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install itamae-skeleton
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ $ itamae-skeleton init
25
+ ```
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/[my-github-username]/itamae-skeleton/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'itamae-skeleton/cli'
4
+ ItamaeSkeleton::CLI.start
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'itamae-skeleton/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-skeleton"
8
+ spec.version = ItamaeSkeleton::VERSION
9
+ spec.authors = ["maruware"]
10
+ spec.email = ["me@maruware.com"]
11
+
12
+ spec.summary = 'Generating Itamae skeleton tool.'
13
+ spec.description = 'Generating Itamae skeleton tool.'
14
+ spec.homepage = "https://github.com/maruware/itamae-skeleton"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'thor'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.8"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1,6 @@
1
+ require "itamae-skeleton/version"
2
+ require 'itamae-skeleton/cli'
3
+
4
+ module ItamaeSkeleton
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,39 @@
1
+ require 'thor'
2
+ require 'pathname'
3
+
4
+ module ItamaeSkeleton
5
+ class CLI < Thor
6
+ desc 'init', 'generate itamae skeleton'
7
+ def init
8
+ template_dir = File.expand_path('../template', __FILE__)
9
+ FileUtils.copy_entry(template_dir, '.')
10
+ end
11
+
12
+ desc 'destroy', 'delete itamae skeleton'
13
+ def destroy
14
+ template_dir = File.expand_path('../template', __FILE__)
15
+ destroy_proc(template_dir, template_dir)
16
+ end
17
+
18
+ private
19
+ def destroy_proc(base_dir, dir)
20
+ Dir::glob("#{dir}/*").each do |path|
21
+ rel_path = Pathname.new(path).relative_path_from(Pathname.new(base_dir))
22
+ if FileTest.directory?(path)
23
+ destroy_proc(base_dir, path)
24
+ if dir_empty?(rel_path)
25
+ Dir.delete(rel_path)
26
+ end
27
+ else
28
+ if File.exist?(rel_path)
29
+ File.delete(rel_path)
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ def dir_empty?(dir)
36
+ Dir::glob("#{dir}/{*, .*}").empty?
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'itamae'
4
+ gem 'rake'
@@ -0,0 +1,5 @@
1
+ node["recipes"] = node["recipes"] || []
2
+
3
+ node["recipes"].each do |recipe|
4
+ include_recipe recipe
5
+ end
@@ -0,0 +1,5 @@
1
+ {
2
+ "recipes": [
3
+ "./roles/app.rb"
4
+ ]
5
+ }
@@ -0,0 +1,3 @@
1
+ execute "Hello, node['hello']['to']!" do
2
+ command "echo \"Hello, #{node['hello']['to']}!\""
3
+ end
@@ -0,0 +1 @@
1
+ include_recipe '../recipes/hello.rb'
@@ -0,0 +1,3 @@
1
+ module ItamaeSkeleton
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-skeleton
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - maruware
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-10-19 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: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Generating Itamae skeleton tool.
56
+ email:
57
+ - me@maruware.com
58
+ executables:
59
+ - itamae-skeleton
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - README.md
67
+ - Rakefile
68
+ - exe/itamae-skeleton
69
+ - itamae-skeleton.gemspec
70
+ - lib/itamae-skeleton.rb
71
+ - lib/itamae-skeleton/cli.rb
72
+ - lib/itamae-skeleton/template/Gemfile
73
+ - lib/itamae-skeleton/template/entry.rb
74
+ - lib/itamae-skeleton/template/nodes/app.json
75
+ - lib/itamae-skeleton/template/recipes/hello.rb
76
+ - lib/itamae-skeleton/template/roles/app.rb
77
+ - lib/itamae-skeleton/version.rb
78
+ homepage: https://github.com/maruware/itamae-skeleton
79
+ licenses: []
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.4.5
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Generating Itamae skeleton tool.
101
+ test_files: []