radius 0.7.0.prerelease → 0.7.0.prerelease2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ doc
2
+ *.dot
3
+ pkg
4
+ *.rbc
5
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ group :test do
6
+ gem 'RedCloth'
7
+ end
@@ -10,7 +10,7 @@ module Radius
10
10
  attr_accessor :globals # :nodoc:
11
11
 
12
12
  # Creates a new Context object.
13
- def initialize(&block)
13
+ def initialize(*args, &block)
14
14
  @definitions = {}
15
15
  @tag_binding_stack = []
16
16
  @globals = DelegatingOpenStruct.new
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
 
3
2
  # line 1 "scanner.rl"
4
3
 
@@ -813,21 +812,20 @@ begin
813
812
  if _goto_level <= _resume
814
813
  case _parser_from_state_actions[cs]
815
814
  when 26 then
816
- # line 1 "scanner.rl"
815
+ # line 1 "NONE"
817
816
  begin
818
817
  ts = p
819
818
  end
820
- # line 1 "scanner.rl"
821
- # line 821 "scanner.rb"
819
+ # line 820 "scanner.rb"
822
820
  end
823
821
  _keys = cs << 1
824
822
  _inds = _parser_index_offsets[cs]
825
823
  _slen = _parser_key_spans[cs]
826
824
  _trans = if ( _slen > 0 &&
827
- _parser_trans_keys[_keys] <= data[p] &&
828
- data[p] <= _parser_trans_keys[_keys + 1]
825
+ _parser_trans_keys[_keys] <= data[p].ord &&
826
+ data[p].ord <= _parser_trans_keys[_keys + 1]
829
827
  ) then
830
- _parser_indicies[ _inds + data[p] - _parser_trans_keys[_keys] ]
828
+ _parser_indicies[ _inds + data[p].ord - _parser_trans_keys[_keys] ]
831
829
  else
832
830
  _parser_indicies[ _inds + _slen ]
833
831
  end
@@ -840,7 +838,6 @@ ts = p
840
838
  # line 5 "scanner.rl"
841
839
  begin
842
840
  mark_pfx = p end
843
- # line 5 "scanner.rl"
844
841
  when 2 then
845
842
  # line 6 "scanner.rl"
846
843
  begin
@@ -856,49 +853,40 @@ ts = p
856
853
 
857
854
  end
858
855
  end
859
- # line 6 "scanner.rl"
860
856
  when 3 then
861
857
  # line 13 "scanner.rl"
862
858
  begin
863
859
  mark_stg = p end
864
- # line 13 "scanner.rl"
865
860
  when 4 then
866
861
  # line 14 "scanner.rl"
867
862
  begin
868
863
  @starttag = data[mark_stg..p-1] end
869
- # line 14 "scanner.rl"
870
864
  when 11 then
871
865
  # line 15 "scanner.rl"
872
866
  begin
873
867
  mark_attr = p end
874
- # line 15 "scanner.rl"
875
868
  when 15 then
876
869
  # line 16 "scanner.rl"
877
870
  begin
878
871
 
879
872
  @attrs[@nat] = @vat
880
873
  end
881
- # line 16 "scanner.rl"
882
874
  when 5 then
883
875
  # line 25 "scanner.rl"
884
876
  begin
885
877
  mark_nat = p end
886
- # line 25 "scanner.rl"
887
878
  when 7 then
888
879
  # line 26 "scanner.rl"
889
880
  begin
890
881
  @nat = data[mark_nat..p-1] end
891
- # line 26 "scanner.rl"
892
882
  when 8 then
893
883
  # line 27 "scanner.rl"
894
884
  begin
895
885
  mark_vat = p end
896
- # line 27 "scanner.rl"
897
886
  when 10 then
898
887
  # line 28 "scanner.rl"
899
888
  begin
900
889
  @vat = data[mark_vat..p-1] end
901
- # line 28 "scanner.rl"
902
890
  when 27 then
903
891
  # line 79 "scanner.rl"
904
892
  begin
@@ -908,7 +896,6 @@ te = p+1
908
896
  @tagstart = p
909
897
  end
910
898
  end
911
- # line 79 "scanner.rl"
912
899
  when 29 then
913
900
  # line 79 "scanner.rl"
914
901
  begin
@@ -918,7 +905,6 @@ p = p - 1; begin
918
905
  @tagstart = p
919
906
  end
920
907
  end
921
- # line 79 "scanner.rl"
922
908
  when 1 then
923
909
  # line 79 "scanner.rl"
924
910
  begin
@@ -928,9 +914,8 @@ p = p - 1; begin
928
914
  @tagstart = p
929
915
  end
930
916
  end
931
- # line 79 "scanner.rl"
932
917
  when 6 then
933
- # line 1 "scanner.rl"
918
+ # line 1 "NONE"
934
919
  begin
935
920
  case act
936
921
  when 1 then
@@ -957,61 +942,49 @@ p = p - 1; begin
957
942
  end
958
943
  end
959
944
  end
960
- # line 1 "scanner.rl"
961
945
  when 13 then
962
946
  # line 15 "scanner.rl"
963
947
  begin
964
948
  mark_attr = p end
965
- # line 15 "scanner.rl"
966
949
  # line 16 "scanner.rl"
967
950
  begin
