'require' problem with RBS
-
Sketchup::require is needed for .rbs files as stated in documentation
you need a direct path for the icons, use find_support_file(s). also use File.join to add the icons names (I had some troubles using concatenation on Mac)
-
Also long lines does not work in .rbs but does in .rb (like a large comment in same line).
-
@juantxo said:
Also long lines does not work in .rbs but does in .rb (like a large comment in same line).
Example?
-
Possible problems:
1) You String delimeter is
"
You may want to use
%[]
(same as%Q[]
,) which is a double-quoted string ...
... or%q[]
which is a single-quoted String.You can use any delimeters you wish when using the
%
syntax... such as[
...]
,{
...}
,(
...)
, and then you do not need to escape nested"
(double quote characters.)
2) You are embedding
**\r \n \t**
characters in an HTML string .... I think the browser will have problems with this, as Ruby will evaluate the double-quoted string and replace them.I think you need to replace these with HTML friendly & codes:
see: [ISO Latin-1 Character Set](http://msdn.microsoft.com/en-us/library/aa752007(v)
and: [Additional Named Entities for HTML](http://msdn.microsoft.com/en-us/library/aa752008(v)
and: [Character Entities for Special Symbols](http://msdn.microsoft.com/en-us/library/ms537499(v)Assign your HTML string to a reference:
**html = %q[** ... *the string here* ... **]**
then:
html.gsub!('\n',' ')
html.gsub!('\r',' ')
[ruby:1xwj7b05]html.gsub!('\t',' ')[/ruby:1xwj7b05]
3) There may be a length limit to the string passed to [ruby:1xwj7b05]eval()[/ruby:1xwj7b05]
-
Example of huge lines in .rb file not working in .rbs. All comment is in the same line.
puts('Hola caracola') #"<TABLE width=\"100%\" border=0>\r\n<TBODY>\r\n<TR>\r\n<TD align=left>\r\n<P class=title>Performance of Grid-connected PV <BR></P>\r\n<P><FONT color=#00ed00>NOTE; before using these calculations for anything serious, you should read </FONT><A href=\"javascript:window.open('PVcalchelp_' + 'en' + '.html','help','height=600,width=600,toolbar=no,scrollbars=yes,resizable'); void 0;\"><FONT color=blue>[this]</FONT></A> </P>\r\n<P class=subtitle align=left>PVGIS estimates of solar electricity generation </P>Location; 46°11'54\" North, 6°8'32\" East, Elevation; 382 m a.s.l.,<BR><BR></TD></TR>\r\n<TR>\r\n<TD align=left><BR>Solar radiation database used; PVGIS-classic <BR><BR>Nominal power of the PV system; 14.5 kW (crystalline silicon)<BR>Estimated losses due to temperature; 7.8% (using local ambient temperature)<BR>Estimated loss due to angular reflectance effects; 3.4%<BR>Other losses (cables, inverter etc.); 14.0%<BR>Combined PV system losses; 23.4% </TD></TR>\r\n<TR>\r\n<TD align=left><BR></TD></TR>\r\n<TR>\r\n<TD align=left>\r\n<TABLE class=data_table width=300 border=1>\r\n<TBODY>\r\n<TR>\r\n<TD colSpan=5><B>Fixed system; inclination=12°, orientation=12° </B></TD></TR>\r\n<TR>\r\n<TH align=left>Month</TH>\r\n<TH width=40><SPAN class=formula>E</SPAN><SUB>d</SUB> </TH>\r\n<TH width=40><SPAN class=formula>E</SPAN><SUB>m</SUB> </TH>\r\n<TH width=40><SPAN class=formula>H</SPAN><SUB>d</SUB></TH>\r\n<TH width=40><SPAN class=formula>H</SPAN><SUB>m</SUB> </TH></TR>\r\n<TR>\r\n<TD>Jan </TD>\r\n<TD align=right>15.60</TD>\r\n<TD align=right>484</TD>\r\n<TD align=right>1.31</TD>\r\n<TD align=right>40.7</TD></TR>\r\n<TR>\r\n<TD>Feb </TD>\r\n<TD align=right>24.40</TD>\r\n<TD align=right>683</TD>\r\n<TD align=right>2.05</TD>\r\n<TD align=right>57.5</TD></TR>\r\n<TR>\r\n<TD>Mar </TD>\r\n<TD align=right>40.60</TD>\r\n<TD align=right>1260</TD>\r\n<TD align=right>3.51</TD>\r\n<TD align=right>109</TD></TR>\r\n<TR>\r\n<TD>Apr </TD>\r\n<TD align=right>50.90</TD>\r\n<TD align=right>1530</TD>\r\n<TD align=right>4.51</TD>\r\n<TD align=right>135</TD></TR>\r\n<TR>\r\n<TD>May </TD>\r\n<TD align=right>55.30</TD>\r\n<TD align=right>1710</TD>\r\n<TD align=right>5.05</TD>\r\n<TD align=right>157</TD></TR>\r\n<TR>\r\n<TD>Jun </TD>\r\n<TD align=right>61.80</TD>\r\n<TD align=right>1850</TD>\r\n<TD align=right>5.76</TD>\r\n<TD align=right>173</TD></TR>\r\n<TR>\r\n<TD>Jul </TD>\r\n<TD align=right>65.80</TD>\r\n<TD align=right>2040</TD>\r\n<TD align=right>6.16</TD>\r\n<TD align=right>191</TD></TR>\r\n<TR>\r\n<TD>Aug </TD>\r\n<TD align=right>58.90</TD>\r\n<TD align=right>1830</TD>\r\n<TD align=right>5.49</TD>\r\n<TD align=right>170</TD></TR>\r\n<TR>\r\n<TD>Sep </TD>\r\n<TD align=right>46.80</TD>\r\n<TD align=right>1400</TD>\r\n<TD align=right>4.22</TD>\r\n<TD align=right>127</TD></TR>\r\n<TR>\r\n<TD>Oct </TD>\r\n<TD align=right>30.00</TD>\r\n<TD align=right>931</TD>\r\n<TD align=right>2.64</TD>\r\n<TD align=right>81.9</TD></TR>\r\n<TR>\r\n<TD>Nov </TD>\r\n<TD align=right>18.20</TD>\r\n<TD align=right>546</TD>\r\n<TD align=right>1.56</TD>\r\n<TD align=right>46.8</TD></TR>\r\n<TR>\r\n<TD>Dec </TD>\r\n<TD align=right>13.20</TD>\r\n<TD align=right>410</TD>\r\n<TD align=right>1.12</TD>\r\n<TD align=right>34.7</TD></TR>\r\n<TR>\r\n<TD colSpan=5></TD></TR>\r\n<TR>\r\n<TD><B>Yearly average </B></TD>\r\n<TD align=right><B>40.2 </B></TD>\r\n<TD align=right><B>1220 </B></TD></TD>\r\n<TD align=right><B>3.62 </B></TD>\r\n<TD align=right><B>110 </B></TD></TR>\r\n<TR>\r\n<TD><B>Total for year</B></TD>\r\n<TD align=right colSpan=2><B>14700 </B></TD>\r\n<TD align=right colSpan=2><B>1320 </B></TD></TR></TBODY></TABLE></TD></TR>\r\n<TR>\r\n<TD><BR></TD></TR>\r\n<TR>\r\n<TD>\r\n<P><SPAN class=formula>E</SPAN><SUB>d</SUB>; Average daily electricity production from the given system (kWh)<BR><SPAN class=formula>E</SPAN><SUB>m</SUB>; Average monthly electricity production from the given system (kWh)<BR><SPAN class=formula>H</SPAN><SUB>d</SUB>; Average daily sum of global irradiation per square meter received by the modules of the given system (kWh/m<SUP>2</SUP>)<BR><SPAN class=formula>H</SPAN><SUB>m</SUB>; Average sum of global irradiation per square meter received by the modules of the given system (kWh/m<SUP>2</SUP>)<BR></P></TD></TD>\r\n<TR>\r\n<TD>\r\n<TR>\r\n<TD><BR>\r\n<P>PVGIS © European Communities, 2001-2010<BR>Reproduction is authorised, provided the source is acknowledged<BR>See the disclaimer <A href=\"http://europa.eu/geninfo/legal_notices_en.htm\" target=legal>here </A></P></TD></TR></TBODY></TABLE>\r\n<SCRIPT language=JavaScript>\r\n\t\topener.window.setAngles(12,12,1,1);\r\n\t</SCRIPT>\r\nwindow.focus(); </SCRIPT>"
-
Sorry, this example is more clear. Length is the problem.
puts('Hola caracola') #aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
@juantxo said:
Sorry, this example is more clear. Length is the problem.
So... what happens if you wrap the very long string inside
` =begin
=end`
like:
puts('Hola caracola') =begin aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =end
-
Another thing you can do to make your life easier.. is to use a HERE DOCUMENT block:
See: The Ruby Language > The Basic Types > Stringsmywebpage = <<HTML This is a DOUBLE quoted string document. Sum = #{a + 1} HTML
mywebpage = <<-"HTML" This is a DOUBLE quoted string document. The above used #{a + 1} HTML
mywebpage = <<-'HTML' This is a SINGLE quoted string document. The above used #{a + 1} HTML
Myself I use:
mystring = %q{ .. a bunch of, ... lines of text }
-
By the way.. in the first example... http://forums.sketchucation.com/viewtopic.php?f=180&t=18903&p=386932#p386841
The first and last
**"**
are not escaped ..... if Google's code that passes it to
eval()
uses literal**"**
characters .. that might cause problems. (guessing here.)
I tried passing your long comments to
eval()
in the console, but got no error. -
@dan rathbun said:
So... what happens if you wrap the very long string inside
=begin
=end
The same, .rbs fails.
Thank you Dan for your advice.
Really I don't look for a solution.
I only want to advert others about this. It's difficult to debug this error.
Yesterday I scrambled the code but it didn't work. It was difficult to find out why. After a long time I discovered that by mistake I put a comment too long in same line and that was the reason.
Advertisement