<?xml version="1.0" encoding="UTF-8"?>
<articles type="array">
  <article>
    <body>## &#31572;&#12360;

&quot;!=&quot;, &quot;!==&quot; &#12434;&#20351;&#12358;

## &#35443;&#32048;

&#25991;&#23383;&#21015;&#12398;HTML&#12456;&#12473;&#12465;&#12540;&#12503;&#12399;Rails&#12420;Rack::Util&#12395;&#12424;&#12387;&#12390;
h&#12504;&#12523;&#12497;&#12513;&#12477;&#12483;&#12489;&#12392;&#12375;&#12390;&#25552;&#20379;&#12373;&#12428;&#12390;&#12362;&#12426;&#12289;
&#12518;&#12540;&#12470;&#12399;&#12456;&#12473;&#12465;&#12540;&#12503;&#20966;&#29702;&#12434;&#12300;h&#12398;&#26377;&#28961;&#12301;&#12395;&#12424;&#12387;&#12390;&#35519;&#25972;&#12375;&#12414;&#12377;&#12290;

|caption=&#20363;: haml&#12391;&#12398;HTML&#12456;&#12473;&#12465;&#12540;&#12503;
|
|&#12467;&#12540;&#12489;,&#32080;&#26524;
|
|= link_to(...),&amp;lt;a href=...
|=h link_to(...),&amp;amp;lt;a href=...

### &#33258;&#21205;&#12456;&#12473;&#12465;&#12540;&#12503;&#12514;&#12540;&#12489;

&#19978;&#35352;&#12398;&#12424;&#12358;&#12394;&#12518;&#12540;&#12470;&#39366;&#21205;&#12398;&#12456;&#12473;&#12465;&#12540;&#12503;&#20966;&#29702;&#12391;&#12399;100%&#12398;&#23433;&#20840;&#24615;&#12434;&#20445;&#35388;&#12391;&#12365;&#12394;&#12356;&#12383;&#12417;&#12289;
haml&#12391;&#12399;&#12300;&#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12456;&#12473;&#12465;&#12540;&#12503;&#12377;&#12427;&#12301;&#12392;&#12356;&#12358;&#12458;&#12503;&#12471;&#12519;&#12531;&#12364;&#23384;&#22312;&#12375;&#12414;&#12377;&#12290;

ruby&gt;&gt;
Haml::Template.options[:escape_html] = true
&lt;&lt;--

&#12371;&#12428;&#12395;&#12424;&#12426;&#24120;&#26178;&#12456;&#12473;&#12465;&#12540;&#12503;&#12373;&#12428;&#12427;&#12424;&#12358;&#12395;&#12394;&#12427;&#12398;&#12391;&#12377;&#12364;&#12289;
&#20170;&#24230;&#12399;h &#12398;&#36870;&#12392;&#12418;&#35328;&#12358;&#12409;&#12365;&#12300;&#12456;&#12473;&#12465;&#12540;&#12503;&#12375;&#12394;&#12356;&#12301;&#26041;&#27861;&#12364;&#24517;&#35201;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;
&#12371;&#12428;&#12364;&#12378;&#12387;&#12392;&#12431;&#12363;&#12425;&#12394;&#12367;&#12390;&#22256;&#12387;&#12390;&#12356;&#12383;&#12398;&#12391;&#12377;&#12364;&#12289;
&#12300;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#35211;&#12427;&#12301;&#12392;&#12356;&#12358;&#25163;&#27573;&#12434;&#24605;&#12356;&#20986;&#12375;&#12390;&#35299;&#27770;&#12375;&#12414;&#12375;&#12383;&#12290;
&quot;!=&quot; &#12434;&#20351;&#12360;&#12400;&#12424;&#12356;&#12424;&#12358;&#12391;&#12377;&#12290;

|caption=&#20363;: escape_html: true
|
|&#12467;&#12540;&#12489;,&#32080;&#26524;
|
|!= link_to(...),&amp;lt;a href=...
|= link_to(...),&amp;amp;lt;a href=...
|=h link_to(...),&amp;amp;amp;lt;a href=...



</body>
    <cached-tag-list>haml monk</cached-tag-list>
    <comments-count type="integer">2</comments-count>
    <created-at type="datetime">2010-02-08T08:34:16+00:00</created-at>
    <daily-archive-id type="integer">1334</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1709</id>
    <monthly-archive-id type="integer">212</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2010-02-08T07:55:00+00:00</published-at>
    <secret>6645c74c-12ca-4c1e-bc2e-1c20157319bd</secret>
    <title>haml &#12398; escape_html &#20013;&#12391; escape &#12375;&#12394;&#12356;&#26041;&#27861;</title>
    <updated-at type="datetime">2010-02-08T08:34:16+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>link_to &#31561;&#12398;&#12504;&#12523;&#12497;&#12513;&#12477;&#12483;&#12489;&#12399; sinatra &#26412;&#20307;&#12395;&#12399;&#21547;&#12414;&#12428;&#12390;&#12356;&#12414;&#12379;&#12435;&#12364;&#12289;
sinatra_more &#12392;&#12356;&#12358; gem &#12364;&#29992;&#24847;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;

## install

shell&gt;&gt;
% gem install sinatra_more
&lt;&lt;--

## standalone &#21033;&#29992;&#12398;&#22580;&#21512;

&#30452;&#25509; Sinatra::Base &#12395; register &#12375;&#12390;&#12375;&#12414;&#12356;&#12414;&#12375;&#12423;&#12358;&#12290;

ruby&gt;&gt;
require 'sinatra'
...
require 'sinatra_more/markup_plugin'
Sinatra::Base.register SinatraMore::MarkupPlugin
...
get '/' do
  ...
&lt;&lt;--

## &#12463;&#12521;&#12473;&#21033;&#29992;&#12398;&#22580;&#21512;

&#35442;&#24403;&#12463;&#12521;&#12473;&#12391; register &#12375;&#12414;&#12377;&#12290;

ruby&gt;&gt;
require 'sinatra_more/markup_plugin'

class Application &lt; Sinatra::Base
  register SinatraMore::MarkupPlugin
end
&lt;&lt;--

## MarkupPlugin

link_to &#12384;&#12369;&#12391;&#12394;&#12367;&#12289;&#20840;56&#31278;(ver 0.3.33 &#29694;&#22312;)&#12418;&#12398;&#12504;&#12523;&#12497;&#12513;&#12477;&#12483;&#12489;&#12364;&#21033;&#29992;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;
&#20197;&#19979;&#12395;&#12289;&#12424;&#12367;&#20351;&#12356;&#12381;&#12358;&#12394;&#12418;&#12398;&#12434;&#25244;&#31883;&#12375;&#12414;&#12377;&#12290;

ruby&gt;&gt;
link_to(*args, &amp;block)
stylesheet_link_tag(*sources)
javascript_include_tag(*sources)
image_tag(url, options={})
image_path(src)
escape_html(text)
h!(text, blank_text = '&amp;nbsp;')
content_tag(*args, &amp;block)
tag(name, options={})
input_tag(type, options = {})
form_for(object, url, settings={}, &amp;block)
text_field_tag(name, options={})
&lt;&lt;--

&#35443;&#32048;&#12399; lib/sinatra_more/markup_plugin/*.rb &#12434;&#30906;&#35469;&#12375;&#12390;&#19979;&#12373;&#12356;&#12290;

## &#12381;&#12398;&#20182;&#12398;Plugin

sinatra_more gem &#12395;&#12399;&#12289;
MarkupPlugin &#20197;&#22806;&#12395;&#12418;
RenderPlugin&#12289;WardenPlugin&#12289;MailerPlugin&#12289;RoutingPlugin
&#12392;&#12356;&#12387;&#12383;&#12503;&#12521;&#12464;&#12452;&#12531;&#12364;&#29992;&#24847;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;
&#21033;&#29992;&#26041;&#27861;&#12399; MarkupPlugin &#12398;&#22580;&#21512;&#12392;&#21516;&#12376;&#12391;&#12289;
&#21033;&#29992;&#12375;&#12383;&#12356;&#12503;&#12521;&#12464;&#12452;&#12531;&#21517;&#12434;&#21015;&#25369;&#12375;&#12390;&#12356;&#12365;&#12414;&#12377;&#12290;

ruby&gt;&gt;
require 'sinatra_more/markup_plugin'
require 'sinatra_more/render_plugin'
Sinatra::Base.register SinatraMore::MarkupPlugin
Sinatra::Base.register SinatraMore::RenderPlugin
...
&lt;&lt;--

&#21508;&#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20195;&#34920;&#30340;&#12394;&#12513;&#12477;&#12483;&#12489;&#12434;&#35352;&#36617;&#12375;&#12414;&#12377;&#12290;
&#20363;&#12360;&#12400;&#12289;RenderPlugin &#12395;&#12399;&#12415;&#12435;&#12394;&#22823;&#22909;&#12365;&#12394; &quot;partial&quot; &#12364;&#20837;&#12387;&#12390;&#12383;&#12426;&#12375;&#12414;&#12377;&#12398;&#12391;&#12289;&#12375;&#12387;&#12363;&#12426;&#12481;&#12455;&#12483;&#12463;&amp;register &#12375;&#12414;&#12375;&#12423;&#12358;&#12290;

## RenderPlugin

&#25551;&#30011;&#31995;&#12503;&#12521;&#12464;&#12452;&#12531;

ruby&gt;&gt;
partial(template, options={})
erb_template(template_path, options={})
haml_template(template_path, options={})
render_template(template_path, options={})
&lt;&lt;--

## WardenPlugin

&#35469;&#35388;&#31995;&#12503;&#12521;&#12464;&#12452;&#12531;

ruby&gt;&gt;
current_user
authenticate_user!
logged_in?
authenticated?(&amp;block)
&lt;&lt;--

## MailerPlugin

&#12513;&#12540;&#12523;&#38306;&#20418;&#65311;(&#20351;&#12431;&#12394;&#12356;&#12398;&#12391;&#26410;&#35519;&#26619;)

## RoutingPlugin

&#12523;&#12540;&#12486;&#12451;&#12531;&#12464;&#31995;&#12503;&#12521;&#12464;&#12452;&#12531; (named route?)

ruby&gt;&gt;
map(*args, &amp;block)
  # map(:accounts).to('/accounts/url')
  # map(:admin, :show).to('/admin/show/:id')
  # map(:admin) { |namespace| namespace.map(:show).to('/admin/show/:id') }
&lt;&lt;--


