Skip to content

Commit 2835312

Browse files
committed
Finish 3.2.2
2 parents 6fbb58c + f3449db commit 2835312

File tree

20 files changed

+508
-346
lines changed

20 files changed

+508
-346
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Run tests
3737
run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES
3838
- name: Coveralls GitHub Action
39-
uses: coverallsapp/github-action@v1.1.2
39+
uses: coverallsapp/github-action@v2
4040
if: ${{ matrix.ruby == '3.0' && matrix.gemfile == 'Gemfile' }}
4141
with:
4242
github-token: ${{ secrets.GITHUB_TOKEN }}

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ source "https://rubygems.org"
33
gemspec
44

55
gem 'rdf', github: "ruby-rdf/rdf", branch: "develop"
6-
gem 'rdf-rdfa', github: "ruby-rdf/rdf-rdfa", branch: "develop"
76
gem "nokogiri", '~> 1.13', '>= 1.13.4', platforms: [:mri, :jruby]
87

98
group :development do

Gemfile-pure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ source "https://rubygems.org"
44
gemspec
55

66
gem 'rdf', github: "ruby-rdf/rdf", branch: "develop"
7-
gem 'rdf-rdfa', github: "ruby-rdf/rdf-rdfa", branch: "develop"
87

98
group :development do
109
gem 'ebnf', github: "dryruby/ebnf", branch: "develop"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[RDF/XML][] reader/writer for [RDF.rb][].
44

5-
[![Gem Version](https://badge.fury.io/rb/rdf-rdfxml.png)](https://badge.fury.io/rb/rdf-rdfxml)
5+
[![Gem Version](https://badge.fury.io/rb/rdf-rdfxml.svg)](https://badge.fury.io/rb/rdf-rdfxml)
66
[![Build Status](https://github.com/ruby-rdf/rdf-rdfxml/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-rdfxml/actions?query=workflow%3ACI)
77
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-rdfxml/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-rdfxml?branch=develop)
88
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
@@ -43,8 +43,8 @@ Write a graph to a file:
4343

4444
## Dependencies
4545
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2)
46-
* [Haml](https://rubygems.org/gems/haml) (~>- 5.2)
47-
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.12)
46+
* [Builder](https://rubygems.org/gems/builder) (~>- 3.2)
47+
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.13)
4848

4949
## Documentation
5050
Full documentation available on [Rubydoc.info][RDF/XML doc])

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.1
1+
3.2.2

lib/rdf/rdfxml.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
require 'rdf'
33

44
module RDF
5-
autoload :XML, 'rdf/rdfa/vocab'
5+
XML = Class.new(Vocabulary("http://www.w3.org/XML/1998/namespace"))
6+
67
##
78
# **`RDF::RDFXML`** is an RDF/XML extension for RDF.rb.
89
#

lib/rdf/rdfxml/extensions.rb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Extend builder to allow for better control of whitespace in XML Literals
2+
3+
require 'builder'
4+
5+
module Builder
6+
# Extends XmlMarkup#tag! to better control whitespace when adding content from a block
7+
#
8+
class RdfXml < Builder::XmlMarkup
9+
# Create a tag named +sym+. Other than the first argument which
10+
# is the tag name, the arguments are the same as the tags
11+
# implemented via <tt>method_missing</tt>.
12+
#
13+
# @see https://github.com/jimweirich/builder/blob/master/lib/builder/xmlbase.rb
14+
def tag!(sym, *args, &block)
15+
text = nil
16+
attrs = args.last.is_a?(::Hash) ? args.last : {}
17+
return super unless block && attrs[:no_whitespace]
18+
attrs.delete(:no_whitespace)
19+
20+
sym = "#{sym}:#{args.shift}".to_sym if args.first.kind_of?(::Symbol)
21+
22+
args.each do |arg|
23+
case arg
24+
when ::Hash
25+
attrs.merge!(arg)
26+
when nil
27+
attrs.merge!({:nil => true}) if explicit_nil_handling?
28+
else
29+
text ||= ''
30+
text << arg.to_s
31+
end
32+
end
33+
34+
unless text.nil?
35+
::Kernel::raise ::ArgumentError,
36+
"XmlMarkup cannot mix a text argument with a block"
37+
end
38+
39+
# Indent
40+
_indent
41+
#unless @indent == 0 || @level == 0
42+
# text!(" " * (@level * @indent))
43+
#end
44+
45+
_start_tag(sym, attrs)
46+
begin
47+
_nested_structures(block)
48+
ensure
49+
_end_tag(sym)
50+
_newline
51+
end
52+
end
53+
end
54+
end

lib/rdf/rdfxml/patches/nokogiri_hacks.rb

Lines changed: 0 additions & 23 deletions
This file was deleted.

lib/rdf/rdfxml/reader.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
begin
22
require 'nokogiri'
3-
rescue LoadError => e
3+
rescue LoadError
44
:rexml
55
end
66
require 'rdf/xsd'
@@ -91,7 +91,7 @@ def extract_mappings(element, &cb)
9191
# Produce the next list entry for this context
9292
def li_next
9393
@li_counter += 1
94-
predicate = RDF["_#{@li_counter}"]
94+
RDF["_#{@li_counter}"]
9595
end
9696

9797
# Set XML base. Ignore any fragment
@@ -328,7 +328,6 @@ def nodeElement(el, ec)
328328
end
329329

330330
# Handle the propertyEltList children events in document order
331-
li_counter = 0 # this will increase for each li we iterate through
332331
el.children.each do |child|
333332
log_fatal "child must be a proxy not a #{child.class}" unless child.is_a?(@implementation::NodeProxy)
334333
next unless child.element?

0 commit comments

Comments
 (0)