newgem 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +31 -10
- data/bin/newgem +22 -6
- data/lib/newgem/version.rb +1 -1
- data/templates/Manifest +9 -0
- data/templates/Rakefile +23 -58
- data/website/version-raw.js +1 -1
- data/website/version.js +1 -1
- metadata +13 -3
data/Rakefile
CHANGED
@@ -9,6 +9,14 @@ require 'fileutils'
|
|
9
9
|
include FileUtils
|
10
10
|
require File.join(File.dirname(__FILE__), 'lib', 'newgem', 'version')
|
11
11
|
|
12
|
+
AUTHOR = "Dr Nic Williams"
|
13
|
+
EMAIL = "drnicwilliams@gmail.com"
|
14
|
+
DESCRIPTION = "Make your own gems at home"
|
15
|
+
RUBYFORGE_PROJECT = "newgem"
|
16
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
17
|
+
BIN_FILES = %w( newgem )
|
18
|
+
RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
|
19
|
+
|
12
20
|
NAME = "newgem"
|
13
21
|
REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
|
14
22
|
VERS = ENV['VERSION'] || (Newgem::VERSION::STRING + (REV ? ".#{REV}" : ""))
|
@@ -18,7 +26,6 @@ RDOC_OPTS = ['--quiet', '--title', "newgem documentation",
|
|
18
26
|
"--line-numbers",
|
19
27
|
"--main", "README",
|
20
28
|
"--inline-source"]
|
21
|
-
BIN_FILES = %w( newgem )
|
22
29
|
|
23
30
|
desc "Packages up newgem gem to make gems."
|
24
31
|
task :default => [:test]
|
@@ -36,15 +43,17 @@ spec =
|
|
36
43
|
s.has_rdoc = true
|
37
44
|
s.extra_rdoc_files = ["README", "CHANGELOG"]
|
38
45
|
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)\/']
|
39
|
-
s.summary =
|
40
|
-
s.description =
|
41
|
-
s.author =
|
42
|
-
s.email =
|
43
|
-
s.homepage =
|
46
|
+
s.summary = DESCRIPTION
|
47
|
+
s.description = DESCRIPTION
|
48
|
+
s.author = AUTHOR
|
49
|
+
s.email = EMAIL
|
50
|
+
s.homepage = HOMEPATH
|
44
51
|
s.executables = BIN_FILES
|
52
|
+
s.rubyforge_project = RUBYFORGE_PROJECT
|
45
53
|
s.bindir = "bin"
|
46
54
|
|
47
55
|
s.add_dependency('activesupport', '>=1.3.1')
|
56
|
+
s.add_dependency('hoe', '>=1.1.4')
|
48
57
|
#s.required_ruby_version = '>= 1.8.2'
|
49
58
|
|
50
59
|
s.files = %w(README Rakefile) +
|
@@ -58,19 +67,31 @@ spec =
|
|
58
67
|
end
|
59
68
|
|
60
69
|
Rake::GemPackageTask.new(spec) do |p|
|
61
|
-
p.need_tar =
|
70
|
+
p.need_tar = RELEASE_TYPES.include? 'tar'
|
71
|
+
p.need_zip = RELEASE_TYPES.include? 'zip'
|
62
72
|
p.gem_spec = spec
|
63
73
|
end
|
64
74
|
|
65
|
-
task :install do
|
66
|
-
sh %{rake package}
|
75
|
+
task :install => [ :package ] do
|
67
76
|
sh %{sudo gem install pkg/#{NAME}-#{VERS}}
|
68
77
|
end
|
69
78
|
|
70
79
|
task :install_win => [:package] do
|
71
|
-
|
80
|
+
puts "gem install pkg/#{NAME}-#{VERS}.gem"
|
81
|
+
puts system("gem install pkg/#{NAME}-#{VERS}.gem")
|
72
82
|
end
|
73
83
|
|
74
84
|
task :uninstall => [:clean] do
|
75
85
|
sh %{sudo gem uninstall #{NAME}}
|
76
86
|
end
|
87
|
+
|
88
|
+
desc "Publish the release files to RubyForge."
|
89
|
+
task :release => [ :package ] do
|
90
|
+
system('rubyforge login')
|
91
|
+
for ext in RELEASE_TYPES
|
92
|
+
release_command = "rubyforge add_release #{RUBYFORGE_PROJECT} #{NAME} 'REL #{VERS}' pkg/#{NAME}-#{VERS}.#{ext}"
|
93
|
+
puts release_command
|
94
|
+
system(release_command)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
data/bin/newgem
CHANGED
@@ -43,8 +43,9 @@ module_name = project_name.classify
|
|
43
43
|
lib = project_name + '/lib'
|
44
44
|
lib_project_name = project_name + '/lib/' + project_name
|
45
45
|
version = project_name + "/lib/" + project_name + "/version.rb"
|
46
|
-
rakefile, changelog, readme, setup
|
47
|
-
|
46
|
+
rakefile, changelog, readme, setup, manifest, history =
|
47
|
+
%w(Rakefile CHANGELOG.txt README.txt setup.rb Manifest.txt History.txt).
|
48
|
+
collect {|f| project_name + '/' + f}
|
48
49
|
|
49
50
|
test = project_name + "/test"
|
50
51
|
main = project_name + "/lib/" + project_name + ".rb"
|
@@ -65,6 +66,9 @@ Dir.mkdir project_name
|
|
65
66
|
puts "creating: " + changelog
|
66
67
|
FileUtils.touch changelog
|
67
68
|
|
69
|
+
puts "creating: " + history
|
70
|
+
FileUtils.touch history
|
71
|
+
|
68
72
|
puts "creating: " + readme
|
69
73
|
File.open(readme, 'w') do |file|
|
70
74
|
file << <<-eos
|
@@ -111,12 +115,17 @@ puts "creating: " + bin
|
|
111
115
|
Dir.mkdir bin
|
112
116
|
|
113
117
|
if OPTIONS[:bin_name]
|
114
|
-
|
115
|
-
|
118
|
+
bin_names_list = OPTIONS[:bin_name].split(',')
|
119
|
+
bin_names_list.each do |bin_name|
|
116
120
|
puts "creating: " + bin + '/' + bin_name
|
117
|
-
|
121
|
+
File.open(bin + '/' + bin_name, 'w') do |file|
|
122
|
+
file << <<-eos
|
123
|
+
#!/usr/bin/env ruby
|
124
|
+
|
125
|
+
eos
|
126
|
+
end
|
118
127
|
end
|
119
|
-
bin_names =
|
128
|
+
bin_names = bin_names_list.join(' ')
|
120
129
|
else
|
121
130
|
bin_names = ''
|
122
131
|
end
|
@@ -127,6 +136,13 @@ File.open(rakefile, 'w') do |file|
|
|
127
136
|
file << eval('"' + template.gsub(/"/, '\"') + '"')
|
128
137
|
end
|
129
138
|
|
139
|
+
puts "creating: " + manifest
|
140
|
+
template = File.open(templates + 'Manifest','r') {|f| f.readlines.join}
|
141
|
+
File.open(manifest, 'w') do |file|
|
142
|
+
file << eval('"' + template.gsub(/"/, '\"') + '"')
|
143
|
+
end
|
144
|
+
|
145
|
+
|
130
146
|
|
131
147
|
puts "creating: " + test
|
132
148
|
Dir.mkdir test
|
data/lib/newgem/version.rb
CHANGED
data/templates/Manifest
ADDED
data/templates/Rakefile
CHANGED
@@ -7,19 +7,21 @@ require 'rake/gempackagetask'
|
|
7
7
|
require 'rake/rdoctask'
|
8
8
|
require 'rake/contrib/rubyforgepublisher'
|
9
9
|
require 'fileutils'
|
10
|
+
require 'hoe'
|
10
11
|
include FileUtils
|
11
12
|
require File.join(File.dirname(__FILE__), 'lib', '#{gem_name}', 'version')
|
12
13
|
|
13
|
-
AUTHOR = "#{author}"
|
14
|
+
AUTHOR = "#{author}" # can also be an array of Authors
|
14
15
|
EMAIL = "your contact email for bug fixes and info"
|
15
16
|
DESCRIPTION = "description of gem"
|
16
|
-
|
17
|
+
GEM_NAME = "#{gem_name}" # what ppl will type to install your gem
|
18
|
+
RUBYFORGE_PROJECT = "#{gem_name}" # The unix name for your project
|
17
19
|
HOMEPATH = "http://\#{RUBYFORGE_PROJECT}.rubyforge.org"
|
18
|
-
|
20
|
+
RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
|
19
21
|
|
20
22
|
|
21
23
|
NAME = "#{gem_name}"
|
22
|
-
REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
|
24
|
+
REV = nil # UNCOMMENT IF REQUIRED: File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
|
23
25
|
VERS = ENV['VERSION'] || (#{module_name}::VERSION::STRING + (REV ? ".\#{REV}" : ""))
|
24
26
|
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
25
27
|
RDOC_OPTS = ['--quiet', '--title', "#{gem_name} documentation",
|
@@ -28,58 +30,21 @@ RDOC_OPTS = ['--quiet', '--title', "#{gem_name} documentation",
|
|
28
30
|
"--main", "README",
|
29
31
|
"--inline-source"]
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
s
|
45
|
-
|
46
|
-
|
47
|
-
s.extra_rdoc_files = ["README", "CHANGELOG"]
|
48
|
-
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)\/']
|
49
|
-
s.summary = DESCRIPTION
|
50
|
-
s.description = DESCRIPTION
|
51
|
-
s.author = AUTHOR
|
52
|
-
s.email = EMAIL
|
53
|
-
s.homepage = HOMEPATH
|
54
|
-
s.executables = BIN_FILES
|
55
|
-
s.rubyforge_project = RUBYFORGE_PROJECT
|
56
|
-
s.bindir = "bin"
|
57
|
-
s.require_path = "lib"
|
58
|
-
s.autorequire = "#{gem_name}"
|
59
|
-
|
60
|
-
#s.add_dependency('activesupport', '>=1.3.1')
|
61
|
-
#s.required_ruby_version = '>= 1.8.2'
|
62
|
-
|
63
|
-
s.files = %w(README CHANGELOG Rakefile) +
|
64
|
-
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
|
65
|
-
Dir.glob("ext/**/*.{h,c,rb}") +
|
66
|
-
Dir.glob("examples/**/*.rb") +
|
67
|
-
Dir.glob("tools/*.rb")
|
68
|
-
|
69
|
-
# s.extensions = FileList["ext/**/extconf.rb"].to_a
|
70
|
-
end
|
71
|
-
|
72
|
-
Rake::GemPackageTask.new(spec) do |p|
|
73
|
-
p.need_tar = true
|
74
|
-
p.gem_spec = spec
|
75
|
-
end
|
76
|
-
|
77
|
-
task :install do
|
78
|
-
name = "\#{NAME}-\#{VERS}.gem"
|
79
|
-
sh %{rake package}
|
80
|
-
sh %{sudo gem install pkg/\#{name}}
|
81
|
-
end
|
82
|
-
|
83
|
-
task :uninstall => [:clean] do
|
84
|
-
sh %{sudo gem uninstall \#{NAME}}
|
33
|
+
# Generate all the Rake tasks
|
34
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
35
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
36
|
+
p.author = AUTHOR
|
37
|
+
p.description = DESCRIPTION
|
38
|
+
p.email = EMAIL
|
39
|
+
p.summary = DESCRIPTION
|
40
|
+
p.url = HOMEPATH
|
41
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
42
|
+
p.test_globs = ["test/**/*_test.rb"]
|
43
|
+
p.clean_globs = CLEAN #An array of file patterns to delete on clean.
|
44
|
+
|
45
|
+
# == Optional
|
46
|
+
#p.changes - A description of the release's latest changes.
|
47
|
+
#p.extra_deps - An array of rubygem dependencies.
|
48
|
+
#p.spec_extras - A hash of extra values to set in the gemspec.
|
85
49
|
end
|
50
|
+
|
data/website/version-raw.js
CHANGED
data/website/version.js
CHANGED
metadata
CHANGED
@@ -3,14 +3,14 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: newgem
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.7.0
|
7
|
+
date: 2006-11-13 00:00:00 +01:00
|
8
8
|
summary: Make your own gems at home
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: drnicwilliams@gmail.com
|
12
12
|
homepage: http://newgem.rubyforge.org
|
13
|
-
rubyforge_project:
|
13
|
+
rubyforge_project: newgem
|
14
14
|
description: Make your own gems at home
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- lib/newgem
|
37
37
|
- lib/newgem.rb
|
38
38
|
- lib/newgem/version.rb
|
39
|
+
- templates/Manifest
|
39
40
|
- templates/Rakefile
|
40
41
|
- templates/setup.rb
|
41
42
|
- templates/test.rb
|
@@ -76,3 +77,12 @@ dependencies:
|
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: 1.3.1
|
78
79
|
version:
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: hoe
|
82
|
+
version_requirement:
|
83
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 1.1.4
|
88
|
+
version:
|