<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="de-DE" xmlns="http://www.w3.org/2005/Atom">
  <title>Thomas Baustert - Home</title>
  <id>tag:www.thomasbaustert.de,2010:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://www.thomasbaustert.de/blog/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.thomasbaustert.de/blog/" rel="alternate" type="text/html"/>
  <updated>2010-02-22T13:20:16Z</updated>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2010-02-22:103</id>
    <published>2010-02-22T13:19:00Z</published>
    <updated>2010-02-22T13:20:16Z</updated>
    <category term="buch"/>
    <category term="publikationen"/>
    <category term="rails"/>
    <link href="http://www.thomasbaustert.de/blog/2010/2/22/keine-4-auflage-von-rwdmror" rel="alternate" type="text/html"/>
    <title>Keine 4. Auflage von RWDMROR</title>
<content type="html">
            &lt;p&gt;
  Aufgrund einiger Nachfragen, hier kurz eine &quot;Pressemitteilung&quot; :)
&lt;/p&gt;
&lt;p&gt;
  Zum Buch &quot;Rapid Web Development mit Ruby on Rails&quot; wird es erstmal keine 4. Auflage geben.
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;http://ralfwirdemann.de&quot;&gt;Ralf&lt;/a&gt; und ich sind vor allem aus Zeitgründen privater und beruflicher Art nicht in der Lage, eine neue Auflage zu Rails 3 zu schreiben. Kurzfristig gab es die Idee, dass uns 
&lt;a href=&quot;http://phillipoertel.com&quot;&gt;Phillip Oertel&lt;/a&gt; unterstützt, aber der hat dann ebenfalls aus Zeitgründen passen müssen.
&lt;/p&gt;
&lt;p&gt;
Die Entscheidung ist uns nicht leicht gefallen, aber vorerst geht es nicht anders.
&lt;/p&gt;
&lt;p&gt;
Vielen Dank an aller Leser für das Lob und die Anregungen!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-11-19:70</id>
    <published>2009-11-19T20:09:00Z</published>
    <updated>2009-11-22T15:04:16Z</updated>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="irb"/>
    <category term="rails"/>
    <category term="rails-console"/>
    <link href="http://www.thomasbaustert.de/blog/2009/11/19/history-der-rails-console-reaktiviert" rel="alternate" type="text/html"/>
    <title>History der Rails-Console reaktiviert</title>
<content type="html">
            &lt;p&gt;
Irgendwann, vermutlich nach einem Update von Ruby und/oder Rails, stand die History meiner Rails Console nicht mehr zur Verfügung.
&lt;/p&gt;&lt;p&gt;
Nachdem ich damit eine gewisse Zeit leben konnte, wollte ich heute dem Grund auf die Schliche kommen. 
&lt;/p&gt;&lt;p&gt;
Nach einigem Probieren kam ich darauf, dass die Konsole und deren History unter &lt;code&gt;~/.irb_history&lt;/code&gt; schon funktioniert. Sie wird allerdings durch die Datei &lt;code&gt;~/.rdebug_hist&lt;/code&gt; erweitert. 
&lt;/p&gt;&lt;p&gt;
Ein Durchlaufen der einzelnen Einträge durch &quot;Pfeil-Taste hoch&quot; lief erst durch die Einträge des Debuggers und fand dann irgendwann auch die Einträge aus &lt;code&gt;~/.irb_history&lt;/code&gt;. Man musste nur oft genug Tippen :).
&lt;/p&gt;&lt;p&gt;
Ein Löschen der Datei &lt;code&gt;~/.rdebug_hist&lt;/code&gt; führte dazu, dass die letzten Einträge in der Konsole beim nächsten Aufruf sofort zur Verfügung standen.
&lt;/p&gt;&lt;p&gt;
Die Datei &lt;code&gt;~/.rdebug_hist&lt;/code&gt; wird durch ruby-debug (genauer &lt;code&gt;ruby-debug-0.10.3/cli/ruby-debug/interface.rb&lt;/code&gt;) eingelesen und geschrieben.  Ich habe den Code noch nicht ganz durchschaut, aber die Datei wurde trotz des Einsatzes des Debuggers bisher nicht wieder erzeugt. Sicherheitshalber habe ich die Datei selbst schreibgeschützt angelegt, um eine erneute Erzeugung zu vermeiden.
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
touch ~/.rdebug_hist
chmod 400 ~/.rdebug_hist
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Logging in der Rails-Console reaktiviert&lt;/h4&gt;

&lt;p&gt;
Darüber hinaus habe ich das Aktivieren und Deaktivieren der Logausgaben
in der Rails-Konsole wieder hinbekommen. Meine &lt;code&gt;~/.irbrc&lt;/code&gt; sieht wie folgt aus:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;

