komachi_foundation 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: b63c4521b176cdaa4bc9bead6c9704a866882da2
4
+ data.tar.gz: 773a5ed79c16166f418110014aa261d5d011c401
5
+ SHA512:
6
+ metadata.gz: f33f2db83b8bba7e1f27bae19f18c1fddd39e1be6608268f7c5da46f079c9a6c4ec55161e7f2ace8c9891c55a3b926452ea68b750e2e8d5a5825798d73d822ee
7
+ data.tar.gz: 57ea8dfb8849efbb76faaade4b96e44d8a866f7c772b1542843f172ba83c8f8c447d2fd5eb27b3f241a1b36a3a80192c7dc5854b286b66f8e5518d4702f2926f
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in komachi_foundation.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 mitaku
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # KomachiFoundation
2
+
3
+ It's a tool for applying the application of the template.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'komachi_foundation'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install komachi_foundation
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ $ komachi-foundation generate [TEMPLATE]
25
+ $ komachi-foundation package [package]
26
+ ```
27
+
28
+ ## Development
29
+
30
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec komachi_foundation` to use the gem in this directory, ignoring other installed copies of this gem.
31
+
32
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
33
+
34
+ ## Contributing
35
+
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mitaku/komachi_foundation.
37
+
38
+
39
+ ## License
40
+
41
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
42
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "komachi_foundation"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "komachi_foundation"
4
+ require "komachi_foundation/generator"
5
+ require "komachi_foundation/package_loader"
6
+
7
+ require 'bundler'
8
+ Bundler.require
9
+
10
+ class CLI < Thor
11
+ register(KomachiFoundation::Generator, "generate", "generate [template_file]", "generate [template_file]")
12
+ register(KomachiFoundation::PackageLoader, "package", "package [package_name]", "package [package_name]")
13
+ end
14
+
15
+ CLI.start(ARGV)
@@ -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 'komachi_foundation/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "komachi_foundation"
8
+ spec.version = KomachiFoundation::VERSION
9
+ spec.authors = ["mitaku"]
10
+ spec.email = ["mitaku1104@gmail.com"]
11
+
12
+ spec.summary = %q{template generator}
13
+ spec.description = %q{It's a tool for applying the application of the template.}
14
+ spec.homepage = "https://github.com/mitaku/komachi_foundation"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_runtime_dependency "thor"
23
+ spec.add_development_dependency "bundler", "~> 1.11"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1,24 @@
1
+ require "komachi_foundation/source"
2
+ require "thor"
3
+
4
+ module KomachiFoundation
5
+ class Generator < Thor::Group
6
+ include Thor::Actions
7
+
8
+ def self.source_paths
9
+ @_source_paths ||= Source.list
10
+ end
11
+
12
+ argument :file_name
13
+ source_root File.expand_path('../templates', __FILE__)
14
+
15
+ def copy_templates
16
+ if File.directory?(find_in_source_paths(file_name))
17
+ directory file_name
18
+ elsif
19
+ template file_name
20
+ end
21
+ end
22
+ end
23
+ end
24
+
@@ -0,0 +1,25 @@
1
+ require "thor"
2
+
3
+ module KomachiFoundation
4
+ class PackageLoader < Thor::Group
5
+ include Thor::Actions
6
+
7
+ if defined?(Rails)
8
+ require "rails/generators/actions"
9
+ include Rails::Generators::Actions
10
+ end
11
+
12
+ argument :package
13
+
14
+ def load_package
15
+ _source_root = KomachiFoundation.const_get(package.capitalize).source_root
16
+ recipe_file = File.join(_source_root, "recipe.rb")
17
+ if File.exists?(recipe_file)
18
+ @source_paths = [File.join(_source_root, "templates")]
19
+ apply(recipe_file)
20
+ else
21
+ raise Error, "Invalid package name #{package}/recipe.rb"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,13 @@
1
+ module KomachiFoundation
2
+ class Source
3
+ class << self
4
+ def list
5
+ @_source_list ||= []
6
+ end
7
+
8
+ def register(path)
9
+ list << path
10
+ end
11
+ end
12
+ end
13
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ module KomachiFoundation
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "komachi_foundation/version"
2
+ require "komachi_foundation/source"
3
+
4
+ module KomachiFoundation
5
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: komachi_foundation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mitaku
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-01-12 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.11'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.11'
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: It's a tool for applying the application of the template.
56
+ email:
57
+ - mitaku1104@gmail.com
58
+ executables:
59
+ - komachi-foundation
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/console
69
+ - bin/setup
70
+ - exe/komachi-foundation
71
+ - komachi_foundation.gemspec
72
+ - lib/komachi_foundation.rb
73
+ - lib/komachi_foundation/generator.rb
74
+ - lib/komachi_foundation/package_loader.rb
75
+ - lib/komachi_foundation/source.rb
76
+ - lib/komachi_foundation/templates/.keep
77
+ - lib/komachi_foundation/version.rb
78
+ homepage: https://github.com/mitaku/komachi_foundation
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.4.5.1
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: template generator
102
+ test_files: []