</body>
    <cached-tag-list>sinatra</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2010-02-04T01:10:55+00:00</created-at>
    <daily-archive-id type="integer">1330</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1704</id>
    <monthly-archive-id type="integer">212</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink>/articles/1704</permalink>
    <published-at type="datetime">2010-02-04T00:22:00+00:00</published-at>
    <secret>fcdd0c43-65f2-4a3c-9bc7-7abb53424726</secret>
    <title>Sinatra &#12391; link_to &#12434;&#20351;&#12358;</title>
    <updated-at type="datetime">2010-02-04T01:10:56+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>Rails + Cucumber &#12391; Culerity &#12434;&#20351;&#12358;&#12392;&#12289;
&#20197;&#19979;&#12398;&#12424;&#12358;&#12394; WARNING &#12364;&#22823;&#37327;&#12395;&#30330;&#29983;&#12377;&#12427;&#12290;
&#12371;&#12428;&#12391;&#12399;&#12289;&#12356;&#12367;&#12425;&#12486;&#12473;&#12488;&#12364;green&#12391;&#12418;&#31934;&#31070;&#12399;red&#12395;&#12394;&#12387;&#12390;&#12375;&#12414;&#12358;&#12290;

shell&gt;&gt;
% cucumber features/foo.feature
Using the default profile...
2010/01/20 18:43:57 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
&#35686;&#21578;: Obsolete content type encountered: 'text/javascript'.
2010/01/20 18:43:58 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
&#35686;&#21578;: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/amazonJQ/amazonJQ-combined-core-5113._V228305908_.js', but got 'application/x-javascript'.
(...)
.

1 scenario (1 passed)
1 step (1 passed)
&lt;&lt;--

&#12371;&#12398;&#35686;&#21578;&#12513;&#12483;&#12475;&#12540;&#12472;&#12399;&#12289; HtmlUnit &#12364;&#21520;&#12356;&#12390;&#12356;&#12427;&#12418;&#12398;&#12391;&#12354;&#12427;&#12364;&#12289;
Culerity::RemoteBrowserProxy &#12398;&#12458;&#12503;&#12471;&#12519;&#12531;(log_level)
&#12391;&#21046;&#24481;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12290;
&#20855;&#20307;&#30340;&#12395;&#12399;&#12289;
&quot;script/generate culerity&quot; &#12434;&#21033;&#29992;&#12375;&#12383;&#22580;&#21512;&#12289;
&#20197;&#19979;&#12398; step &#12501;&#12449;&#12452;&#12523;&#20869;&#12391;&#23450;&#32681;&#12373;&#12428;&#12390;&#12356;&#12427;&#12290;

shell&gt;&gt;
% vi features/step_definitions/culerity_steps.rb
-  $browser.log_level = :warning
+  $browser.log_level = :severe
&lt;&lt;--