&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;rubygems&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt; &lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;wirble&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt; &lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;pp&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    4&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;    5&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Wirble&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;init
&lt;span class=&quot;linenum&quot;&gt;    6&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Wirble&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;colorize
&lt;span class=&quot;linenum&quot;&gt;    7&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;    8&lt;/span&gt; &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;ri&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;*&lt;/span&gt;names&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    9&lt;/span&gt;   system&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby string_quoted_double_ruby_mod&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;%{&lt;/span&gt;ri &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;names&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;map &lt;span class=&quot;punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_block variable_other_block_ruby&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby&quot;&gt;|&lt;/span&gt; name&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;to_s&lt;span class=&quot;punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;join&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   10&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   11&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   12&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;include?&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;RAILS_ENV&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   13&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   14&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;sql&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   15&lt;/span&gt;     &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;connection&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;select_all&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;query&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   16&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   17&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   18&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;logon&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   19&lt;/span&gt;     set_logger &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Logger&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;STDOUT&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   20&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   21&lt;/span&gt;   
&lt;span class=&quot;linenum&quot;&gt;   22&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;logoff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   23&lt;/span&gt;     set_logger &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;logger&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   24&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   25&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   26&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;get_logger&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   27&lt;/span&gt;     &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;connection&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;instance_variable_get&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;@logger&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   28&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   29&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   30&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;set_logger&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   31&lt;/span&gt;     &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;logger&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby&quot;&gt;||=&lt;/span&gt; get_logger
&lt;span class=&quot;linenum&quot;&gt;   32&lt;/span&gt;     &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;connection&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;instance_variable_set&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;@logger&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; logger&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   33&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   34&lt;/span&gt;   
&lt;span class=&quot;linenum&quot;&gt;   35&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;   36&lt;/span&gt; &lt;/pre&gt;

&lt;p&gt;
Update: Ich nutze Rails 2.3.4 und Ruby ruby 1.8.7
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-09-16:44</id>
    <published>2009-09-16T21:17:00Z</published>
    <updated>2009-09-16T21:18:19Z</updated>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="include"/>
    <category term="ruby"/>
    <link href="http://www.thomasbaustert.de/blog/2009/9/16/ruby-include-part-i" rel="alternate" type="text/html"/>
    <title>Ruby include Part I</title>
<content type="html">
            &lt;p&gt;
Ein häufiger Denkfehler beim Einbinden eines Moduls per &lt;span class=&quot;code&quot;&gt;include&lt;/span&gt; 
in eine Klasse ist, dass die Methoden aus dem Modul tatsächlich in die Klasse eingefügt werden.
Dem ist &lt;b&gt;nicht&lt;/b&gt; so. Hier ein Beispiel:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M1&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M1#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Der Aufruf von &lt;span class=&quot;code&quot;&gt;include M1&lt;/span&gt; führt intern &lt;span class=&quot;bold&quot;&gt;nicht&lt;/span&gt;
zu folgendem Code:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M1#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Tatsächlich wird durch &lt;span class=&quot;code&quot;&gt;include&lt;/span&gt; eine anonyme Proxyklasse erzeugt, 
die auf das Modul verweist und die Klasse &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; erhält eine Referenz auf diese Proxy-Klasse:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Proxy&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;&amp;gt;&lt;/span&gt; proxy
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;
a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Im obigen Beispiel findet Ruby die Methode &lt;span class=&quot;code&quot;&gt;foo&lt;/span&gt; also nicht in der 
Klasse &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt;, sondern (über die Proxy-Klasse) im Modul 
&lt;span class=&quot;code&quot;&gt;M1&lt;/span&gt;.
&lt;/p&gt;

&lt;h4&gt;Suche entlang der Vererbungshierachie&lt;/h4&gt;

&lt;p&gt;
Grundsätzlich gilt: Um eine Methode auszuführen, muss Ruby die Definition
der Methode finden und sucht die Methode dazu entlang der Vererbungshierachie. 
Ein Beispiel:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_inheritance punctuation_separator_inheritance_ruby&quot;&gt;&amp;lt;&lt;/span&gt; B&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M2&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;
a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Damit ergibt sich diese Suchreihenfolge:
&lt;/p&gt;

&lt;pre&gt;
1) A
2) M2 (über proxy)
3) M1 (über proxy)
4) B
&lt;/pre&gt;

&lt;p&gt;
Die Vererbungshierachie sieht wie folgt aus:
&lt;/p&gt;

&lt;pre&gt;
A -&gt; (proxy-&gt;M2) -&gt; (proxy-&gt;M1) -&gt; B
&lt;/pre&gt;

&lt;p&gt;
Es wird bei der Klasse &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; begonnen. Wird die Methode nicht gefunden, 
wird im Modul &lt;span class=&quot;code&quot;&gt;M2&lt;/span&gt; gesucht. Ist die Methode hier nicht vorhanden, wird 
im Modul &lt;span class=&quot;code&quot;&gt;M1&lt;/span&gt; gesucht und existiert die Methode hier nicht, wird in der 
Superklasse &lt;span class=&quot;code&quot;&gt;B&lt;/span&gt; nachgeschaut. Dort wiederholt sich die Suche.
&lt;/p&gt;
&lt;p&gt;
Daher hat eine in der Klasse &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; definierte Methode immer 
Vorrang vor einer gleichnamigen aus einem inkludierten Modul:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M1&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M1#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;&amp;gt;&lt;/span&gt; proxy &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;

  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;A#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;
a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;A#foo&quot;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Ruby sucht die Methode entlang der Vererbungshierachie und findet die Methode 
in der Klasse &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; bevor es im Modul &lt;span class=&quot;code&quot;&gt;M1&lt;/span&gt;
sucht. 
&lt;/p&gt;

&lt;h4&gt;Modulmethode über super aufrufen&lt;/h4&gt;

&lt;p&gt;
Es ist sicher bekannt, dass die Methode &lt;span class=&quot;code&quot;&gt;super&lt;/span&gt; dazu dient, 
eine gleichnamige Methode in der Superklasse aufzurufen. Beispiel:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;SuperClass&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;SuperClass#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_inheritance punctuation_separator_inheritance_ruby&quot;&gt;&amp;lt;&lt;/span&gt; SuperClass&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;A#foo: &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt; 
a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;A#foo: SuperClass#foo&quot;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Was vielleicht nicht sofort einleuchtet ist, dass auch die Modulmethode über 
&lt;span class=&quot;code&quot;&gt;super&lt;/span&gt; aufgerufen werden kann. Das Modul befindet sich 
(wie die Superklasse auch) in der Vererbungshierachie und daher kann sowohl die 
Superklassenmethode, als auch die Modulmethode über &lt;span class=&quot;code&quot;&gt;super&lt;/span&gt; 
aufgerufen werden:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M1&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M1#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;

 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;A#foo: &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;
