PHP 8.2.31
Preview: package_task.rb Size: 3.79 KB
//proc/thread-self/root/opt/alt/ruby19/lib64/ruby/1.9.1/rubygems/package_task.rb

# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'rubygems'
begin
  gem 'rake'
rescue Gem::LoadError
end

require 'rake/packagetask'

##
# Create a package based upon a Gem::Specification.  Gem packages, as well as
# zip files and tar/gzipped packages can be produced by this task.
#
# In addition to the Rake targets generated by Rake::PackageTask, a
# Gem::PackageTask will also generate the following tasks:
#
# [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.gem"</b>]
#   Create a RubyGems package with the given name and version.
#
# Example using a Gem::Specification:
#
#   require 'rubygems'
#   require 'rubygems/package_task'
#
#   spec = Gem::Specification.new do |s|
#     s.platform = Gem::Platform::RUBY
#     s.summary = "Ruby based make-like utility."
#     s.name = 'rake'
#     s.version = PKG_VERSION
#     s.requirements << 'none'
#     s.require_path = 'lib'
#     s.autorequire = 'rake'
#     s.files = PKG_FILES
#     s.description = <<-EOF
#   Rake is a Make-like program implemented in Ruby. Tasks
#   and dependencies are specified in standard Ruby syntax.
#     EOF
#   end
#
#   Gem::PackageTask.new(spec) do |pkg|
#     pkg.need_zip = true
#     pkg.need_tar = true
#   end

class Gem::PackageTask < Rake::PackageTask

  ##
  # Ruby Gem::Specification containing the metadata for this package.  The
  # name, version and package_files are automatically determined from the
  # gemspec and don't need to be explicitly provided.

  attr_accessor :gem_spec

  ##
  # Create a Gem Package task library.  Automatically define the gem if a
  # block is given.  If no block is supplied, then #define needs to be called
  # to define the task.

  def initialize(gem_spec)
    init gem_spec
    yield self if block_given?
    define if block_given?
  end

  ##
  # Initialization tasks without the "yield self" or define operations.

  def init(gem)
    super gem.full_name, :noversion
    @gem_spec = gem
    @package_files += gem_spec.files if gem_spec.files
  end

  ##
  # Create the Rake tasks and actions specified by this Gem::PackageTask.
  # (+define+ is automatically called if a block is given to +new+).

  def define
    super

    task :package => [:gem]

    gem_file = File.basename gem_spec.cache_file
    gem_path = File.join package_dir, gem_file
    gem_dir  = File.join package_dir, gem_spec.full_name

    desc "Build the gem file #{gem_file}"
    task :gem => [gem_path]

    trace = Rake.application.options.trace
    Gem.configuration.verbose = trace

    file gem_path => [package_dir, gem_dir] + @gem_spec.files do
      chdir(gem_dir) do
        when_writing "Creating #{gem_spec.file_name}" do
          Gem::Builder.new(gem_spec).build
          verbose trace do
            mv gem_file, '..'
          end
        end
      end
    end
  end

end

Directory Contents

Dirs: 4 × Files: 49

Name Size Perms Modified Actions
commands DIR
- drwxr-xr-x 2024-03-03 22:48:12
Edit Download
ext DIR
- drwxr-xr-x 2024-03-03 22:48:12
Edit Download
package DIR
- drwxr-xr-x 2024-03-03 22:48:12
Edit Download
ssl_certs DIR
- drwxr-xr-x 2024-03-03 22:48:12
Edit Download
2.21 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
12.46 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
4.67 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
9.69 KB lrw-r--r-- 2012-04-19 23:38:41
Edit Download
1.83 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
2.65 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
6.43 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
9.94 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
5.58 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
1.81 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
5.55 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
793 B lrw-r--r-- 2011-07-27 02:04:03
Edit Download
2.34 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
379 B lrw-r--r-- 2011-07-27 02:04:03
Edit Download
1.96 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
1.86 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
2.24 KB lrw-r--r-- 2011-08-05 20:18:14
Edit Download
4.57 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
2.38 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
16.85 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
16.94 KB lrw-r--r-- 2012-10-25 09:18:59
Edit Download
3.10 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
3.87 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
3.36 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
1.05 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
3.69 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
2.15 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
3.79 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
1.50 KB lrw-r--r-- 2011-08-26 01:12:57
Edit Download
5.55 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
498 B lrw-r--r-- 2012-04-19 22:43:16
Edit Download
1.34 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
13.50 KB lrw-r--r-- 2012-04-19 23:38:41
Edit Download
4.99 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
577 B lrw-r--r-- 2011-07-27 02:04:03
Edit Download
28.83 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
21.93 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
11.00 KB lrw-r--r-- 2011-10-08 10:53:11
Edit Download
54.68 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
7.17 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
3.96 KB lrw-r--r-- 2012-04-19 23:38:41
Edit Download
21.89 KB lrw-r--r-- 2012-04-19 22:43:16
Edit Download
3.47 KB lrw-r--r-- 2011-08-05 20:18:14
Edit Download
1.23 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
6.77 KB lrw-r--r-- 2011-07-27 03:42:40
Edit Download
11.22 KB lrw-r--r-- 2011-08-05 20:18:14
Edit Download
4.65 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download
10.18 KB lrw-r--r-- 2013-12-22 04:38:28
Edit Download
1.59 KB lrw-r--r-- 2011-07-27 02:04:03
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).