lector 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lector (0.0.1)
4
+ lector (0.0.2)
5
5
  citrus
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  ```
15
15
  # read-eval is off by default:
16
16
  > Lector::read_s("{three: #='1+2'}")
17
- => {:three=>nil}
17
+ => {:three=>"1+2"}
18
18
 
19
19
  # but you can turn it on...
20
20
  > Lector::read_s("{three: #='1+2'}", :read_eval => true)
@@ -15,6 +15,8 @@ module Lector
15
15
  def val
16
16
  if $_LECTOR_READ_EVAL
17
17
  eval(code.to_s.slice(3..-2))
18
+ else
19
+ code.to_s.slice(3..-2)
18
20
  end
19
21
  end
20
22
  end
@@ -1,3 +1,3 @@
1
1
  module Lector
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -94,10 +94,10 @@ describe Lector do
94
94
  end
95
95
 
96
96
  context 'read-evaling' do
97
- it "shouldn't eval the code" do
98
- Lector::read_s("#='1+2'").should == nil
97
+ it "returns the code when read-eval is off" do
98
+ Lector::read_s("#='1+2'").should == '1+2'
99
99
  end
100
- it "should eval the code" do
100
+ it "evals the code when read-eval is on" do
101
101
  Lector::read_s("#='1+2'", :read_eval => true).should == 3
102
102
  end
103
103
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: