File: gemspec.rb

package info (click to toggle)
ruby-session 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 156 kB
  • sloc: ruby: 935; makefile: 2
file content (62 lines) | stat: -rwxr-xr-x 1,540 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /usr/bin/env ruby

lib, version, *ignored = ARGV

unless lib
  lib = File.basename(Dir.pwd)
end

unless version
  mod = lib.capitalize
  require "./lib/#{ lib }"
  version = eval(mod).send(:version)
end

abort('no lib') unless lib
abort('no version') unless version

puts "### gemspec: #{ lib }-#{ version }"

$VERBOSE = nil

shiteless = lambda{|list| list.delete_if{|file| file =~ %r/\.(git|svn|tmp|sw.|bak)$/}}

files       = shiteless[Dir::glob("**/**")]
executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
has_rdoc    = true #File.exist?('doc')
test_files  = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb")

extensions = []
%w( Makefile configure extconf.rb rakefile Rakefile mkrf_conf ).each do |ext|
  extensions << ext if File.exists?(ext)
end

template = <<-__

  Gem::Specification::new do |spec|
    spec.name = #{ lib.inspect }
    spec.version = #{ version.inspect }
    spec.platform = Gem::Platform::RUBY
    spec.summary = #{ lib.inspect }

    spec.files = #{ files.inspect }
    spec.executables = #{ executables.inspect }
    
    spec.require_path = "lib"

    spec.has_rdoc = #{ has_rdoc.inspect }
    spec.test_files = #{ test_files.inspect }
    #spec.add_dependency 'lib', '>= version'
    #spec.add_dependency 'fattr'

    spec.extensions.push(*#{ extensions.inspect })

    spec.rubyforge_project = 'codeforpeople'
    spec.author = "Ara T. Howard"
    spec.email = "ara.t.howard@gmail.com"
    spec.homepage = "http://github.com/ahoward/#{ lib }/tree/master"
  end

__

puts template