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 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 = "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'
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 = false
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
- %x{gem install pkg\\#{NAME}-#{VERS}.gem}
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 = %w(Rakefile CHANGELOG README setup.rb).
47
- collect {|f| project_name + '/' + f}
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
- bin_names = OPTIONS[:bin_name].split(',')
115
- bin_names.each do |bin_name|
118
+ bin_names_list = OPTIONS[:bin_name].split(',')
119
+ bin_names_list.each do |bin_name|
116
120
  puts "creating: " + bin + '/' + bin_name
117
- FileUtils.touch bin + '/' + bin_name
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 = bin_names.join(' ')
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
@@ -1,7 +1,7 @@
1
1
  module Newgem #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 6
4
+ MINOR = 7
5
5
  TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
@@ -0,0 +1,9 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ setup.rb
6
+ lib/#{gem_name}.rb
7
+ lib/#{gem_name}/version.rb
8
+ test/test_helper.rb
9
+ test/#{gem_name}_test.rb
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
- RUBYFORGE_PROJECT = "#{gem_name}"
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
- BIN_FILES = %w( #{bin_names} )
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
- desc "Packages up #{gem_name} gem."
32
- task :default => [:test]
33
- task :package => [:clean]
34
-
35
- Rake::TestTask.new("test") { |t|
36
- t.libs << "test"
37
- t.pattern = "test/**/*_test.rb"
38
- t.verbose = true
39
- }
40
-
41
- spec =
42
- Gem::Specification.new do |s|
43
- s.name = NAME
44
- s.version = VERS
45
- s.platform = Gem::Platform::RUBY
46
- s.has_rdoc = true
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
+
@@ -1,3 +1,3 @@
1
1
  // Announcement JS file
2
- var version = "0.5.2";
2
+ var version = "0.6.0";
3
3
  MagicAnnouncement.show('newgem', version);
data/website/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Version JS file
2
- var version = "0.5.2";
2
+ var version = "0.6.0";
3
3
 
4
4
  document.write(" - " + version);
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.6.0
7
- date: 2006-10-19 00:00:00 +02:00
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: