radius 0.7.4 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +8 -0
  3. data/CONTRIBUTORS +2 -0
  4. data/Gemfile +16 -2
  5. data/README.rdoc +2 -6
  6. data/Rakefile +10 -1
  7. data/coverage/assets/{0.7.1 → 0.10.2}/application.css +52 -363
  8. data/coverage/assets/{0.7.1 → 0.10.2}/application.js +1153 -72
  9. data/coverage/assets/0.10.2/colorbox/border.png +0 -0
  10. data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
  11. data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
  12. data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
  13. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_asc.png +0 -0
  14. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  15. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_both.png +0 -0
  16. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_desc.png +0 -0
  17. data/coverage/assets/0.13.1/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  18. data/coverage/assets/0.13.1/application.css +1 -0
  19. data/coverage/assets/0.13.1/application.js +7 -0
  20. data/coverage/assets/0.13.1/colorbox/border.png +0 -0
  21. data/coverage/assets/0.13.1/colorbox/controls.png +0 -0
  22. data/coverage/assets/0.13.1/colorbox/loading.gif +0 -0
  23. data/coverage/assets/0.13.1/colorbox/loading_background.png +0 -0
  24. data/coverage/assets/0.13.1/favicon_green.png +0 -0
  25. data/coverage/assets/0.13.1/favicon_red.png +0 -0
  26. data/coverage/assets/0.13.1/favicon_yellow.png +0 -0
  27. data/coverage/assets/0.13.1/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  28. data/coverage/assets/0.13.1/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  29. data/coverage/assets/0.13.1/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  30. data/coverage/assets/0.13.1/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  31. data/coverage/assets/0.13.1/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  32. data/coverage/assets/0.13.1/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  33. data/coverage/assets/0.13.1/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  34. data/coverage/assets/0.13.1/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  35. data/coverage/assets/0.13.1/images/ui-icons_222222_256x240.png +0 -0
  36. data/coverage/assets/0.13.1/images/ui-icons_2e83ff_256x240.png +0 -0
  37. data/coverage/assets/0.13.1/images/ui-icons_454545_256x240.png +0 -0
  38. data/coverage/assets/0.13.1/images/ui-icons_888888_256x240.png +0 -0
  39. data/coverage/assets/0.13.1/images/ui-icons_cd0a0a_256x240.png +0 -0
  40. data/coverage/assets/0.13.1/loading.gif +0 -0
  41. data/coverage/assets/0.13.1/magnify.png +0 -0
  42. data/lib/radius/context.rb +2 -1
  43. data/lib/radius/delegating_open_struct.rb +15 -19
  44. data/lib/radius/ord_string.rb +6 -8
  45. data/lib/radius/parser/JavaScanner.class +0 -0
  46. data/lib/radius/parser/JavaScanner.java +211 -161
  47. data/lib/radius/parser/JavaScanner.rl +36 -7
  48. data/lib/radius/parser/scanner.rb +2 -2
  49. data/lib/radius/parser.rb +69 -40
  50. data/lib/radius/utility.rb +5 -14
  51. data/lib/radius/version.rb +1 -1
  52. data/lib/radius.rb +11 -11
  53. data/pkg/radius-0.8.0.gem +0 -0
  54. data/radius.gemspec +12 -4
  55. data/test/context_test.rb +13 -5
  56. data/test/multithreaded_test.rb +60 -43
  57. data/test/ord_string_test.rb +3 -3
  58. data/test/parser_test.rb +11 -3
  59. data/test/quickstart_test.rb +2 -2
  60. data/test/squiggle_test.rb +3 -3
  61. data/test/test_helper.rb +21 -26
  62. data/test/utility_test.rb +3 -3
  63. metadata +86 -70
  64. data/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
  65. data/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
  66. data/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
  67. data/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
  68. data/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
  69. data/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
  70. data/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
  71. data/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
  72. data/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
  73. data/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
  74. data/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
  75. data/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
  76. data/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
  77. data/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
  78. data/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
  79. data/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
  80. data/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
  81. data/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
  82. data/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
  83. data/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
  84. data/pkg/radius-0.7.0.prerelease.gem +0 -0
  85. /data/coverage/assets/{0.7.1 → 0.10.2}/favicon_green.png +0 -0
  86. /data/coverage/assets/{0.7.1 → 0.10.2}/favicon_red.png +0 -0
  87. /data/coverage/assets/{0.7.1 → 0.10.2}/favicon_yellow.png +0 -0
  88. /data/coverage/assets/{0.7.1 → 0.10.2}/loading.gif +0 -0
  89. /data/coverage/assets/{0.7.1 → 0.10.2}/magnify.png +0 -0
  90. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  91. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  92. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  93. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  94. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  95. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  96. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  97. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  98. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-icons_222222_256x240.png +0 -0
  99. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  100. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-icons_454545_256x240.png +0 -0
  101. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-icons_888888_256x240.png +0 -0
  102. /data/coverage/assets/{0.7.1 → 0.10.2}/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
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