gthor 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +21 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.org +21 -0
- data/Rakefile +2 -0
- data/bin/gthor +6 -0
- data/gthor.gemspec +19 -0
- data/lib/gthor.rb +4 -0
- data/lib/gthor/runner.rb +26 -0
- data/lib/gthor/version.rb +3 -0
- metadata +72 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Shintaro Katayama
|
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.org
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
* Gthor
|
2
|
+
|
3
|
+
*Gthor* - [[https://github.com/wycats/thor][Thor]] with extension management on RubyGem framework
|
4
|
+
|
5
|
+
Gthor finds not only Thorfiles by traversing from current directory down to the root, but also =Gthorfile= at the current directory (no traversing) or root of all installed gems, and then enables to exec it as subcommands of =gthor=. So Gthor can manage Thor extensions on RubyGem framework, by =gem= command.
|
6
|
+
|
7
|
+
* Installation
|
8
|
+
|
9
|
+
: gem install gthor
|
10
|
+
|
11
|
+
* Usage
|
12
|
+
|
13
|
+
Format of =Gthorfile= is same with Thorfiles, which contain standard ruby code with Thor functionalities. Please see [[https://github.com/wycats/thor/wiki][Thor wiki]] for detailed usages.
|
14
|
+
|
15
|
+
* Contributing
|
16
|
+
|
17
|
+
1. Fork it
|
18
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
19
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
20
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
21
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/gthor
ADDED
data/gthor.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/gthor/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Shintaro Katayama"]
|
6
|
+
gem.email = ["shintaro.katayama@gmail.com"]
|
7
|
+
gem.description = %q{Gthor - Thor with extension management on RubyGem framework}
|
8
|
+
gem.summary = gem.description
|
9
|
+
gem.homepage = "https://github.com/shka/ruby-gthor"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "gthor"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Gthor::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency 'thor'
|
19
|
+
end
|
data/lib/gthor.rb
ADDED
data/lib/gthor/runner.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'gthor'
|
2
|
+
require 'thor/runner'
|
3
|
+
|
4
|
+
class Gthor::Runner < Thor::Runner
|
5
|
+
|
6
|
+
namespace :default
|
7
|
+
|
8
|
+
def method_missing(meth, *args)
|
9
|
+
meth = meth.to_s
|
10
|
+
initialize_thorfiles(meth)
|
11
|
+
klass, task = Thor::Util.find_class_and_task_by_namespace(meth)
|
12
|
+
self.class.handle_no_task_error(task, false) if klass.nil?
|
13
|
+
args.unshift(task) if task
|
14
|
+
klass.start(args, :shell => self.shell)
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(*)
|
18
|
+
super
|
19
|
+
Gem.find_files('../Gthorfile').each { |thorfile|
|
20
|
+
Thor::Util.load_thorfile(thorfile)
|
21
|
+
}
|
22
|
+
thorfile = File.expand_path('./Gthorfile')
|
23
|
+
Thor::Util.load_thorfile(thorfile) if File.exist?(thorfile)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gthor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Shintaro Katayama
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-08-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Gthor - Thor with extension management on RubyGem framework
|
31
|
+
email:
|
32
|
+
- shintaro.katayama@gmail.com
|
33
|
+
executables:
|
34
|
+
- gthor
|
35
|
+
extensions: []
|
36
|
+
extra_rdoc_files: []
|
37
|
+
files:
|
38
|
+
- .gitignore
|
39
|
+
- Gemfile
|
40
|
+
- LICENSE
|
41
|
+
- README.org
|
42
|
+
- Rakefile
|
43
|
+
- bin/gthor
|
44
|
+
- gthor.gemspec
|
45
|
+
- lib/gthor.rb
|
46
|
+
- lib/gthor/runner.rb
|
47
|
+
- lib/gthor/version.rb
|
48
|
+
homepage: https://github.com/shka/ruby-gthor
|
49
|
+
licenses: []
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 1.8.23
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: Gthor - Thor with extension management on RubyGem framework
|
72
|
+
test_files: []
|