(celerity &#12398; default &#12399; :off &#12384;&#12364;&#12289;culerity &#12364; :warning &#12395;&#12375;&#12390;&#12356;&#12427;)

&#19978;&#35352;&#12398;&#20462;&#27491;&#12395;&#12424;&#12387;&#12390;&#12289;WARNING &#12398;&#34920;&#31034;&#12364;&#25233;&#21046;&#12373;&#12428;&#12427;&#12290;

shell&gt;&gt;
% cucumber features/foo.feature
Using the default profile...
.

1 scenario (1 passed)
1 step (1 passed)
&lt;&lt;--

&#26032;&#35215;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#24230;&#12395;&#27598;&#22238;&#22793;&#26356;&#12377;&#12427;&#12398;&#12364;&#38754;&#20498;&#12391;&#12354;&#12428;&#12400;&#12289;
generator &#12398; template &#12434;&#30452;&#25509;&#22793;&#26356;&#12377;&#12427;&#12398;&#12418;&#12356;&#12356;&#12363;&#12418;&#12375;&#12428;&#12394;&#12356;&#12290;

shell&gt;&gt;
% vi $GEM_PATH/gems/culerity-0.2.7/rails_generators/culerity/templates/features/step_definitions/culerity_steps.rb
&lt;&lt;--

&#25351;&#23450;&#21487;&#33021;&#12394; log_level &#12399;&#12289;
    (&#39640;) :all, :severe, :warning, :info, :config, :fine, :finer, :finest, :off (&#20302;)
&#12391;&#12354;&#12426;&#12289;&#23455;&#38555;&#12395;&#20197;&#19979;&#12398;&#12467;&#12540;&#12489;&#12391;&#30906;&#35469;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12290;(JRuby)

ruby&gt;&gt;
% irb
irb(main):001:0&gt; java.util.logging.Level.constants
=&gt; [&quot;FINE&quot;, &quot;CONFIG&quot;, &quot;FINEST&quot;, &quot;FINER&quot;, &quot;WARNING&quot;, &quot;SEVERE&quot;, &quot;OFF&quot;, &quot;INFO&quot;, &quot;ALL&quot;]
&lt;&lt;--


log level &#12395;&#38306;&#12377;&#12427;&#12373;&#12425;&#12394;&#12427;&#35443;&#32048;&#12399; java.util.logging.Level &#12434;&#21442;&#29031;&#12398;&#12371;&#12392;&#12290;

[http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/util/logging/Level.html](http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/util/logging/Level.html)


</body>
    <cached-tag-list>Rails JRuby Celerity Culerity HtmlUnit</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2010-01-20T10:39:01+00:00</created-at>
    <daily-archive-id type="integer">1320</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1690</id>
    <monthly-archive-id type="integer">206</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2010-01-20T09:50:00+00:00</published-at>
    <secret>2358a602-f3f6-47bb-8382-db4520ae56b7</secret>
    <title>Cucumber &#12391; Celerity &#12398; WARNING &#12434;&#25233;&#21046;</title>
    <updated-at type="datetime">2010-01-20T10:39:01+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>(&#20197;&#19979;&#12399; PostgreSQL &#12434;&#20363;&#12395;&#12375;&#12390;&#12414;&#12377;&#12364;&#12289;&#20182;&#12398;&#12489;&#12521;&#12452;&#12496;&#12391;&#12418;&#36890;&#29992;&#12377;&#12427;&#12392;&#24605;&#12356;&#12414;&#12377;)

## install

&#12414;&#12378;&#12399; JRuby &#29992;&#12398;&#12489;&#12521;&#12452;&#12496;&#12434;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12375;&#12414;&#12377;&#12290;

shell&gt;&gt;
% gem install activerecord-jdbcpostgresql-adapter
&lt;&lt;--

## &#35373;&#23450;

&#36890;&#24120;&#12399; database.yml &#12395; &quot;adapter: jdbcpostgresql&quot; &#12392;&#35352;&#36848;&#12375;&#12390;&#21033;&#29992;&#12377;&#12427;&#12398;&#12391;&#12377;&#12364;&#12289;&#12371;&#12371;&#12391;&#12399;&#21029;&#12398;&#26041;&#27861;&#12434;&#32057;&#20171;&#12375;&#12414;&#12377;&#12290;
&#20869;&#23481;&#12399;&#31777;&#21336;&#12391;&#20197;&#19979;&#12398;&#12467;&#12540;&#12489;&#12434;&#35413;&#20385;&#12377;&#12427;&#12384;&#12369;&#12391;&#12377;&#12290;

ruby&gt;&gt;
if RUBY_PLATFORM == &quot;java&quot;
  require &quot;active_record/connection_adapters/jdbcpostgresql_adapter&quot;
end
&lt;&lt;--

(Rails&#12391;&#12354;&#12428;&#12400; &quot;config/initializers/jruby_compat.rb&quot; &#12394;&#12393;&#12395;&#35352;&#36848;&#12375;&#12390;&#12362;&#12367;&#12392;&#12424;&#12356;&#12391;&#12375;&#12423;&#12358;)

## &#12513;&#12522;&#12483;&#12488;

 * MRI &#12392;&#21516;&#12376;&#12450;&#12480;&#12503;&#12479;&#21517; &quot;postgresql&quot; &#12434;&#21033;&#29992;&#12391;&#12365;&#12427;
 * &#22793;&#26356;&#12394;&#12375;&#12391; MRI, JRuby &#12398;&#12393;&#12385;&#12425;&#12391;&#12418;&#21205;&#20316;&#12377;&#12427;

## &#23455;&#34892;&#20363;

shell&gt;&gt;
% rvm use system
% ./script/console
&gt;&gt; User.count
=&gt; 6
&gt;&gt; User.connection.class
=&gt; ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

% rvm use jruby
% ./script/console
&gt;&gt; User.count
=&gt; 6
&gt;&gt; User.connection.class
=&gt; ActiveRecord::ConnectionAdapters::JdbcAdapter
&lt;&lt;--

JRuby &#12399;&#12414;&#12384;&#30330;&#23637;&#36884;&#19978;&#12391;&#12377;&#12398;&#12391;&#12289;
&#38283;&#30330;&#12420;&#25369;&#21205;&#30906;&#35469;&#12391; MRI &#12434;&#21033;&#29992;&#12377;&#12427;&#23616;&#38754;&#12364;&#22810;&#12293;&#12354;&#12426;&#12414;&#12377;&#12290;
&#12381;&#12435;&#12394;&#25240;&#12289;&#12371;&#12398;&#26041;&#27861;&#12391;&#12354;&#12428;&#12400;&#12356;&#12385;&#12356;&#12385; database.yml &#12398;&#20869;&#23481;&#12434;&#22793;&#26356;&#12377;&#12427;&#24517;&#35201;&#12364;&#12394;&#12356;&#12383;&#12417;&#12289;&#38750;&#24120;&#12395;&#12471;&#12540;&#12512;&#12524;&#12473;&#65286;&#24555;&#36969;&#12395;&#21033;&#29992;&#12391;&#12365;&#12427;&#12392;&#24605;&#12356;&#12414;&#12377;&#12290;

</body>
    <cached-tag-list>Rails JRuby ActiveRecord PostgreSQL</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2010-01-18T23:44:18+00:00</created-at>
    <daily-archive-id type="integer">1319</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1689</id>
    <monthly-archive-id type="integer">206</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2010-01-18T23:16:00+00:00</published-at>
    <secret>b2917863-a423-4720-8e99-2153ee184807</secret>
    <title>Ruby &#12392; JRuby &#12391;&#12471;&#12540;&#12512;&#12524;&#12473;&#12395; ActiveRecord &#12434;&#20351;&#12358;&#26041;&#27861;</title>
    <updated-at type="datetime">2010-01-18T23:44:18+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>chasen &#12434;&#20037;&#12293;&#12395;&#20351;&#12387;&#12390;&#12415;&#12383;&#12392;&#12371;&#12429;&#20197;&#19979;&#12398;&#12456;&#12521;&#12540;&#12364;&#20986;&#12414;&#12375;&#12383;&#12290;
(chasen-2.4.4-2 @ Ubuntu) 

pre&gt;&gt;
% chasen foo.txt
chasen: /var/lib/chasen/dic/debian/cforms.cha:9-21: no basic form
&lt;&lt;--

&#35519;&#12409;&#12390;&#12415;&#12383;&#12392;&#12371;&#12429;&#12289;naist-jdic-utf8 &#12497;&#12483;&#12465;&#12540;&#12472;&#12398;&#19981;&#20855;&#21512;&#12391;&#12289;
&#20197;&#19979;&#12398;&#12467;&#12540;&#12489;&#12434;&#35373;&#23450;&#12501;&#12449;&#12452;&#12523;&#12395;&#36861;&#21152;&#12377;&#12427;&#12371;&#12392;&#12391;&#35299;&#27770;&#12377;&#12427;&#12424;&#12358;&#12391;&#12377;&#12290;
(&#22580;&#25152;&#12399;&#12393;&#12371;&#12391;&#12418;&#12356;&#12356;&#12392;&#24605;&#12358;&#12398;&#12391;&#12392;&#12426;&#12354;&#12360;&#12378;&#19968;&#30058;&#19979;&#12395;&#36861;&#21152;)

pre&gt;&gt;
# vi /usr/share/chasen/chasenrc-utf8
...
(ENCODE &quot;w&quot;)
&lt;&lt;--

(http://groups.google.co.jp/group/linux.debian.bugs.dist/browse_thread/thread/4fb69cc926bf8bc1?pli=1)

pre&gt;&gt;
% chasen foo.txt
&#12354;      &#12450;      &#12354;      &#24863;&#21205;&#35422;
&#12356;&#12358;    &#12452;&#12454;    &#12356;&#12358;    &#21205;&#35422;-&#33258;&#31435;   ...
&#12360;      &#12456;      &#12360;      &#24863;&#21205;&#35422;
&#12362;      &#12458;      &#12362;      &#24863;&#21205;&#35422;
EOS
&lt;&lt;--

&#27425;&#12398;&#12522;&#12522;&#12540;&#12473;&#12391;&#12399;&#27835;&#12427;&#20104;&#23450;&#12398;&#12424;&#12358;&#12391;&#12377;&#12290;

</body>
    <cached-tag-list></cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2010-01-02T16:47:15+00:00</created-at>
    <daily-archive-id type="integer">1312</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1682</id>
    <monthly-archive-id type="integer">206</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink>/articles/1682</permalink>
    <published-at type="datetime">2010-01-02T16:36:00+00:00</published-at>
    <secret>b8e8434b-c6a3-4d88-9d28-79cbd1a599ad</secret>
    <title>chasen &#12391;&#12456;&#12521;&#12540;</title>
    <updated-at type="datetime">2010-01-02T16:47:16+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>haml &#12399;&#27083;&#36896;&#21270;&#25991;&#31456;&#12434;&#12471;&#12531;&#12503;&#12523;&#12363;&#12388;&#24375;&#21147;&#12395;&#35352;&#36848;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12364;&#12289;
&#35079;&#25968;&#34892;&#12398;&#12487;&#12540;&#12479;&#12398;&#25201;&#12356;&#12395;&#12399;&#20197;&#19979;&#12398;&#29702;&#30001;&#12391;&#19981;&#21521;&#12365;&#12391;&#12354;&#12427;&#12290;

 * &#34892;&#25351;&#21521;&#12391;&#12354;&#12427;&#12383;&#12417;&#36969;&#20999;&#12394;&#12452;&#12531;&#12487;&#12531;&#12488;&#12398;&#35352;&#36848;&#12364;&#24375;&#35201;&#12373;&#12428;&#12427;
 * &#38929;&#24373;&#12387;&#12390;&#22475;&#12417;&#36796;&#12435;&#12391;&#12418;&#21487;&#35501;&#24615;&#12364;&#33853;&#12385;&#12390;&#20840;&#20307;&#12398;&#27083;&#36896;&#12364;&#25226;&#25569;&#12375;&#36763;&#12367;&#12394;&#12427;

&#12371;&#12428;&#12434;&#25913;&#21892;&#12377;&#12427;&#12395;&#12399;&#12289;&#12467;&#12540;&#12489;(&#27083;&#36896;&#24773;&#22577;)&#12392;&#12487;&#12540;&#12479;&#12398;&#20998;&#38626;&#12364;&#24517;&#35201;&#12395;&#12394;&#12427;&#12290;

## inline filter module

ruby&gt;&gt;
module Inline
  include Haml::Filters::Base
 
  def self.[](key)
    @@data[key.to_s] rescue nil
  end
 
  def render(str)
    @@data = Hash[*str.split(/^\s*@@\s*(\w+)\s*\n/m)[1..-1]]
    return nil
  end
end
&lt;&lt;--

&#19978;&#35352;&#12434;&#35413;&#20385;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;
sinatra &#12398; in file template &#12398;&#12424;&#12358;&#12395;&#12487;&#12540;&#12479;&#32676;&#12434;&#31649;&#29702;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12394;&#12427;&#12290;


## &#20837;&#21147;(haml)

haml&gt;&gt;
%h1 Inline Filter
.describe= Inline[:describe]
.author created by #{Inline[:author]}
 
:inline
 @@ describe
 This filter easily separates structure and data.
 You can use in-file-templates like sinatra.
 
 @@ author
 maiha@wota.jp
&lt;&lt;--


## &#20986;&#21147;(html)


html&gt;&gt;
&lt;h1&gt;Inline Filter&lt;/h1&gt;
&lt;div class='describe'&gt;
  This filter easily separates structure and data.
  You can use in-file-templates like sinatra.
&lt;/div&gt;
&lt;div class='author'&gt;created by maiha@wota.jp&lt;/div&gt;
&lt;&lt;--
</body>
    <cached-tag-list>haml inline template</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2009-10-20T20:59:32+00:00</created-at>
    <daily-archive-id type="integer">1279</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1645</id>
    <monthly-archive-id type="integer">198</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2009-10-20T20:39:00+00:00</published-at>
    <secret>ff93839c-7fe4-46e6-b5ff-5f9ddb835cb5</secret>
    <title>haml &#12391; in file template</title>
    <updated-at type="datetime">2009-10-20T20:59:32+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body># Gears &#12434;&#20351;&#12358;&#12395;&#12399;

 1. gears_init.js &#12398;&#35501;&#12415;&#36796;&#12415;
 2. &#20302;&#12524;&#12505;&#12523;API&#12434;&#39366;&#20351;

&#12392;&#12356;&#12358;&#38754;&#20498;&#12394;&#20316;&#26989;&#12364;&#24517;&#35201;&#12395;&#12394;&#12427;&#12290;


# &#20855;&#20307;&#30340;&#12395;&#12399;


html&gt;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;gears_init.js&quot;&gt;&lt;/script&gt;
&lt;&lt;--

javascript&gt;&gt;
var db = google.gears.factory.create('beta.database');
db.open(&quot;database-demo&quot;);
var rs = db.execute(&quot;select name from users&quot;);
while(rs.isValidRow()) {
  name = rs.fieldByName('name');
  rs.next();
}
rs.close();
db.close();
&lt;&lt;--

&#12398;&#12424;&#12358;&#12394;&#12467;&#12540;&#12489;&#12364;&#24517;&#35201;&#12395;&#12394;&#12426;&#12289;&#20170;&#26085;&#26085;&#12371;&#12358;&#12356;&#12358;&#12398;&#12399;&#26360;&#12365;&#12383;&#12367;&#12394;&#12356;&#12290;
&#12381;&#12371;&#12391;&#12289;

# active_record.js &#12434;&#20351;&#12358;

Aptana &#12364;&#25552;&#20379;&#12375;&#12390;&#12427; activejs &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398; ActiveRecord &#12521;&#12452;&#12502;&#12521;&#12522;&#12434;&#21033;&#29992;&#12377;&#12427;&#12392;&#12289;&#20197;&#19979;&#12398;&#12424;&#12358;&#12395;&#12377;&#12387;&#12365;&#12426;&#12377;&#12427;&#12290;


html&gt;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;active_record.js&quot;&gt;&lt;/script&gt;
&lt;&lt;--

javascript&gt;&gt;
ActiveRecord.connect(ActiveRecord.Adapters.Gears,'database-demo');
var User = ActiveRecord.create('users', {name:''});
User.create({name:'maiha'});
&lt;&lt;--

Rails&#12398;AR&#12434;&#24544;&#23455;&#12395;JavaScript&#12408;&#31227;&#26893;&#12375;&#12390;&#12354;&#12427;&#12383;&#12417;&#12289;
AR&#12395;&#24931;&#12428;&#12390;&#12356;&#12428;&#12400;&#12411;&#12412;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12394;&#12375;&#12391;&#20351;&#12360;&#12427;&#12398;&#12364;&#23305;&#12375;&#12356;&#12290;


javascript&gt;&gt;
maiha = User.findByName('maiha');  // Dynamic Finder
name  = maiha.name; // Accessor methods
maiha.name = 'foo';
maiha.save();

User.count();
User.find({all: true, order: 'name'});
&lt;&lt;--

&#20182;&#12395;&#12418;
 * Validation
 * Callback
 * Relation (hasOne, hasMany, belongsTo)
 * Migration

&#12392;&#12356;&#12387;&#12383;&#27231;&#33021;&#12364;&#23455;&#35013;&#12373;&#12428;&#12390;&#12362;&#12426;&#12289;
AR&#12398;&#31227;&#26893;&#29289;&#12392;&#12375;&#12390;&#12415;&#12390;&#12418;&#23436;&#25104;&#24230;&#12364;&#38750;&#24120;&#12395;&#39640;&#12356;&#12290;
&#12385;&#12394;&#12415;&#12395;&#12289;js &#12398;&#12469;&#12452;&#12474;&#12399; compaction &#12394;&#12375;&#12391;200KB&#31243;&#24230;&#12290;

# &#21442;&#32771;

 * http://activerecordjs.org/
</body>
    <cached-tag-list>JavaScript Gears AR</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2009-10-19T05:51:56+00:00</created-at>
    <daily-archive-id type="integer">1278</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1644</id>
    <monthly-archive-id type="integer">198</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink>/articles/1644</permalink>
    <published-at type="datetime">2009-10-19T05:12:00+00:00</published-at>
    <secret>a78a41f2-72bd-4db0-aa16-9071cf4c8511</secret>
    <title>ActiveRecord on Gears</title>
    <updated-at type="datetime">2009-10-19T05:51:57+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>S-IDE &#12391;&#12399;&#25805;&#20316;&#23550;&#35937;&#12398;&#35201;&#32032;&#12434; xpath &#12391;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12290;

|caption=&#20363;&#65306;xpath&#12398;&#26126;&#31034;
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|click,xpath=//h2/a,

&#23550;&#35937;&#35201;&#32032;&#12434;&#29305;&#23450;&#12377;&#12427;&#12371;&#12398;&#27231;&#33021;&#12399; Element Locator &#12392;&#21628;&#12400;&#12428;&#12289;
Selenium Core &#12391;&#25552;&#20379;&#12373;&#12428;&#12390;&#12356;&#12427;&#12290;

javascript&gt;&gt;
BrowserBot.prototype.findElement = function(locator, win) {
    var element = this.findElementOrNull(locator, win);
    if (element == null) throw new SeleniumError(&quot;Element &quot; + locator + &quot; not found&quot;);
    return element;
}
&lt;&lt;--
(selenium-core-1.0.1/core/scripts/selenium-browserbot.js)

&#24467;&#12387;&#12390;&#12289;S-IDE &#12398;&#23550;&#35937;&#25351;&#23450;&#20197;&#22806;&#12391;&#12398;&#22580;&#25152;&#12289;
&#20363;&#12360;&#12400;&#33258;&#20316;&#38306;&#25968;&#20869;&#12420; getEval &#12398;&#20013;&#12394;&#12393;&#12391;&#20351;&#12356;&#12383;&#12356;&#22580;&#21512;&#12395;&#12399;&#12289;
&#19978;&#35352;&#12398; findElement &#12434;&#30452;&#25509;&#21628;&#12403;&#20986;&#12377;&#12392;&#12424;&#12356;&#12290;

|HP,2703/2842
|MP,1413/1413

javascript&gt;&gt;
function isHpFull(percent) {
  var path = '//tr[0]/td[1]';
  var hp   = selenium.browserbot.findElement(path).split('/');
  var hp1  = parseInt(hp[0]);
  var hp2  = parseInt(hp[1]);
  return ((hp1 * 100 / hp2) &gt; percent);
}
&lt;&lt;--

|caption=&#20363;&#65306;HP&#12364;90%&#20197;&#19978;&#12354;&#12427;&#22580;&#21512;&#12399;&#23487;&#23627;&#12395;&#20837;&#12425;&#12394;&#12356;
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|gotoIf,isHpFull(90),skip_inn
|click,label=&#23487;&#23627;,
|label,skip_inn,

&#38306;&#36899;&#12392;&#12375;&#12390;&#12289;Selenium &#29872;&#22659;&#12391;&#12399;&#12394;&#12356;&#29366;&#24907;&#12398; Mozilla &#12391; xpath &#12434;&#25201;&#12358;&#12395;&#12399;&#12289;
document.evaluate &#12364;&#20415;&#21033;&#12391;&#12354;&#12427;&#12290;

ruby&gt;&gt;
function xpath2text(path) {
  var result = document.evaluate(path, doc, null, 7, null);
  var item = result.snapshotItem(0);
  return item.innerHTML;
}
&lt;&lt;--

&#21442;&#32771;
 * https://developer.mozilla.org/ja/Introduction_to_using_XPath_in_JavaScript

</body>
    <cached-tag-list>Selenium xpath</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2009-09-25T21:50:16+00:00</created-at>
    <daily-archive-id type="integer">1262</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1624</id>
    <monthly-archive-id type="integer">194</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2009-09-25T21:51:00+00:00</published-at>
    <secret>06076d46-9b31-41b3-9517-53967a1af6c5</secret>
    <title>Selenium IDE &#12391; xpath</title>
    <updated-at type="datetime">2009-09-25T21:56:07+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>S-IDE &#12391;&#12523;&#12540;&#12503;&#12420;&#26465;&#20214;&#20998;&#23696;&#12392;&#12356;&#12387;&#12383;&#12501;&#12525;&#12540;&#12467;&#12531;&#12488;&#12525;&#12540;&#12523;&#12434;&#34892;&#12358;&#12383;&#12417;&#12398;&#12513;&#12514;

## &#19979;&#31574;&#65306;TR&#12434;&#12467;&#12500;&#12506;

[&#12518;&#12540;&#12473;&#12465;&#12540;&#12473;] &#28961;&#38480;&#12391;&#12394;&#12367;&#12390;&#12356;&#12356;&#12363;&#12425;&#36969;&#24230;&#12395;&#12356;&#12414;&#12377;&#12368;

|caption=&#20363;&#65306;&#22909;&#12365;&#12394;&#12384;&#12369;&#12467;&#12500;&#12506;
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|open,/users/new,
|type,name,maiha
|type,pass,xxxxx
|open,/users/new,
|...,,

1,000&#12458;&#12506;&#12524;&#12540;&#12471;&#12519;&#12531;&#12399;&#20840;&#28982;&#22823;&#19976;&#22827;&#12384;&#12387;&#12383;&#12369;&#12393;&#12289;
10,000&#12368;&#12425;&#12356;&#26360;&#12356;&#12383;&#12425;&#33394;&#12293;&#37325;&#12367;&#12394;&#12387;&#12383;&#12398;&#12391;&#27880;&#24847;

## &#20013;&#31574;&#65306;flowControl extension &#12434;&#20351;&#12358;

[&#12518;&#12540;&#12473;&#12465;&#12540;&#12473;] &#12523;&#12540;&#12503;&#12384;&#12369;&#12391;&#12394;&#12367;&#26465;&#20214;&#20998;&#23696;&#12418;&#12391;&#12365;&#12427;

### &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;

Andrey &#12364;&#20316;&#12387;&#12383; flowControl &#12399; Selenium &#29992;&#12391;&#12354;&#12427;&#12364;&#12289;
&#12381;&#12428;&#12434; Darren &#12364; S-IDE &#12395;&#31227;&#26893;&#12375;&#12383;(goto_sel_ide.js)
&#12398;&#12391; Selenium Core &#25313;&#24373;&#12392;&#12375;&#12390;&#35501;&#12415;&#36796;&#12414;&#12379;&#12427;&#12290;

 * http://51elliot.blogspot.com/2008/02/selenium-ide-goto.html


|caption=&#20363;&#65306;&#33775;&#40599;&#12395; goto
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|label,create_user,
|open,/users/new,
|type,name,maiha
|type,pass,xxxxx
|goto,create_user,


## &#19978;&#31574;&#65306;while &#12391;&#25915;&#12417;&#12427;

[&#12518;&#12540;&#12473;&#12465;&#12540;&#12473;] goto &#12399;&#12522;&#12450;&#12523;&#12391;&#28961;&#38480;&#12394;&#12398;&#12391; while &#12391;&#22238;&#25968;&#25351;&#23450;&#12377;&#12427;

|caption=&#20363;&#65306;while &#12391;500&#12523;&#12540;&#12503;&#25351;&#23450;
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|store,0,i
|while,storedVars.i++ &lt; 500,
|open,/users/new,
|type,name,maiha
|type,pass,xxxxx
|endWhile,,

flowControl&#12398;&#12381;&#12398;&#20182;&#12398;&#21629;&#20196;&#21450;&#12403;&#35443;&#32048;&#12394;&#20351;&#12356;&#26041;&#12399;
 * http://wiki.openqa.org/display/SEL/flowControl
</body>
    <cached-tag-list></cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2009-09-21T17:40:26+00:00</created-at>
    <daily-archive-id type="integer">1258</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1619</id>
    <monthly-archive-id type="integer">194</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2009-09-21T16:58:00+00:00</published-at>
    <secret>5bc09df9-5ab1-4ff5-93b9-e07a5f33b2c5</secret>
    <title>Selenium IDE &#12391;&#28961;&#38480;&#12523;&#12540;&#12503;</title>
    <updated-at type="datetime">2009-09-21T17:40:26+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
  <article>
    <body>&#33258;&#20316;&#38306;&#25968;&#12434;IDE&#19978;&#12391;&#21033;&#29992;&#12377;&#12427;&#12395;&#12399;&#12289;
&#23450;&#32681;&#12375;&#12383; js &#12501;&#12449;&#12452;&#12523;&#12434;[&#12458;&#12503;&#12471;&#12519;&#12531;]&#8594;[&#35373;&#23450;]&#12395;&#12354;&#12427;&#12300;Selenium Core &#25313;&#24373;&#12473;&#12463;&#12522;&#12503;&#12488;&#12301;&#12391;&#25351;&#23450;&#12377;&#12427;&#12290;

### user.js

javascript&gt;&gt;
function eachTag(name, attr, value, func) {
  var win = selenium.page().getCurrentWindow();
  var tags = win.document.getElementsByTagName(name);
  for (var i=0; i&lt;tags.length; i++) {
    if (tags[i].getAttribute(attr) == value) { func(tags[i]); }
  }
}

function reportErrors() {
  eachTag('div', 'class', 'fieldWithErrors' , function(e) {LOG.warn(e.innerHTML);});
}
&lt;&lt;--

|caption=&#20363;&#65306;&#12456;&#12521;&#12540;&#20869;&#23481;&#12398;&#12487;&#12496;&#12483;&#12464;&#34920;&#31034;
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|open,/users/new,
|type,name,maiha
|clickAndWait,create,
|getEval,reportErrors(),


|caption=&#20363;&#65306;&#12521;&#12531;&#12480;&#12512;&#12394;&#25991;&#23383;&#21015;&#12392;&#12363;
|
|&#12467;&#12510;&#12531;&#12489;,&#23550;&#35937;,&#20516;
|
|open,/users/new,
|type,name,maiha
|type,pass,javascript{randomWord(8)}

(&#8251; &quot;function randomWord(size)&quot; &#12364; user.js &#12395;&#23450;&#32681;&#28168;&#12392;&#12375;&#12390;)</body>
    <cached-tag-list>Selenium</cached-tag-list>
    <comments-count type="integer">0</comments-count>
    <created-at type="datetime">2009-09-20T18:44:39+00:00</created-at>
    <daily-archive-id type="integer">1257</daily-archive-id>
    <filter-type>blue_stole</filter-type>
    <id type="integer">1618</id>
    <monthly-archive-id type="integer">194</monthly-archive-id>
    <pdf-digest nil="true"></pdf-digest>
    <permalink nil="true"></permalink>
    <published-at type="datetime">2009-09-20T18:26:00+00:00</published-at>
    <secret>be338dd0-ecec-4253-ab17-a7397dbd93da</secret>
    <title>Selenium IDE &#12391;&#33258;&#20316;&#38306;&#25968;</title>
    <updated-at type="datetime">2009-09-20T19:28:29+00:00</updated-at>
    <user-id type="integer">48</user-id>
  </article>
</articles>
