Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated the rubygems-tasks gemspec.

  • Loading branch information...
commit ad49c03302bf13acddd5414e6394e8ef4e44a638 1 parent 393203d
Postmodern authored
Showing with 24 additions and 42 deletions.
  1. +24 −42 rubygems-tasks.gemspec
66 rubygems-tasks.gemspec
View
@@ -23,72 +23,54 @@ Gem::Specification.new do |gemspec|
}
version = {
- :file => 'lib/ore/tasks/version.rb',
- :constant => 'Ore::Tasks::VERSION'
+ :file => 'lib/rubygems/tasks/version.rb',
+ :constant => 'Gem::Tasks::VERSION'
}
defaults = {
- 'name' => File.basename(File.dirname(__FILE__)),
- 'files' => files,
- 'executables' => filter_files['bin/*'].map { |path| File.basename(path) },
- 'test_files' => filter_files['{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'],
- 'extra_doc_files' => filter_files['*.{txt,rdoc,md,markdown,tt,textile}'],
+ 'name' => File.basename(File.dirname(__FILE__)),
+ 'files' => files,
+ 'require_paths' => ['ext', 'lib'].select { |dir| File.directory?(dir) },
+ 'executables' => filter_files['bin/*'].map { |path| File.basename(path) },
+ 'test_files' => filter_files['{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'],
+ 'extra_doc_files' => filter_files['*.{txt,rdoc,md,markdown,tt,textile}']
}
metadata = defaults.merge(YAML.load_file('gemspec.yml'))
- gemspec.name = metadata.fetch('name',defaults[:name])
+ gemspec.name = metadata['name']
gemspec.version = if metadata['version']
metadata['version']
- elsif File.file?(version[:file])
- require File.join('.',version[:file])
+ else
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
+
+ require version[:file]
eval(version[:constant])
end
- gemspec.summary = metadata.fetch('summary',metadata['description'])
+ gemspec.summary = metadata.fetch('summary',metadata['description'])
gemspec.description = metadata.fetch('description',metadata['summary'])
- case metadata['license']
- when Array
- gemspec.licenses = metadata['license']
- when String
- gemspec.license = metadata['license']
- end
+ gemspec.licenses = Array(metadata['license'])
+ gemspec.authors = Array(metadata['authors'])
- case metadata['authors']
- when Array
- gemspec.authors = metadata['authors']
- when String
- gemspec.author = metadata['authors']
- end
-
- gemspec.email = metadata['email']
+ gemspec.email = metadata['email']
gemspec.homepage = metadata['homepage']
- case metadata['require_paths']
- when Array
- gemspec.require_paths = metadata['require_paths']
- when String
- gemspec.require_path = metadata['require_paths']
- end
-
- gemspec.files = filter_files[metadata['files']]
-
- gemspec.executables = metadata['executables']
- gemspec.extensions = metadata['extensions']
+ gemspec.require_paths = Array(metadata['require_paths'])
+ gemspec.files = filter_files[metadata['files']]
+ gemspec.executables = metadata['executables']
+ gemspec.extensions = metadata['extensions']
if Gem::VERSION < '1.7.'
gemspec.default_executable = gemspec.executables.first
end
- gemspec.test_files = filter_files[metadata['test_files']]
-
- unless gemspec.files.include?('.document')
- gemspec.extra_rdoc_files = metadata['extra_doc_files']
- end
+ gemspec.test_files = filter_files[metadata['test_files']]
+ gemspec.extra_rdoc_files = Array(metadata['extra_doc_files'])
gemspec.post_install_message = metadata['post_install_message']
- gemspec.requirements = metadata['requirements']
+ gemspec.requirements = metadata['requirements']
if gemspec.respond_to?(:required_ruby_version=)
gemspec.required_ruby_version = metadata['required_ruby_version']
Please sign in to comment.
Something went wrong with that request. Please try again.