968
951
 
969
952
  @attrs[@nat] = @vat
970
953
  end
971
- # line 16 "scanner.rl"
972
954
  when 14 then
973
955
  # line 16 "scanner.rl"
974
956
  begin
975
957
 
976
958
  @attrs[@nat] = @vat
977
959
  end
978
- # line 16 "scanner.rl"
979
960
  # line 25 "scanner.rl"
980
961
  begin
981
962
  mark_nat = p end
982
- # line 25 "scanner.rl"
983
963
  when 18 then
984
964
  # line 27 "scanner.rl"
985
965
  begin
986
966
  mark_vat = p end
987
- # line 27 "scanner.rl"
988
967
  # line 15 "scanner.rl"
989
968
  begin
990
969
  mark_attr = p end
991
- # line 15 "scanner.rl"
992
970
  when 9 then
993
971
  # line 27 "scanner.rl"
994
972
  begin
995
973
  mark_vat = p end
996
- # line 27 "scanner.rl"
997
974
  # line 28 "scanner.rl"
998
975
  begin
999
976
  @vat = data[mark_vat..p-1] end
1000
- # line 28 "scanner.rl"
1001
977
  when 23 then
1002
978
  # line 28 "scanner.rl"
1003
979
  begin
1004
980
  @vat = data[mark_vat..p-1] end
1005
- # line 28 "scanner.rl"
1006
981
  # line 27 "scanner.rl"
1007
982
  begin
1008
983
  mark_vat = p end
1009
- # line 27 "scanner.rl"
1010
984
  when 31 then
1011
985
  # line 30 "scanner.rl"
1012
986
  begin
1013
987
  @flavor = :open end
1014
- # line 30 "scanner.rl"
1015
988
  # line 70 "scanner.rl"
1016
989
  begin
1017
990
  te = p
@@ -1030,12 +1003,10 @@ p = p - 1; begin
1030
1003
 
1031
1004
  end
1032
1005
  end
1033
- # line 70 "scanner.rl"
1034
1006
  when 30 then
1035
1007
  # line 31 "scanner.rl"
1036
1008
  begin
1037
1009
  @flavor = :self end
1038
- # line 31 "scanner.rl"
1039
1010
  # line 70 "scanner.rl"
1040
1011
  begin
1041
1012
  te = p
@@ -1054,12 +1025,10 @@ p = p - 1; begin
1054
1025
 
1055
1026
  end
1056
1027
  end
1057
- # line 70 "scanner.rl"
1058
1028
  when 32 then
1059
1029
  # line 32 "scanner.rl"
1060
1030
  begin
1061
1031
  @flavor = :close end
1062
- # line 32 "scanner.rl"
1063
1032
  # line 70 "scanner.rl"
1064
1033
  begin
1065
1034
  te = p
@@ -1078,148 +1047,120 @@ p = p - 1; begin
1078
1047
 
1079
1048
  end
1080
1049
  end
1081
- # line 70 "scanner.rl"
1082
1050
  when 22 then
1083
- # line 1 "scanner.rl"
1051
+ # line 1 "NONE"
1084
1052
  begin
1085
1053
  te = p+1
1086
1054
  end
1087
- # line 1 "scanner.rl"
1088
1055
  # line 70 "scanner.rl"
1089
1056
  begin
1090
1057
  act = 1; end
1091
- # line 70 "scanner.rl"
1092
1058
  when 28 then
1093
- # line 1 "scanner.rl"
1059
+ # line 1 "NONE"
1094
1060
  begin
1095
1061
  te = p+1
1096
1062
  end
1097
- # line 1 "scanner.rl"
1098
1063
  # line 79 "scanner.rl"
1099
1064
  begin
1100
1065
  act = 2; end
1101
- # line 79 "scanner.rl"
1102
1066
  when 12 then
1103
1067
  # line 15 "scanner.rl"
1104
1068
  begin
1105
1069
  mark_attr = p end
1106
- # line 15 "scanner.rl"
1107
1070
  # line 16 "scanner.rl"
1108
1071
  begin
1109
1072
 
1110
1073
  @attrs[@nat] = @vat
1111
1074
  end
1112
- # line 16 "scanner.rl"
1113
1075
  # line 25 "scanner.rl"
1114
1076
  begin
1115
1077
  mark_nat = p end
1116
- # line 25 "scanner.rl"
1117
1078
  when 20 then
1118
1079
  # line 27 "scanner.rl"
1119
1080
  begin
1120
1081
  mark_vat = p end
1121
- # line 27 "scanner.rl"
1122
1082
  # line 15 "scanner.rl"
1123
1083
  begin
1124
1084
  mark_attr = p end
1125
- # line 15 "scanner.rl"
1126
1085
  # line 16 "scanner.rl"
1127
1086
  begin
1128
1087
 
1129
1088
  @attrs[@nat] = @vat
1130
1089
  end
1131
- # line 16 "scanner.rl"
1132
1090
  when 17 then
1133
- # line 1 "scanner.rl"
1091
+ # line 1 "NONE"
1134
1092
  begin
1135
1093
  te = p+1
1136
1094
  end
1137
- # line 1 "scanner.rl"
1138
1095
  # line 16 "scanner.rl"
1139
1096
  begin
1140
1097
 
