Revision 912:5e80956cc792 .svn/pristine/0e
| .svn/pristine/0e/0e08d9f41b8e44a9cd63aac9bdb04868977fcdc7.svn-base | ||
|---|---|---|
| 1 |
class AddRolesPermissions < ActiveRecord::Migration |
|
| 2 |
def self.up |
|
| 3 |
add_column :roles, :permissions, :text |
|
| 4 |
end |
|
| 5 |
|
|
| 6 |
def self.down |
|
| 7 |
remove_column :roles, :permissions |
|
| 8 |
end |
|
| 9 |
end |
|
| .svn/pristine/0e/0e9e1072226f562ac691c9b0e43850580a4d42a6.svn-base | ||
|---|---|---|
| 1 |
<h2><%= l(:label_spent_time) %></h2> |
|
| 2 |
|
|
| 3 |
<% labelled_tabular_form_for(:time_entry, @time_entry, :url => {
|
|
| 4 |
:action => (@time_entry.new_record? ? 'create' : 'update'), |
|
| 5 |
:id => @time_entry, |
|
| 6 |
:project_id => @time_entry.project |
|
| 7 |
}, |
|
| 8 |
:html => {:method => @time_entry.new_record? ? :post : :put}) do |f| %>
|
|
| 9 |
<%= error_messages_for 'time_entry' %> |
|
| 10 |
<%= back_url_hidden_field_tag %> |
|
| 11 |
|
|
| 12 |
<div class="box"> |
|
| 13 |
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
|
|
| 14 |
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
|
|
| 15 |
<p><%= f.text_field :hours, :size => 6, :required => true %></p> |
|
| 16 |
<p><%= f.text_field :comments, :size => 100 %></p> |
|
| 17 |
<p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p> |
|
| 18 |
<% @time_entry.custom_field_values.each do |value| %> |
|
| 19 |
<p><%= custom_field_tag_with_label :time_entry, value %></p> |
|
| 20 |
<% end %> |
|
| 21 |
<%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %>
|
|
| 22 |
</div> |
|
| 23 |
|
|
| 24 |
<%= submit_tag l(:button_save) %> |
|
| 25 |
|
|
| 26 |
<% end %> |
|
| .svn/pristine/0e/0eacf75b8b3e6c5870bf462661ff3ac98d37c872.svn-base | ||
|---|---|---|
| 1 |
-*-text-*- |
|
| 2 |
$Id: AUTHORS,v 1.5 2003/10/08 12:22:24 peterlin Exp $ |
|
| 3 |
|
|
| 4 |
The free UCS scalable font collection is being maintained by Primo? |
|
| 5 |
Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si>. The folowing list |
|
| 6 |
cites the other contributors that contributed to particular ISO 10646 |
|
| 7 |
blocks. |
|
| 8 |
|
|
| 9 |
# URW++ Design & Development GmbH <http://www.urwpp.de/> |
|
| 10 |
|
|
| 11 |
Basic Latin (U+0041-U+007A) |
|
| 12 |
Latin-1 Supplement (U+00C0-U+00FF) (most) |
|
| 13 |
Latin Extended-A (U+0100-U+017F) |
|
| 14 |
Spacing Modifier Letters (U+02B0-U+02FF) |
|
| 15 |
Mathematical Operators (U+2200-U+22FF) (parts) |
|
| 16 |
Block Elements (U+2580-U+259F) |
|
| 17 |
Dingbats (U+2700-U+27BF) |
|
| 18 |
|
|
| 19 |
# Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John |
|
| 20 |
Plaice <plaice AT omega.cse.unsw.edu.au> |
|
| 21 |
|
|
| 22 |
Latin Extended-B (U+0180-U+024F) |
|
| 23 |
IPA Extensions (U+0250-U+02AF) |
|
| 24 |
Greek (U+0370-U+03FF) |
|
| 25 |
Armenian (U+0530-U+058F) |
|
| 26 |
Hebrew (U+0590-U+05FF) |
|
| 27 |
Arabic (U+0600-U+06FF) |
|
| 28 |
Currency Symbols (U+20A0-U+20CF) |
|
| 29 |
Arabic Presentation Forms-A (U+FB50-U+FDFF) |
|
| 30 |
Arabic Presentation Forms-B (U+FE70-U+FEFF) |
|
| 31 |
|
|
| 32 |
# Young U. Ryu <ryoung AT utdallas.edu> |
|
| 33 |
|
|
| 34 |
Arrows (U+2190-U+21FF) |
|
| 35 |
Mathematical Symbols (U+2200-U+22FF) |
|
| 36 |
|
|
| 37 |
# Valek Filippov <frob AT df.ru> |
|
| 38 |
|
|
| 39 |
Cyrillic (U+0400-U+04FF) |
|
| 40 |
|
|
| 41 |
# Wadalab Kanji Comittee |
|
| 42 |
|
|
| 43 |
Hiragana (U+3040-U+309F) |
|
| 44 |
Katakana (U+30A0-U+30FF) |
|
| 45 |
|
|
| 46 |
# Angelo Haritsis <ah AT computer.org> |
|
| 47 |
|
|
| 48 |
Greek (U+0370-U+03FF) |
|
| 49 |
|
|
| 50 |
# Yannis Haralambous and Virach Sornlertlamvanich |
|
| 51 |
|
|
| 52 |
Thai (U+0E00-U+0E7F) |
|
| 53 |
|
|
| 54 |
# Shaheed R. Haque <srhaque AT iee.org> |
|
| 55 |
|
|
| 56 |
Bengali (U+0980-U+09FF) |
|
| 57 |
|
|
| 58 |
# Sam Stepanyan <sam AT arminco.com> |
|
| 59 |
|
|
| 60 |
Armenian (U+0530-U+058F) |
|
| 61 |
|
|
| 62 |
# Mohamed Ishan <ishan AT mitf.f2s.com> |
|
| 63 |
|
|
| 64 |
Thaana (U+0780-U+07BF) |
|
| 65 |
|
|
| 66 |
# Sushant Kumar Dash <sushant AT writeme.com> |
|
| 67 |
|
|
| 68 |
Oriya (U+0B00-U+0B7F) |
|
| 69 |
|
|
| 70 |
# Harsh Kumar <harshkumar AT vsnl.com> |
|
| 71 |
|
|
| 72 |
Devanagari (U+0900-U+097F) |
|
| 73 |
Bengali (U+0980-U+09FF) |
|
| 74 |
Gurmukhi (U+0A00-U+0A7F) |
|
| 75 |
Gujarati (U+0A80-U+0AFF) |
|
| 76 |
|
|
| 77 |
# Prasad A. Chodavarapu <chprasad AT hotmail.com> |
|
| 78 |
|
|
| 79 |
Telugu (U+0C00-U+0C7F) |
|
| 80 |
|
|
| 81 |
# Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey |
|
| 82 |
<apandey AT u.washington.edu> |
|
| 83 |
|
|
| 84 |
Devanagari (U+0900-U+097F) |
|
| 85 |
|
|
| 86 |
# Hardip Singh Pannu <HSPannu AT aol.com> |
|
| 87 |
|
|
| 88 |
Gurmukhi (U+0A00-U+0A7F) |
|
| 89 |
|
|
| 90 |
# Jeroen Hellingman <jehe AT kabelfoon.nl> |
|
| 91 |
|
|
| 92 |
Oriya (U+0B00-U+0B7F) |
|
| 93 |
Malayalam (U+0D00-U+0D7F) |
|
| 94 |
|
|
| 95 |
# Thomas Ridgeway <email needed> |
|
| 96 |
|
|
| 97 |
Tamil (U+0B80-U+0BFF) |
|
| 98 |
|
|
| 99 |
# Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>, |
|
| 100 |
Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf |
|
| 101 |
Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger < |
|
| 102 |
|
|
| 103 |
Ethiopic (U+1200-U+137F) |
|
| 104 |
|
|
| 105 |
# Maxim Iorsh <iorsh AT users.sourceforge.net> |
|
| 106 |
|
|
| 107 |
Hebrew (U+0590-U+05FF) |
|
| 108 |
|
|
| 109 |
|
|
| 110 |
# Vyacheslav Dikonov <sdiconov AT mail.ru> |
|
| 111 |
|
|
| 112 |
Syriac (U+0700-U+074A) |
|
| 113 |
Braille (U+2800-U+28FF) |
|
| 114 |
|
|
| 115 |
# M.S. Sridhar <mssridhar AT vsnl.com> |
|
| 116 |
|
|
| 117 |
Devanagari (U+0900-U+097F) |
|
| 118 |
Bengali (U+0980-U+09FF) |
|
| 119 |
Gurmukhi (U+0A00-U+0A7F) |
|
| 120 |
Gujarati (U+0A80-U+0AFF) |
|
| 121 |
Oriya (U+0B00-U+0B7F) |
|
| 122 |
Tamil (U+0B80-U+0BFF) |
|
| 123 |
Telugu (U+0C00-U+0C7F) |
|
| 124 |
Kannada (U+0C80-U+0CFF) |
|
| 125 |
Malayalam (U+0D00-U+0D7F) |
|
| 126 |
|
|
| 127 |
# DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt |
|
| 128 |
<nlevitt AT columbia.edu> |
|
| 129 |
|
|
| 130 |
Sinhala (U+0D80-U+0DFF) |
|
| 131 |
|
|
| 132 |
# Dan Shurovich Chirkov <dansh AT chirkov.com> |
|
| 133 |
|
|
| 134 |
Cyrillic (U+0400-U+04FF) |
|
| 135 |
|
|
| 136 |
# Abbas Izad <abbasizad AT hotmail.com> |
|
| 137 |
|
|
| 138 |
Arabic (U+0600-U+06FF) |
|
| 139 |
Arabic Presentation Forms-A (U+FB50-U+FDFF) |
|
| 140 |
Arabic Presentation Forms-B (U+FE70-U+FEFF) |
|
| 141 |
|
|
| 142 |
Please see the CREDITS file for details on who contributed particular |
|
| 143 |
subsets of the glyphs in font files. |
|
| .svn/pristine/0e/0eb7cc8a4d0dacf34d7ebb20ac1b776d16812b39.svn-base | ||
|---|---|---|
| 1 |
!00 U+0000 .notdef |
|
| 2 |
!01 U+0001 .notdef |
|
| 3 |
!02 U+0002 .notdef |
|
| 4 |
!03 U+0003 .notdef |
|
| 5 |
!04 U+0004 .notdef |
|
| 6 |
!05 U+0005 .notdef |
|
| 7 |
!06 U+0006 .notdef |
|
| 8 |
!07 U+0007 .notdef |
|
| 9 |
!08 U+0008 .notdef |
|
| 10 |
!09 U+0009 .notdef |
|
| 11 |
!0A U+000A .notdef |
|
| 12 |
!0B U+000B .notdef |
|
| 13 |
!0C U+000C .notdef |
|
| 14 |
!0D U+000D .notdef |
|
| 15 |
!0E U+000E .notdef |
|
| 16 |
!0F U+000F .notdef |
|
| 17 |
!10 U+0010 .notdef |
|
| 18 |
!11 U+0011 .notdef |
|
| 19 |
!12 U+0012 .notdef |
|
| 20 |
!13 U+0013 .notdef |
|
| 21 |
!14 U+0014 .notdef |
|
| 22 |
!15 U+0015 .notdef |
|
| 23 |
!16 U+0016 .notdef |
|
| 24 |
!17 U+0017 .notdef |
|
| 25 |
!18 U+0018 .notdef |
|
| 26 |
!19 U+0019 .notdef |
|
| 27 |
!1A U+001A .notdef |
|
| 28 |
!1B U+001B .notdef |
|
| 29 |
!1C U+001C .notdef |
|
| 30 |
!1D U+001D .notdef |
|
| 31 |
!1E U+001E .notdef |
|
| 32 |
!1F U+001F .notdef |
|
| 33 |
!20 U+0020 space |
|
| 34 |
!21 U+0021 exclam |
|
| 35 |
!22 U+0022 quotedbl |
|
| 36 |
!23 U+0023 numbersign |
|
| 37 |
!24 U+0024 dollar |
|
| 38 |
!25 U+0025 percent |
|
| 39 |
!26 U+0026 ampersand |
|
| 40 |
!27 U+0027 quotesingle |
|
| 41 |
!28 U+0028 parenleft |
|
| 42 |
!29 U+0029 parenright |
|
| 43 |
!2A U+002A asterisk |
|
| 44 |
!2B U+002B plus |
|
| 45 |
!2C U+002C comma |
|
| 46 |
!2D U+002D hyphen |
|
| 47 |
!2E U+002E period |
|
| 48 |
!2F U+002F slash |
|
| 49 |
!30 U+0030 zero |
|
| 50 |
!31 U+0031 one |
|
| 51 |
!32 U+0032 two |
|
| 52 |
!33 U+0033 three |
|
| 53 |
!34 U+0034 four |
|
| 54 |
!35 U+0035 five |
|
| 55 |
!36 U+0036 six |
|
| 56 |
!37 U+0037 seven |
|
| 57 |
!38 U+0038 eight |
|
| 58 |
!39 U+0039 nine |
|
| 59 |
!3A U+003A colon |
|
| 60 |
!3B U+003B semicolon |
|
| 61 |
!3C U+003C less |
|
| 62 |
!3D U+003D equal |
|
| 63 |
!3E U+003E greater |
|
| 64 |
!3F U+003F question |
|
| 65 |
!40 U+0040 at |
|
| 66 |
!41 U+0041 A |
|
| 67 |
!42 U+0042 B |
|
| 68 |
!43 U+0043 C |
|
| 69 |
!44 U+0044 D |
|
| 70 |
!45 U+0045 E |
|
| 71 |
!46 U+0046 F |
|
| 72 |
!47 U+0047 G |
|
| 73 |
!48 U+0048 H |
|
| 74 |
!49 U+0049 I |
|
| 75 |
!4A U+004A J |
|
| 76 |
!4B U+004B K |
|
| 77 |
!4C U+004C L |
|
| 78 |
!4D U+004D M |
|
| 79 |
!4E U+004E N |
|
| 80 |
!4F U+004F O |
|
| 81 |
!50 U+0050 P |
|
| 82 |
!51 U+0051 Q |
|
| 83 |
!52 U+0052 R |
|
| 84 |
!53 U+0053 S |
|
| 85 |
!54 U+0054 T |
|
| 86 |
!55 U+0055 U |
|
| 87 |
!56 U+0056 V |
|
| 88 |
!57 U+0057 W |
|
| 89 |
!58 U+0058 X |
|
| 90 |
!59 U+0059 Y |
|
| 91 |
!5A U+005A Z |
|
| 92 |
!5B U+005B bracketleft |
|
| 93 |
!5C U+005C backslash |
|
| 94 |
!5D U+005D bracketright |
|
| 95 |
!5E U+005E asciicircum |
|
| 96 |
!5F U+005F underscore |
|
| 97 |
!60 U+0060 grave |
|
| 98 |
!61 U+0061 a |
|
| 99 |
!62 U+0062 b |
|
| 100 |
!63 U+0063 c |
|
| 101 |
!64 U+0064 d |
|
| 102 |
!65 U+0065 e |
|
| 103 |
!66 U+0066 f |
|
| 104 |
!67 U+0067 g |
|
| 105 |
!68 U+0068 h |
|
| 106 |
!69 U+0069 i |
|
| 107 |
!6A U+006A j |
|
| 108 |
!6B U+006B k |
|
| 109 |
!6C U+006C l |
|
| 110 |
!6D U+006D m |
|
| 111 |
!6E U+006E n |
|
| 112 |
!6F U+006F o |
|
| 113 |
!70 U+0070 p |
|
| 114 |
!71 U+0071 q |
|
| 115 |
!72 U+0072 r |
|
| 116 |
!73 U+0073 s |
|
| 117 |
!74 U+0074 t |
|
| 118 |
!75 U+0075 u |
|
| 119 |
!76 U+0076 v |
|
| 120 |
!77 U+0077 w |
|
| 121 |
!78 U+0078 x |
|
| 122 |
!79 U+0079 y |
|
| 123 |
!7A U+007A z |
|
| 124 |
!7B U+007B braceleft |
|
| 125 |
!7C U+007C bar |
|
| 126 |
!7D U+007D braceright |
|
| 127 |
!7E U+007E asciitilde |
|
| 128 |
!7F U+007F .notdef |
|
| 129 |
!80 U+20AC Euro |
|
| 130 |
!85 U+2026 ellipsis |
|
| 131 |
!91 U+2018 quoteleft |
|
| 132 |
!92 U+2019 quoteright |
|
| 133 |
!93 U+201C quotedblleft |
|
| 134 |
!94 U+201D quotedblright |
|
| 135 |
!95 U+2022 bullet |
|
| 136 |
!96 U+2013 endash |
|
| 137 |
!97 U+2014 emdash |
|
| 138 |
!A0 U+00A0 space |
|
| 139 |
!A1 U+0E01 kokaithai |
|
| 140 |
!A2 U+0E02 khokhaithai |
|
| 141 |
!A3 U+0E03 khokhuatthai |
|
| 142 |
!A4 U+0E04 khokhwaithai |
|
| 143 |
!A5 U+0E05 khokhonthai |
|
| 144 |
!A6 U+0E06 khorakhangthai |
|
| 145 |
!A7 U+0E07 ngonguthai |
|
| 146 |
!A8 U+0E08 chochanthai |
|
| 147 |
!A9 U+0E09 chochingthai |
|
| 148 |
!AA U+0E0A chochangthai |
|
| 149 |
!AB U+0E0B sosothai |
|
| 150 |
!AC U+0E0C chochoethai |
|
| 151 |
!AD U+0E0D yoyingthai |
|
| 152 |
!AE U+0E0E dochadathai |
|
| 153 |
!AF U+0E0F topatakthai |
|
| 154 |
!B0 U+0E10 thothanthai |
|
| 155 |
!B1 U+0E11 thonangmonthothai |
|
| 156 |
!B2 U+0E12 thophuthaothai |
|
| 157 |
!B3 U+0E13 nonenthai |
|
| 158 |
!B4 U+0E14 dodekthai |
|
| 159 |
!B5 U+0E15 totaothai |
|
| 160 |
!B6 U+0E16 thothungthai |
|
| 161 |
!B7 U+0E17 thothahanthai |
|
| 162 |
!B8 U+0E18 thothongthai |
|
| 163 |
!B9 U+0E19 nonuthai |
|
| 164 |
!BA U+0E1A bobaimaithai |
|
| 165 |
!BB U+0E1B poplathai |
|
| 166 |
!BC U+0E1C phophungthai |
|
| 167 |
!BD U+0E1D fofathai |
|
| 168 |
!BE U+0E1E phophanthai |
|
| 169 |
!BF U+0E1F fofanthai |
|
| 170 |
!C0 U+0E20 phosamphaothai |
|
| 171 |
!C1 U+0E21 momathai |
|
| 172 |
!C2 U+0E22 yoyakthai |
|
| 173 |
!C3 U+0E23 roruathai |
|
| 174 |
!C4 U+0E24 ruthai |
|
| 175 |
!C5 U+0E25 lolingthai |
|
| 176 |
!C6 U+0E26 luthai |
|
| 177 |
!C7 U+0E27 wowaenthai |
|
| 178 |
!C8 U+0E28 sosalathai |
|
| 179 |
!C9 U+0E29 sorusithai |
|
| 180 |
!CA U+0E2A sosuathai |
|
| 181 |
!CB U+0E2B hohipthai |
|
| 182 |
!CC U+0E2C lochulathai |
|
| 183 |
!CD U+0E2D oangthai |
|
| 184 |
!CE U+0E2E honokhukthai |
|
| 185 |
!CF U+0E2F paiyannoithai |
|
| 186 |
!D0 U+0E30 saraathai |
|
| 187 |
!D1 U+0E31 maihanakatthai |
|
| 188 |
!D2 U+0E32 saraaathai |
|
| 189 |
!D3 U+0E33 saraamthai |
|
| 190 |
!D4 U+0E34 saraithai |
|
| 191 |
!D5 U+0E35 saraiithai |
|
| 192 |
!D6 U+0E36 sarauethai |
|
| 193 |
!D7 U+0E37 saraueethai |
|
| 194 |
!D8 U+0E38 sarauthai |
|
| 195 |
!D9 U+0E39 sarauuthai |
|
| 196 |
!DA U+0E3A phinthuthai |
|
| 197 |
!DF U+0E3F bahtthai |
|
| 198 |
!E0 U+0E40 saraethai |
|
| 199 |
!E1 U+0E41 saraaethai |
|
| 200 |
!E2 U+0E42 saraothai |
|
| 201 |
!E3 U+0E43 saraaimaimuanthai |
|
| 202 |
!E4 U+0E44 saraaimaimalaithai |
|
| 203 |
!E5 U+0E45 lakkhangyaothai |
|
| 204 |
!E6 U+0E46 maiyamokthai |
|
| 205 |
!E7 U+0E47 maitaikhuthai |
|
| 206 |
!E8 U+0E48 maiekthai |
|
| 207 |
!E9 U+0E49 maithothai |
|
| 208 |
!EA U+0E4A maitrithai |
|
| 209 |
!EB U+0E4B maichattawathai |
|
| 210 |
!EC U+0E4C thanthakhatthai |
|
| 211 |
!ED U+0E4D nikhahitthai |
|
| 212 |
!EE U+0E4E yamakkanthai |
|
| 213 |
!EF U+0E4F fongmanthai |
|
| 214 |
!F0 U+0E50 zerothai |
|
| 215 |
!F1 U+0E51 onethai |
|
| 216 |
!F2 U+0E52 twothai |
|
| 217 |
!F3 U+0E53 threethai |
|
| 218 |
!F4 U+0E54 fourthai |
|
| 219 |
!F5 U+0E55 fivethai |
|
| 220 |
!F6 U+0E56 sixthai |
|
| 221 |
!F7 U+0E57 seventhai |
|
| 222 |
!F8 U+0E58 eightthai |
|
| 223 |
!F9 U+0E59 ninethai |
|
| 224 |
!FA U+0E5A angkhankhuthai |
|
| 225 |
!FB U+0E5B khomutthai |
|
| .svn/pristine/0e/0ee15adcf36536c48b6695748041d2c5e43cb26a.svn-base | ||
|---|---|---|
| 1 |
module CodeRay |
|
| 2 |
module Scanners |
|
| 3 |
|
|
| 4 |
load :java |
|
| 5 |
|
|
| 6 |
# Scanner for Groovy. |
|
| 7 |
class Groovy < Java |
|
| 8 |
|
|
| 9 |
register_for :groovy |
|
| 10 |
|
|
| 11 |
# TODO: check list of keywords |
|
| 12 |
GROOVY_KEYWORDS = %w[ |
|
| 13 |
as assert def in |
|
| 14 |
] # :nodoc: |
|
| 15 |
KEYWORDS_EXPECTING_VALUE = WordList.new.add %w[ |
|
| 16 |
case instanceof new return throw typeof while as assert in |
|
| 17 |
] # :nodoc: |
|
| 18 |
GROOVY_MAGIC_VARIABLES = %w[ it ] # :nodoc: |
|
| 19 |
|
|
| 20 |
IDENT_KIND = Java::IDENT_KIND.dup. |
|
| 21 |
add(GROOVY_KEYWORDS, :keyword). |
|
| 22 |
add(GROOVY_MAGIC_VARIABLES, :local_variable) # :nodoc: |
|
| 23 |
|
|
| 24 |
ESCAPE = / [bfnrtv$\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
|
|
| 25 |
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x # :nodoc: no 4-byte unicode chars? U[a-fA-F0-9]{8}
|
|
| 26 |
REGEXP_ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} | \d | [bBdDsSwW\/] /x # :nodoc:
|
|
| 27 |
|
|
| 28 |
# TODO: interpretation inside ', ", / |
|
| 29 |
STRING_CONTENT_PATTERN = {
|
|
| 30 |
"'" => /(?>\\[^\\'\n]+|[^\\'\n]+)+/, |
|
| 31 |
'"' => /[^\\$"\n]+/, |
|
| 32 |
"'''" => /(?>[^\\']+|'(?!''))+/, |
|
| 33 |
'"""' => /(?>[^\\$"]+|"(?!""))+/, |
|
| 34 |
'/' => /[^\\$\/\n]+/, |
|
| 35 |
} # :nodoc: |
|
| 36 |
|
|
| 37 |
protected |
|
| 38 |
|
|
| 39 |
def scan_tokens encoder, options |
|
| 40 |
|
|
| 41 |
state = :initial |
|
| 42 |
inline_block_stack = [] |
|
| 43 |
inline_block_paren_depth = nil |
|
| 44 |
string_delimiter = nil |
|
| 45 |
import_clause = class_name_follows = last_token = after_def = false |
|
| 46 |
value_expected = true |
|
| 47 |
|
|
| 48 |
until eos? |
|
| 49 |
|
|
| 50 |
case state |
|
| 51 |
|
|
| 52 |
when :initial |
|
| 53 |
|
|
| 54 |
if match = scan(/ \s+ | \\\n /x) |
|
| 55 |
encoder.text_token match, :space |
|
| 56 |
if match.index ?\n |
|
| 57 |
import_clause = after_def = false |
|
| 58 |
value_expected = true unless value_expected |
|
| 59 |
end |
|
| 60 |
next |
|
| 61 |
|
|
| 62 |
elsif match = scan(%r! // [^\n\\]* (?: \\. [^\n\\]* )* | /\* (?: .*? \*/ | .* ) !mx) |
|
| 63 |
value_expected = true |
|
| 64 |
after_def = false |
|
| 65 |
encoder.text_token match, :comment |
|
| 66 |
|
|
| 67 |
elsif bol? && match = scan(/ \#!.* /x) |
|
| 68 |
encoder.text_token match, :doctype |
|
| 69 |
|
|
| 70 |
elsif import_clause && match = scan(/ (?!as) #{IDENT} (?: \. #{IDENT} )* (?: \.\* )? /ox)
|
|
| 71 |
after_def = value_expected = false |
|
| 72 |
encoder.text_token match, :include |
|
| 73 |
|
|
| 74 |
elsif match = scan(/ #{IDENT} | \[\] /ox)
|
|
| 75 |
kind = IDENT_KIND[match] |
|
| 76 |
value_expected = (kind == :keyword) && KEYWORDS_EXPECTING_VALUE[match] |
|
| 77 |
if last_token == '.' |
|
| 78 |
kind = :ident |
|
| 79 |
elsif class_name_follows |
|
| 80 |
kind = :class |
|
| 81 |
class_name_follows = false |
|
| 82 |
elsif after_def && check(/\s*[({]/)
|
|
| 83 |
kind = :method |
|
| 84 |
after_def = false |
|
| 85 |
elsif kind == :ident && last_token != '?' && check(/:/) |
|
| 86 |
kind = :key |
|
| 87 |
else |
|
| 88 |
class_name_follows = true if match == 'class' || (import_clause && match == 'as') |
|
| 89 |
import_clause = match == 'import' |
|
| 90 |
after_def = true if match == 'def' |
|
| 91 |
end |
|
| 92 |
encoder.text_token match, kind |
|
| 93 |
|
|
| 94 |
elsif match = scan(/;/) |
|
| 95 |
import_clause = after_def = false |
|
| 96 |
value_expected = true |
|
| 97 |
encoder.text_token match, :operator |
|
| 98 |
|
|
| 99 |
elsif match = scan(/\{/)
|
|
| 100 |
class_name_follows = after_def = false |
|
| 101 |
value_expected = true |
|
| 102 |
encoder.text_token match, :operator |
|
| 103 |
if !inline_block_stack.empty? |
|
| 104 |
inline_block_paren_depth += 1 |
|
| 105 |
end |
|
| 106 |
|
|
| 107 |
# TODO: ~'...', ~"..." and ~/.../ style regexps |
|
| 108 |
elsif match = scan(/ \.\.<? | \*?\.(?!\d)@? | \.& | \?:? | [,?:(\[] | -[->] | \+\+ | |
|
| 109 |
&& | \|\| | \*\*=? | ==?~ | <=?>? | [-+*%^~&|>=!]=? | <<<?=? | >>>?=? /x) |
|
| 110 |
value_expected = true |
|
| 111 |
value_expected = :regexp if match == '~' |
|
| 112 |
after_def = false |
|
| 113 |
encoder.text_token match, :operator |
|
| 114 |
|
|
| 115 |
elsif match = scan(/ [)\]}] /x) |
|
| 116 |
value_expected = after_def = false |
|
| 117 |
if !inline_block_stack.empty? && match == '}' |
|
| 118 |
inline_block_paren_depth -= 1 |
|
| 119 |
if inline_block_paren_depth == 0 # closing brace of inline block reached |
|
| 120 |
encoder.text_token match, :inline_delimiter |
|
| 121 |
encoder.end_group :inline |
|
| 122 |
state, string_delimiter, inline_block_paren_depth = inline_block_stack.pop |
|
| 123 |
next |
|
| 124 |
end |
|
| 125 |
end |
|
| 126 |
encoder.text_token match, :operator |
|
| 127 |
|
|
| 128 |
elsif check(/[\d.]/) |
|
| 129 |
after_def = value_expected = false |
|
| 130 |
if match = scan(/0[xX][0-9A-Fa-f]+/) |
|
| 131 |
encoder.text_token match, :hex |
|
| 132 |
elsif match = scan(/(?>0[0-7]+)(?![89.eEfF])/) |
|
| 133 |
encoder.text_token match, :octal |
|
| 134 |
elsif match = scan(/\d+[fFdD]|\d*\.\d+(?:[eE][+-]?\d+)?[fFdD]?|\d+[eE][+-]?\d+[fFdD]?/) |
|
| 135 |
encoder.text_token match, :float |
|
| 136 |
elsif match = scan(/\d+[lLgG]?/) |
|
| 137 |
encoder.text_token match, :integer |
|
| 138 |
end |
|
| 139 |
|
|
| 140 |
elsif match = scan(/'''|"""/) |
|
| 141 |
after_def = value_expected = false |
|
| 142 |
state = :multiline_string |
|
| 143 |
encoder.begin_group :string |
|
| 144 |
string_delimiter = match |
|
| 145 |
encoder.text_token match, :delimiter |
|
| 146 |
|
|
| 147 |
# TODO: record.'name' syntax |
|
| 148 |
elsif match = scan(/["']/) |
|
| 149 |
after_def = value_expected = false |
|
| 150 |
state = match == '/' ? :regexp : :string |
|
| 151 |
encoder.begin_group state |
|
| 152 |
string_delimiter = match |
|
| 153 |
encoder.text_token match, :delimiter |
|
| 154 |
|
|
| 155 |
elsif value_expected && match = scan(/\//) |
|
| 156 |
after_def = value_expected = false |
|
| 157 |
encoder.begin_group :regexp |
|
| 158 |
state = :regexp |
|
| 159 |
string_delimiter = '/' |
|
| 160 |
encoder.text_token match, :delimiter |
|
| 161 |
|
|
| 162 |
elsif match = scan(/ @ #{IDENT} /ox)
|
|
| 163 |
after_def = value_expected = false |
|
| 164 |
encoder.text_token match, :annotation |
|
| 165 |
|
|
| 166 |
elsif match = scan(/\//) |
|
| 167 |
after_def = false |
|
| 168 |
value_expected = true |
|
| 169 |
encoder.text_token match, :operator |
|
| 170 |
|
|
| 171 |
else |
|
| 172 |
encoder.text_token getch, :error |
|
| 173 |
|
|
| 174 |
end |
|
| 175 |
|
|
| 176 |
when :string, :regexp, :multiline_string |
|
| 177 |
if match = scan(STRING_CONTENT_PATTERN[string_delimiter]) |
|
| 178 |
encoder.text_token match, :content |
|
| 179 |
|
|
| 180 |
elsif match = scan(state == :multiline_string ? /'''|"""/ : /["'\/]/) |
|
| 181 |
encoder.text_token match, :delimiter |
|
| 182 |
if state == :regexp |
|
| 183 |
# TODO: regexp modifiers? s, m, x, i? |
|
| 184 |
modifiers = scan(/[ix]+/) |
|
| 185 |
encoder.text_token modifiers, :modifier if modifiers && !modifiers.empty? |
|
| 186 |
end |
|
| 187 |
state = :string if state == :multiline_string |
|
| 188 |
encoder.end_group state |
|
| 189 |
string_delimiter = nil |
|
| 190 |
after_def = value_expected = false |
|
| 191 |
state = :initial |
|
| 192 |
next |
|
| 193 |
|
|
| 194 |
elsif (state == :string || state == :multiline_string) && |
|
| 195 |
(match = scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox))
|
|
| 196 |
if string_delimiter[0] == ?' && !(match == "\\\\" || match == "\\'") |
|
| 197 |
encoder.text_token match, :content |
|
| 198 |
else |
|
| 199 |
encoder.text_token match, :char |
|
| 200 |
end |
|
| 201 |
elsif state == :regexp && match = scan(/ \\ (?: #{REGEXP_ESCAPE} | #{UNICODE_ESCAPE} ) /mox)
|
|
| 202 |
encoder.text_token match, :char |
|
| 203 |
|
|
| 204 |
elsif match = scan(/ \$ #{IDENT} /mox)
|
|
| 205 |
encoder.begin_group :inline |
|
| 206 |
encoder.text_token '$', :inline_delimiter |
|
| 207 |
match = match[1..-1] |
|
| 208 |
encoder.text_token match, IDENT_KIND[match] |
|
| 209 |
encoder.end_group :inline |
|
| 210 |
next |
|
| 211 |
elsif match = scan(/ \$ \{ /x)
|
|
| 212 |
encoder.begin_group :inline |
|
| 213 |
encoder.text_token match, :inline_delimiter |
|
| 214 |
inline_block_stack << [state, string_delimiter, inline_block_paren_depth] |
|
| 215 |
inline_block_paren_depth = 1 |
|
| 216 |
state = :initial |
|
| 217 |
next |
|
| 218 |
|
|
| 219 |
elsif match = scan(/ \$ /mx) |
|
| 220 |
encoder.text_token match, :content |
|
| 221 |
|
|
| 222 |
elsif match = scan(/ \\. /mx) |
|
| 223 |
encoder.text_token match, :content # TODO: Shouldn't this be :error? |
|
| 224 |
|
|
| 225 |
elsif match = scan(/ \\ | \n /x) |
|
| 226 |
encoder.end_group state |
|
| 227 |
encoder.text_token match, :error |
|
| 228 |
after_def = value_expected = false |
|
| 229 |
state = :initial |
|
| 230 |
|
|
| 231 |
else |
|
| 232 |
raise_inspect "else case \" reached; %p not handled." % peek(1), encoder |
|
| 233 |
|
|
| 234 |
end |
|
| 235 |
|
|
| 236 |
else |
|
| 237 |
raise_inspect 'Unknown state', encoder |
|
| 238 |
|
|
| 239 |
end |
|
| 240 |
|
|
| 241 |
last_token = match unless [:space, :comment, :doctype].include? kind |
|
| 242 |
|
|
| 243 |
end |
|
| 244 |
|
|
| 245 |
if [:multiline_string, :string, :regexp].include? state |
|
| 246 |
encoder.end_group state |
|
| 247 |
end |
|
| 248 |
|
|
| 249 |
encoder |
|
| 250 |
end |
|
| 251 |
|
|
| 252 |
end |
|
| 253 |
|
|
| 254 |
end |
|
| 255 |
end |
|
| .svn/pristine/0e/0ee222eff2b16f026f0f817fdf32372447c6e7e8.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2011 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
require File.expand_path('../../test_helper', __FILE__)
|
|
| 19 |
|
|
| 20 |
class ProjectsTest < ActionController::IntegrationTest |
|
| 21 |
fixtures :projects, :users, :members |
|
| 22 |
|
|
| 23 |
def test_archive_project |
|
| 24 |
subproject = Project.find(1).children.first |
|
| 25 |
log_user("admin", "admin")
|
|
| 26 |
get "admin/projects" |
|
| 27 |
assert_response :success |
|
| 28 |
assert_template "admin/projects" |
|
| 29 |
post "projects/archive", :id => 1 |
|
| 30 |
assert_redirected_to "/admin/projects" |
|
| 31 |
assert !Project.find(1).active? |
|
| 32 |
|
|
| 33 |
get 'projects/1' |
|
| 34 |
assert_response 403 |
|
| 35 |
get "projects/#{subproject.id}"
|
|
| 36 |
assert_response 403 |
|
| 37 |
|
|
| 38 |
post "projects/unarchive", :id => 1 |
|
| 39 |
assert_redirected_to "/admin/projects" |
|
| 40 |
assert Project.find(1).active? |
|
| 41 |
get "projects/1" |
|
| 42 |
assert_response :success |
|
| 43 |
end |
|
| 44 |
end |
|
Also available in: Unified diff