a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;A#foo: M1#foo&quot;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h4&gt;Vorrang beim Einbinden von Modulen&lt;/h4&gt;

&lt;p&gt;
Werden zwei Modul eingebunden und erhalten diese dieselbe Methode, so
wird die Methode des zuletzt inkludierten Moduls verwendet.
Im Beispiel &lt;span class=&quot;code&quot;&gt;M2&lt;/span&gt;:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M1&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M1#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M2&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M2#foo&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;
&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M2&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;
a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; M2#foo
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h4&gt;Einschränkung der Sichtbarkeit&lt;/h4&gt;

&lt;p&gt;
Mit dem Wissen um die Wirkung von &lt;span class=&quot;code&quot;&gt;include&lt;/span&gt;, wird auch klar, 
warum die Einschränkung der Sichtbarkeit wie folgt &lt;span class=&quot;bold&quot;&gt;nicht&lt;/span&gt; 
möglich ist:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M1&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;mod_method1&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;mod_method1&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M2&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;mod_method2&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;mod_method2&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;

 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;private&lt;/span&gt;
   &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M2&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; method mod_method2 is still public
&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;mod_method1 &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;mod_method1&quot;
&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;mod_method2 &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;mod_method2&quot;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Die Methoden aus dem Modul &lt;span class=&quot;code&quot;&gt;M2&lt;/span&gt; sind öffentlich (public), 
obwohl das Modul nach dem Schlüsselwort &lt;span class=&quot;code&quot;&gt;private&lt;/span&gt; eingebunden wird. 
Und zwar, weil die Methode aus dem Modul nicht in die Klasse eingebunden werden, sondern 
die Klasse auf das Modul verweist (über den Proxy) und 
&lt;span class=&quot;code&quot;&gt;mod_method2&lt;/span&gt; in &lt;span class=&quot;code&quot;&gt;M2&lt;/span&gt; öffentlich ist.
&lt;/p&gt;

&lt;p&gt;
Korrekt geht es wie folgt:
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M2&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;private&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;mod_method2&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;mod_method2&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M1&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M2&lt;/span&gt;

 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   mod_method2
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo         &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;mod_method2&quot;
&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;mod_method1 &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;mod_method1&quot;
&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;mod_method2 &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; NoMethodError: private method ‘mod_method2’ called
&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt;&amp;lt;A:0x108d8&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Wenn eine Modulmethode nur für interne Implementierung dient, sollte die
Methode auf jeden Fall als &lt;span class=&quot;code&quot;&gt;private&lt;/span&gt; deklariert werden.
&lt;/p&gt;

&lt;h4&gt;Proxy-Klasse&lt;/h4&gt;

&lt;p&gt;
Wozu dient eigentlich die Proxy-Klasse? Warum wird nicht direkt eine Referenz auf das Modul
in die Klasse eingefügt? Wozu der Umweg über die Proxy-Klasse?
&lt;/p&gt;
&lt;p&gt;
Die Proxy-Klasse ist notwendig, da von Modulen keine Instanzen erzeugt werden können.
Dennoch möchte man eventuell Instanzvariablen von Modulen nutzen. 
&lt;/p&gt;
&lt;p&gt;
Inkludieren die Klassen &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; und &lt;span class=&quot;code&quot;&gt;B&lt;/span&gt; das Modul &lt;span class=&quot;code&quot;&gt;M1&lt;/span&gt;, so darf die Änderung einer Instanzvariablen 
in der Klasse &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; nicht den Wert in &lt;span class=&quot;code&quot;&gt;B&lt;/span&gt; beeinflussen. Daher gibt für &lt;span class=&quot;code&quot;&gt;A&lt;/span&gt; und &lt;span class=&quot;code&quot;&gt;B&lt;/span&gt; jeweils eine 
Proxy-Klasse und die die Werte hält. 
&lt;/p&gt;
&lt;p&gt;
Alle Proxy-Klasse verweisen auf dasselbe Modul, daher werden Änderung an Methoden des Moduls 
in alle Klassen sichtbar: 
&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo=&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;foo&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; v
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
  
  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;M#foo: &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;foo&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;A&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M&lt;/span&gt;
  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; v
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt; 
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;B&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;M&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; v
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt; 
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

a &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;47&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
p a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;M#foo 47&quot;
&lt;/span&gt;b &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;B&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
p b&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;M#foo 11&quot;
&lt;/span&gt;
&lt;span class=&quot;meta meta_module meta_module_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_module keyword_control_module_ruby&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby&quot;&gt;M&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;foo&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;modified M#foo &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;foo&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

p a&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;modified M#foo 47&quot;
&lt;/span&gt;p b&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;foo &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; &quot;modified M#foo 11&quot;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Hoffe, ich habe für mehr Klarheit sorgen können und nicht mehr verwirrt :)
&lt;/p&gt;

&lt;p&gt;
to be continued ...
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-09-13:42</id>
    <published>2009-09-13T16:57:00Z</published>
    <updated>2009-09-13T16:57:58Z</updated>
    <category term="Konferenz"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="konferenz"/>
    <category term="rails"/>
    <category term="rails-konferenz"/>
    <category term="rk09"/>
    <category term="ruby"/>
    <link href="http://www.thomasbaustert.de/blog/2009/9/13/rails-konferenz-2009-review" rel="alternate" type="text/html"/>
    <title>Rails-Konferenz 2009 Review</title>
<content type="html">
            &lt;a href=&quot;http://www.rails-konferenz.de&quot;&gt;
&lt;img src=&quot;http://thomasbaustert.de/blog/assets/2009/3/15/railskonferenz-logo-125.png&quot; /&gt;
&lt;/a&gt;

&lt;p&gt;
Ist schon wieder zwei Wochen her, dass wir die 4. &lt;a href=&quot;http://www.rails-konferenz.de&quot;&gt;Rails-Konferenz&lt;/a&gt; hinter uns gebracht haben. 
&lt;/p&gt;
&lt;p&gt;
Diesmal fand die Konferenz im &lt;a href=&quot;http://www.achat-hotel.de/wDeutsch/02_hotels/Uebersicht_Hotels/21_Uebersicht.php&quot;&gt;ACHAT Plaza Frankfurt/Offenbach&lt;/a&gt; statt. Das Hotel machte einen durchweg guten Eindruck, liegt allerdings verkehrstechnisch nicht besonders günstig. Auch der Vorraum für Pausen ist für 100+ Personen einfach viel zu klein. Die Zimmer waren sauber und geräumig und das Essen gut.
Für 2010 werden wir uns aber trotzdem nach einer Alternative umschauen. Wer Tipps hat, bitte melden.
&lt;/p&gt;
&lt;p&gt;
Den Gesprächen und Feedback-Bögen zur Folge, ist die Konferenz auch diese Jahr wieder sehr gut angekommen.
Die Workshops, Vorträge und das Socializing zwischendurch ergaben ein rundes Bild.
&lt;/p&gt;
&lt;p&gt;
Nur der Ort des Vorabend-Events kam nicht so gut an, weil die Teilnehmer vom Hotel in Offenbach erst in die Innenstadt von Frankfurt mussten. Das ACHAT-Hotel selbst wäre ein guter Ort gewesen, kostete aber zu viel Geld. Die Lounge im &lt;a href=&quot;http://www.flemings-hotels.com/de/club_frankfurt_city_flemings&quot;&gt;Fleming's Club&lt;/a&gt; kam bei den Anwesenden dann aber gut an. Danke auf diesem Wege nochmals an &lt;a href=&quot;http://www.xing.com&quot;&gt;XING&lt;/a&gt; für das Sponsoring und die Vorträge!
&lt;/p&gt;
&lt;p&gt;
Danke auch an alle Sponsoren, Speaker und Teilnehmer!!!
&lt;/p&gt;
&lt;p&gt;
Dem Feedback nach zu urteilen, werden auch 2010 wieder genügend Teilnehmer kommen. In diesem Sinne: bis 2010!. 
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-08-10:37</id>
    <published>2009-08-10T06:33:00Z</published>
    <updated>2009-08-10T06:33:52Z</updated>
    <category term="Konferenz"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="konferenz"/>
    <category term="rails"/>
    <category term="rails-konferenz"/>
    <link href="http://www.thomasbaustert.de/blog/2009/8/10/ticket-rabatt-auf-rubyonrails-de" rel="alternate" type="text/html"/>
    <title>Ticket-Rabatt auf rubyonrails.de</title>
<content type="html">
            Auf der Seite &lt;a href=&quot;http://www.rubyonrails.de&quot;&gt;rubyonrails.de&lt;/a&gt; von Kaan Karaca gibt es ab heute 20 Tickets für die &lt;a href=&quot;http://www.rails-konferenz.de&quot;&gt;Rails-Konferenz.de 2009&lt;/a&gt; mit einem Rabatt von 10%.
&lt;p&gt;
Na, dann mal schnell zuschlagen :)
&lt;/p&gt;
&lt;p&gt;
Vielen Dank an Kaan für die Unterstützung!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-08-07:36</id>
    <published>2009-08-07T10:07:00Z</published>
    <updated>2009-08-07T10:07:39Z</updated>
    <category term="Plugins"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="plugin"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://www.thomasbaustert.de/blog/2009/8/7/rails-plugin-amount_field" rel="alternate" type="text/html"/>
    <title>Rails Plugin amount_field</title>
<content type="html">
            Ich habe heute mein Rails Plugin &lt;a href=&quot;http://github.com/thomasbaustert/amount_field/tree/master&quot;&gt;amount_field&lt;/a&gt; veröffentlicht. Es ermöglicht die Angabe von Beträgen im deutschen und im amerikanischen Format in Textfeldern eines Formulars, zum Beispiel:

&lt;p&gt;
&lt;img src=&quot;http://thomasbaustert.de/blog/assets/2009/8/7/Bild_2.png&quot; /&gt;
&lt;img src=&quot;http://thomasbaustert.de/blog/assets/2009/8/7/Bild_1.png&quot; /&gt;
&lt;/p&gt;

Bisher habe ich das für den Einzelfall speziell gelöst. In einen aktuellen Projekt habe ich jedoch ein Formular mit vielen Beträgen, die im deutschen Format angezeigt und akzeptiert werden sollen. Daher war es an der Zeit, eine generelle Lösung zu finden. 

&lt;p&gt;
Da ich nichts adäquates an Gems oder Plugins gefunden habe, habe ich mich selbst daran gemacht. Und das war anfangs gar nicht so einfach :)
&lt;/p&gt;

&lt;p&gt;
Es ist die Eingabe (die Übertragung aus dem Formular an die Rails-Anwendung) und die korrekt formatierte Ausgabe (Anzeige im View/Formular) zu betrachten.
&lt;/p&gt;

&lt;h4&gt;Eingabe&lt;/h4&gt;

Vorweg folgende Definition:

&lt;ul&gt;
&lt;li&gt;Formatvalidierung: z.B. ist &quot;1.234,56&quot; ein gültiges Format?&lt;/li&gt;
&lt;li&gt;Wertvalidierung: z.B. ist 1.234,56 &gt; 1250 ?&lt;/li&gt;
&lt;/ul&gt;

Folgende Anforderungen und Überlegungen führten zur Lösung:

