update to Asciidoctor 0.1.3

This commit is contained in:
Dan Allen 2013-06-08 15:44:03 -06:00
parent a8c3364927
commit 987075541d
5 changed files with 35 additions and 74 deletions

View File

@ -3,7 +3,7 @@ Dan Allen
:idprefix: :idprefix:
:gem_title: Asciidoctor :gem_title: Asciidoctor
:gem_name: asciidoctor :gem_name: asciidoctor
:gem_version: 0.1.1 :gem_version: 0.1.3
:gem_gem: {gem_name}-{gem_version}.gem :gem_gem: {gem_name}-{gem_version}.gem
:gem_url: https://github.com/asciidoctor/asciidoctor :gem_url: https://github.com/asciidoctor/asciidoctor
:rpm_name: rubygem-{gem_name} :rpm_name: rubygem-{gem_name}
@ -51,7 +51,7 @@ You'll also need to create all the required folders:
Next, grab the Asciidoctor gem (the sources) and put it into the +$HOME/rpmbuild/SOURCES+ directory: Next, grab the Asciidoctor gem (the sources) and put it into the +$HOME/rpmbuild/SOURCES+ directory:
wget -O $HOME/rpmbuild/SOURCES/asciidoctor-0.1.1.gem http://rubygems.org/gems/asciidoctor-0.1.1.gem wget -O $HOME/rpmbuild/SOURCES/asciidoctor-0.1.3.gem http://rubygems.org/gems/asciidoctor-0.1.3.gem
Finally, copy the +.patch+ files from this repository to the same directory: Finally, copy the +.patch+ files from this repository to the same directory:
@ -72,7 +72,7 @@ If all goes well, both the binary and source RPMs will emerge in the +$HOME/rpmb
There's nothing special about installing this RPM. There's nothing special about installing this RPM.
I recommend using +yum+ because it will install any dependencies that the package requires (though you should already have them if you built the RPM). I recommend using +yum+ because it will install any dependencies that the package requires (though you should already have them if you built the RPM).
yum localinstall $HOME/rpmbuild/RPMS/noarch/rubygem-asciidoctor-0.1.1.rpm yum localinstall $HOME/rpmbuild/RPMS/noarch/rubygem-asciidoctor-0.1.3.rpm
Now, it's time to start using Asciidoctor! Now, it's time to start using Asciidoctor!
@ -111,7 +111,7 @@ You should see this output in your terminal.
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="Asciidoctor 0.1.1"> <meta name="generator" content="Asciidoctor 0.1.3">
<title>My First Document</title> <title>My First Document</title>
</head> </head>
<body class="article"> <body class="article">

View File

@ -5,9 +5,9 @@ diff --git a/test/test_helper.rb b/test/test_helper.rb
index 3b27218..964ff59 100644 index 3b27218..964ff59 100644
--- a/test/test_helper.rb --- a/test/test_helper.rb
+++ b/test/test_helper.rb +++ b/test/test_helper.rb
@@ -10,7 +10,7 @@ rescue LoadError @@ -5,7 +5,7 @@ require 'test/unit'
end require "#{File.expand_path(File.dirname(__FILE__))}/../lib/asciidoctor.rb"
require 'htmlentities'
require 'nokogiri' require 'nokogiri'
-require 'pending' -require 'pending'
+#require 'pending' +#require 'pending'

View File

