public
Fork of tobi/liquid
Description: Liquid markup language. Save, customer facing template language for flexible web apps.
Homepage: http://www.liquidmarkup.org
Clone URL: git://github.com/jamesmacaulay/liquid.git
Search Repo:
Merged last set of changes from original SVN location
Tobias Lütke (author)
Thu May 08 08:34:43 -0700 2008
commit  7f58cbf82d9a064c191a1e5ca957f1850bbed5fb
tree    6c39a65f75568213a2c5ca9f17553b62e429730d
parent  1d647361e1a39ee09f1bd2d62701925c0128c578
...
1
 
 
2
3
 
4
5
6
 
7
8
 
9
10
 
11
12
 
13
14
 
15
16
 
17
18
19
 
20
21
 
22
23
 
24
25
 
 
26
27
28
29
 
30
31
32
...
37
38
39
40
 
...
 
1
2
3
 
4
5
 
 
6
7
 
8
9
 
10
11
 
12
13
 
14
15
 
16
17
 
 
18
19
 
20
21
 
22
23
 
24
25
26
27
28
 
29
30
31
32
...
37
38
39
 
40
0
@@ -1,32 +1,32 @@
0
-Changelog
0
+* Fixed gem install rake task
0
+* Improve Error encapsulation in liquid by maintaining a own set of exceptions instead of relying on ruby build ins
0
 
0
-Added If with or / and expressions
0
+* Added If with or / and expressions
0
 
0
-Implemented .to_liquid for all objects which can be passed to liquid like Strings Arrays Hashes Numerics and Booleans.
0
-To export new objects to liquid just implement .to_liquid on them and return objects which themselves have .to_liquid methods.
0
+* Implemented .to_liquid for all objects which can be passed to liquid like Strings Arrays Hashes Numerics and Booleans. To export new objects to liquid just implement .to_liquid on them and return objects which themselves have .to_liquid methods.
0
 
0
-Added more tags to standard library
0
+* Added more tags to standard library
0
 
0
-Added include tag ( like partials in rails )
0
+* Added include tag ( like partials in rails )
0
 
0
-[...] Gazillion of detail improvements
0
+* [...] Gazillion of detail improvements
0
 
0
-Added strainers as filter hosts for better security [Tobias Luetke]
0
+* Added strainers as filter hosts for better security [Tobias Luetke]
0
 
0
-Fixed that rails integration would call filter with the wrong "self" [Michael Geary]
0
+* Fixed that rails integration would call filter with the wrong "self" [Michael Geary]
0
 
0
-Fixed bad error reporting when a filter called a method which doesn't exist. Liquid told you that it couldn't find the
0
-filter which was obviously misleading [Tobias Luetke]
0
+* Fixed bad error reporting when a filter called a method which doesn't exist. Liquid told you that it couldn't find the filter which was obviously misleading [Tobias Luetke]
0
 
0
-Removed count helper from standard lib. use size [Tobias Luetke]
0
+* Removed count helper from standard lib. use size [Tobias Luetke]
0
 
0
-Fixed bug with string filter parameters failing to tolerate commas in strings. [Paul Hammond]
0
+* Fixed bug with string filter parameters failing to tolerate commas in strings. [Paul Hammond]
0
 
0
-Improved filter parameters. Filter parameters are now context sensitive; Types are resolved according to the rules of the context. Multiple parameters are now separated by the Liquid::ArgumentSeparator: , by default [Paul Hammond]
0
+* Improved filter parameters. Filter parameters are now context sensitive; Types are resolved according to the rules of the context. Multiple parameters are now separated by the Liquid::ArgumentSeparator: , by default [Paul Hammond]
0
+
0
   {{ 'Typo' | link_to: 'http://typo.leetsoft.com', 'Typo - a modern weblog engine' }}
0
   
0
 
0
-Added Liquid::Drop. A base class which you can use for exporting proxy objects to liquid which can acquire more data when used in liquid. [Tobias Luetke]
0
+* Added Liquid::Drop. A base class which you can use for exporting proxy objects to liquid which can acquire more data when used in liquid. [Tobias Luetke]
0
 
0
   class ProductDrop < Liquid::Drop
0
     def top_sales
0
@@ -37,4 +37,4 @@ Added Liquid::Drop. A base class which you can use for exporting proxy objects t
0
   t.render('product' => ProductDrop.new )
0
 
0
 
0
-Added filter parameters support. Example: {{ date | format_date: "%Y" }} [Paul Hammond]
0
+* Added filter parameters support. Example: {{ date | format_date: "%Y" }} [Paul Hammond]
...
1
 
2
3
4
 
5
6
7
...
20
21
22
 
23
24
25
...
36
37
38
 
39
40
41
...
47
48
49
 
50
51
52
...
56
57
58
 
59
60
...
1
2
3
4
 
5
6
7
8
...
21
22
23
24
25
26
27
...
38
39
40
41
42
43
44
...
50
51
52
53
54
55
56
...
60
61
62
63
64
65
0
@@ -1,7 +1,8 @@
0
 CHANGELOG
0
+History.txt
0
 MIT-LICENSE
0
 Manifest.txt
0
-README
0
+README.txt
0
 Rakefile
0
 example/server/example_servlet.rb
0
 example/server/liquid_servlet.rb
0
@@ -20,6 +21,7 @@ lib/liquid/errors.rb
0
 lib/liquid/extensions.rb
0
 lib/liquid/file_system.rb
0
 lib/liquid/htmltags.rb
0
+lib/liquid/module_ex.rb
0
 lib/liquid/standardfilters.rb
0
 lib/liquid/strainer.rb
0
 lib/liquid/tag.rb