1141
1098
  @attrs[@nat] = @vat
1142
1099
  end
1143
- # line 16 "scanner.rl"
1144
1100
  # line 70 "scanner.rl"
1145
1101
  begin
1146
1102
  act = 1; end
1147
- # line 70 "scanner.rl"
1148
1103
  when 19 then
1149
1104
  # line 27 "scanner.rl"
1150
1105
  begin
1151
1106
  mark_vat = p end
1152
- # line 27 "scanner.rl"
1153
1107
  # line 15 "scanner.rl"
1154
1108
  begin
1155
1109
  mark_attr = p end
1156
- # line 15 "scanner.rl"
1157
1110
  # line 16 "scanner.rl"
1158
1111
  begin
1159
1112
 
1160
1113
  @attrs[@nat] = @vat
1161
1114
  end
1162
- # line 16 "scanner.rl"
1163
1115
  # line 25 "scanner.rl"
1164
1116
  begin
1165
1117
  mark_nat = p end
1166
- # line 25 "scanner.rl"
1167
1118
  when 16 then
1168
- # line 1 "scanner.rl"
1119
+ # line 1 "NONE"
1169
1120
  begin
1170
1121
  te = p+1
1171
1122
  end
1172
- # line 1 "scanner.rl"
1173
1123
  # line 15 "scanner.rl"
1174
1124
  begin
1175
1125
  mark_attr = p end
1176
- # line 15 "scanner.rl"
1177
1126
  # line 16 "scanner.rl"
1178
1127
  begin
1179
1128
 
1180
1129
  @attrs[@nat] = @vat
1181
1130
  end
1182
- # line 16 "scanner.rl"
1183
1131
  # line 70 "scanner.rl"
1184
1132
  begin
1185
1133
  act = 1; end
1186
- # line 70 "scanner.rl"
1187
1134
  when 21 then
1188
- # line 1 "scanner.rl"
1135
+ # line 1 "NONE"
1189
1136
  begin
1190
1137
  te = p+1
1191
1138
  end
1192
- # line 1 "scanner.rl"
1193
1139
  # line 27 "scanner.rl"
1194
1140
  begin
1195
1141
  mark_vat = p end
1196
- # line 27 "scanner.rl"
1197
1142
  # line 15 "scanner.rl"
1198
1143
  begin
1199
1144
  mark_attr = p end
1200
- # line 15 "scanner.rl"
1201
1145
  # line 16 "scanner.rl"
1202
1146
  begin
1203
1147
 
1204
1148
  @attrs[@nat] = @vat
1205
1149
  end
1206
- # line 16 "scanner.rl"
1207
1150
  # line 70 "scanner.rl"
1208
1151
  begin
1209
1152
  act = 1; end
1210
- # line 70 "scanner.rl"
1211
- # line 1211 "scanner.rb"
1153
+ # line 1154 "scanner.rb"
1212
1154
  end
1213
1155
  end
1214
1156
  end
1215
1157
  if _goto_level <= _again
1216
1158
  case _parser_to_state_actions[cs]
1217
1159
  when 25 then
1218
- # line 1 "scanner.rl"
1160
+ # line 1 "NONE"
1219
1161
  begin
1220
1162
  ts = nil; end
1221
- # line 1 "scanner.rl"
1222
- # line 1222 "scanner.rb"
1163
+ # line 1164 "scanner.rb"
1223
1164
  end
1224
1165
 
1225
1166
  if cs == 0
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
 
3
2
  # line 1 "squiggle_scanner.rl"
4
3
 
@@ -817,21 +816,20 @@ begin
817
816
  if _goto_level <= _resume
818
817
  case _parser_from_state_actions[cs]
819
818
  when 24 then
820
- # line 1 "squiggle_scanner.rl"
819
+ # line 1 "NONE"
821
820
  begin
822
821
  ts = p
823
822
  end
824
- # line 1 "squiggle_scanner.rl"
825
- # line 825 "squiggle_scanner.rb"
823
+ # line 824 "squiggle_scanner.rb"
826
824
  end
827
825
  _keys = cs << 1
828
826
  _inds = _parser_index_offsets[cs]
829
827
  _slen = _parser_key_spans[cs]
830
828
  _trans = if ( _slen > 0 &&
831
- _parser_trans_keys[_keys] <= data[p] &&
832
- data[p] <= _parser_trans_keys[_keys + 1]
829
+ _parser_trans_keys[_keys] <= data[p].ord &&
830
+ data[p].ord <= _parser_trans_keys[_keys + 1]
833
831
  ) then
834
- _parser_indicies[ _inds + data[p] - _parser_trans_keys[_keys] ]
832
+ _parser_indicies[ _inds + data[p].ord - _parser_trans_keys[_keys] ]
835
833
  else
836
834
  _parser_indicies[ _inds + _slen ]
837
835
  end
@@ -844,44 +842,36 @@ ts = p
844
842
  # line 12 "squiggle_scanner.rl"
845
843
  begin
846
844
  mark_stg = p end
847
- # line 12 "squiggle_scanner.rl"
848
845
  when 3 then
849
846
  # line 13 "squiggle_scanner.rl"
850
847
  begin
851
848
  @starttag = data[mark_stg..p-1] end
852
- # line 13 "squiggle_scanner.rl"
853
849
  when 10 then
854
850
  # line 14 "squiggle_scanner.rl"
855
851
  begin
856
852
  mark_attr = p end
857
- # line 14 "squiggle_scanner.rl"
858
853
  when 14 then
859
854
  # line 15 "squiggle_scanner.rl"
860
855
  begin
861
856
 
862
857
  @attrs[@nat] = @vat
863
858
  end
864
- # line 15 "squiggle_scanner.rl"
865
859
  when 4 then
866
860
  # line 24 "squiggle_scanner.rl"
867
861
  begin
868
862
  mark_nat = p end
869
- # line 24 "squiggle_scanner.rl"
870
863
  when 6 then
871
864
  # line 25 "squiggle_scanner.rl"
872
865
  begin
873
866
  @nat = data[mark_nat..p-1] end
874
- # line 25 "squiggle_scanner.rl"
875
867
  when 7 then
876
868
  # line 26 "squiggle_scanner.rl"
877
869
  begin
878
870
  mark_vat = p end
879
- # line 26 "squiggle_scanner.rl"
880
871
  when 9 then
881
872
  # line 27 "squiggle_scanner.rl"
882
873
  begin
883
874
  @vat = data[mark_vat..p-1] end
884
- # line 27 "squiggle_scanner.rl"
885
875
  when 25 then
886
876
  # line 80 "squiggle_scanner.rl"
887
877
  begin
@@ -891,7 +881,6 @@ te = p+1
891
881
  @tagstart = p
892
882
  end
893
883
  end
894
- # line 80 "squiggle_scanner.rl"
895
884
  when 27 then
896
885
  # line 80 "squiggle_scanner.rl"
897
886
  begin
@@ -901,7 +890,6 @@ p = p - 1; begin
901
890
  @tagstart = p
902
891
  end
903
892
  end
904
- # line 80 "squiggle_scanner.rl"
905
893
  when 1 then
906
894
  # line 80 "squiggle_scanner.rl"
907
895
  begin
@@ -911,9 +899,8 @@ p = p - 1; begin
911
899
  @tagstart = p
912
900
  end
913
901
  end
914
- # line 80 "squiggle_scanner.rl"
915
902
  when 5 then
916
- # line 1 "squiggle_scanner.rl"
903
+ # line 1 "NONE"
917
904
  begin
918
905
  case act
919
906
  when 1 then
@@ -940,61 +927,49 @@ p = p - 1; begin
940
927
  end
941
928
  end
942
929
  end
943
- # line 1 "squiggle_scanner.rl"
944
930
  when 12 then
945
931
  # line 14 "squiggle_scanner.rl"
946
932
  begin
947
933
  mark_attr = p end
948
- # line 14 "squiggle_scanner.rl"
949
934
  # line 15 "squiggle_scanner.rl"
950
935
  begin
951
936
 
952
937
  @attrs[@nat] = @vat
953
938
  end
954
- # line 15 "squiggle_scanner.rl"
955
939
  when 13 then
956
940
  # line 15 "squiggle_scanner.rl"
957
941
  begin
958
942
 
959
943
  @attrs[@nat] = @vat
960
944
  end
961
- # line 15 "squiggle_scanner.rl"
962
945
  # line 24 "squiggle_scanner.rl"
963
946
  begin
964
947
  mark_nat = p end
965
- # line 24 "squiggle_scanner.rl"
966
948
  when 17 then
967
949
  # line 26 "squiggle_scanner.rl"
968
950
  begin
969
951
  mark_vat = p end
970
- # line 26 "squiggle_scanner.rl"
971
952
  # line 14 "squiggle_scanner.rl"
972
953
  begin
973
954
  mark_attr = p end
974
- # line 14 "squiggle_scanner.rl"
975
955
  when 8 then
976
956
  # line 26 "squiggle_scanner.rl"
977
957
  begin
978
958
  mark_vat = p end
979
- # line 26 "squiggle_scanner.rl"
980
959
  # line 27 "squiggle_scanner.rl"
981
960
  begin
982
961
  @vat = data[mark_vat..p-1] end
983
- # line 27 "squiggle_scanner.rl"
984
962
  when 22 then
985
963
  # line 27 "squiggle_scanner.rl"
986
964
  begin
987
965
  @vat = data[mark_vat..p-1] end
988
- # line 27 "squiggle_scanner.rl"
989
966
  # line 26 "squiggle_scanner.rl"
990
967
  begin
991
968
  mark_vat = p end
992
- # line 26 "squiggle_scanner.rl"
993
969
  when 29 then
994
970
  # line 29 "squiggle_scanner.rl"
995
971
  begin
996
972
  @flavor = :open end
997
- # line 29 "squiggle_scanner.rl"
998
973
  # line 71 "squiggle_scanner.rl"
999
974
  begin
1000
975
  te = p
@@ -1013,12 +988,10 @@ p = p - 1; begin
1013
988
 
1014
989
  end
1015
990
  end
1016
- # line 71 "squiggle_scanner.rl"
1017
991
  when 28 then
1018
992
  # line 30 "squiggle_scanner.rl"
1019
993
  begin
1020
994
  @flavor = :self end
1021
- # line 30 "squiggle_scanner.rl"
1022
995
  # line 71 "squiggle_scanner.rl"
