gemhub 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +40 -0
- data/Rakefile +49 -0
- data/app_generators/gemhub/gemhub_generator.rb +57 -0
- data/app_generators/gemhub/templates/README.textile +24 -0
- data/app_generators/gemhub/templates/Rakefile.erb +47 -0
- data/app_generators/gemhub/templates/lib/template.rb.erb +2 -0
- data/app_generators/gemhub/templates/spec/template_spec.rb.erb +5 -0
- data/bin/gemhub +14 -0
- data/lib/gemhub.rb +3 -0
- metadata +74 -0
data/README.textile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
h2. INSTALLATION
|
2
|
+
|
3
|
+
@sudo gem install dcrec1-gemhub -s http://gems.github.com@
|
4
|
+
|
5
|
+
h2. USAGE
|
6
|
+
|
7
|
+
Create your gem's project structure with:
|
8
|
+
|
9
|
+
@gemhub <gem-name>@
|
10
|
+
|
11
|
+
Then create your files, edit Rakefile and finally execute:
|
12
|
+
|
13
|
+
@rake make_spec@
|
14
|
+
|
15
|
+
to create the gemspec file.
|
16
|
+
|
17
|
+
h2. LICENSE:
|
18
|
+
|
19
|
+
(The MIT License)
|
20
|
+
|
21
|
+
Copyright (c) 2008 FIX
|
22
|
+
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
24
|
+
a copy of this software and associated documentation files (the
|
25
|
+
'Software'), to deal in the Software without restriction, including
|
26
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
27
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
28
|
+
permit persons to whom the Software is furnished to do so, subject to
|
29
|
+
the following conditions:
|
30
|
+
|
31
|
+
The above copyright notice and this permission notice shall be
|
32
|
+
included in all copies or substantial portions of the Software.
|
33
|
+
|
34
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
35
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
36
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
37
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
38
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
39
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
40
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubygems/specification'
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
require 'spec/rake/spectask'
|
6
|
+
|
7
|
+
GEM = "gemhub"
|
8
|
+
GEM_VERSION = "0.5.0"
|
9
|
+
SUMMARY = "Simple gem creation"
|
10
|
+
AUTHOR = "Diego Carrion"
|
11
|
+
EMAIL = "dc.rec1@gmail.com"
|
12
|
+
HOMEPAGE = "http://www.diegocarrion.com"
|
13
|
+
|
14
|
+
spec = Gem::Specification.new do |s|
|
15
|
+
s.name = GEM
|
16
|
+
s.version = GEM_VERSION
|
17
|
+
s.platform = Gem::Platform::RUBY
|
18
|
+
s.summary = SUMMARY
|
19
|
+
s.require_paths = ['app_generators', 'bin', 'lib']
|
20
|
+
s.files = FileList['app_generators/**/*', 'bin/*', 'lib/**/*.rb', '[A-Z]*'].to_a
|
21
|
+
s.executables = ["gemhub"]
|
22
|
+
|
23
|
+
s.add_dependency(%q<rubigen>, [">= 1.3.4"])
|
24
|
+
|
25
|
+
s.author = AUTHOR
|
26
|
+
s.email = EMAIL
|
27
|
+
s.homepage = HOMEPAGE
|
28
|
+
end
|
29
|
+
|
30
|
+
Spec::Rake::SpecTask.new do |t|
|
31
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
32
|
+
t.spec_opts = %w(-fs --color)
|
33
|
+
end
|
34
|
+
|
35
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
36
|
+
pkg.gem_spec = spec
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "Install the gem locally"
|
40
|
+
task :install => [:package] do
|
41
|
+
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Create a gemspec file"
|
45
|
+
task :make_spec do
|
46
|
+
File.open("#{GEM}.gemspec", "w") do |file|
|
47
|
+
file.puts spec.to_ruby
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
|
3
|
+
class GemhubGenerator < RubiGen::Base
|
4
|
+
|
5
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
6
|
+
Config::CONFIG['ruby_install_name'])
|
7
|
+
|
8
|
+
attr_reader :name, :module_name
|
9
|
+
|
10
|
+
def initialize(runtime_args, runtime_options = {})
|
11
|
+
super
|
12
|
+
usage if args.empty?
|
13
|
+
@destination_root = File.expand_path(args.shift)
|
14
|
+
@name = base_name
|
15
|
+
@module_name = base_name.split(/_+/).each{ |word| word.capitalize! }.join('')
|
16
|
+
end
|
17
|
+
|
18
|
+
def manifest
|
19
|
+
record do |m|
|
20
|
+
# Ensure appropriate folder(s) exists
|
21
|
+
m.directory ''
|
22
|
+
BASEDIRS.each { |path| m.directory path }
|
23
|
+
|
24
|
+
# Create stubs
|
25
|
+
# m.template "template.rb", "some_file_after_erb.rb"
|
26
|
+
m.template "lib/template.rb.erb", "lib/#{name}.rb"
|
27
|
+
m.template "spec/template_spec.rb.erb", "spec/#{name}_spec.rb"
|
28
|
+
|
29
|
+
m.file "README.textile", "README.textile"
|
30
|
+
m.template "Rakefile.erb", "Rakefile"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
def banner
|
36
|
+
<<-EOS
|
37
|
+
Creates a simple RubyGems scaffold.
|
38
|
+
|
39
|
+
USAGE: #{spec.name} name --simple"
|
40
|
+
EOS
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_options!(opts)
|
44
|
+
opts.separator ''
|
45
|
+
opts.separator 'Options:'
|
46
|
+
# For each option below, place the default
|
47
|
+
# at the top of the file next to "default_options"
|
48
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
49
|
+
# "Some comment about this option",
|
50
|
+
# "Default: none") { |x| options[:author] = x }
|
51
|
+
opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
52
|
+
end
|
53
|
+
|
54
|
+
# Installation skeleton. Intermediate directories are automatically
|
55
|
+
# created so don't sweat their absence here.
|
56
|
+
BASEDIRS = %w(lib spec)
|
57
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
h2. LICENSE:
|
2
|
+
|
3
|
+
(The MIT License)
|
4
|
+
|
5
|
+
Copyright (c) 2008 FIX
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
a copy of this software and associated documentation files (the
|
9
|
+
'Software'), to deal in the Software without restriction, including
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be
|
16
|
+
included in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
21
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
22
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
23
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
24
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubygems/specification'
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
require 'spec/rake/spectask'
|
6
|
+
|
7
|
+
GEM = "<%= name %>"
|
8
|
+
GEM_VERSION = "0.1.0"
|
9
|
+
SUMMARY = "FIXME Summary"
|
10
|
+
AUTHOR = "FIXME Author"
|
11
|
+
EMAIL = "FIXME Email"
|
12
|
+
HOMEPAGE = "FIXME HomePage"
|
13
|
+
|
14
|
+
|
15
|
+
spec = Gem::Specification.new do |s|
|
16
|
+
s.name = GEM
|
17
|
+
s.version = GEM_VERSION
|
18
|
+
s.platform = Gem::Platform::RUBY
|
19
|
+
s.summary = SUMMARY
|
20
|
+
s.require_paths = ['lib']
|
21
|
+
s.files = FileList['app_generators/**/*', 'bin/*', 'lib/**/*.rb', '[A-Z]*'].to_a
|
22
|
+
|
23
|
+
s.author = AUTHOR
|
24
|
+
s.email = EMAIL
|
25
|
+
s.homepage = HOMEPAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
Spec::Rake::SpecTask.new do |t|
|
29
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
30
|
+
t.spec_opts = %w(-fs --color)
|
31
|
+
end
|
32
|
+
|
33
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
34
|
+
pkg.gem_spec = spec
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "Install the gem locally"
|
38
|
+
task :install => [:package] do
|
39
|
+
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
|
40
|
+
end
|
41
|
+
|
42
|
+
desc "Create a gemspec file"
|
43
|
+
task :make_spec do
|
44
|
+
File.open("#{GEM}.gemspec", "w") do |file|
|
45
|
+
file.puts spec.to_ruby
|
46
|
+
end
|
47
|
+
end
|
data/bin/gemhub
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rubigen'
|
5
|
+
|
6
|
+
if %w(-v --version).include? ARGV.first
|
7
|
+
require 'gemhub'
|
8
|
+
puts "#{File.basename($0)} #{GemHub::VERSION}"
|
9
|
+
exit(0)
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'rubigen/scripts/generate'
|
13
|
+
RubiGen::Base.use_application_sources!
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'gemhub')
|
data/lib/gemhub.rb
ADDED
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gemhub
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Diego Carrion
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-30 00:00:00 -02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rubigen
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.3.4
|
24
|
+
version:
|
25
|
+
description:
|
26
|
+
email: dc.rec1@gmail.com
|
27
|
+
executables:
|
28
|
+
- gemhub
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
33
|
+
files:
|
34
|
+
- app_generators/gemhub/gemhub_generator.rb
|
35
|
+
- app_generators/gemhub/templates/lib/template.rb.erb
|
36
|
+
- app_generators/gemhub/templates/Rakefile.erb
|
37
|
+
- app_generators/gemhub/templates/README.textile
|
38
|
+
- app_generators/gemhub/templates/spec/template_spec.rb.erb
|
39
|
+
- bin/gemhub
|
40
|
+
- lib/gemhub.rb
|
41
|
+
- Rakefile
|
42
|
+
- README.textile
|
43
|
+
has_rdoc: true
|
44
|
+
homepage: http://www.diegocarrion.com
|
45
|
+
licenses: []
|
46
|
+
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
|
50
|
+
require_paths:
|
51
|
+
- app_generators
|
52
|
+
- bin
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "0"
|
65
|
+
version:
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 1.3.5
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Simple gem creation
|
73
|
+
test_files: []
|
74
|
+
|