-
Notifications
You must be signed in to change notification settings - Fork 2
/
packnga.gemspec
75 lines (65 loc) · 2.42 KB
/
packnga.gemspec
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
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8; mode: ruby -*-
#
# Copyright (C) 2012 Haruka Yoshihara <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
base_dir = File.dirname(__FILE__)
$LOAD_PATH.unshift(File.expand_path("lib", base_dir))
require "packnga/version"
version = Packnga::VERSION.dup
readme_path = File.join(base_dir, "README.textile")
entries = File.read(readme_path).split(/^h2\.\s(.*)$/)
entry = lambda do |entry_title|
entries[entries.index(entry_title) + 1]
end
authors = []
emails = []
entry.call("Authors").each_line do |line|
if /\*\s*(.+)\s<([^<>]*)>$/ =~ line
authors << $1
emails << $2
end
end
clean_white_space = lambda do |entry_description|
entry_description.gsub(/(\A\n+|\n+\z)/, '') + "\n"
end
description = clean_white_space.call(entry.call("Description"))
summary, description = description.split(/\n\n+/, 2)
Gem::Specification.new do |spec|
spec.name = "packnga"
spec.version = version
spec.authors = authors
spec.email = emails
spec.summary = summary
spec.description = description
spec.extra_rdoc_files = ["README.textile"]
spec.files = ["README.textile", "Rakefile", "Gemfile", ".yardopts"]
spec.files += ["packnga.gemspec"]
Dir.chdir(base_dir) do
spec.files += Dir.glob("lib/**/*.rb")
spec.files += Dir.glob("doc/text/*.*")
spec.test_files = Dir.glob("test/**/*.rb")
end
spec.homepage = "http://ranguba.org/packnga/en/"
spec.licenses = ["LGPLv2"]
spec.require_paths = ["lib"]
spec.add_runtime_dependency("rake")
spec.add_runtime_dependency("yard", ">= 0.9")
spec.add_runtime_dependency("gettext", ">= 3.1.3")
spec.add_development_dependency("test-unit")
spec.add_development_dependency("test-unit-notify")
spec.add_development_dependency("test-unit-rr")
spec.add_development_dependency("bundler")
spec.add_development_dependency("RedCloth")
end