1023
996
  begin
1024
997
  te = p
@@ -1037,12 +1010,10 @@ p = p - 1; begin
1037
1010
 
1038
1011
  end
1039
1012
  end
1040
- # line 71 "squiggle_scanner.rl"
1041
1013
  when 30 then
1042
1014
  # line 31 "squiggle_scanner.rl"
1043
1015
  begin
1044
1016
  @flavor = :close end
1045
- # line 31 "squiggle_scanner.rl"
1046
1017
  # line 71 "squiggle_scanner.rl"
1047
1018
  begin
1048
1019
  te = p
@@ -1061,148 +1032,120 @@ p = p - 1; begin
1061
1032
 
1062
1033
  end
1063
1034
  end
1064
- # line 71 "squiggle_scanner.rl"
1065
1035
  when 21 then
1066
- # line 1 "squiggle_scanner.rl"
1036
+ # line 1 "NONE"
1067
1037
  begin
1068
1038
  te = p+1
1069
1039
  end
1070
- # line 1 "squiggle_scanner.rl"
1071
1040
  # line 71 "squiggle_scanner.rl"
1072
1041
  begin
1073
1042
  act = 1; end
1074
- # line 71 "squiggle_scanner.rl"
1075
1043
  when 26 then
1076
- # line 1 "squiggle_scanner.rl"
1044
+ # line 1 "NONE"
1077
1045
  begin
1078
1046
  te = p+1
1079
1047
  end
1080
- # line 1 "squiggle_scanner.rl"
1081
1048
  # line 80 "squiggle_scanner.rl"
1082
1049
  begin
1083
1050
  act = 2; end
1084
- # line 80 "squiggle_scanner.rl"
1085
1051
  when 11 then
1086
1052
  # line 14 "squiggle_scanner.rl"
1087
1053
  begin
1088
1054
  mark_attr = p end
1089
- # line 14 "squiggle_scanner.rl"
1090
1055
  # line 15 "squiggle_scanner.rl"
1091
1056
  begin
1092
1057
 
1093
1058
  @attrs[@nat] = @vat
1094
1059
  end
1095
- # line 15 "squiggle_scanner.rl"
1096
1060
  # line 24 "squiggle_scanner.rl"
1097
1061
  begin
1098
1062
  mark_nat = p end
1099
- # line 24 "squiggle_scanner.rl"
1100
1063
  when 19 then
1101
1064
  # line 26 "squiggle_scanner.rl"
1102
1065
  begin
1103
1066
  mark_vat = p end
1104
- # line 26 "squiggle_scanner.rl"
1105
1067
  # line 14 "squiggle_scanner.rl"
1106
1068
  begin
1107
1069
  mark_attr = p end
1108
- # line 14 "squiggle_scanner.rl"
1109
1070
  # line 15 "squiggle_scanner.rl"
1110
1071
  begin
1111
1072
 
1112
1073
  @attrs[@nat] = @vat
1113
1074
  end
1114
- # line 15 "squiggle_scanner.rl"
1115
1075
  when 16 then
1116
- # line 1 "squiggle_scanner.rl"
1076
+ # line 1 "NONE"
1117
1077
  begin
1118
1078
  te = p+1
1119
1079
  end
1120
- # line 1 "squiggle_scanner.rl"
1121
1080
  # line 15 "squiggle_scanner.rl"
1122
1081
  begin
1123
1082
 
1124
1083
  @attrs[@nat] = @vat
1125
1084
  end
1126
- # line 15 "squiggle_scanner.rl"
1127
1085
  # line 71 "squiggle_scanner.rl"
1128
1086
  begin
1129
1087
  act = 1; end
1130
- # line 71 "squiggle_scanner.rl"
1131
1088
  when 18 then
1132
1089
  # line 26 "squiggle_scanner.rl"
1133
1090
  begin
1134
1091
  mark_vat = p end
1135
- # line 26 "squiggle_scanner.rl"
1136
1092
  # line 14 "squiggle_scanner.rl"
1137
1093
  begin
1138
1094
  mark_attr = p end
1139
- # line 14 "squiggle_scanner.rl"
1140
1095
  # line 15 "squiggle_scanner.rl"
1141
1096
  begin
1142
1097
 
1143
1098
  @attrs[@nat] = @vat
1144
1099
  end
1145
- # line 15 "squiggle_scanner.rl"
1146
1100
  # line 24 "squiggle_scanner.rl"
1147
1101
  begin
1148
1102
  mark_nat = p end
1149
- # line 24 "squiggle_scanner.rl"
1150
1103
  when 15 then
1151
- # line 1 "squiggle_scanner.rl"
1104
+ # line 1 "NONE"
1152
1105
  begin
1153
1106
  te = p+1
1154
1107
  end
1155
- # line 1 "squiggle_scanner.rl"
1156
1108
  # line 14 "squiggle_scanner.rl"
1157
1109
  begin
1158
1110
  mark_attr = p end
1159
- # line 14 "squiggle_scanner.rl"
1160
1111
  # line 15 "squiggle_scanner.rl"
1161
1112
  begin
1162
1113
 
1163
1114
  @attrs[@nat] = @vat
1164
1115
  end
1165
- # line 15 "squiggle_scanner.rl"
1166
1116
  # line 71 "squiggle_scanner.rl"
1167
1117
  begin
1168
1118
  act = 1; end
1169
- # line 71 "squiggle_scanner.rl"
1170
1119
  when 20 then
1171
- # line 1 "squiggle_scanner.rl"
1120
+ # line 1 "NONE"
1172
1121
  begin
1173
1122
  te = p+1
1174
1123
  end
1175
- # line 1 "squiggle_scanner.rl"
1176
1124
  # line 26 "squiggle_scanner.rl"
1177
1125
  begin
1178
1126
  mark_vat = p end
1179
- # line 26 "squiggle_scanner.rl"
1180
1127
  # line 14 "squiggle_scanner.rl"
1181
1128
  begin
1182
1129
  mark_attr = p end
1183
- # line 14 "squiggle_scanner.rl"
1184
1130
  # line 15 "squiggle_scanner.rl"
1185
1131
  begin
1186
1132
 
1187
1133
  @attrs[@nat] = @vat
1188
1134
  end
1189
- # line 15 "squiggle_scanner.rl"
1190
1135
  # line 71 "squiggle_scanner.rl"
1191
1136
  begin
1192
1137
  act = 1; end
1193
- # line 71 "squiggle_scanner.rl"
1194
- # line 1194 "squiggle_scanner.rb"
1138
+ # line 1139 "squiggle_scanner.rb"
1195
1139
  end
1196
1140
  end
1197
1141
  end
1198
1142
  if _goto_level <= _again
1199
1143
  case _parser_to_state_actions[cs]
1200
1144
  when 23 then
1201
- # line 1 "squiggle_scanner.rl"
1145
+ # line 1 "NONE"
1202
1146
  begin
1203
1147
  ts = nil; end
1204
- # line 1 "squiggle_scanner.rl"
1205
- # line 1205 "squiggle_scanner.rb"
1148
+ # line 1149 "squiggle_scanner.rb"
1206
1149
  end
1207
1150
 
1208
1151
  if cs == 0
@@ -1,8 +1,5 @@
1
1
  module Radius #:nodoc:
2
2
  def self.version
3
- @version ||= begin
4
- filename = File.join(File.dirname(__FILE__), '..', '..', 'VERSION')
5
- IO.read(filename).strip
6
- end
3
+ '0.7.0.prerelease2'
7
4
  end
8
5
  end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ $: << (__FILE__ + '/../lib')
