edn 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd10c75b5dfef4dbd63853f1623351d545886b98
4
- data.tar.gz: aacbe91671af6bb47f02a85e20296ea7888ea127
3
+ metadata.gz: 6352cb6679dbcd323b1d569160a0249215e4ad10
4
+ data.tar.gz: e7f95c57e339b8638ac37f5da3443540f06cd221
5
5
  SHA512:
6
- metadata.gz: 697d7c7414967e2c6dc07b01213738a2f7447ce4edb09f87fddd4aaee7e53f415a97cdb19c3c339c3a755f71a6c19f3cfa49c2898b312b03c5a4d06d7f5d1dff
7
- data.tar.gz: a75e25065fde8c7e15c61751614c6d3881a92e3528ab0c0dfb18f117cff3f1fee20906cafa4fdcc2bfda51e3380b7f754c31fbdd50d5095ac25674263f4a2e7c
6
+ metadata.gz: ff4d500ebf2ff5a1e80b7d91df8f55de31c86f9d0ff13092d990001251d5b4a839377bd322d096255b73742d1e5f257ebcab0f046787fcbdb5c47d492a5ddc3c
7
+ data.tar.gz: 8eb71ea55c3cf8ccae178d2ee71005a83b2fad5de0a02050cc4d18e615d3399ed4a048c7479a9fd299cc4b5e74d30c0591d3d7cd3b9afeee40f9be98412fe75c
@@ -31,7 +31,7 @@ module EDN
31
31
  end
32
32
 
33
33
  def ws?(c=current)
34
- /[ \t\n,]/ =~ c
34
+ /[ \t\r\n,]/ =~ c
35
35
  end
36
36
 
37
37
  def newline?(c=current)
@@ -1,3 +1,3 @@
1
1
  module EDN
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -19,70 +19,70 @@ describe EDN::CharStream do
19
19
 
20
20
  it "knows if the current char is a digit" do
21
21
  s = EDN::CharStream.new(io_for("4f"))
22
- s.digit?.should be_true
22
+ s.digit?.should be_truthy
23
23
  s.advance
24
- s.digit?.should be_false
24
+ s.digit?.should be_falsey
25
25
  end
26
26
 
27
27
  it "knows if the current char is an alpha" do
28
28
  s = EDN::CharStream.new(io_for("a9"))
29
- s.alpha?.should be_true
29
+ s.alpha?.should be_truthy
30
30
  s.advance
31
- s.alpha?.should be_false
31
+ s.alpha?.should be_falsey
32
32
  end
33
33
 
34
34
  it "knows if the current char is whitespace" do
35
35
  s = EDN::CharStream.new(io_for("a b\nc\td,"))
36
- s.ws?.should be_false # a
36
+ s.ws?.should be_falsey # a
37
37
 
38
38
  s.advance
39
- s.ws?.should be_true # " "
39
+ s.ws?.should be_truthy # " "
40
40
 
41
41
  s.advance
42
- s.ws?.should be_false # b
42
+ s.ws?.should be_falsey # b
43
43
 
44
44
  s.advance
45
- s.ws?.should be_true # \n
45
+ s.ws?.should be_truthy # \n
46
46
 
47
47
  s.advance
48
- s.ws?.should be_false # c
48
+ s.ws?.should be_falsey # c
49
49
 
50
50
  s.advance
51
- s.ws?.should be_true # \t
51
+ s.ws?.should be_truthy # \t
52
52
 
53
53
  s.advance
54
- s.ws?.should be_false # d
54
+ s.ws?.should be_falsey # d
55
55
 
56
56
  s.advance
57
- s.ws?.should be_true # ,
57
+ s.ws?.should be_truthy # ,
58
58
  end
59
59
 
60
60
  it "knows if the current char is a newline" do
61
61
  s = EDN::CharStream.new(io_for("a\nb\rc"))
62
- s.newline?.should be_false # a
62
+ s.newline?.should be_falsey # a
63
63
 
64
64
  s.advance
65
- s.newline?.should be_true # \n
65
+ s.newline?.should be_truthy # \n
66
66
 
67
67
  s.advance
68
- s.newline?.should be_false # b
68
+ s.newline?.should be_falsey # b
69
69
 
70
70
  s.advance
71
- s.newline?.should be_true # \r
71
+ s.newline?.should be_truthy # \r
72
72
 
73
73
  s.advance
74
- s.newline?.should be_false # c
74
+ s.newline?.should be_falsey # c
75
75
  end
76
76
 
77
77
  it "knows if it is at the eof" do
78
78
  s = EDN::CharStream.new(io_for("abc"))
79
- s.eof?.should be_false # a
79
+ s.eof?.should be_falsey # a
80
80
  s.advance
81
- s.eof?.should be_false # b
81
+ s.eof?.should be_falsey # b
82
82
  s.advance
83
- s.eof?.should be_false # c
83
+ s.eof?.should be_falsey # c
84
84
  s.advance
85
- s.eof?.should be_true
85
+ s.eof?.should be_truthy
86
86
  end
87
87
 
88
88
  it "knows how to skip past a char" do
@@ -56,6 +56,11 @@ describe EDN do
56
56
  end
57
57
 
58
58
  context "reading data" do
59
+ it "treats carriage returns like whitespace" do
60
+ EDN.read("\r\n[\r\n]\r\n").should == []
61
+ EDN.read("\r[\r]\r\r").should == []
62
+ end
63
+
59
64
  it "reads any valid element" do
60
65
  elements = rant(RantlyHelpers::ELEMENT)
61
66
  elements.each do |element|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clinton N. Dreisbach & Russ Olsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-01 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry