eader 0.0.1 → 0.0.2
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/.gitignore +0 -1
- data/.rspec +1 -1
- data/lib/eader.rb +0 -1
- data/lib/eader/document.rb +5 -9
- data/lib/eader/version.rb +1 -1
- data/spec/eader_spec.rb +8 -4
- metadata +2 -2
data/.gitignore
CHANGED
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--format
|
1
|
+
--format documentation
|
2
2
|
--color
|
data/lib/eader.rb
CHANGED
data/lib/eader/document.rb
CHANGED
@@ -1,16 +1,12 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
1
3
|
module Eader
|
2
4
|
class Document
|
3
|
-
attr_reader :
|
5
|
+
attr_reader :doc
|
4
6
|
|
5
7
|
def initialize(path)
|
6
|
-
|
7
|
-
@
|
8
|
-
@doc = xml_doc_class.parse(file)
|
9
|
-
end
|
10
|
-
|
11
|
-
def content
|
12
|
-
file.rewind
|
13
|
-
file.read
|
8
|
+
file = open(path)
|
9
|
+
@doc = xml_doc_class.parse(file)
|
14
10
|
end
|
15
11
|
|
16
12
|
def items
|
data/lib/eader/version.rb
CHANGED
data/spec/eader_spec.rb
CHANGED
@@ -2,14 +2,18 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Eader do
|
4
4
|
let!(:e) { Eader::Document.new('./spec/support/test.xml') }
|
5
|
+
let(:i) { Eader::Document.new(ENV['REMOTE_URL']) }
|
5
6
|
let(:item) { e.items.first }
|
6
7
|
|
7
|
-
it "opens the xml" do
|
8
|
-
e.content.should include('<ead>')
|
9
|
-
end
|
10
|
-
|
11
8
|
it "returns dsc levels" do
|
12
9
|
e.should have(1).dsc_levels
|
10
|
+
|
11
|
+
# checking that remote url works
|
12
|
+
i.should have(4434).dsc_levels
|
13
|
+
end
|
14
|
+
|
15
|
+
it "returns the items" do
|
16
|
+
e.should have(1).items
|
13
17
|
end
|
14
18
|
|
15
19
|
it "returns item unitids" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|