Skip to content

Commit

Permalink
added copyright and license information, added datadir methods
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/rubygems/trunk@1039 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information
jimweirich committed Jun 7, 2006
1 parent f69642e commit ea8e85c
Show file tree
Hide file tree
Showing 90 changed files with 1,027 additions and 11 deletions.
340 changes: 340 additions & 0 deletions rubygems/GPL.txt

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions rubygems/LICENSE.txt
@@ -0,0 +1,53 @@
RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim
Weirich and others. You can redistribute it and/or modify it under
either the terms of the GPL (see COPYING.txt file), or the conditions
below:

1. You may make and give away verbatim copies of the source form of the
software without restriction, provided that you duplicate all of the
original copyright notices and associated disclaimers.

2. You may modify your copy of the software in any way, provided that
you do at least ONE of the following:

a) place your modifications in the Public Domain or otherwise
make them Freely Available, such as by posting said
modifications to Usenet or an equivalent medium, or by allowing
the author to include your modifications in the software.

b) use the modified software only within your corporation or
organization.

c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided.

d) make other distribution arrangements with the author.

3. You may distribute the software in object code or executable
form, provided that you do at least ONE of the following:

a) distribute the executables and library files of the software,
together with instructions (in the manual page or equivalent)
on where to get the original distribution.

b) accompany the distribution with the machine-readable source of
the software.

c) give non-standard executables non-standard names, with
instructions on where to get the original software distribution.

d) make other distribution arrangements with the author.

4. You may modify and include the part of the software into any other
software (possibly commercial).

5. The scripts and library files supplied as input to or produced as
output from the software do not automatically fall under the
copyright of the software, but belong to whomever generated them,
and may be sold commercially, and may be aggregated with this
software.

6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
45 changes: 35 additions & 10 deletions rubygems/Rakefile
@@ -1,5 +1,11 @@
# Rakefile for RubyGems -*- ruby -*-

#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require 'rubygems'
require 'rake/clean'
require 'rake/testtask'
Expand Down Expand Up @@ -43,16 +49,17 @@ CLOBBER.include(
)

task :default => [:test]
task :test => [:test_units]

Rake::TestTask.new(:test) do |t|
Rake::TestTask.new(:test_units) do |t|
t.test_files = FileList['test/test*.rb']
end

Rake::TestTask.new(:functional) do |t|
Rake::TestTask.new(:test_functional) do |t|
t.test_files = FileList['test/functional*.rb']
end

Rake::TestTask.new(:alltests) do |t|
Rake::TestTask.new(:test_all) do |t|
t.test_files = FileList['test/{test,functional}*.rb']
end

Expand All @@ -75,9 +82,9 @@ task :build_tests do
end

# Shortcuts for test targets
task :tf => [:functional]
task :tu => [:test]
task :ta => [:alltests]
task :tf => [:test_functional]
task :tu => [:test_units]
task :ta => [:test_all]

task :gemtest do
ruby %{-Ilib -rscripts/runtest -e 'run_tests("test/test_gempaths.rb", true)'}
Expand Down Expand Up @@ -152,7 +159,7 @@ task :update_version => [:prerelease] do
if ENV['RELTEST']
announce "Release Task Testing, skipping commiting of new version"
else
sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rubygems/rubygems_version.rb}
sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rubygems/rubygems_version.rb} # "
end
end
end
Expand All @@ -168,6 +175,26 @@ task :tag => [:prerelease] do
end
end

# --------------------------------------------------------------------

begin
require 'rcov/rcovtask'
HAVE_RCOV = true
rescue LoadError
HAVE_RCOV = false
end

if HAVE_RCOV
Rcov::RcovTask.new do |t|
t.libs << "test"
t.rcov_opts = ['-xRakefile', '-xrakefile', '-xpublish.rf', '--text-report']
t.test_files = FileList[
'test/test*.rb'
]
t.verbose = true
end
end

# --------------------------------------------------------------------
# Create a task to build the RDOC documentation tree.

Expand All @@ -176,13 +203,11 @@ rd = Rake::RDocTask.new("rdoc") { |rdoc|
rdoc.rdoc_dir = 'html'
rdoc.title = "RubyGems"
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
rdoc.rdoc_files.include('README', 'TODO', 'Releases')
rdoc.rdoc_files.include('README', 'TODO', 'Releases', 'LICENSE.txt', 'GPL.txt')
rdoc.rdoc_files.include('lib/**/*.rb')
# rdoc.rdoc_files.include('test/**/*.rb')
}

file "html/index.html" => [:rdoc]

desc "Publish the RDOCs on RubyForge"
task :publish_rdoc => ["html/index.html"] do
# NOTE: This task assumes that you have an SSH alias setup for rubyforge.
Expand Down
6 changes: 6 additions & 0 deletions rubygems/bin/gem
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


