rubyless 0.8.7 → 0.8.8

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/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.8.8 2012-09-28
2
+
3
+ * Minor enhancements
4
+ * Fixed a bug with ternary op missing parenthesis.
5
+
1
6
  == 0.8.7 2012-09-24
2
7
 
3
8
  * Minor enhancements
@@ -1,3 +1,3 @@
1
1
  module RubyLess
2
- VERSION = '0.8.7'
2
+ VERSION = '0.8.8'
3
3
  end
@@ -107,7 +107,7 @@ module RubyLess
107
107
  opts = {}
108
108
  opts[:nil] = true_res.nil? || true_res.could_be_nil? || false_res.nil? || false_res.could_be_nil?
109
109
  opts[:class] = true_res ? true_res.klass : false_res.klass
110
- t "#{cond} ? #{true_res || 'nil'} : #{false_res || 'nil'}", opts
110
+ t "(#{cond} ? #{true_res || 'nil'} : #{false_res || 'nil'})", opts
111
111
  end
112
112
 
113
113
  def process_call(exp)
data/rubyless.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rubyless}
8
- s.version = "0.8.7"
8
+ s.version = "0.8.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gaspard Bucher"]
12
- s.date = %q{2012-09-24}
12
+ s.date = %q{2012-09-28}
13
13
  s.description = %q{RubyLess is an interpreter for "safe ruby". The idea is to transform some "unsafe" ruby code into safe, type checked ruby, eventually rewriting some variables or methods.}
14
14
  s.email = %q{gaspard@teti.ch}
15
15
  s.extra_rdoc_files = [
@@ -53,14 +53,18 @@ nil_greater_then:
53
53
 
54
54
  nil_ternary_op:
55
55
  src: "spouse ? 'foo' : 'bar'"
56
- tem: "node.spouse ? \"foo\" : \"bar\""
56
+ tem: "(node.spouse ? \"foo\" : \"bar\")"
57
57
  res: 'bar'
58
58
 
59
59
  nested_ternary_op:
60
60
  src: "spouse.name == 'Adam' ? 'man' : 'not a man'"
61
- tem: "(node.spouse ? (node.spouse.name==\"Adam\") : nil) ? \"man\" : \"not a man\""
61
+ tem: "((node.spouse ? (node.spouse.name==\"Adam\") : nil) ? \"man\" : \"not a man\")"
62
62
  res: "not a man"
63
63
 
64
+ one_minus_ternary_op:
65
+ src: "1 - (node.id == 0 ? 5 : node.id)"
66
+ tem: "(1-((node.zip==0) ? 5 : node.zip))"
67
+
64
68
  method_on_method:
65
69
  src: "project.name.to_s"
66
70
  tem: "node.project.name.to_s"
@@ -68,12 +72,12 @@ method_on_method:
68
72
 
69
73
  comp_ternary_op:
70
74
  src: "1 > 2 ? 'foo' : 'bar'"
71
- tem: "(1>2) ? \"foo\" : \"bar\""
75
+ tem: "((1>2) ? \"foo\" : \"bar\")"
72
76
  res: "bar"
73
77
 
74
78
  method_ternary_op:
75
79
  src: "id > 2 ? 'foo' : 'bar'"
76
- tem: "(node.zip>2) ? \"foo\" : \"bar\""
80
+ tem: "((node.zip>2) ? \"foo\" : \"bar\")"
77
81
  res: "foo"
78
82
 
79
83
  method_argument_can_be_nil:
@@ -273,5 +277,5 @@ nil:
273
277
 
274
278
  nil_in_op:
275
279
  src: '(dictionary[:foo] == "something" ? "foo" : nil)'
276
- tem: '(get_dict[:foo]=="something") ? "foo" : nil'
280
+ tem: '((get_dict[:foo]=="something") ? "foo" : nil)'
277
281
  res: ''
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyless
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 7
10
- version: 0.8.7
9
+ - 8
10
+ version: 0.8.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gaspard Bucher
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-24 00:00:00 +02:00
18
+ date: 2012-09-28 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency