ron 0.3 → 0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ron.gemspec +39 -51
- metadata +50 -77
- data/COPYING +0 -21
- data/README.md +0 -133
- data/Rakefile +0 -94
- data/bin/ron +0 -130
- data/lib/ron.rb +0 -16
- data/lib/ron/document.rb +0 -289
- data/lib/ron/layout.html +0 -75
- data/lib/ron/roff.rb +0 -180
- data/man/markdown.5 +0 -1614
- data/man/markdown.5.ron +0 -881
- data/man/ron.1 +0 -226
- data/man/ron.1.ron +0 -158
- data/man/ron.5 +0 -210
- data/man/ron.5.ron +0 -154
- data/man/ron.7 +0 -201
- data/man/ron.7.ron +0 -133
- data/test/angle_bracket_syntax.html +0 -12
- data/test/angle_bracket_syntax.ron +0 -12
- data/test/basic_document.html +0 -3
- data/test/basic_document.ron +0 -4
- data/test/custom_title_document.html +0 -3
- data/test/custom_title_document.ron +0 -5
- data/test/definition_list_syntax.html +0 -21
- data/test/definition_list_syntax.ron +0 -18
- data/test/document_test.rb +0 -88
- data/test/ron_test.rb +0 -59
- data/test/titleless_document.html +0 -2
- data/test/titleless_document.ron +0 -2
data/ron.gemspec
CHANGED
@@ -1,62 +1,50 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
3
|
-
s.required_rubygems_version = Gem::Requirement.new(">=
|
3
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = 'ron'
|
6
|
-
s.version = '0.
|
7
|
-
s.date = '
|
6
|
+
s.version = '0.4'
|
7
|
+
s.date = '2010-03-08'
|
8
8
|
|
9
|
-
s.description = "
|
10
|
-
|
9
|
+
s.description = "ron -- the opposite of roff -- is now known as 'ronn'"
|
10
|
+
|
11
|
+
s.summary = (<<-TEXT).gsub(/^ {4}/, '')
|
12
|
+
IMPORTANT: ron -- the opposite of roff -- is now known as "ronn". Ownership
|
13
|
+
of the "ron" gem will be handed over to the Ruby Object Notation (Ron)
|
14
|
+
project in the not-too-distant future.
|
15
|
+
|
16
|
+
If you came here looking for "ron" -- the opposite of roff --, see the
|
17
|
+
"ronn" gem instead: http://rubygems.org/gems/ronn
|
18
|
+
|
19
|
+
If you came here looking for Ron (Ruby Object Notation), see the "Ron"
|
20
|
+
gem instead: http://rubygems.org/gems/Ron
|
21
|
+
TEXT
|
11
22
|
|
12
23
|
s.authors = ["Ryan Tomayko"]
|
13
24
|
s.email = "rtomayko@gmail.com"
|
14
|
-
|
15
|
-
|
16
|
-
s.
|
17
|
-
COPYING
|
18
|
-
README.md
|
19
|
-
Rakefile
|
20
|
-
bin/ron
|
21
|
-
lib/ron.rb
|
22
|
-
lib/ron/document.rb
|
23
|
-
lib/ron/layout.html
|
24
|
-
lib/ron/roff.rb
|
25
|
-
man/markdown.5
|
26
|
-
man/markdown.5.ron
|
27
|
-
man/ron.1
|
28
|
-
man/ron.1.ron
|
29
|
-
man/ron.5
|
30
|
-
man/ron.5.ron
|
31
|
-
man/ron.7
|
32
|
-
man/ron.7.ron
|
33
|
-
ron.gemspec
|
34
|
-
test/angle_bracket_syntax.html
|
35
|
-
test/angle_bracket_syntax.ron
|
36
|
-
test/basic_document.html
|
37
|
-
test/basic_document.ron
|
38
|
-
test/custom_title_document.html
|
39
|
-
test/custom_title_document.ron
|
40
|
-
test/definition_list_syntax.html
|
41
|
-
test/definition_list_syntax.ron
|
42
|
-
test/document_test.rb
|
43
|
-
test/ron_test.rb
|
44
|
-
test/titleless_document.html
|
45
|
-
test/titleless_document.ron
|
46
|
-
]
|
47
|
-
# = MANIFEST =
|
48
|
-
|
49
|
-
s.executables = ['ron']
|
50
|
-
s.test_files = s.files.select { |path| path =~ /^test\/.*_test.rb/ }
|
51
|
-
|
52
|
-
s.extra_rdoc_files = %w[COPYING]
|
53
|
-
s.add_dependency 'nokogiri', '~> 1.4'
|
54
|
-
s.add_dependency 'rdiscount', '~> 1.3'
|
55
|
-
s.add_development_dependency 'contest', '~> 0.1'
|
25
|
+
s.files = %w[ron.gemspec]
|
26
|
+
s.executables = []
|
27
|
+
s.test_files = []
|
56
28
|
|
57
29
|
s.has_rdoc = true
|
58
|
-
s.homepage = "http://github.com/
|
59
|
-
s.
|
60
|
-
s.
|
61
|
-
|
30
|
+
s.homepage = "http://rtomayko.github.com/ronn/"
|
31
|
+
s.require_paths = ['.']
|
32
|
+
s.add_dependency 'ronn', '>= 0.4'
|
33
|
+
|
34
|
+
s.post_install_message = (<<-TEXT).gsub(/^ {4}/, '')
|
35
|
+
==================================================================
|
36
|
+
WARNING: ron -- the opposite of roff -- is now known as "ronn"
|
37
|
+
|
38
|
+
The "ronn" gem has automatically been installed. However, in the
|
39
|
+
not-too-distant future, the "ron" gem will be owned by the
|
40
|
+
Ruby Object Notation <http://github.com/coatl/ron> project. Please
|
41
|
+
use the "ronn" gem to install ronn -- the opposite of roff -- from
|
42
|
+
this point forward.
|
43
|
+
|
44
|
+
If you meant to install the Ruby Object Notation (Ron) gem,
|
45
|
+
uninstall the "ron" and "ronn" gems and install the "Ron" gem:
|
46
|
+
gem uninstall ron ronn
|
47
|
+
gem install Ron
|
48
|
+
==================================================================
|
49
|
+
TEXT
|
62
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
version: "0.4"
|
5
9
|
platform: ruby
|
6
10
|
authors:
|
7
11
|
- Ryan Tomayko
|
@@ -9,108 +13,77 @@ autorequire:
|
|
9
13
|
bindir: bin
|
10
14
|
cert_chain: []
|
11
15
|
|
12
|
-
date:
|
16
|
+
date: 2010-03-08 00:00:00 -08:00
|
13
17
|
default_executable:
|
14
18
|
dependencies:
|
15
19
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
name: ronn
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
23
|
requirements:
|
21
|
-
- -
|
24
|
+
- - ">="
|
22
25
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
25
|
-
-
|
26
|
-
|
26
|
+
segments:
|
27
|
+
- 0
|
28
|
+
- 4
|
29
|
+
version: "0.4"
|
27
30
|
type: :runtime
|
28
|
-
|
29
|
-
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: "1.3"
|
34
|
-
version:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: contest
|
37
|
-
type: :development
|
38
|
-
version_requirement:
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: "0.1"
|
44
|
-
version:
|
45
|
-
description: The opposite of roff
|
31
|
+
version_requirements: *id001
|
32
|
+
description: ron -- the opposite of roff -- is now known as 'ronn'
|
46
33
|
email: rtomayko@gmail.com
|
47
|
-
executables:
|
48
|
-
|
34
|
+
executables: []
|
35
|
+
|
49
36
|
extensions: []
|
50
37
|
|
51
|
-
extra_rdoc_files:
|
52
|
-
|
38
|
+
extra_rdoc_files: []
|
39
|
+
|
53
40
|
files:
|
54
|
-
- COPYING
|
55
|
-
- README.md
|
56
|
-
- Rakefile
|
57
|
-
- bin/ron
|
58
|
-
- lib/ron.rb
|
59
|
-
- lib/ron/document.rb
|
60
|
-
- lib/ron/layout.html
|
61
|
-
- lib/ron/roff.rb
|
62
|
-
- man/markdown.5
|
63
|
-
- man/markdown.5.ron
|
64
|
-
- man/ron.1
|
65
|
-
- man/ron.1.ron
|
66
|
-
- man/ron.5
|
67
|
-
- man/ron.5.ron
|
68
|
-
- man/ron.7
|
69
|
-
- man/ron.7.ron
|
70
41
|
- ron.gemspec
|
71
|
-
- test/angle_bracket_syntax.html
|
72
|
-
- test/angle_bracket_syntax.ron
|
73
|
-
- test/basic_document.html
|
74
|
-
- test/basic_document.ron
|
75
|
-
- test/custom_title_document.html
|
76
|
-
- test/custom_title_document.ron
|
77
|
-
- test/definition_list_syntax.html
|
78
|
-
- test/definition_list_syntax.ron
|
79
|
-
- test/document_test.rb
|
80
|
-
- test/ron_test.rb
|
81
|
-
- test/titleless_document.html
|
82
|
-
- test/titleless_document.ron
|
83
42
|
has_rdoc: true
|
84
|
-
homepage: http://github.com/
|
43
|
+
homepage: http://rtomayko.github.com/ronn/
|
85
44
|
licenses: []
|
86
45
|
|
87
|
-
post_install_message:
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
-
|
46
|
+
post_install_message: |
|
47
|
+
==================================================================
|
48
|
+
WARNING: ron -- the opposite of roff -- is now known as "ronn"
|
49
|
+
|
50
|
+
The "ronn" gem has automatically been installed. However, in the
|
51
|
+
not-too-distant future, the "ron" gem will be owned by the
|
52
|
+
Ruby Object Notation <http://github.com/coatl/ron> project. Please
|
53
|
+
use the "ronn" gem to install ronn -- the opposite of roff -- from
|
54
|
+
this point forward.
|
55
|
+
|
56
|
+
If you meant to install the Ruby Object Notation (Ron) gem,
|
57
|
+
uninstall the "ron" and "ronn" gems and install the "Ron" gem:
|
58
|
+
gem uninstall ron ronn
|
59
|
+
gem install Ron
|
60
|
+
==================================================================
|
61
|
+
|
62
|
+
rdoc_options: []
|
63
|
+
|
93
64
|
require_paths:
|
94
|
-
-
|
65
|
+
- .
|
95
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
67
|
requirements:
|
97
68
|
- - ">="
|
98
69
|
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
99
72
|
version: "0"
|
100
|
-
version:
|
101
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
74
|
requirements:
|
103
75
|
- - ">="
|
104
76
|
- !ruby/object:Gem::Version
|
105
|
-
|
106
|
-
|
77
|
+
segments:
|
78
|
+
- 1
|
79
|
+
- 2
|
80
|
+
version: "1.2"
|
107
81
|
requirements: []
|
108
82
|
|
109
83
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.3.
|
84
|
+
rubygems_version: 1.3.6
|
111
85
|
signing_key:
|
112
86
|
specification_version: 2
|
113
|
-
summary:
|
114
|
-
test_files:
|
115
|
-
|
116
|
-
- test/ron_test.rb
|
87
|
+
summary: "IMPORTANT: ron -- the opposite of roff -- is now known as \"ronn\". Ownership of the \"ron\" gem will be handed over to the Ruby Object Notation (Ron) project in the not-too-distant future. If you came here looking for \"ron\" -- the opposite of roff --, see the \"ronn\" gem instead: http://rubygems.org/gems/ronn If you came here looking for Ron (Ruby Object Notation), see the \"Ron\" gem instead: http://rubygems.org/gems/Ron"
|
88
|
+
test_files: []
|
89
|
+
|
data/COPYING
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
Copyright (C) 2009 Ryan Tomayko <tomayko.com/about>
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person ob-
|
4
|
-
taining a copy of this software and associated documentation
|
5
|
-
files (the "Software"), to deal in the Software without restric-
|
6
|
-
tion, including without limitation the rights to use, copy, modi-
|
7
|
-
fy, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
-
the Software, and to permit persons to whom the Software is fur-
|
9
|
-
nished to do so, subject to the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
16
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONIN-
|
17
|
-
FRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
19
|
-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
data/README.md
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
ron -- the opposite of roff
|
2
|
-
===========================
|
3
|
-
|
4
|
-
## DESCRIPTION
|
5
|
-
|
6
|
-
Ron is a humane text format and toolchain for creating UNIX man
|
7
|
-
pages, and things that appear as man pages from a distance. Use it
|
8
|
-
to build and install standard UNIX roff man pages or to generate
|
9
|
-
nicely formatted HTML manual pages for the web.
|
10
|
-
|
11
|
-
The Ron file format is based on Markdown. In fact, Ron files are a
|
12
|
-
compatible subset of Markdown syntax but have a more rigid structure and
|
13
|
-
extend Markdown in some ways to provide features commonly found in man
|
14
|
-
pages (e.g., definition lists). The ron(5) manual page defines the
|
15
|
-
format in more detail.
|
16
|
-
|
17
|
-
## DOCUMENTATION
|
18
|
-
|
19
|
-
The `.ron` files located under the `man/` directory show off a wide
|
20
|
-
range of ron capabilities and are the source of Ron's own documentation.
|
21
|
-
The source files and generated HTML / roff output files are available
|
22
|
-
at:
|
23
|
-
|
24
|
-
* [ron(1)](http://rtomayko.github.com/ron/ron.1.html) -
|
25
|
-
build markdown based manual pages at the command line.
|
26
|
-
[source file](http://github.com/rtomayko/ron/blob/master/man/ron.1.ron),
|
27
|
-
[roff output](http://github.com/rtomayko/ron/blob/master/man/ron.1)
|
28
|
-
|
29
|
-
* [ron(5)](http://rtomayko.github.com/ron/ron.5.html) -
|
30
|
-
humane manual page authoring format syntax reference.
|
31
|
-
[source file](http://github.com/rtomayko/ron/blob/master/man/ron.5.ron),
|
32
|
-
[roff output](http://github.com/rtomayko/ron/blob/master/man/ron.5)
|
33
|
-
|
34
|
-
* [markdown(5)](http://rtomayko.github.com/ron/markdown.5.html) -
|
35
|
-
humane text markup syntax (taken from
|
36
|
-
[Markdown Syntax](http://daringfireball.net/projects/markdown/syntax),
|
37
|
-
John Gruber)
|
38
|
-
[source file](http://github.com/rtomayko/ron/blob/master/man/ron.5.ron),
|
39
|
-
[roff output](http://github.com/rtomayko/ron/blob/master/man/ron.5)
|
40
|
-
|
41
|
-
## INSTALL
|
42
|
-
|
43
|
-
Install with Rubygems:
|
44
|
-
|
45
|
-
$ [sudo] gem install ron
|
46
|
-
$ ron --help
|
47
|
-
|
48
|
-
Or, clone the git repository:
|
49
|
-
|
50
|
-
$ git clone git://github.com/rtomayko/ron.git
|
51
|
-
$ PATH=ron/bin:$PATH
|
52
|
-
$ ron --help
|
53
|
-
|
54
|
-
## BASIC USAGE
|
55
|
-
|
56
|
-
To generate a roff man page from the included
|
57
|
-
[`markdown.5.ron`](man/markdown.5.ron) file and open it with man(1):
|
58
|
-
|
59
|
-
$ ron -b man/markdown.5.ron
|
60
|
-
building: man/markdown.5
|
61
|
-
$ man man/markdown.5
|
62
|
-
|
63
|
-
To generate a standalone HTML version:
|
64
|
-
|
65
|
-
$ ron -b --html man/markdown.5.ron
|
66
|
-
building: man/markdown.5.html
|
67
|
-
$ open man/markdown.5.html
|
68
|
-
|
69
|
-
To build roff and HTML versions of all ron files:
|
70
|
-
|
71
|
-
$ ron -b --roff --html man/*.ron
|
72
|
-
|
73
|
-
If you just want to view a ron file as if it were a man page without
|
74
|
-
building intermediate files:
|
75
|
-
|
76
|
-
$ ron -m man/markdown.5.ron
|
77
|
-
|
78
|
-
The [ron(1)](http://rtomayko.github.com/ron/ron.1.html) manual page
|
79
|
-
includes comprehensive documentation on `ron` command line options.
|
80
|
-
|
81
|
-
## ABOUT
|
82
|
-
|
83
|
-
Some people think UNIX manual pages are a poor and outdated style of
|
84
|
-
documentation. I disagree:
|
85
|
-
|
86
|
-
- Man pages follow a well defined structure that's immediately
|
87
|
-
familiar and provides a useful starting point for developers
|
88
|
-
documenting new tools, libraries, and formats.
|
89
|
-
|
90
|
-
- Man pages get to the point. Because they're written in an inverted
|
91
|
-
style, with a SYNOPSIS section followed by additional detail,
|
92
|
-
prose and references to other sources of information, man pages
|
93
|
-
provide the best of both cheat sheet and reference style
|
94
|
-
documentation.
|
95
|
-
|
96
|
-
- Man pages have extremely -- unbelievably -- limited text
|
97
|
-
formatting capabilities. You get a couple of headings, lists, bold,
|
98
|
-
underline and no more. This is a feature.
|
99
|
-
|
100
|
-
- Although two levels of section hierarchy are technically
|
101
|
-
supported, most man pages use only a single level. Unwieldy
|
102
|
-
document hierarchies complicate otherwise good documentation.
|
103
|
-
Feynman covered all of physics -- heavenly bodies through QED --
|
104
|
-
with only two levels of document hierarchy (_The Feynman Lectures
|
105
|
-
on Physics_, 1970).
|
106
|
-
|
107
|
-
- Man pages have a simple referencing syntax; e.g., sh(1), fork(2),
|
108
|
-
markdown(5). HTML versions can use this to generate links between
|
109
|
-
pages.
|
110
|
-
|
111
|
-
- The classical terminal man page display is typographically well
|
112
|
-
thought out. Big bold section headings, justified monospace text,
|
113
|
-
nicely indented paragraphs, intelligently aligned definition
|
114
|
-
lists, and an informational header and footer.
|
115
|
-
|
116
|
-
Unfortunately, trying to figure out how to create a man page is a
|
117
|
-
fairly tedious process. The roff/man macro languages are highly
|
118
|
-
extensible, fractured between multiple dialects, and include a bunch
|
119
|
-
of device specific stuff that's entirely irrelevant to modern
|
120
|
-
publishing tools.
|
121
|
-
|
122
|
-
Ron aims to address many of the issues with man page creation while
|
123
|
-
preserving the things that makes man pages a great form of
|
124
|
-
documentation.
|
125
|
-
|
126
|
-
## COPYING
|
127
|
-
|
128
|
-
Ron is Copyright (C) 2009 [Ryan Tomayko](http://tomayko.com/about)
|
129
|
-
See the file COPYING for information of licensing and distribution.
|
130
|
-
|
131
|
-
## SEE ALSO
|
132
|
-
|
133
|
-
ron(1), ron(5), markdown(5)
|
data/Rakefile
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'rake/clean'
|
2
|
-
|
3
|
-
task :default => :test
|
4
|
-
|
5
|
-
task :environment do
|
6
|
-
require_library 'nokogiri'
|
7
|
-
require_library 'rdiscount'
|
8
|
-
ENV['RUBYLIB'] = "#{$:.join(':')}:#{ENV['RUBYLIB']}"
|
9
|
-
ENV['PATH'] = "bin:#{ENV['PATH']}"
|
10
|
-
end
|
11
|
-
|
12
|
-
desc 'Run tests'
|
13
|
-
task :test => :environment do
|
14
|
-
require_library 'contest'
|
15
|
-
if ENV['PATH'].split(':').any? { |p| File.executable?("#{p}/turn") }
|
16
|
-
sh 'turn -Ilib test/*_test.rb'
|
17
|
-
else
|
18
|
-
sh 'testrb Ilib test/*_test.rb'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
desc 'Build the manual'
|
23
|
-
task :man => :environment do
|
24
|
-
sh "ron -br5 --manual='Ron Manual' --organization='Ryan Tomayko' man/*.ron"
|
25
|
-
end
|
26
|
-
|
27
|
-
# PACKAGING ============================================================
|
28
|
-
|
29
|
-
require 'rubygems/specification'
|
30
|
-
$spec = eval(File.read('ron.gemspec'))
|
31
|
-
|
32
|
-
def package(ext='')
|
33
|
-
"pkg/ron-#{$spec.version}" + ext
|
34
|
-
end
|
35
|
-
|
36
|
-
desc 'Build packages'
|
37
|
-
task :package => %w[.gem .tar.gz].map { |ext| package(ext) }
|
38
|
-
|
39
|
-
desc 'Build and install as local gem'
|
40
|
-
task :install => package('.gem') do
|
41
|
-
sh "gem install #{package('.gem')}"
|
42
|
-
end
|
43
|
-
|
44
|
-
directory 'pkg/'
|
45
|
-
CLOBBER.include('pkg')
|
46
|
-
|
47
|
-
file package('.gem') => %w[pkg/ ron.gemspec] + $spec.files do |f|
|
48
|
-
sh "gem build ron.gemspec"
|
49
|
-
mv File.basename(f.name), f.name
|
50
|
-
end
|
51
|
-
|
52
|
-
file package('.tar.gz') => %w[pkg/] + $spec.files do |f|
|
53
|
-
sh <<-SH
|
54
|
-
git archive --prefix=ron-#{source_version}/ --format=tar HEAD |
|
55
|
-
gzip > #{f.name}
|
56
|
-
SH
|
57
|
-
end
|
58
|
-
|
59
|
-
# Gemspec Helpers ====================================================
|
60
|
-
|
61
|
-
def source_version
|
62
|
-
line = File.read('lib/ron.rb')[/^\s*VERSION = .*/]
|
63
|
-
line.match(/.*VERSION = '(.*)'/)[1]
|
64
|
-
end
|
65
|
-
|
66
|
-
file 'ron.gemspec' => FileList['{lib,test}/**','Rakefile'] do |f|
|
67
|
-
# read spec file and split out manifest section
|
68
|
-
spec = File.read(f.name)
|
69
|
-
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
70
|
-
# replace version and date
|
71
|
-
head.sub!(/\.version = '.*'/, ".version = '#{source_version}'")
|
72
|
-
head.sub!(/\.date = '.*'/, ".date = '#{Date.today.to_s}'")
|
73
|
-
# determine file list from git ls-files
|
74
|
-
files = `git ls-files`.
|
75
|
-
split("\n").
|
76
|
-
sort.
|
77
|
-
reject{ |file| file =~ /^\./ }.
|
78
|
-
reject { |file| file =~ /^doc/ }.
|
79
|
-
map{ |file| " #{file}" }.
|
80
|
-
join("\n")
|
81
|
-
# piece file back together and write...
|
82
|
-
manifest = " s.files = %w[\n#{files}\n ]\n"
|
83
|
-
spec = [head,manifest,tail].join(" # = MANIFEST =\n")
|
84
|
-
File.open(f.name, 'w') { |io| io.write(spec) }
|
85
|
-
puts "updated #{f.name}"
|
86
|
-
end
|
87
|
-
|
88
|
-
# Misc ===============================================================
|
89
|
-
|
90
|
-
def require_library(name)
|
91
|
-
require name
|
92
|
-
rescue LoadError => boom
|
93
|
-
abort "fatal: the '#{name}' library is required (gem install #{name})"
|
94
|
-
end
|