require 'rubygems'
Gem.manage_gems
Expand Down
6 changes: 6 additions & 0 deletions rubygems/bin/gem_mirror
@@ -1,4 +1,10 @@
#! /usr/local/bin/ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


# sample ~/.gemmirrorc:
#---
Expand Down
6 changes: 6 additions & 0 deletions rubygems/bin/gemlock
@@ -1,5 +1,11 @@
#!/usr/bin/env ruby
# -*- ruby -*-
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


# gemlock -- Generate a lockdown list of a set of gems
#
Expand Down
6 changes: 6 additions & 0 deletions rubygems/bin/gemwhich
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


require 'rubygems'
require 'optparse'
Expand Down
6 changes: 6 additions & 0 deletions rubygems/bin/index_gem_repository.rb
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


# Generate the yaml/yaml.Z index files for a gem server directory.
#
Expand Down
6 changes: 6 additions & 0 deletions rubygems/bin/update_rubygems
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


update_dir = $LOAD_PATH.find { |fn| fn =~ /rubygems-update/ }

Expand Down
8 changes: 7 additions & 1 deletion rubygems/doc/makedoc.rb
@@ -1,4 +1,10 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

Dir.glob("*.txt").each do |file|
htmlfile = File.basename(file)[0...-(File.extname(file).size)]+".html"
`wiki2html -b . -s doc.css -t "RubyGems" -o #{htmlfile} #{file}`
end
end
6 changes: 6 additions & 0 deletions rubygems/doc/rdoc_templates/jamis.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

module RDoc
module Page

Expand Down
6 changes: 6 additions & 0 deletions rubygems/examples/application/lib/somefunctionality.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

def go
puts "Where?"
end
6 changes: 6 additions & 0 deletions rubygems/lib/gemconfigure.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

module Gem

# Activate the gems specfied by the gem_pairs list.
Expand Down
24 changes: 24 additions & 0 deletions rubygems/lib/rbconfig/datadir.rb
@@ -0,0 +1,24 @@
#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


module Config

# Only define datadir if it doesn't already exist.
unless Config.respond_to?(:datadir)

# Return the path to the data directory associated with the given
# package name. Normally this is just
# "#{Config::CONFIG['datadir']}/#{package_name}", but may be
# modified by packages like RubyGems to handle versioned data
# directories.
def Config.datadir(package_name)
File.join(CONFIG['datadir'], package_name)
end

end
end
37 changes: 37 additions & 0 deletions rubygems/lib/rubygems.rb
@@ -1,3 +1,12 @@
#!/usr/bin/env ruby
# -*- ruby -*-

#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require 'rbconfig'

module Gem
Expand Down Expand Up @@ -145,6 +154,15 @@ def configuration=(config)
@configuration = config
end

# Return the path the the data directory specified by the gem
# name. If the package is not available as a gem, return nil.
def datadir(gem_name)
return nil if @loaded_specs.nil?
spec = @loaded_specs[gem_name]
return nil if spec.nil?
File.join(spec.full_gem_path, 'data')
end

# Return the Ruby command to use to execute the Ruby interpreter.
def ruby
"ruby"
Expand Down Expand Up @@ -422,6 +440,25 @@ def ensure_gem_subdirectories(gemdir)
end
end


# Modify the non-gem version of datadir to handle gem package names.

require 'rbconfig/datadir'
module Config
class << self
alias gem_original_datadir datadir

# Return the path to the data directory associated with the named
# package. If the package is loaded as a gem, return the gem
# specific data directory. Otherwise return a path to the share
# area as define by "#{Config::CONFIG['datadir']}/#{package_name}".
def datadir(package_name)
Gem.datadir(package_name) || Config.gem_original_datadir(package_name)
end
end
end


require 'rubygems/source_index'
require 'rubygems/specification'
require 'rubygems/security'
Expand Down
6 changes: 6 additions & 0 deletions rubygems/lib/rubygems/builder.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require "rubygems/package"
require "rubygems/security"
require "yaml"
Expand Down
6 changes: 6 additions & 0 deletions rubygems/lib/rubygems/cmd_manager.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require 'rubygems'
require 'rubygems/command'
require 'rubygems/user_interaction'
Expand Down
6 changes: 6 additions & 0 deletions rubygems/lib/rubygems/command.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require 'rubygems/user_interaction'

module Gem
Expand Down
6 changes: 6 additions & 0 deletions rubygems/lib/rubygems/config_file.rb
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


require 'yaml'

Expand Down
6 changes: 6 additions & 0 deletions rubygems/lib/rubygems/custom_require.rb
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require 'rubygems/source_index'

module Kernel
Expand Down

0 comments on commit ea8e85c

Please sign in to comment.