radius 0.7.5 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +5 -0
  3. data/CONTRIBUTORS +2 -0
  4. data/Gemfile +9 -5
  5. data/README.rdoc +2 -6
  6. data/Rakefile +9 -0
  7. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_asc.png +0 -0
  8. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  9. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_both.png +0 -0
  10. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_desc.png +0 -0
  11. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  12. data/coverage/assets/0.13.1/application.css +1 -0
  13. data/coverage/assets/0.13.1/application.js +7 -0
  14. data/coverage/assets/0.13.1/colorbox/border.png +0 -0
  15. data/coverage/assets/0.13.1/colorbox/controls.png +0 -0
  16. data/coverage/assets/0.13.1/colorbox/loading.gif +0 -0
  17. data/coverage/assets/0.13.1/colorbox/loading_background.png +0 -0
  18. data/coverage/assets/0.13.1/favicon_green.png +0 -0
  19. data/coverage/assets/0.13.1/favicon_red.png +0 -0
  20. data/coverage/assets/0.13.1/favicon_yellow.png +0 -0
  21. data/coverage/assets/0.13.1/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  22. data/coverage/assets/0.13.1/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  23. data/coverage/assets/0.13.1/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  24. data/coverage/assets/0.13.1/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  25. data/coverage/assets/0.13.1/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  26. data/coverage/assets/0.13.1/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  27. data/coverage/assets/0.13.1/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  28. data/coverage/assets/0.13.1/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  29. data/coverage/assets/0.13.1/images/ui-icons_222222_256x240.png +0 -0
  30. data/coverage/assets/0.13.1/images/ui-icons_2e83ff_256x240.png +0 -0
  31. data/coverage/assets/0.13.1/images/ui-icons_454545_256x240.png +0 -0
  32. data/coverage/assets/0.13.1/images/ui-icons_888888_256x240.png +0 -0
  33. data/coverage/assets/0.13.1/images/ui-icons_cd0a0a_256x240.png +0 -0
  34. data/coverage/assets/0.13.1/loading.gif +0 -0
  35. data/coverage/assets/0.13.1/magnify.png +0 -0
  36. data/lib/radius/context.rb +2 -1
  37. data/lib/radius/delegating_open_struct.rb +15 -19
  38. data/lib/radius/ord_string.rb +6 -8
  39. data/lib/radius/parser/JavaScanner.class +0 -0
  40. data/lib/radius/parser/JavaScanner.java +211 -161
  41. data/lib/radius/parser/JavaScanner.rl +36 -7
  42. data/lib/radius/parser.rb +69 -40
  43. data/lib/radius/utility.rb +5 -14
  44. data/lib/radius/version.rb +1 -1
  45. data/lib/radius.rb +11 -11
  46. data/pkg/radius-0.8.0.gem +0 -0
  47. data/radius.gemspec +12 -4
  48. data/test/context_test.rb +13 -5
  49. data/test/multithreaded_test.rb +60 -43
  50. data/test/ord_string_test.rb +3 -3
  51. data/test/parser_test.rb +3 -3
  52. data/test/quickstart_test.rb +2 -2
  53. data/test/squiggle_test.rb +3 -3
  54. data/test/test_helper.rb +21 -26
  55. data/test/utility_test.rb +3 -3
  56. metadata +52 -16
Binary file
Binary file
@@ -58,6 +58,7 @@ module Radius
58
58
  else
59
59
  tag_definition_block = @definitions[qualified_tag_name(name.to_s)]
60
60
  if tag_definition_block
61
+ # puts name: name, attributes: attributes
61
62
  stack(name, attributes, block) do |tag|
62
63
  tag_definition_block.call(tag).to_s
63
64
  end
@@ -95,7 +96,7 @@ module Radius
95
96
  def stack(name, attributes, block)
96
97
  previous = @tag_binding_stack.last
97
98
  previous_locals = previous.nil? ? globals : previous.locals
98
- locals = DelegatingOpenStruct.new(previous_locals)
99
+ locals = previous_locals.dup
99
100
  binding = TagBinding.new(self, locals, name, attributes, block)
100
101
  @tag_binding_stack.push(binding)
101
102
  result = yield(binding)
@@ -8,30 +8,26 @@ module Radius
8
8
  end
9
9
 
10
10
  def dup
11
- rv = self.class.new
12
- rv.instance_variable_set(:@hash, @hash.dup)
13
- rv
11
+ self.class.new.tap do |copy|
12
+ copy.instance_variable_set(:@hash, @hash.dup)
13
+ copy.object = @object
14
+ end
14
15
  end
15
16
 
16
17
  def method_missing(method, *args, &block)
17
- symbol = (method.to_s =~ /^(.*?)=$/) ? $1.intern : method
18
- if (0..1).include?(args.size)
19
- if args.size == 1
20
- @hash[symbol] = args.first
21
- else
22
- if @hash.has_key?(symbol)
23
- @hash[symbol]
24
- else
25
- unless object.nil?
26
- @object.send(method, *args, &block)
27
- else
28
- nil
29
- end
30
- end
31
- end
18
+ return super if args.size > 1
19
+
20
+ symbol = method.to_s.chomp('=').to_sym
21
+
22
+ if method.to_s.end_with?('=')
23
+ @hash[symbol] = args.first
32
24
  else
33
- super
25
+ @hash.fetch(symbol) { @object&.public_send(method, *args, &block) }
34
26
  end
35
27
  end
28
+
29
+ def respond_to_missing?(method, include_private = false)
30
+ (args.size <= 1) || super
31
+ end
36
32
  end
37
33
  end
@@ -1,13 +1,11 @@
1
1
  module Radius
2
2
  class OrdString < String
3
- unless "a"[0] == 97 # test for lower than Ruby 1.9
4
- def [](*args)
5
- if args.size == 1 && args.first.is_a?(Integer)
6
- slice(args.first).ord
7
- else
8
- super
9
- end
3
+ def [](*args)
4
+ if args.size == 1 && args.first.is_a?(Integer)
5
+ slice(args.first).ord
6
+ else
7
+ super
10
8
  end
11
9
  end
12
10
  end
13
- end
11
+ end
Binary file