4
+ require 'radius'
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{radius}
7
+ s.version = ::Radius.version
8
+
9
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.authors = [%q{John W. Long (me@johnwlong.com)}, %q{David Chelimsky (dchelimsky@gmail.com)}, %q{Bryce Kerley (bkerley@brycekerley.net)}]
11
+ s.description = %q{Radius is a powerful tag-based template language for Ruby inspired by the template languages used in MovableType and TextPattern. It uses tags similar to XML, but can be used to generate any form of plain text (HTML, e-mail, etc...).}
12
+ s.email = %q{me@johnwlong.com}
13
+ s.extra_rdoc_files = [
14
+ "CHANGELOG",
15
+ "LICENSE",
16
+ "QUICKSTART.rdoc",
17
+ "README.rdoc"
18
+ ]
19
+
20
+ ignores = File.read('.gitignore').split("\n").inject([]) {|a,p| a + Dir[p] }
21
+ s.files = Dir['**/*','.gitignore'] - ignores
22
+
23
+ s.homepage = %q{http://github.com/jlong/radius}
24
+ s.summary = %q{A tag-based templating language for Ruby.}
25
+
26
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
+ s.add_development_dependency(%q<RedCloth>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<RedCloth>, [">= 0"])
30
+ end
31
+ end
32
+
@@ -22,14 +22,24 @@ amount = 1000
22
22
 
23
23
  Benchmark.bmbm do |bm|
24
24
  bm.report('vanilla') do
25
- scanner = Radius::Scanner.new(:scanner => Radius::Scanner)
25
+ scanner = RUBY_VERSION =~ /1\.9/ ? Radius::Scanner.new(:scanner => Radius::Scanner) : Radius::Scanner.new
26
26
  amount.times { scanner.operate('r', document) }
27
27
  end
28
+
29
+ bm.report('vanilla (huge)') do
30
+ scanner = RUBY_VERSION =~ /1\.9/ ? Radius::Scanner.new(:scanner => Radius::Scanner) : Radius::Scanner.new
31
+ scanner.operate('r', 'a' * 460000)
32
+ end
28
33
 
29
34
  if RUBY_PLATFORM == 'java'
30
35
  bm.report('JavaScanner') do
31
36
  scanner = Radius::JavaScanner.new(JRuby.runtime)
32
37
  amount.times { scanner.operate('r', document) }
33
38
  end
39
+
40
+ bm.report('JavaScanner (huge)') do
41
+ scanner = Radius::JavaScanner.new(JRuby.runtime)
42
+ scanner.operate('r', 'a' * 460000)
43
+ end
34
44
  end
35
45
  end
@@ -3,6 +3,14 @@ require File.expand_path(File.dirname(__FILE__) + '/test_helper')
3
3
  class RadiusContextTest < Test::Unit::TestCase
4
4
  include RadiusTestHelper
5
5
 
6
+ class SuperContext < Radius::Context
7
+ attr_accessor :name
8
+ def initialize(name)
9
+ self.name = name
10
+ super
11
+ end
12
+ end
13
+
6
14
  def setup
7
15
  @context = new_context
8
16
  end
@@ -19,6 +27,14 @@ class RadiusContextTest < Test::Unit::TestCase
19
27
  assert_not_equal Hash.new, @context.definitions
20
28
  end
21
29
 
30
+ def test_initialize_with_arguments
31
+ @context = SuperContext.new('arg') do |c|
32
+ assert_kind_of Radius::Context, c
33
+ c.define_tag('test') { 'just a test' }
34
+ end
35
+ assert_equal 'arg', @context.name
36
+ end
37
+
22
38
  def test_with
23
39
  got = @context.with do |c|
24
40
  assert_equal @context, c
metadata CHANGED
@@ -1,39 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radius
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1092611506
5
4
  prerelease: 6
6
- segments:
7
- - 0
8
- - 7
9
- - 0
10
- - prerelease
11
- version: 0.7.0.prerelease
5
+ version: 0.7.0.prerelease2
12
6
  platform: ruby
13
7
  authors:
14
- - John W. Long (me@johnwlong.com)
15
- - David Chelimsky (dchelimsky@gmail.com)
16
- - Bryce Kerley (bkerley@brycekerley.net)
8
+ - John W. Long (me@johnwlong.com)
9
+ - David Chelimsky (dchelimsky@gmail.com)
10
+ - Bryce Kerley (bkerley@brycekerley.net)
17
11
  autorequire:
18
12
  bindir: bin
19
13
  cert_chain: []
20
14
 
21
- date: 2011-06-13 00:00:00 Z
15
+ date: 2011-07-23 00:00:00 -04:00
16
+ default_executable:
22
17
  dependencies:
23
- - !ruby/object:Gem::Dependency
24
- name: RedCloth
25
- prerelease: false
26
- requirement: &id001 !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- hash: 3
32
- segments:
33
- - 0
34
- version: "0"
35
- type: :development
36
- version_requirements: *id001
18
+ - !ruby/object:Gem::Dependency
19
+ name: RedCloth
20
+ prerelease: false
21
+ requirement: &id001 !ruby/object:Gem::Requirement
22
+ none: false
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: "0"
27
+ type: :development
28
+ version_requirements: *id001
37
29
  description: Radius is a powerful tag-based template language for Ruby inspired by the template languages used in MovableType and TextPattern. It uses tags similar to XML, but can be used to generate any form of plain text (HTML, e-mail, etc...).
38
30
  email: me@johnwlong.com
39
31
  executables: []
@@ -41,52 +33,80 @@ executables: []
41
33
  extensions: []
42
34
 
43
35
  extra_rdoc_files:
44
- - CHANGELOG
45
- - LICENSE
46
- - QUICKSTART.rdoc
47
- - README.rdoc
36
+ - CHANGELOG
37
+ - LICENSE
38
+ - QUICKSTART.rdoc
39
+ - README.rdoc
48
40
  files:
49
- - CHANGELOG
50
- - LICENSE
51
- - QUICKSTART.rdoc
52
- - README.rdoc
53
- - Rakefile
54
- - VERSION
55
- - lib/radius.rb
56
- - lib/radius/context.rb
57
- - lib/radius/delegating_open_struct.rb
58
- - lib/radius/error.rb
59
- - lib/radius/ord_string.rb
60
- - lib/radius/parse_tag.rb
61
- - lib/radius/parser.rb
62
- - lib/radius/parser/JavaScanner$Flavor.class
63
- - lib/radius/parser/JavaScanner$Tag.class
64
- - lib/radius/parser/JavaScanner.class
65
- - lib/radius/parser/JavaScanner.java
66
- - lib/radius/parser/JavaScanner.rl
67
- - lib/radius/parser/java_scanner.jar
68
- - lib/radius/parser/scanner.rb
69
- - lib/radius/parser/scanner.rl
70
- - lib/radius/parser/squiggle_scanner.rb
71
- - lib/radius/parser/squiggle_scanner.rl
72
- - lib/radius/tag_binding.rb
73
- - lib/radius/tag_definitions.rb
74
- - lib/radius/utility.rb
75
- - lib/radius/version.rb
76
- - tasks/jeweler.rake
77
- - tasks/rdoc.rake
78
- - tasks/rubinius.rake
79
- - tasks/scan.rake
80
- - tasks/test.rake
81
- - test/benchmarks.rb
82
- - test/context_test.rb
83
- - test/multithreaded_test.rb
84
- - test/ord_string_test.rb
85
- - test/parser_test.rb
86
- - test/quickstart_test.rb
87
- - test/squiggle_test.rb
88
- - test/test_helper.rb
89
- - test/utility_test.rb
41
+ - CHANGELOG
42
+ - Gemfile
43
+ - LICENSE
44
+ - QUICKSTART.rdoc
45
+ - radius.gemspec
46
+ - Rakefile
47
+ - README.rdoc
48
+ - lib/radius.rb
49
+ - lib/radius.rbc
50
+ - lib/radius/context.rb
51
+ - lib/radius/context.rbc
52
+ - lib/radius/delegating_open_struct.rb
53
+ - lib/radius/delegating_open_struct.rbc
54
+ - lib/radius/error.rb
55
+ - lib/radius/error.rbc
56
+ - lib/radius/ord_string.rb
57
+ - lib/radius/ord_string.rbc
58
+ - lib/radius/parse_tag.rb
59
+ - lib/radius/parse_tag.rbc
60
+ - lib/radius/parser.rb
61
+ - lib/radius/parser.rbc
62
+ - lib/radius/tag_binding.rb
63
+ - lib/radius/tag_binding.rbc
64
+ - lib/radius/tag_definitions.rb
65
+ - lib/radius/tag_definitions.rbc
66
+ - lib/radius/utility.rb
67
+ - lib/radius/utility.rbc
68
+ - lib/radius/version.rb
69
+ - lib/radius/version.rbc
70
+ - lib/radius/parser/java_scanner.jar
71
+ - lib/radius/parser/JavaScanner$Flavor.class
72
+ - lib/radius/parser/JavaScanner$Tag.class
73
+ - lib/radius/parser/JavaScanner.class
74
+ - lib/radius/parser/JavaScanner.java
75
+ - lib/radius/parser/JavaScanner.rl
76
+ - lib/radius/parser/scanner.rb
77
+ - lib/radius/parser/scanner.rbc
78
+ - lib/radius/parser/scanner.rl
79
+ - lib/radius/parser/squiggle_scanner.rb
80
+ - lib/radius/parser/squiggle_scanner.rbc
81
+ - lib/radius/parser/squiggle_scanner.rl
82
+ - pkg/radius-0.7.0.prerelease.gem
83
+ - tasks/rdoc.rake
84
+ - tasks/rdoc.rake.compiled.rbc
85
+ - tasks/rubinius.rake
86
+ - tasks/rubinius.rake.compiled.rbc
87
+ - tasks/scan.rake
88
+ - tasks/scan.rake.compiled.rbc
89
+ - tasks/test.rake
90
+ - tasks/test.rake.compiled.rbc
91
+ - test/benchmarks.rb
92
+ - test/context_test.rb
93
+ - test/context_test.rbc
94
+ - test/multithreaded_test.rb
95
+ - test/multithreaded_test.rbc
96
+ - test/ord_string_test.rb
97
+ - test/ord_string_test.rbc
98
+ - test/parser_test.rb
99
+ - test/parser_test.rbc
100
+ - test/quickstart_test.rb
101
+ - test/quickstart_test.rbc
102
+ - test/squiggle_test.rb
103
+ - test/squiggle_test.rbc
104
+ - test/test_helper.rb
105
+ - test/test_helper.rbc
106
+ - test/utility_test.rb
107
+ - test/utility_test.rbc
108
+ - .gitignore
109
+ has_rdoc: true
90
110
  homepage: http://github.com/jlong/radius
91
111
  licenses: []
92
112
 
@@ -94,31 +114,23 @@ post_install_message:
94
114
  rdoc_options: []
95
115
 
96
116
  require_paths:
97
- - lib
117
+ - lib
98
118
  required_ruby_version: !ruby/object:Gem::Requirement
99
119
  none: false
100
120
  requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: "0"
107
124
  required_rubygems_version: !ruby/object:Gem::Requirement
108
125
  none: false
109
126
  requirements:
110
- - - ">"
111
- - !ruby/object:Gem::Version
112
- hash: 25
113
- segments:
114
- - 1
115
- - 3
116
- - 1
117
- version: 1.3.1
127
+ - - ">"
128
+ - !ruby/object:Gem::Version
129
+ version: 1.3.1
118
130
  requirements: []
119
131
 
120
132
  rubyforge_project:
121
- rubygems_version: 1.8.5
133
+ rubygems_version: 1.5.1
122
134
  signing_key:
123
135
  specification_version: 3
124
136
  summary: A tag-based templating language for Ruby.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.7.0.prerelease
@@ -1,22 +0,0 @@
1
- begin
2
- require 'jeweler'
3
- Jeweler::Tasks.new do |gem|
4
- gem.name = "radius"
5
- gem.summary = "A tag-based templating language for Ruby."
6
- gem.description = "Radius is a powerful tag-based template language for Ruby inspired by the template languages used in MovableType and TextPattern. It uses tags similar to XML, but can be used to generate any form of plain text (HTML, e-mail, etc...)."
7
- gem.email = "me@johnwlong.com"
8
- gem.homepage = "http://github.com/jlong/radius"
9
- gem.authors = [
10
- "John W. Long (me@johnwlong.com)",
11
- "David Chelimsky (dchelimsky@gmail.com)",
12
- "Bryce Kerley (bkerley@brycekerley.net)"
13
- ]
14
- gem.files = FileList["[A-Z]*", "{bin,lib,tasks,test}/**/*"].exclude("tmp",'*.rbc','*.dot')
15
- gem.extra_rdoc_files = ['README.rdoc', 'QUICKSTART.rdoc', 'LICENSE', 'CHANGELOG']
16
- gem.add_development_dependency('RedCloth')
17
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
18
- end
19
- Jeweler::GemcutterTasks.new
20
- rescue LoadError
21
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
22
- end