From 316154057eff14ec6b0bb9ee3e75dc28bc10c767 Mon Sep 17 00:00:00 2001 From: Gaspard Bucher Date: Thu, 13 Jun 2013 07:56:16 +0200 Subject: [PATCH] Fixed Range handling. --- History.txt | 5 +++++ lib/ruby_less/info.rb | 2 +- lib/ruby_less/processor.rb | 6 +++++- rubyless.gemspec | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/History.txt b/History.txt index 60f330d..bccafeb 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,8 @@ +== 0.8.10 2013-06-13 + +* Minor enhancement + * Fixed Range handling + == 0.8.9 2013-04-16 * Minor enhancement diff --git a/lib/ruby_less/info.rb b/lib/ruby_less/info.rb index e09af9e..4b62fe3 100644 --- a/lib/ruby_less/info.rb +++ b/lib/ruby_less/info.rb @@ -1,3 +1,3 @@ module RubyLess - VERSION = '0.8.9' + VERSION = '0.8.10' end diff --git a/lib/ruby_less/processor.rb b/lib/ruby_less/processor.rb index 58cb07b..cf425cd 100644 --- a/lib/ruby_less/processor.rb +++ b/lib/ruby_less/processor.rb @@ -415,7 +415,11 @@ def get_lit_class(lit) unless lit_class = RubyLess::SafeClass.literal_class_for(lit.class) raise RubyLess::SyntaxError.new("#{klass} literal not supported by RubyLess.") end - {:class => lit_class, :literal => lit} + if lit_class == Range + {:class => lit_class, :literal => lit, :raw => "(#{lit.inspect})"} + else + {:class => lit_class, :literal => lit} + end end def args_with_prepend(args, opts) diff --git a/rubyless.gemspec b/rubyless.gemspec index 1f8fa1c..36e9b7f 100644 --- a/rubyless.gemspec +++ b/rubyless.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = %q{rubyless} - s.version = "0.8.9" + s.version = "0.8.10" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Gaspard Bucher"] - s.date = %q{2013-04-16} + s.date = %q{2013-05-07} 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.} s.email = %q{gaspard@teti.ch} s.extra_rdoc_files = [