@ -1,50 +0,0 @@
# Nokogiri is choking on assertions that use nth-child with a loose parent match
diff --git a/test/tables_test.rb b/test/tables_test.rb
index 5ccb92e..d86a70d 100644
--- a/test/tables_test.rb
+++ b/test/tables_test.rb
@@ -21,8 +21,8 @@ context 'Tables' do
assert_css 'table td', output, 9
assert_css 'table > tbody > tr > td.tableblock.halign-left.valign-top > p.tableblock', output, 9
cells.each_with_index {|row, rowi|
- assert_css "table tr:nth-child(#{rowi + 1}) > td", output, row.size
- assert_css "table tr:nth-child(#{rowi + 1}) > td > p", output, row.size
+ assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td", output, row.size
+ assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td > p", output, row.size
row.each_with_index {|cell, celli|
assert_xpath "(//tr)[#{rowi + 1}]/td[#{celli + 1}]/p[text()='#{cell}']", output, 1
}
@@ -272,21 +272,21 @@ d|9 2+>|10
assert_css 'table > tbody > tr:nth-child(3) > td', output, 1
assert_css 'table > tbody > tr:nth-child(4) > td', output, 2
- assert_css 'table tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1
- assert_css 'table tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1
- assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1
- assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0
- assert_css 'table tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1
+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1
+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1
+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1
+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0
+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1
- assert_css 'table tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1
- assert_css 'table tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1
- assert_css 'table tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1
+ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1
+ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1
+ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1
- assert_css 'table tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1
+ assert_css 'table > tbody > tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1
- assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1
- assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0
- assert_css 'table tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1
+ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1
+ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0
+ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1
end
test 'supports repeating cells' do

View File

@ -3,7 +3,7 @@
Summary: AsciiDoc implementation in Ruby Summary: AsciiDoc implementation in Ruby
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 0.1.1 Version: 0.1.3
Release: 1%{?dist} Release: 1%{?dist}
Group: Development/Languages Group: Development/Languages
License: MIT License: MIT
@ -13,33 +13,28 @@ Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
# pending, is not packaged in Fedora and since the statement is merely a task # pending, is not packaged in Fedora and since the statement is merely a task
# note, it's safe to disable it's usage for the purpose of packaging. # note, it's safe to disable it's usage for the purpose of packaging.
Patch0: asciidoctor-disable-use-of-pending.patch Patch0: asciidoctor-disable-use-of-pending.patch
# Patch1: works around nth-child selector bug in Nokogiri %if 0%{?rhel} > 6 || 0%{?fedora} > 18
Patch1: asciidoctor-fix-nth-child-selectors.patch
%if 0%{?fedora} <= 18
Requires: ruby(abi) = 1.9.1
BuildRequires: ruby(abi) = 1.9.1
%else
Requires: ruby(release) Requires: ruby(release)
BuildRequires: ruby(release) BuildRequires: ruby(release)
%else
Requires: ruby(abi) = 1.9.1
BuildRequires: ruby(abi) = 1.9.1
%endif %endif
Requires: ruby(rubygems) Requires: ruby(rubygems)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
BuildRequires: ruby(rubygems) BuildRequires: ruby(rubygems)
BuildRequires: rubygem(coderay) BuildRequires: rubygem(coderay)
BuildRequires: rubygem(erubis) BuildRequires: rubygem(erubis)
BuildRequires: rubygem(htmlentities)
BuildRequires: rubygem(mocha)
BuildRequires: rubygem(minitest) BuildRequires: rubygem(minitest)
BuildRequires: rubygem(nokogiri) BuildRequires: rubygem(nokogiri)
# using patch to comment lines where pending is used
#BuildRequires: rubygem(pending)
BuildArch: noarch BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version} Provides: rubygem(%{gem_name}) = %{version}
%description %description
A pure AsciiDoc implementation in Ruby for parsing AsciiDoc source files and An open source text processor and publishing toolchain written in Ruby for
strings and then rendering them as HTML, DocBook or other formats using the converting AsciiDoc markup into HTML 5, DocBook 4.5 and custom formats. Export
built-in ERB templates or a set of custom Tilt-supported template files. to custom formats is performed by running the nodes of the parsed tree through
a collection of Tilt-supported templates.
%package doc %package doc
Summary: Documentation for %{name} Summary: Documentation for %{name}
@ -55,7 +50,6 @@ gem unpack -V %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version} %setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%patch0 -p1 %patch0 -p1
%patch1 -p1
%build %build
gem build %{gem_name}.gemspec gem build %{gem_name}.gemspec
@ -77,25 +71,34 @@ mkdir -p %{buildroot}%{mandir}
cp -pa .%{gem_instdir}/man/*.1 \ cp -pa .%{gem_instdir}/man/*.1 \
%{buildroot}%{mandir}/ %{buildroot}%{mandir}/
mkdir -p %{buildroot}%{_sysconfdir}/%{gem_name}
cp -pa .%{gem_instdir}/compat/* \
%{buildroot}%{_sysconfdir}/%{gem_name}/
%files %files
%dir %{gem_instdir} %dir %{gem_instdir}
%exclude %{gem_cache} %exclude %{gem_cache}
%exclude %{gem_instdir}/%{gem_name}.gemspec %exclude %{gem_instdir}/%{gem_name}.gemspec
%exclude %{gem_instdir}/Gemfile %exclude %{gem_instdir}/Gemfile
%exclude %{gem_instdir}/Guardfile
%exclude %{gem_instdir}/Rakefile %exclude %{gem_instdir}/Rakefile
%exclude %{gem_instdir}/test %exclude %{gem_instdir}/compat
%exclude %{gem_instdir}/man %exclude %{gem_instdir}/man
%exclude %{gem_instdir}/test
%{gem_instdir}/LICENSE %{gem_instdir}/LICENSE
%{gem_instdir}/README.* %{gem_instdir}/README.*
%{_bindir}/* %{_bindir}/*
%{gem_instdir}/bin %{gem_instdir}/bin
%{gem_libdir} %{gem_libdir}
%{mandir}/* %{mandir}/*
%{_sysconfdir}/%{gem_name}/*
%{gem_spec} %{gem_spec}
%files doc %files doc
%doc %{gem_docdir} %doc %{gem_docdir}
%changelog %changelog
* Sat Jun 08 2013 Dan Allen <dan.j.allen@gmail.com> - 0.1.3-1
- Update to Asciidoctor 0.1.3
* Fri Mar 01 2013 Dan Allen <dan.j.allen@gmail.com> - 0.1.1-1 * Fri Mar 01 2013 Dan Allen <dan.j.allen@gmail.com> - 0.1.1-1
- Initial package - Initial package

View File

@ -4,4 +4,12 @@
require 'asciidoctor' require 'asciidoctor'
puts Asciidoctor.render("= Asciidoctor\n\nI'm **alive**!", :header_footer => true, :compact => true) source = <<EOS
= Asciidoctor
Author Name
http://asciidoctor.org[Asciidoctor] is an _open source_ implementation of
http://asciidoc.org[AsciiDoc] in [red]*Ruby*.
EOS
puts Asciidoctor.render(source, :backend => :html5, :header_footer => true, :compact => true, :safe => :safe, :attributes => 'linkcss!')