&lt;ol&gt;
&lt;li&gt;Damit sichergestellt werden kann, dass der eingegebene Wert wirklich ein gültiges Format hat (z.B. 1.234,56), muss zunächst eine Formatvalidierung erfolgen und danach die (sichere) Konvertierung in eine Zahl 1234.56. Im Anschluss kann optional die Wertvalidierung erfolgen.
&lt;p&gt;
Ohne die Formatvalidierung würde Rails aus 1.234,56 den Wert 1.23 machen, ohne dass der Anwender das gegebenenfalls merkt. Und das ist schlecht. 
&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
Die Formatierung (Ein- und Ausgabe) hat eigentlich nichts mit dem Attribut oder dem ActiveRecord-Modell zu tun. Es handelt sich ja mehr um eine bestimmte Repräsentation eines Betrags und dafür ist das Modell nicht zuständig. Zur formatierten Anzeige werden u.a. die View-Helper von Rails genutzt.
&lt;p&gt;
Die Konvertierung von &quot;1.234,56&quot; in 1234.56 kann aber nicht auf Controller/View-Ebene erfolgen, da die Validierung der Attribute in ActiveRecord geschieht. Und die Formatvalidierung ist eben eine solche Validierung. Daher bleibt doch nur das Modell.
&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;Die Zuweisung als Ruby-Zahl an den Setter (an das Attribute) muss weiterhin wie gewohnt möglich sein:
&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;p &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Product&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;
p&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;price &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;12.345,67&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; schlecht
&lt;/span&gt;p&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;price &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;12345.67&lt;/span&gt;    &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; ok
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;Der Getter des Attributs muss den Wert als (Ruby-)Zahl liefern, damit Berechnungen weiterhin wie gewohnt möglich sind:
&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;p &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Product&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;price&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_key-value&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;1.23&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
p&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;price &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; =&amp;gt; 1.23 damit Rechnen möglich
&lt;/span&gt;tax &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; p&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;price &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;19.0&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;100.0&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;/li&gt;

&lt;li&gt;
Eine clientseitige Formatvalidierung  (und Formatierung) durch JavaScript ist hilfreich, verhindet aber nicht unbedingt die Übertragung falsch formatierter Beträge und daher ist eine serverseitige Formatvalidierung immer notwendig.
&lt;/li&gt;
&lt;br /&gt;

&lt;li&gt;Die Formatierung eines Betrags besteht immer aus den drei Werten: 

&lt;ul&gt;
&lt;li&gt;Separator (Tausendseparator)&lt;/li&gt;
&lt;li&gt;Delimiter (Trennung Ganzzahl und Nachkommastellen)&lt;/li&gt;
&lt;li&gt;Precision (Anzahl der Nachkommastellen)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Die drei Werte bilden die Formatkonfiguration: 
&lt;br /&gt;deutsch: &lt;code&gt;{ :precision =&gt; 2, :delimiter =&gt; '.', :separator =&gt; ',' }&lt;/code&gt; 
&lt;br /&gt;amerikanisch:&lt;code&gt;{ :precision =&gt; 2, :delimiter =&gt; ',', :separator =&gt; '.' }&lt;/code&gt;
&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;Fehlermeldungen bei einen falschen Format sollten internationalisierbar sein&lt;/li&gt;
&lt;br /&gt;

&lt;li&gt;Hinweis: Active Record speichert den übergebenen Wert “1.234,56” in dem Attribute &quot;price&quot;. Erst beim Lesen des Wertes wird dieser konvertiert zurückgeliefert. Daher liefert &quot;price_before_type_cast&quot; den Wert “1.234,56” und &quot;price&quot; den Wert 1.234 zurück. Die Wertvalidierung erfolgt bei Active Record auf Basis von XXX_before_type_cast.
&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;
Als Lösung definiere ich einen eigenen View-Helper &quot;amount_field&quot; als Ersatz für &quot;text_field&quot;. Das HTML sieht wie folgt aus:

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;&amp;lt;&lt;/span&gt;input name&lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;product[amount_field_price]&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt; amount_field&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;...&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Der eingegebene Wert (z.B. &quot;1.234,56&quot;) wird dadurch über den Parameter &lt;code&gt;amount_field_price&lt;/code&gt; und nicht (wie normalerweise) über den Parameter &lt;code&gt;price&lt;/code&gt; übertragen.
&lt;/p&gt;

&lt;p&gt;
Zusätzlich existiert das Validierungsmakro &quot;validates_amount_format_of&quot;, dass für jedes angegebene Attribut eine spezielle Setter-Methode (z.B. &lt;code&gt;amount_field_price=(value)&lt;/code&gt; definiert, die den Parameter &lt;code&gt;amount_field_price&lt;/code&gt; annimmt und Werte im Format &quot;1.234,56&quot; akzeptiert.

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Product&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_inheritance punctuation_separator_inheritance_ruby&quot;&gt;&amp;lt;&lt;/span&gt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
  validates_amount_format_of &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;price&lt;/span&gt; 
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
Nach der Validierung und Konvertierung (z.B. &quot;1.234,56&quot; in 1234.56) wird der Wert an das Originalattribut &quot;price&quot; zugewiesen und kann von weiteren Validierungsmakro geprüft werden (z.B: &lt;code&gt;validates_numericality_of :price&lt;/code&gt;). 
&lt;/p&gt;

&lt;h4&gt;Ausgabe&lt;/h4&gt;

&lt;p&gt;
Damit die Ausgabe des Wertes 1234.56 formatiert erfolgt (z.B. &quot;1.234,56&quot;), verwendet der View-Helper &lt;code&gt;amount_field&lt;/code&gt; intern den View-Helper &lt;code&gt;number_with_precision&lt;/code&gt; mit der global definierten Formatkonfiguration. Im Fehlerfall wird der Wert nicht formatiert, sondern wie eingegeben angezeigt. 
&lt;/p&gt;

&lt;p&gt;
Das Gem (oder Plugin) inklusive Dokumentation ist unter &lt;a href=&quot;http://github.com/thomasbaustert/amount_field/tree/master&quot;&gt;GitHub&lt;/a&gt; zu finden.
&lt;/p&gt;

&lt;p&gt;
Freue mich über Feedback, Fragen oder Fehlermeldungen.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-07-22:30</id>
    <published>2009-07-22T19:10:00Z</published>
    <updated>2009-08-07T08:07:52Z</updated>
    <category term="Konferenz"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="konferenz"/>
    <category term="rails"/>
    <category term="rails-konferenz"/>
    <link href="http://www.thomasbaustert.de/blog/2009/7/22/anmeldung-zur-rails-konferenz-de-2009-online" rel="alternate" type="text/html"/>
    <title>Anmeldung zur Rails-Konferenz.de 2009 online! </title>
<content type="html">
            Die &lt;a href=&quot;http://anmeldung.rails-konferenz.de&quot;&gt;Anmeldung&lt;/a&gt; zur &lt;a href=&quot;http://rails-konferenz.de&quot;&gt;Rails-Konferenz.de 2009&lt;/a&gt; ist online! 

&lt;p&gt;Wir sehen uns in Frankfurt/Offenbach!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-07-20:28</id>
    <published>2009-07-20T08:53:00Z</published>
    <updated>2009-08-07T08:07:37Z</updated>
    <category term="Konferenz"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="konferenz"/>
    <category term="rails"/>
    <category term="rails-konferenz.de"/>
    <link href="http://www.thomasbaustert.de/blog/2009/7/20/programm-rails-konferenz-2009-online" rel="alternate" type="text/html"/>
    <title>Programm Rails-Konferenz 2009 online</title>
<content type="html">
            Das Programm zur &lt;a href=&quot;http://rails-konferenz.de&quot;&gt;Rails-Konferenz 2009&lt;/a&gt; ist jetzt online. Wir haben wieder einen bunten Mix aus den vielen Proposals erstellt und hoffen auf viele Teilnehmer und eine tolle Konferenz, wie in den letzten Jahren.
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-07-16:26</id>
    <published>2009-07-16T14:52:00Z</published>
    <updated>2009-08-07T10:04:56Z</updated>
    <category term="rails"/>
    <category term="shoulda"/>
    <category term="test"/>
    <link href="http://www.thomasbaustert.de/blog/2009/7/16/shoulda-macros-werden-nicht-gefunden" rel="alternate" type="text/html"/>
    <title>Shoulda Macros werden nicht gefunden</title>
<content type="html">
            Für ein Rails-Projekt habe ich testweise &lt;a href=&quot;http://www.thoughtbot.com/projects/shoulda&quot;&gt;Shoulda&lt;/a&gt; eingesetzt und beim ersten Testlauf aus &lt;a href=&quot;http://macromates.com/&quot;&gt;TextMate&lt;/a&gt; heraus die folgende Fehlermeldung erhalten:

&lt;code&gt;&lt;pre&gt;
undefined method ‘should_validate_presence_of’ for PoliceTest:Class
&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Es handelt sich dabei um Rails 2.3 und Shoulda 2.10.2. Der Quellcode dazu sieht wie folgt aus:&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;test_helper&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;shoulda&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;meta meta_rails meta_rails_unit_test&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;PoliceTest&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_inheritance punctuation_separator_inheritance_ruby&quot;&gt;&amp;lt;&lt;/span&gt; ActiveRecord::TestCase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

  should_validate_presence_of &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;currency&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;message&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_key-value&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;string string_regexp string_regexp_classic string_regexp_classic_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby&quot;&gt;/&lt;/span&gt;Währung&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby&quot;&gt;/&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;p&gt;Nachdem ich zwei weitere require-Einträge vorgenommen habe, ging es:&lt;/p&gt;

&lt;pre class=&quot;textmate-source mac_classic&quot;&gt;&lt;span class=&quot;source source_ruby source_ruby_rails&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;test_helper&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;shoulda&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;shoulda/test_unit&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;shoulda/rails&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;meta meta_rails meta_rails_unit_test&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;PoliceTest&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_inheritance punctuation_separator_inheritance_ruby&quot;&gt;&amp;lt;&lt;/span&gt; ActiveRecord::TestCase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

  should_validate_presence_of &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;currency&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;message&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_key-value&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;string string_regexp string_regexp_classic string_regexp_classic_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby&quot;&gt;/&lt;/span&gt;Währung&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby&quot;&gt;/&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;Zum Zeitpunkt des Blog-Eintrags werden auf der Shoulda-Seite noch Macros wie &lt;code&gt;should_require_attributes&lt;/code&gt;
oder &lt;code&gt;should_require_unique_attributes&lt;/code&gt; aufgeführt, die es in der Version 2.10.2 (oder früher) nicht mehr gibt.
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-04-16:12</id>
    <published>2009-04-16T16:36:00Z</published>
    <updated>2009-08-07T08:08:48Z</updated>
    <category term="Publikationen"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="magazin"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://www.thomasbaustert.de/blog/2009/4/16/artikel-zum-gem-und-plugin-erstellung" rel="alternate" type="text/html"/>
    <title>Artikel zum Gem- und Plugin-Erstellung</title>
<content type="html">
            &lt;img src=&quot;http://thomasbaustert.de/blog/assets/2009/7/16/original4a0acdcca0535.jpg&quot; height=&quot;142&quot; width=&quot;100&quot; /&gt;

&lt;p&gt;
In der am Montag, dem 20. April erscheinenden dritten Ausgabe des &lt;a href=&quot;http://it-republik.de/railsway&quot;&gt;RailsWay-Magazins&lt;/a&gt; habe ich wieder einen Artikel beigesteuert. Diesmal geht es um das Thema, wie man ein eigenes 
&lt;a href=&quot;http://rubygems.org&quot;&gt;Ruby-Gem&lt;/a&gt; und Rails-Plugin erstellt.
&lt;/p&gt;

&lt;p&gt;
Weitere spannende Artikel und ein Interview mit David Heinemeier Hansson sind enthalten.
&lt;/p&gt;

&lt;p&gt;
Viel Spaß mit dem neuen Magazin!
&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-04-02:11</id>
    <published>2009-04-02T21:17:00Z</published>
    <updated>2009-04-06T18:28:21Z</updated>
    <category term="Konferenz"/>
    <category term="konferenz"/>
    <category term="rails"/>
    <category term="rails-konferenz.de"/>
    <link href="http://www.thomasbaustert.de/blog/2009/4/2/rails-konferenz-de-twitter" rel="alternate" type="text/html"/>
    <title>Rails-Konferenz.de@twitter</title>
<content type="html">
            Damit alle Interessierten noch besser am Ball bleiben, haben wir für die &lt;a href=&quot;http://rails-konferenz.de&quot;&gt;Rails-Konferenz.de&lt;/a&gt; einen &lt;a href=&quot;http://twitter.com/railskonferenz&quot;&gt;Twitter-Account&lt;/a&gt; angelegt. Bitte folgen :)
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-03-16:10</id>
    <published>2009-03-16T14:02:00Z</published>
    <updated>2009-03-30T18:04:15Z</updated>
    <category term="PodcastOnRails.de"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="podcast"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="sicherheit"/>
    <link href="http://www.thomasbaustert.de/blog/2009/3/16/heiko-webers-sicherheitsaspekte-von-rails-anwendungen" rel="alternate" type="text/html"/>
    <title>Heiko Webers - Sicherheitsaspekte von Rails-Anwendungen</title>
<content type="html">
            &lt;div class=&quot;podcast-image&quot;&gt;
  &lt;img class=&quot;frame&quot; src=&quot;/blog/assets/2009/3/30/heiko-webers-3x4.jpg&quot; height=&quot;100&quot; width=&quot;80&quot; /&gt;
&lt;/div&gt;
&lt;div class=&quot;podcast-about&quot;&gt;
Gespräch mit &lt;a href=&quot;http://www.rorsecurity.info&quot;&gt;Heiko Webers&lt;/a&gt; 
über Sicherheitsaspekte in Ruby on Rails-Anwendungen, wie Cross Site Scripting (CSS), Cross-Site Request Forgery (CSRF), SQL-Injection, SessionCookieStore, Plugins/Gems, Session Fixation, Default Routes, Privilege Escalation und Ruby und Rails im Allgemeinen.
&lt;p&gt;
Download: &lt;a href=&quot;http://thomasbaustert.podspot.de/files/podcastonrails-de-02-sicherheitsaspekte-ruby-on-rails-heiko-webers.mp3&quot;&gt;MP3 (50:12 Min, 16.7 MB)&lt;/a&gt;&lt;br /&gt;
Podcast-Abo: &lt;a href=&quot;http://thomasbaustert.podspot.de/rss&quot;&gt;RSS mit Enclosures&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;

&lt;p&gt;
Weitere Links:&lt;br /&gt;
&lt;a href=&quot;http://www.rorsecurity.info&quot;&gt;Ruby on Rails Security Project&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rorsecurity.info/the-book&quot;&gt;PDF: Ruby on Rails Security&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://guides.rubyonrails.org/security.html&quot;&gt;Ruby On Rails Security Guide&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rails-konferenz.de/2008/programm/22/heiko-webers-rails-sicherheit-fuer-fortgeschrittene&quot;&gt;Session auf der Rails-Konferenz 2008&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://guides.rubyonrails.org/security.html#cross-site-reference-forgery-csrf&quot;&gt;Cross Site Request forgery (csrf)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://groups.google.com/group/rubyonrails-security&quot;&gt;Newsletter zur Rails-Sicherheit&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.ruby-lang.org/en/security/&quot;&gt;Newsletter Sicherheitslücken in Ruby&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.bauland42.de&quot;&gt;bauland42&lt;/a&gt;&lt;br /&gt;
&lt;/p&gt;

&lt;p&gt;
Heiko Webers ist Gründer und Geschäftsführer von &lt;a href=&quot;http://www.bauland42.de&quot;&gt;bauland42&lt;/a&gt;. Das Softwarebüro bauland42 erstellt sichere, effiziente und einfach zu bedienende Webanwendungen mit Ruby
on Rails. Außerdem bietet bauland42 &lt;a href=&quot;http://www.bauland42.eu/sicherheit.html&quot;&gt;Sicherheitsberatung&lt;/a&gt;, Code-Audits und Training für Ruby on Rails. bauland42 informiert mit dem &lt;a href=&quot;http://www.rorsecurity.info&quot;&gt;Ruby On Rails Security Project&lt;/a&gt;
regelmäßig über neue Entwicklungen im Bereich der Sicherheit von Rails.
&lt;/p&gt;
&lt;p&gt;
Der Podcast ist etwas länger geworden, als geplant, aber das Thema Sicherheits ist nicht mal eben abzuhandeln. Und wir haben sicher noch lange nicht alle Punkte angesprochen :). An der Qualität der Aufnahmen muss ich noch etwas pfeilen, aber besser so, als gar nicht.
&lt;/p&gt;
&lt;p&gt;
Danke an Heiko!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-03-15:9</id>
    <published>2009-03-15T12:20:00Z</published>
    <updated>2009-04-02T21:20:49Z</updated>
    <category term="Konferenz"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="konferenz"/>
    <category term="rails"/>
    <category term="rails-konferenz.de"/>
    <category term="ruby"/>
    <link href="http://www.thomasbaustert.de/blog/2009/3/15/rails-konferenz-2009" rel="alternate" type="text/html"/>
    <title>Rails-Konferenz 2009</title>
<content type="html">
            &lt;p&gt;
Gute Neuigkeiten für alle Rails-Interessierten:
&lt;/p&gt;

&lt;p&gt;
Die &lt;a href=&quot;http://rails-konferenz.de&quot;&gt;Rails-Konferenz&lt;/a&gt; findet auch dieses Jahr wieder statt!
&lt;/p&gt;

&lt;p&gt;
Termin &amp; Ort&lt;br /&gt;
1. und 2. September 2009&lt;br /&gt;
ACHAT Plaza Frankfurt/Offenbach&lt;br /&gt;
Ernst-Griesheimer-Platz 7&lt;br /&gt;
D - 63071 Offenbach&lt;br /&gt;
&lt;a href=&quot;http://www.achat-hotel.de/wDeutsch/02_hotels/Uebersicht_Hotels/21_Uebersicht.php&quot;&gt;ACHAT Plaza Frankfurt/Offenbach&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://rails-konferenz.de&quot;&gt;
&lt;img src=&quot;http://thomasbaustert.de/blog/assets/2009/3/15/railskonferenz-logo-125.png&quot;&gt;
&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Auch dieses Jahr freuen wir uns wieder auf spannende Vorträge, interessante Diskussionen, den Erfahrungsaustausch in gemütlicher Atmosphäre und vieles mehr!
&lt;/p&gt;
Seit dabei, es lohnt sich!
&lt;p&gt;
Alle Informationen unter &lt;a href=&quot;http://rails-konferenz.de&quot;&gt;Rails-Konferenz.de&lt;/a&gt;!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-03-03:8</id>
    <published>2009-03-03T19:48:00Z</published>
    <updated>2009-03-15T12:16:06Z</updated>
    <category term="Mac"/>
    <category term="backup"/>
    <category term="mac"/>
    <category term="superduper"/>
    <link href="http://www.thomasbaustert.de/blog/2009/3/3/clone-mac-with-superduper" rel="alternate" type="text/html"/>
    <title>Mac Image mit SuperDuper klonen</title>
<content type="html">
            &lt;p&gt;
Nun ist es da, mein neues MacBook. Ich habe mich für die 13 Zoll Version mit 4 GB Hauptspeicher und 250 GB Festplatte entschieden. 
&lt;/p&gt;
&lt;img src=&quot;http://thomasbaustert.de/blog/assets/2009/3/3/mac-13-and-cinema-20.jpg&quot; /&gt;
&lt;p&gt;
Die Version ist für Reisen leichter und kleiner, als mein altes MacBook Pro mit 15 Zoll. 
Und da ich über ein 20 Zoll Cinema Display verfüge, habe ich bei längeren Arbeiten auch ein entsprechend großes Display. Für mich im Moment die optimale Kombination.
&lt;/p&gt;
&lt;/p&gt;
Die Daten auf dem alten MacBook Pro habe ich regelmäßig mit Hilfe von &lt;a href=&quot;http://superduper.softonic.de/mac&quot;&gt;SuperDuper&lt;/a&gt; als Standard Sparse Image auf eine externe Festplatte gesichert. Diese Sicherung ermöglichte mir nun, das neue MacBook einfach mit dem Image zu versehen und somit sofort mit dem neuen Rechner arbeiten zu können. Keine technische Neuigkeit, aber dennoch erfreulich. 
&lt;p&gt;
&lt;/p&gt;
Einfach eine Image vom alten Rechner auf der externen Festplatte erzeugen. Das kann schon mal 1-2 Stunden dauert. Festplatte am neuen MacBook am USB-Port anschließen (ggf. Firewire-Kabel abziehen!) und neu starten. Dabei Optionstaste (Alt) gedrückt halten. Statt der Mac-Partition, das Image auswählen und davon booten. (Seit dem Intel-Prozessor können Macs auch von USB-Platten booten!). Dann mit Hilfe des Festplatten-Dienstprogramms den Reiter Wiederherstellen klicken, also Quelle das Image und als Ziel die MacBook-Platte wählen. Den Hacken bei &quot;Zielmedium löschen&quot; setzen und &quot;Wiederherstellen&quot; klicken. 
&lt;p&gt;
&lt;p&gt;
Neustart und mit dem neuen Mac loslegen. Prima!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.thomasbaustert.de/blog/">
    <author>
      <name>thomas</name>
    </author>
    <id>tag:www.thomasbaustert.de,2009-03-03:7</id>
    <published>2009-03-03T17:57:00Z</published>
    <updated>2009-03-03T17:59:43Z</updated>
    <category term="Webdesign"/>
    <category term="usability"/>
    <category term="webdesign"/>
    <link href="http://www.thomasbaustert.de/blog/2009/3/3/lohnt-sich-der-aufwand-der-pixelschieberei" rel="alternate" type="text/html"/>
    <title>Lohnt sich der Aufwand der Pixelschieberei?</title>
<content type="html">
            Ist der hohe Aufwand für die Erstellung von Webseiten, die in &quot;allen&quot; Browsern gleich aussehen wirklich lohnenswert?
&lt;p&gt;
Warum muss eine Seite im Internet Explorer exakt so aussehen, wie im Firefox oder Safari?&lt;br /&gt;
Wer stört sich als Anwender wirklich an kleinen Unterschieden?&lt;br /&gt;
Wechselt der Benutzer häufig zwischen den Browsern, so dass ihm die Unterschiede negativ auffallen? &lt;br /&gt;
Und machen Sie die Seiten dann für ihn schwerer nutzbar?&lt;br /&gt;
&lt;/p&gt;

&lt;p&gt;
Diesem Thema widmet sich Ingo Chao im lesenswerten Artikel &lt;a href=&quot;http://blog.xing.com/2009/02/degradation-without-grace/&quot;&gt;Degradation Without Grace&lt;/a&gt;.
&lt;/p&gt;
          </content>  </entry>
</feed>
