fbo 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fbo.rb +1 -1
- data/lib/fbo/exceptions.rb +12 -0
- data/lib/fbo/interpreter.rb +1 -1
- data/lib/fbo/node_extensions.rb +0 -1
- data/lib/fbo/parser.rb +2 -1
- data/lib/fbo/version.rb +1 -1
- data/spec/fbo/parser_spec.rb +21 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef4552a83b8f9ea2c230b313030dcceeaa8cceec
|
4
|
+
data.tar.gz: 4d23253323be1c32ea1b851913614165c89691cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc68dc78677417516f8b51ff388f4dc54f6bbff627b764a3e21272cea3d92e91d03c0ecd920d42212d8d1da20d6fb7cac4be064c9f9abd7b2c06eac32a0534b
|
7
|
+
data.tar.gz: 8dbaca1de6506f7f578b51f237124080714d99dd1e16a1d28f116ff0ed3c435d8c8a0b8c9b23ae1ece543c3fd223a7ab6e9e88b97e4be1bc9a4fb599ff805795
|
data/lib/fbo.rb
CHANGED
@@ -8,6 +8,7 @@ module FBO
|
|
8
8
|
|
9
9
|
end
|
10
10
|
|
11
|
+
require 'fbo/exceptions'
|
11
12
|
require 'fbo/file'
|
12
13
|
require 'fbo/chunked_file'
|
13
14
|
require 'fbo/segmented_file'
|
@@ -15,4 +16,3 @@ require 'fbo/remote_file'
|
|
15
16
|
require 'fbo/parser'
|
16
17
|
require 'fbo/node_extensions'
|
17
18
|
require 'fbo/interpreter'
|
18
|
-
|
data/lib/fbo/interpreter.rb
CHANGED
data/lib/fbo/node_extensions.rb
CHANGED
@@ -159,7 +159,6 @@ module FBO
|
|
159
159
|
class PasswordNode < SimplePropertyNode; end
|
160
160
|
class ProjectIDNode < SimplePropertyNode; end
|
161
161
|
class UploadTypeNode < SimplePropertyNode; end
|
162
|
-
class CorrectionNode < SimplePropertyNode; end
|
163
162
|
|
164
163
|
# Complex properties may contain other simple properties
|
165
164
|
#
|
data/lib/fbo/parser.rb
CHANGED
@@ -33,7 +33,8 @@ module FBO
|
|
33
33
|
line = parser.failure_line
|
34
34
|
column = parser.failure_column
|
35
35
|
reason = parser.failure_reason
|
36
|
-
raise
|
36
|
+
raise FBO::ParserError.new("Could not parse data: line #{ line }, column #{ column }, reason '#{ reason }'",
|
37
|
+
data:data)
|
37
38
|
end
|
38
39
|
clean_tree(tree)
|
39
40
|
end
|
data/lib/fbo/version.rb
CHANGED
data/spec/fbo/parser_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe FBO::Parser do
|
|
7
7
|
subject { FBO::Parser.new(file) }
|
8
8
|
|
9
9
|
it 'parses the data all at once' do
|
10
|
-
subject.expects(:parse_string).with(file.contents)
|
10
|
+
subject.expects(:parse_string).with(file.contents)
|
11
11
|
subject.parse
|
12
12
|
end
|
13
13
|
|
@@ -49,4 +49,24 @@ describe FBO::Parser do
|
|
49
49
|
'FBO::Dump::PresolicitationNode' ]
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
53
|
+
context 'a bad String' do
|
54
|
+
let(:contents) { "<PRESOL>\n</PRESOL>\n<COMBINE>\n<COMBINE>\n</COMBINE>\n<AMDCSS>\n</AMDCSS>\n" }
|
55
|
+
let(:file) { stub('FBO::File', contents: contents) }
|
56
|
+
subject { FBO::Parser.new(file) }
|
57
|
+
|
58
|
+
it 'raises a ParserError' do
|
59
|
+
proc { subject.parse }.must_raise FBO::ParserError
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context 'a collection of data with a bad String' do
|
64
|
+
let(:contents) { [ '<PRESOL></PRESOL>', '<COMBINE><COMBINE></COMBINE>', '<AMDCSS></AMDCSS>' ] }
|
65
|
+
let(:file) { stub('FBO::ChunkedFile', contents: contents) }
|
66
|
+
subject { FBO::Parser.new(file) }
|
67
|
+
|
68
|
+
it 'raises a ParserError' do
|
69
|
+
proc { subject.parse }.must_raise FBO::ParserError
|
70
|
+
end
|
71
|
+
end
|
52
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Kottom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/fbo.rb
|
117
117
|
- lib/fbo/chunked_file.rb
|
118
118
|
- lib/fbo/dump.treetop
|
119
|
+
- lib/fbo/exceptions.rb
|
119
120
|
- lib/fbo/file.rb
|
120
121
|
- lib/fbo/interpreter.rb
|
121
122
|
- lib/fbo/node_extensions.rb
|