newgem 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
data/README ADDED
@@ -0,0 +1,3 @@
1
+ README for newgem
2
+ =================
3
+
@@ -0,0 +1,76 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/packagetask'
5
+ require 'rake/gempackagetask'
6
+ require 'rake/rdoctask'
7
+ require 'rake/contrib/rubyforgepublisher'
8
+ require 'fileutils'
9
+ include FileUtils
10
+ require File.join(File.dirname(__FILE__), 'lib', 'newgem', 'version')
11
+
12
+ NAME = "newgem"
13
+ REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
14
+ VERS = ENV['VERSION'] || (Newgem::VERSION::STRING + (REV ? ".#{REV}" : ""))
15
+ CLEAN.include ['**/.*.sw?', '*.gem', '.config']
16
+ RDOC_OPTS = ['--quiet', '--title', "newgem documentation",
17
+ "--opname", "index.html",
18
+ "--line-numbers",
19
+ "--main", "README",
20
+ "--inline-source"]
21
+ BIN_FILES = %w( newgem )
22
+
23
+ desc "Packages up newgem gem to make gems."
24
+ task :default => [:test]
25
+ task :package => [:clean]
26
+
27
+ task :test do
28
+ require File.dirname(__FILE__) + '/test/all_tests.rb'
29
+ end
30
+
31
+ spec =
32
+ Gem::Specification.new do |s|
33
+ s.name = NAME
34
+ s.version = VERS
35
+ s.platform = Gem::Platform::RUBY
36
+ s.has_rdoc = true
37
+ s.extra_rdoc_files = ["README", "CHANGELOG"]
38
+ s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)\/']
39
+ s.summary = "Make your own gems at home"
40
+ s.description = s.summary
41
+ s.author = "Dr Nic Williams"
42
+ s.email = 'drnicwilliams@gmail.com'
43
+ s.homepage = 'http://newgem.rubyforge.org'
44
+ s.executables = BIN_FILES
45
+ s.bindir = "bin"
46
+
47
+ s.add_dependency('activesupport', '>=1.3.1')
48
+ #s.required_ruby_version = '>= 1.8.2'
49
+
50
+ s.files = %w(README Rakefile) +
51
+ Dir.glob("{bin,doc,test,lib,templates,extras,website,script}/**/*") +
52
+ Dir.glob("ext/**/*.{h,c,rb}") +
53
+ Dir.glob("examples/**/*.rb") +
54
+ Dir.glob("tools/*.rb")
55
+
56
+ s.require_path = "lib"
57
+ # s.extensions = FileList["ext/**/extconf.rb"].to_a
58
+ end
59
+
60
+ Rake::GemPackageTask.new(spec) do |p|
61
+ p.need_tar = false
62
+ p.gem_spec = spec
63
+ end
64
+
65
+ task :install do
66
+ sh %{rake package}
67
+ sh %{sudo gem install pkg/#{NAME}-#{VERS}}
68
+ end
69
+
70
+ task :install_win => [:package] do
71
+ %x{gem install pkg\\#{NAME}-#{VERS}.gem}
72
+ end
73
+
74
+ task :uninstall => [:clean] do
75
+ sh %{sudo gem uninstall #{NAME}}
76
+ end
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+ require 'active_support'
5
+
6
+ templates = File.dirname(__FILE__) + '/../templates/'
7
+
8
+ gem_name = project_name = ARGV[0]
9
+ module_name = project_name.classify
10
+ lib = project_name + '/lib'
11
+ lib_project_name = project_name + '/lib/' + project_name
12
+ version = project_name + "/lib/" + project_name + "/version.rb"
13
+ rakefile, changelog, readme = %w(Rakefile CHANGELOG README).
14
+ collect {|f| project_name + '/' + f}
15
+
16
+ test = project_name + "/test"
17
+ all_tests = test + "/all_tests.rb"
18
+ main = project_name + "/lib/" + project_name + ".rb"
19
+ test_helper = test + "/test_helper.rb"
20
+ unit_test = test + "/" + project_name + "_test.rb"
21
+
22
+ examples = project_name + '/examples'
23
+ bin = project_name + '/bin'
24
+
25
+ FileUtils.rm_rf project_name
26
+
27
+ puts "creating: " + project_name
28
+ Dir.mkdir project_name
29
+
30
+ puts "creating: " + changelog
31
+ FileUtils.touch changelog
32
+
33
+ puts "creating: " + readme
34
+ File.open(readme, 'w') do |file|
35
+ file << <<-eos
36
+ README for #{project_name}
37
+ ===========#{'=' * project_name.length}
38
+
39
+ eos
40
+ end
41
+
42
+
43
+ puts "creating: " + lib
44
+ Dir.mkdir lib
45
+
46
+ puts "creating: " + lib_project_name
47
+ Dir.mkdir lib_project_name
48
+
49
+ puts "creating: " + main
50
+ File.open(main, 'w') do |file|
51
+ file << "Dir['#{project_name}/**/*.rb'].sort.each { |lib| require lib }"
52
+ end
53
+
54
+ puts "creating: " + version
55
+ File.open(version, 'w') do |file|
56
+ file << <<-eos
57
+ module #{module_name} #:nodoc:
58
+ module VERSION #:nodoc:
59
+ MAJOR = 0
60
+ MINOR = 0
61
+ TINY = 1
62
+
63
+ STRING = [MAJOR, MINOR, TINY].join('.')
64
+ end
65
+ end
66
+ eos
67
+ end
68
+
69
+ puts "creating: " + rakefile
70
+ template = File.open(templates + 'Rakefile','r') {|f| f.readlines.join}
71
+ File.open(rakefile, 'w') do |file|
72
+ file << eval('"' + template.gsub(/"/, '\"') + '"')
73
+ end
74
+
75
+
76
+ puts "creating: " + test
77
+ Dir.mkdir test
78
+
79
+ puts "creating: " + all_tests
80
+ File.open(all_tests, 'w') do |file|
81
+ file << "Dir['**/*_test.rb'].each { |test_case| require test_case }"
82
+ end
83
+
84
+ puts "creating: " + test_helper
85
+ File.open(test_helper, 'w') do |file|
86
+ file << <<-eos
87
+ require 'test/unit'
88
+ require File.dirname(__FILE__) + '/../lib/#{project_name}'
89
+ eos
90
+ end
91
+
92
+ puts "creating: " + unit_test
93
+ template = File.open(templates + 'test.rb','r') {|f| f.readlines.join}
94
+ File.open(unit_test, 'w') do |file|
95
+ file << eval('"' + template.gsub(/"/, '\"') + '"')
96
+ end
97
+
98
+ puts "creating: " + examples
99
+ Dir.mkdir examples
100
+
101
+ puts "creating: " + bin
102
+ Dir.mkdir bin
103
+
@@ -0,0 +1 @@
1
+ Dir['newgem/**/*.rb'].each { |lib| require lib }
@@ -0,0 +1,9 @@
1
+ module Newgem #:nodoc:
2
+ module VERSION #:nodoc:
3
+ MAJOR = 0
4
+ MINOR = 2
5
+ TINY = 0
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
@@ -0,0 +1,79 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/packagetask'
5
+ require 'rake/gempackagetask'
6
+ require 'rake/rdoctask'
7
+ require 'rake/contrib/rubyforgepublisher'
8
+ require 'fileutils'
9
+ include FileUtils
10
+ require File.join(File.dirname(__FILE__), 'lib', '#{gem_name}', 'version')
11
+
12
+ AUTHOR = "you"
13
+ EMAIL = "your contact email for bug fixes and info"
14
+ DESCRIPTION = "description of gem"
15
+ HOMEPATH = 'http://#{gem_name}.rubyforge.org'
16
+
17
+
18
+ NAME = "#{gem_name}"
19
+ REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
20
+ VERS = ENV['VERSION'] || (#{module_name}::VERSION::STRING + (REV ? ".\#{REV}" : ""))
21
+ CLEAN.include ['**/.*.sw?', '*.gem', '.config']
22
+ RDOC_OPTS = ['--quiet', '--title', "#{gem_name} documentation",
23
+ "--opname", "index.html",
24
+ "--line-numbers",
25
+ "--main", "README",
26
+ "--inline-source"]
27
+ BIN_FILES = %w( )
28
+
29
+ desc "Packages up #{gem_name} gem."
30
+ task :default => [:test]
31
+ task :package => [:clean]
32
+
33
+ task :test do
34
+ require File.dirname(__FILE__) + '/test/all_tests.rb'
35
+ end
36
+
37
+ spec =
38
+ Gem::Specification.new do |s|
39
+ s.name = NAME
40
+ s.version = VERS
41
+ s.platform = Gem::Platform::RUBY
42
+ s.has_rdoc = true
43
+ s.extra_rdoc_files = ["README", "CHANGELOG"]
44
+ s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)\/']
45
+ s.summary = DESCRIPTION
46
+ s.description = DESCRIPTION
47
+ s.author = AUTHOR
48
+ s.email = EMAIL
49
+ s.homepage = HOMEPATH
50
+ s.executables = BIN_FILES
51
+ s.bindir = "bin"
52
+ s.require_path = "lib"
53
+
54
+ #s.add_dependency('activesupport', '>=1.3.1')
55
+ #s.required_ruby_version = '>= 1.8.2'
56
+
57
+ s.files = %w(README CHANGELOG Rakefile) +
58
+ Dir.glob("{bin,doc,test,lib,templates,extras,website,script}/**/*") +
59
+ Dir.glob("ext/**/*.{h,c,rb}") +
60
+ Dir.glob("examples/**/*.rb") +
61
+ Dir.glob("tools/*.rb")
62
+
63
+ # s.extensions = FileList["ext/**/extconf.rb"].to_a
64
+ end
65
+
66
+ Rake::GemPackageTask.new(spec) do |p|
67
+ p.need_tar = false
68
+ p.gem_spec = spec
69
+ end
70
+
71
+ task :install do
72
+ name = "\#{NAME}-\#{VERS}.gem"
73
+ sh %{rake package}
74
+ sh %{sudo gem install pkg/\#{name}}
75
+ end
76
+
77
+ task :uninstall => [:clean] do
78
+ sh %{sudo gem uninstall \#{NAME}}
79
+ end
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class #{module_name}Test < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+ end
@@ -0,0 +1 @@
1
+ Dir['**/*_test.rb'].each { |test_case| require test_case }
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/newgem'
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: newgem
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.2.0
7
+ date: 2006-10-11 00:00:00 +02:00
8
+ summary: Make your own gems at home
9
+ require_paths:
10
+ - lib
11
+ email: drnicwilliams@gmail.com
12
+ homepage: http://newgem.rubyforge.org
13
+ rubyforge_project:
14
+ description: Make your own gems at home
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Dr Nic Williams
30
+ files:
31
+ - README
32
+ - Rakefile
33
+ - bin/newgem
34
+ - test/all_tests.rb
35
+ - test/test_helper.rb
36
+ - lib/newgem
37
+ - lib/newgem.rb
38
+ - lib/newgem/version.rb
39
+ - templates/Rakefile
40
+ - templates/test.rb
41
+ - CHANGELOG
42
+ test_files: []
43
+
44
+ rdoc_options:
45
+ - --quiet
46
+ - --title
47
+ - newgem documentation
48
+ - --opname
49
+ - index.html
50
+ - --line-numbers
51
+ - --main
52
+ - README
53
+ - --inline-source
54
+ - --exclude
55
+ - ^(examples|extras)\/
56
+ extra_rdoc_files:
57
+ - README
58
+ - CHANGELOG
59
+ executables:
60
+ - newgem
61
+ extensions: []
62
+
63
+ requirements: []
64
+
65
+ dependencies:
66
+ - !ruby/object:Gem::Dependency
67
+ name: activesupport
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Version::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.3.1
74
+ version: