rdf-tabular 0.3.0 → 0.4.0.beta2
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.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/VERSION +1 -1
- data/lib/rdf/tabular.rb +0 -1
- data/lib/rdf/tabular/format.rb +16 -0
- data/lib/rdf/tabular/metadata.rb +223 -191
- data/lib/rdf/tabular/reader.rb +84 -133
- data/lib/rdf/tabular/uax35.rb +0 -2
- data/spec/format_spec.rb +34 -0
- data/spec/matchers.rb +3 -78
- data/spec/metadata_spec.rb +150 -80
- data/spec/reader_spec.rb +27 -24
- data/spec/spec_helper.rb +4 -3
- data/spec/suite_helper.rb +1 -1
- data/spec/suite_spec.rb +8 -9
- metadata +109 -60
- data/lib/rdf/tabular/utils.rb +0 -33
data/lib/rdf/tabular/utils.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
module RDF::Tabular
|
2
|
-
module Utils
|
3
|
-
# Add debug event to debug array, if specified
|
4
|
-
#
|
5
|
-
# param [String] message
|
6
|
-
# yieldreturn [String] appended to message, to allow for lazy-evaulation of message
|
7
|
-
def debug(*args)
|
8
|
-
options = args.last.is_a?(Hash) ? args.pop : {}
|
9
|
-
return unless options[:debug] || @options[:debug] || RDF::Tabular.debug?
|
10
|
-
depth = options[:depth] || @options[:depth]
|
11
|
-
d_str = depth > 100 ? ' ' * 100 + '+' : ' ' * depth
|
12
|
-
list = args
|
13
|
-
list << yield if block_given?
|
14
|
-
message = d_str + (list.empty? ? "" : list.join(": "))
|
15
|
-
options[:debug] << message if options[:debug].is_a?(Array)
|
16
|
-
@options[:debug] << message if @options[:debug].is_a?(Array)
|
17
|
-
$stderr.puts(message) if RDF::Tabular.debug? || @options[:debug] == TrueClass
|
18
|
-
end
|
19
|
-
module_function :debug
|
20
|
-
|
21
|
-
# Increase depth around a method invocation
|
22
|
-
# @yield
|
23
|
-
# Yields with no arguments
|
24
|
-
# @yieldreturn [Object] returns the result of yielding
|
25
|
-
# @return [Object]
|
26
|
-
def depth
|
27
|
-
@options[:depth] += 1
|
28
|
-
ret = yield
|
29
|
-
@options[:depth] -= 1
|
30
|
-
ret
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|