edn 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.0.2
2
+ * Handle numbers with M precision
3
+
1
4
  # 1.0.1
2
5
  * EDN.register defaults to the identity function when no handler is given
3
6
 
data/README.md CHANGED
@@ -173,6 +173,7 @@ More than one piece of metadata can be applied to an element. Metadata is applie
173
173
 
174
174
  * Clinton N. Dreisbach (@crnixon)
175
175
  * Michael Ficarra (@michaelficarra)
176
+ * Andrew Forward (@aforward)
176
177
  * Gabriel Horner (@cldwalker)
177
178
 
178
179
  ## Contributing
data/lib/edn/parser.rb CHANGED
@@ -98,7 +98,7 @@ module EDN
98
98
  rule(:integer) {
99
99
  (match['\-\+'].maybe >>
100
100
  (str('0') | match('[1-9]') >> digit.repeat)).as(:integer) >>
101
- str('N').maybe.as(:precision)
101
+ (str('N') | str("M") ).maybe.as(:precision)
102
102
  }
103
103
 
104
104
  rule(:float) {
data/lib/edn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EDN
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/spec/edn_spec.rb CHANGED
@@ -19,6 +19,11 @@ describe EDN do
19
19
  EDN.read('\c').should == "c"
20
20
  end
21
21
 
22
+ it "should support M suffix without decimals" do
23
+ EDN.read(123412341231212121241234.to_edn).should == 123412341231212121241234
24
+ EDN.read("123412341231212121241234M").should == 123412341231212121241234
25
+ end
26
+
22
27
  it "reads #inst tagged elements" do
23
28
  EDN.read('#inst "2012-09-10T16:16:03-04:00"').should == DateTime.new(2012, 9, 10, 16, 16, 3, '-04:00')
24
29
  end
data/spec/spec_helper.rb CHANGED
@@ -3,6 +3,8 @@ require 'edn'
3
3
  require 'parslet/rig/rspec'
4
4
  require 'parslet/convenience'
5
5
  require 'rantly'
6
+ require 'date'
7
+ require 'time'
6
8
 
7
9
  REPEAT = (ENV["REPEAT"] || 100).to_i
8
10
 
@@ -12,6 +14,9 @@ RSpec.configure do |c|
12
14
  c.alias_example_to :fit, :focused => true
13
15
  c.treat_symbols_as_metadata_keys_with_true_values = true
14
16
  c.run_all_when_everything_filtered = true
17
+
18
+ c.filter_run :focus
19
+ c.run_all_when_everything_filtered = true
15
20
  end
16
21
 
17
22
  module RantlyHelpers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.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-04-12 00:00:00.000000000 Z
12
+ date: 2013-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parslet
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: 2104386366038822837
143
+ hash: -1298335697156083659
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: 2104386366038822837
152
+ hash: -1298335697156083659
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.24