0
@@ -36,6 +38,7 @@ lib/liquid/tags/unless.rb
0
 lib/liquid/template.rb
0
 lib/liquid/variable.rb
0
 test/block_test.rb
0
+test/condition_test.rb
0
 test/context_test.rb
0
 test/drop_test.rb
0
 test/error_handling_test.rb
0
@@ -47,6 +50,7 @@ test/helper.rb
0
 test/html_tag_test.rb
0
 test/if_else_test.rb
0
 test/include_tag_test.rb
0
+test/module_ex_test.rb
0
 test/output_test.rb
0
 test/parsing_quirks_test.rb
0
 test/regexp_test.rb
0
@@ -56,5 +60,6 @@ test/standard_tag_test.rb
0
 test/statements_test.rb
0
 test/strainer_test.rb
0
 test/template_test.rb
0
+test/test_helper.rb
0
 test/unless_else_test.rb
0
 test/variable_test.rb
...
3
4
5
6
 
7
8
9
...
17
18
19
20
 
21
22
23
 
24
25
...
3
4
5
 
6
7
8
9
...
17
18
19
 
20
21
22
 
23
24
25
0
@@ -3,7 +3,7 @@ require 'rubygems'
0
 require 'rake'
0
 require 'hoe'
0
 
0
-PKG_VERSION = "1.7.0"
0
+PKG_VERSION = "1.9.0"
0
 PKG_NAME = "liquid"
0
 PKG_DESC = "A secure non evaling end user template engine with aesthetic markup."
0
 
0
@@ -17,8 +17,8 @@ end
0
 Hoe.new(PKG_NAME, PKG_VERSION) do |p|
0
   p.rubyforge_name = PKG_NAME
0
   p.summary = PKG_DESC
0
- p.description = nil
0
+ p.description = PKG_DESC
0
   p.author = "Tobias Luetke"
0
   p.email = "tobi@leetsoft.com"
0
- p.url = "http://home.leetsoft.com/liquid"
0
+ p.url = "http://www.liquidmarkup.org"
0
 end
0
\ No newline at end of file
...
96
97
98
99
 
100
101
102
...
96
97
98
 
99
100
101
102
0
@@ -96,7 +96,7 @@ module Liquid
0
       left, right = context[left], context[right]
0
             
0
 
0
- operation = self.class.operators[op] || raise(ArgumentError.new("Error in tag '#{name}' - Unknown operator #{op}"))
0
+ operation = self.class.operators[op] || raise(ArgumentError.new("Unknown operator #{op}"))
0
 
0
       if operation.respond_to?(:call)
0
         operation.call(self, left, right)
...
1
2
3
4
5
6
7
8
...
1
2
 
 
 
3
4
5
0
@@ -1,8 +1,5 @@
0
 module Liquid
0
   
0
- class ContextError < StandardError
0
- end
0
-
0
   # Context keeps the variable stack and resolves variables, as well as keywords
0
   #
0
   # context['variable'] = 'testing'
...
1
2
3
4
5
6
 
 
 
 
 
 
 
 
7
8
...
1
 
 
 
 
 
2
3
4
5
6
7
8
9
10
11
0
@@ -1,7 +1,10 @@
0
 module Liquid
0
- class FilterNotFound < StandardError
0
- end
0
-
0
- class FileSystemError < StandardError
0
- end
0
+ class Error < ::StandardError; end
0
+
0
+ class ArgumentError < Error; end
0
+ class ContextError < Error; end
0
+ class FilterNotFound < Error; end
0
+ class FileSystemError < Error; end
0
+ class StandardError < Error; end
0
+ class SyntaxError < Error; end
0
 end
0
\ No newline at end of file
...
24
25
26
27
 
28
29
30
...
24
25
26
 
27
28
29
30
0
@@ -24,7 +24,7 @@ module Liquid
0
     end
0
               
0
     def self.global_filter(filter)
0
- raise StandardError, "Passed filter is not a module" unless filter.is_a?(Module)
0
+ raise ArgumentError, "Passed filter is not a module" unless filter.is_a?(Module)
0
       @@filters[filter.name] = filter
0
     end
0
     
...
4
5
6
7
 
8
9
10
11
 
12
13
14
15
 
16
17
18
...
59
60
61
 
 
 
 
 
 
 
 
 
 
 
 
 
62
63
64
...
4
5
6
 
7
8
9
10
 
11
12
13
14
 
15
16
17
18
...
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
0
@@ -4,15 +4,15 @@ require File.dirname(__FILE__) + '/helper'
0
 
0
 class ErrorDrop < Liquid::Drop
0
   def standard_error
0
- raise StandardError, 'standard error'
0
+ raise Liquid::StandardError, 'standard error'
0
   end
0
 
0
   def argument_error
0
- raise ArgumentError, 'argument error'
0
+ raise Liquid::ArgumentError, 'argument error'
0
   end
0
   
0
   def syntax_error
0
- raise SyntaxError, 'syntax error'
0
+ raise Liquid::SyntaxError, 'syntax error'
0
   end
0
   
0
 end
0
@@ -59,6 +59,19 @@ class ErrorHandlingTest < Test::Unit::TestCase
0
     
0
   end
0
   
0
+ def test_unrecognized_operator
0
+
0
+ assert_nothing_raised do
0
+
0
+ template = Liquid::Template.parse(' {% if 1 =! 2 %}ok{% endif %} ')
0
+ assert_equal ' Liquid error: Unknown operator =! ', template.render
0
+
0
+ assert_equal 1, template.errors.size
0
+ assert_equal Liquid::ArgumentError, template.errors.first.class
0
+
0
+ end
0
+
0
+ end
0
   
0
 end
0
 

Comments

    No one has commented yet.