<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" version="2.0">

<channel>
	<title>Sprint</title>
	
	<link>http://sprint.inspiresynergy.com</link>
	<description>the Inspire Synergy ’s Development Blog</description>
	<pubDate>Fri, 03 Jul 2009 18:11:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/inspiresynergy/sprint" type="application/rss+xml" /><item>
		<title>Ruby on Rails 入門/進階</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/ruby-on-rails-%e5%85%a5%e9%96%80%e9%80%b2%e9%9a%8e/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/ruby-on-rails-%e5%85%a5%e9%96%80%e9%80%b2%e9%9a%8e/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 18:11:27 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=27</guid>
		<description><![CDATA[如何入門 Ruby on Rails : http://blog.xdite.net/?p=1190
進階學習 Ruby on Rails : http://blog.xdite.net/?p=1227
]]></description>
			<content:encoded><![CDATA[<p>如何入門 Ruby on Rails : <span style="font-weight: normal;font-size: 13px">http://blog.xdite.net/?p=1190</span></p>
<p>進階學習 Ruby on Rails : <span style="font-weight: normal;font-size: 13px">http://blog.xdite.net/?p=1227</span></p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/ruby-on-rails-%e5%85%a5%e9%96%80%e9%80%b2%e9%9a%8e/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mac 推薦軟體</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/mac-%e6%8e%a8%e8%96%a6%e8%bb%9f%e9%ab%94/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/mac-%e6%8e%a8%e8%96%a6%e8%bb%9f%e9%ab%94/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 18:07:09 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=43</guid>
		<description><![CDATA[原文：
Mac 推荐软件 (2009)
]]></description>
			<content:encoded><![CDATA[<p>原文：</p>
<p><a href="http://ihower.idv.tw/blog/archives/2861" target="_blank">Mac 推荐软件 (2009)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/mac-%e6%8e%a8%e8%96%a6%e8%bb%9f%e9%ab%94/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Customize Will Paginate Layout</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/customize-will-paginate-layout/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/customize-will-paginate-layout/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:48:39 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=39</guid>
		<description><![CDATA[In Rails 2.0 , the paginate is removed and we start looking into will_paginate for pagination display.
reference:
http://iceskysl.1sters.com/?action=show&#38;id=42
http://rock.errtheblog.com/will_paginate/classes/WillPaginate/ViewHelpers.html
here is our code
&#60;%= page_entries_info @tutor %&#62;
&#60;%- paginated_section @tutor do %&#62;
… display tutor info..
&#60;%- end%&#62;
display would be :

Displaying entries 1-2 of 2 in total
 &#60;div class=”pagination“&#62;


&#60;span class=”disabled prev_page“&#62;上一頁&#60;/span&#62;


&#60;span class=”current“&#62;1&#60;/span&#62;


&#60;a rel=”next“ href=”/tutors/tags/%E7%89%A9%E7%90%86?page=2“&#62;2&#60;/a&#62;


&#60;a class=”next_page“ rel=”next“ href=”/tutors/tags/%E7%89%A9%E7%90%86?page=2“&#62;下一頁&#60;/a&#62;


&#60;/div&#62;

however if we would like to do some layout [...]]]></description>
			<content:encoded><![CDATA[<h2><span style="font-weight: normal;font-size: 13px">In Rails 2.0 , the <span>paginate</span> is removed and we start looking into will_paginate for pagination display.</span></h2>
<p>reference:</p>
<p><a href="http://iceskysl.1sters.com/?action=show&amp;id=42" target="_blank">http://iceskysl.1sters.com/?action=show&amp;id=42</a></p>
<p><a href="http://rock.errtheblog.com/will_paginate/classes/WillPaginate/ViewHelpers.html" target="_blank">http://rock.errtheblog.com/will_paginate/classes/WillPaginate/ViewHelpers.html</a></p>
<p>here is our code</p>
<blockquote><p>&lt;%= page_entries_info @tutor %&gt;</p>
<p>&lt;%- paginated_section @tutor do %&gt;</p>
<p>… display tutor info..</p>
<p>&lt;%- end%&gt;</p></blockquote>
<p>display would be :</p>
<blockquote>
<pre><span>Displaying entries 1-2 of 2 in total</span>
<span> &lt;<span>div</span><span> <span>class</span>=”<span>pagination</span>“</span><span>&gt;</span></span></pre>
<div>
<div>
<div><span>&lt;<span>span</span><span> <span>class</span>=”<span>disabled prev_page</span>“</span><span>&gt;</span><span>上一頁</span>&lt;/<span>span</span>&gt;</span></div>
</div>
<div>
<div><span>&lt;<span>span</span><span> <span>class</span>=”<span>current</span>“</span><span>&gt;</span><span>1</span>&lt;/<span>span</span>&gt;</span></div>
</div>
<div>
<div><span>&lt;<span>a</span><span> <span>rel</span>=”<span>next</span>“</span><span> <span>href</span>=”<span>/tutors/tags/%E7%89%A9%E7%90%86?page=2</span>“</span><span>&gt;</span><span>2</span>&lt;/<span>a</span>&gt;</span></div>
</div>
<div>
<div><span>&lt;<span>a</span><span> <span>class</span>=”<span>next_page</span>“</span><span> <span>rel</span>=”<span>next</span>“</span><span> <span>href</span>=”<span>/tutors/tags/%E7%89%A9%E7%90%86?page=2</span>“</span><span>&gt;</span><span>下一頁</span>&lt;/<span>a</span>&gt;</span></div>
</div>
</div>
<div><span>&lt;/<span>div</span>&gt;</span></div>
</blockquote>
<div><span>however if we would like to do some <span>layout</span> stuff, we have to do some code review on the pagination</span></div>
<div><span>first page_entries_info :</span></div>
<blockquote>
<div><strong>page_entries_info</strong>(collection)</div>
<div>
<div>
<p>Renders a helpful message with numbers of displayed vs. total entries. You can use this as a blueprint for your own, similar helpers.</p>
<pre>  &lt;%= page_entries_info @posts %&gt;
  #-&gt; Displaying entries 6 - 10 of 26 in total</pre>
</div>
<div>
<div>
<pre><span># File lib/will_paginate/view_helpers.rb, line 125</span>
    <span>def</span> <span>page_entries_info</span>(<span>collection</span>)
      <span>%{Displaying entries &lt;b&gt;%d - %d&lt;/b&gt; of &lt;b&gt;%d&lt;/b&gt; in total}</span> <span>%</span> [
        <span>collection</span>.<span>offset</span> <span>+</span> <span>1</span>,
        <span>collection</span>.<span>offset</span> <span>+</span> <span>collection</span>.<span>length</span>,
        <span>collection</span>.<span>total_entries</span>
      ]
    <span>end</span></pre>
</div>
</div>
</div>
</blockquote>
<p>as it said, we can use this as a blueprint for our own, similar helpers. instead i do it quick and dirty :</p>
<blockquote><p>&lt;%= %{%d 個符合的導師 , 顯示 &lt;b&gt;%d - %d&lt;/b&gt; / &lt;b&gt;%d&lt;/b&gt; ,每頁顯示 %d } % [@tutors.total_entries, @tutors.offset + 1, @tutors.offset + @tutors.length, @tutors.total_entries , @tutors.per_page] %&gt;</p></blockquote>
<p>for paginated_section, it would directly passed the arguments to will_paginate, so i just <span>customize</span> the :next_label and :prev_label</p>
<blockquote><p>&lt;%- paginated_section @tutors , :next_label =&gt; ‘下一頁’, :prev_label =&gt; ‘上一頁’ do -%&gt;</p>
<p>&lt;%- end %&gt;</p></blockquote>
<p>Quick and dirty.</p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/customize-will-paginate-layout/feed/</wfw:commentRss>
		</item>
		<item>
		<title>gem dependencies in 2.1.0</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/gem-dependencies-in-210/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/gem-dependencies-in-210/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:48:16 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=37</guid>
		<description><![CDATA[In Rails 2.1 we now have the ability to set gem dependencies.
to config, we can add config.gem in config/environment.rb
When I try to add
config.gem “RedCloth”
config.gem “mime-types”
it throw RedCloth and mime-types error .seems it cannot detect the gems library and always execute gem install .
no such file to load — RedCloth
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/gem_dependency.rb:57:in `load’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in [...]]]></description>
			<content:encoded><![CDATA[<p>In Rails 2.1 we now have the ability to set gem dependencies.</p>
<p>to config, we can add config.gem in config/environment.rb</p>
<p>When I try to add</p>
<blockquote><p>config.gem “RedCloth”</p>
<p>config.gem “mime-types”</p></blockquote>
<p>it throw RedCloth and mime-types error .seems it cannot detect the gems library and always execute gem install .</p>
<blockquote><p>no such file to load — RedCloth<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/gem_dependency.rb:57:in `load’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `__send__’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `to_proc’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `load_gems’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:137:in `process’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run’<br />
/root/apps/duncan_mod/config/environment.rb:13<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/misc.rake:3<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/gems.rake:15<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31<br />
/usr/bin/rake:19:in `load’<br />
/usr/bin/rake:19<br />
no such file to load — mime-types<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/gem_dependency.rb:57:in `load’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `__send__’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `to_proc’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `load_gems’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:137:in `process’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run’<br />
/root/apps/duncan_mod/config/environment.rb:13<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/misc.rake:3<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/gems.rake:15<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31<br />
/usr/bin/rake:19:in `load’<br />
/usr/bin/rake:19<br />
no such file to load — RedCloth<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/gem_dependency.rb:57:in `load’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `__send__’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `to_proc’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `load_gems’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:142:in `process’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run’<br />
/root/apps/duncan_mod/config/environment.rb:13<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/misc.rake:3<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/gems.rake:15<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31<br />
/usr/bin/rake:19:in `load’<br />
/usr/bin/rake:19<br />
no such file to load — mime-types<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/gem_dependency.rb:57:in `load’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `__send__’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in `to_proc’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:246:in `load_gems’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:142:in `process’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run’<br />
/root/apps/duncan_mod/config/environment.rb:13<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’<br />
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/misc.rake:3<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/gems.rake:15<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in `invoke_prerequisites’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run’<br />
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31<br />
/usr/bin/rake:19:in `load’<br />
/usr/bin/rake:19<br />
gem install RedCloth<br />
Successfully installed RedCloth-3.0.4<br />
1 gem installed<br />
gem install mime-types<br />
Successfully installed mime-types-1.15<br />
1 gem installed<br />
Installing ri documentation for mime-types-1.15…<br />
Installing RDoc documentation for mime-types-1.15…</p></blockquote>
<p>however it is not my intend.. after reading http://rails.lighthouseapp.com/projects/8994/tickets/293-gem-dependencies-broken-in-2-1-0 , I noticed that we have to include :lib in the config if the library name isn’t the same as the gems name .</p>
<blockquote><p>config.gem “RedCloth” ,:lib =&gt; ‘redcloth’</p>
<p>config.gem “mime-types”, :lib =&gt; ‘mime/types’</p></blockquote>
<p>Cool</p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/gem-dependencies-in-210/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Multilingual Full Text Search on Ferret</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/multilingual-full-text-search-on-ferret/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/multilingual-full-text-search-on-ferret/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:47:39 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=35</guid>
		<description><![CDATA[Ferret’s analyzer perform terribly support for multilingual .
thanks for the plugin multilingual_ferret_tools 
Here is the description from it:

This plugin provides a multilingual-aware Analyzer for Ferret.  This analyzer is useful when
fields may contain characters from multiple languages.  Fields are broken into latin parts and
non-latin-parts- the latin parts are then processed with Ferret::Analysis::StandardAnalyzer, and
the non-latin parts [...]]]></description>
			<content:encoded><![CDATA[<p>Ferret’s analyzer perform terribly support for multilingual .<br />
thanks for the plugin <a rel="nofollow" href="http://svn.lingr.com/plugins/multilingual_ferret_tools/" target="_blank">multilingual_ferret_tools </a><br />
Here is the description from it:</p>
<blockquote>
<pre>This plugin provides a multilingual-aware Analyzer for Ferret.  This analyzer is useful when
fields may contain characters from multiple languages.  Fields are broken into latin parts and
non-latin-parts- the latin parts are then processed with Ferret::Analysis::StandardAnalyzer, and
the non-latin parts are processed with Ferret::Analysis::RegExpAnalyzer.  By default, the RegExpAnalyzer
used considers each character as a distinct token.

If you want to change the configuration of the delegated analyzers, you'll find that initialization
code in MultilingualFerretTools::Analyzer#token_stream_for.</pre>
</blockquote>
<p><a rel="nofollow" href="http://svn.lingr.com/plugins/multilingual_ferret_tools/" target="_blank">http://svn.lingr.com/plugins/multilingual_ferret_tools/</a></p>
<p>to install thru piston, simply execute below :</p>
<blockquote><p>piston import <a rel="nofollow" href="http://svn.lingr.com/plugins/multilingual_ferret_tools/" target="_blank">http://svn.lingr.com/plugins/multilingual_ferret_tools/</a>vender/plugins/multilingual_ferret_tools</p></blockquote>
<p>To enable ,add analyzer parameter to acts_as_ferret :</p>
<blockquote><p>acts_as_ferret (<br />
{:fields =&gt; {<br />
:name                  =&gt; { :boost =&gt; 2 },<br />
:chinese_name          =&gt; { :boost =&gt; 2 },<br />
:self_description      =&gt; { :boost =&gt; 1.5 },<br />
:subtitle              =&gt; {},<br />
:teaching_time_remarks =&gt; {},<br />
:description           =&gt; {},<br />
:extra_curriculums     =&gt; {},<br />
:job_description1      =&gt; {},<br />
:job_description2      =&gt; {},<br />
:primary_school        =&gt; {},<br />
:secondary_school      =&gt; {},<br />
:other_university      =&gt; {},<br />
:university_major      =&gt; {},<br />
:university_minors     =&gt; {},<br />
:professional_courses  =&gt; {},<br />
}},<br />
{:analyzer =&gt; MultilingualFerretTools::Analyzer.new })</p></blockquote>
<p><strong>Related:</strong></p>
<ul>
<li><a href="http://lucene.apache.org/" target="_blank">Lucene</a></li>
<li><a href="http://www.ibm.com/developerworks/cn/java/j-lo-lucene1/" target="_blank">实战 Lucene，第 1 部分: 初识 Lucene</a></li>
<li><a href="http://www.ibm.com/developerworks/cn/java/wa-lucene/" target="_blank">深入 Lucene 索引机制</a></li>
<li><a href="http://ferret.davebalmain.com/trac/wiki/FerretOnRails" target="_blank">act_as_ferret Project</a></li>
<li><a href="http://lukhnos.org/blog/zh/" target="_blank">acts_as_ferret: Rails全文搜尋快速上手（與中日韓文支援）</a></li>
<li><a href="http://blog.dragon2.net/2007/05/18/461.php" target="_blank">快快樂樂學 Ruby - 再談 Ferret</a></li>
<li>http://lukhnos.org/blog/zh/archives/501</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/multilingual-full-text-search-on-ferret/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configuring Rails 2.1 To Use Gmail’s SMTP Server</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/configuring-rails-21-to-use-gmail%e2%80%99s-smtp-server/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/configuring-rails-21-to-use-gmail%e2%80%99s-smtp-server/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:47:17 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=33</guid>
		<description><![CDATA[Tutormetro uses Google Apps For Your Domain, and all email flows throw Google’s servers. Unfortunately, Rails 1.2.2 or later cannot send via smtp.google.com out of the box as it use tls, which standard ruby package is not included.
There is a solution from http://railsforum.com/viewtopic.php?id=12875 .We have deployed and tested in our Pilot site. Here are the step we [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Tutor Metro" href="http://www.tutormetro.com/" target="_blank">Tutormetro</a> uses <a href="http://www.google.com/a/" target="_blank">Google Apps For Your Domain</a>, and all email flows throw Google’s servers. Unfortunately, Rails 1.2.2 or later cannot send via <em>smtp.google.com</em> out of the box as it use tls, which standard ruby package is not included.</p>
<p>There is a solution from http://railsforum.com/viewtopic.php?id=12875 .We have deployed and tested in our Pilot site. Here are the step we go thro.</p>
<ol>
<li>include vendor/plugin/action_mailer_tls</li>
<li>create<strong> config/initializers/mail.rb</strong><strong><span><br />
</span></strong></li>
<li>use ActionMailer as normal</li>
</ol>
<blockquote>
<div>
<div>
<p>#vendor/plugins/action_mailer_tls/init.rb<br />
require_dependency ’smtp_tls’</p></div>
<div>#vendor/plugins/action_mailer_tls/lib/smtp_tls.rb<br />
require “openssl”<br />
require “net/smtp”Net::SMTP.class_eval do<br />
private<br />
def do_start(helodomain, user, secret, authtype)<br />
raise IOError, ‘SMTP session already started’ if @started<br />
check_auth_args user, secret, authtype if user or secret</p>
<p>sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }<br />
@socket = Net::InternetMessageIO.new(sock)<br />
@socket.read_timeout = 60 #@read_timeout<br />
@socket.debug_output = STDERR #@debug_output</p>
<p>check_response(critical { recv_response() })<br />
do_helo(helodomain)</p>
<p>raise ‘openssl library not installed’ unless defined?(OpenSSL)<br />
starttls<br />
ssl = OpenSSL::SSL::SSLSocket.new(sock)<br />
ssl.sync_close = true<br />
ssl.connect<br />
@socket = Net::InternetMessageIO.new(ssl)<br />
@socket.read_timeout = 60 #@read_timeout<br />
@socket.debug_output = STDERR #@debug_output<br />
do_helo(helodomain)</p>
<p>authenticate user, secret, authtype if user<br />
@started = true<br />
ensure<br />
unless @started<br />
# authentication failed, cancel connection.<br />
@socket.close if not @started and @socket and not @socket.closed?<br />
@socket = nil<br />
end<br />
end</p>
<p>def do_helo(helodomain)<br />
begin<br />
if @esmtp<br />
ehlo helodomain<br />
else<br />
helo helodomain<br />
end<br />
rescue Net::ProtocolError<br />
if @esmtp<br />
@esmtp = false<br />
@error_occured = false<br />
retry<br />
end<br />
raise<br />
end<br />
end</p>
<p>def starttls<br />
getok(’STARTTLS’)<br />
end</p>
<p>def quit<br />
begin<br />
getok(’QUIT’)<br />
rescue EOFError<br />
end<br />
end<br />
end</p></div>
<div># config/initializers/mail.rb</div>
<div>ActionMailer::Base.delivery_method = :smtp<br />
ActionMailer::Base.smtp_settings = {<br />
:address =&gt; “smtp.gmail.com”,<br />
:port =&gt; 587,<br />
:authentication =&gt; :plain,<br />
:user_name =&gt; “<span>user<a title="Reveal this e-mail address" href="http://mailhide.recaptcha.net/d?k=01bFgtYx3jvtPX146DxmfLVg==%20&amp;c=fNZUIT09ig4VuRtMrK_mwaAIbiN9l6LUx7z6DIN8Q6g=" target="_blank">&#8230;</a>@your-domain.com</span>”,<br />
:password =&gt; “password”</div>
<div>}</div>
</div>
</blockquote>
<div>One thing we need to be sure is to use a email user name without special char. We tried to use <span>no-r<a title="Reveal this e-mail address" href="http://mailhide.recaptcha.net/d?k=01bFgtYx3jvtPX146DxmfLVg==%20&amp;c=XXTW9e9zo1uVQnV_oFpi4Uah6C95kQR27G4Cl26mIH0=" target="_blank">&#8230;</a>@xxx.com</span> but it failed to login gmail auth system.</div>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/configuring-rails-21-to-use-gmail%e2%80%99s-smtp-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BDD Behaviour Driven Development</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/bdd-behaviour-driven-development/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/bdd-behaviour-driven-development/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:46:49 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=31</guid>
		<description><![CDATA[In Hong Kong, as a fast moving city, “urgent” is one of the most common requirement from the clients. They require the most “cost-effective” way to implement systems and with a marginal price. For these low budget (but urgent) projects, some of the local software houses would simply deliver a “just-to-requirement” and “not-well-tested” solution to [...]]]></description>
			<content:encoded><![CDATA[<p>In Hong Kong, as a fast moving city, “urgent” is one of the most common requirement from the clients. They require the most “cost-effective” way to implement systems and with a marginal price. For these low budget (but urgent) projects, some of the local software houses would simply deliver a “just-to-requirement” and “not-well-tested” solution to the client — the result is poor client satisfaction.</p>
<p>What we believe is — quality software is the base of the success of one software company. Therefore, we strictly adopt the agile development process and BDD is one of the testing approach we used.</p>
<p>In order to perform effective testing across increasing complex application, we adopted BDD in our projects. Some of the developers are lazy to write test cases throughout the development as they found that some test cases are meaningless to be written. When the application complexity increases, testing would be the harshest part of the development process.</p>
<p>Here is an example of “meaningless” test case:</p>
<blockquote><p>class UserTest &lt; Test::Unit::TestCase<br />
def test_create<br />
user = User.create(:some =&gt; ‘params’)<br />
assert user.save<br />
end<br />
end</p></blockquote>
<p>In this kind of test case which we regard as “meaningless” because it tests on the framework but not our own code. What we need is an effective testing across our codes.</p>
<p><strong>Some Background</strong></p>
<p>What is BDD? Behaviour Driven Development is an Agile development process that comprises aspects of Acceptance Test Driven Planning, Domain Driven Design and Test Driven Development.</p>
<p>RSpec is a BDD tool aimed at TDD in the context of BDD. And as our application is mainly built on Ruby on Rails, what we need is RSpec and RSpec on Rails plugins for our applications.</p>
<p>For more details on BDD: http://en.wikipedia.org/wiki/Behavior_driven_development</p>
<p>And more details for RSpec: http://rspec.info/</p>
<p>To install the plugin of RSpec and RSpec on Rails, what we need is to go here</p>
<p>http://github.com/dchelimsky/rspec-rails/wikis/home</p>
<p>but for the latest version (v 1.1.4) it only offers git repos to install, and we get some time to install the git into our system (as we have sticked to svn for long)……</p>
<p>We uses RSpec for testing as it is somehow more realistic to test the application on the “behaviour” instead of unit. Here is a piece of test case we wrote to illustrate the ellegance of the BDD:</p>
<blockquote><p>describe Bid do<br />
it ’should create reference id automatically’ do<br />
@bid = Bid.new<br />
@bid.reference_id.should_not be_nil<br />
end<br />
end</p></blockquote>
<p>It is a test case to test whether the ‘reference_id’ would be created automatically when we ‘new’ the Bid object. We are testing on the application behaviour rather than testing whether we can create the object.</p>
<p>Here is the result, printing in a nice specdoc format:</p>
<blockquote><p>$ spec spec/models/bid_spec.rb –format specdoc<br />
Bid<br />
- should create reference id automatically<br />
Finished in 0.138937 seconds<br />
1 example, 0 failures</p></blockquote>
<p>btw, git is the next part we should spend time to explore, probaby after we finish some important client’s projects….</p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/bdd-behaviour-driven-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Migrate from Acts As Taggable On Steroids to Acts As Taggable On</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/migrate-from-acts-as-taggable-on-steroids-to-acts-as-taggable-on/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/migrate-from-acts-as-taggable-on-steroids-to-acts-as-taggable-on/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:46:27 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=29</guid>
		<description><![CDATA[Acts As Taggable On Steroids is based on acts_as_taggable by DHH but includes extras such as
tests, smarter tag assignment, and tag cloud calculations.
For a number of applications, especially our Tutor Social Platform - Tutor Metro,  We’ve found a need for advanced tagging functionality not offered by the acts_as_taggable_on_steroids plugin.
for instance, we will wished a model could have [...]]]></description>
			<content:encoded><![CDATA[<p>Acts As Taggable On Steroids is based on acts_as_taggable by DHH but includes extras such as</p>
<p>tests, smarter tag assignment, and tag cloud calculations.</p>
<p>For a number of applications, especially our <a href="http://www.tutormetro.com/" target="_blank">Tutor Social Platform - Tutor Metro</a>,  We’ve found a need for advanced tagging functionality not offered by the <a href="http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids" target="_blank">acts_as_taggable_on_steroids</a> plugin.</p>
<p>for instance, we will wished a model could have multiple “sets” of tags that would function both independently and together and named scope support</p>
<p>That’s where acts_as_taggable_on comes in.</p>
<p>From <a href="http://github.com/mbleigh" target="_blank">mbleigh</a><span> :</span></p>
<blockquote><p>For instance, in a social network, a user might have tags that are called skills, interests, sports, and more. There is no real way to differentiate between tags and so an implementation of this type is not possible with acts as taggable on steroids. Enter Acts as Taggable On. Rather than tying functionality to a specific keyword (namely “tags”), acts as taggable on allows you to specify an arbitrary number of tag “contexts” that can be used locally or in combination in the same way steroids was used.</p></blockquote>
<p>To install, that is very simple from the project site, however, if we want to migrate from taggable on steroids in previous project, we have to do some more tweaking :</p>
<p>1. install gems or plugin as normal</p>
<p>2. generate the migration as usual</p>
<pre>script/generate acts_as_taggable_on_migration</pre>
<p>3. suppose you have an acts_as_taggable migration before, we have to do less in this migration .  modify the migration as following</p>
<p><code><br />
class ActsAsTaggableOnMigration &lt; ActiveRecord::Migration<br />
</code><br />
<code><br />
def self.up<br />
remove_index :taggings, [:taggable_id,:taggable_type]<br />
add_column :taggings, :tagger_id, :integer<br />
add_column :taggings, :tagger_type, :string<br />
add_column :taggings, :context, :string<br />
t.column :tagger_id, :integer<br />
t.column :tagger_type, :string<br />
t.column :context, :string<br />
create_table :tags do |t|<br />
t.column :name, :string<br />
end<br />
create_table :taggings do |t|<br />
t.column :tag_id, :integer<br />
t.column :taggable_id, :integer<br />
t.column :tagger_id, :integer<br />
t.column :tagger_type, :string<br />
# You should make sure that the column created is<br />
# long enough to store the required class names.<br />
t.column :taggable_type, :string<br />
t.column :context, :string<br />
t.column :created_at, :datetime<br />
end<br />
add_index :taggings, :tag_id<br />
add_index :taggings, [:taggable_id, :taggable_type, :context] , :name =&gt; ‘index_taggings’<br />
end<br />
</code></p>
<p><code><br />
def self.down<br />
remove_index :taggings, :name =&gt; 'index_taggings'<br />
add_index :taggings, [:taggable_id, :taggable_type]<br />
remove_column :taggings, :tagger_id<br />
remove_column :taggings, :tagger_type<br />
remove_column :taggings, :context<br />
drop_table :taggings<br />
drop_table :tags<br />
end<br />
</code><br />
<code><br />
end</code></p>
<p>4. rake db:migrate</p>
<p>5. add parameters to the acts_as_taggable_on</p>
<pre>class Photo &lt; ActiveRecord::Base  acts_as_taggable_on :tagsend</pre>
<p>6. fix your code on getting the tag list</p>
<p>7. do your testing, and you may have it done, cheer !</p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/migrate-from-acts-as-taggable-on-steroids-to-acts-as-taggable-on/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Authentication Integration with Yahoo! Account using OAuth</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/authentication-integration-with-yahoo-account-using-oauth/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/authentication-integration-with-yahoo-account-using-oauth/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:27:05 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=22</guid>
		<description><![CDATA[Yahoo! has updated their OAuth UI to be more contextual and streamlined so the the user experience on OAuth authentication
http://developer.yahoo.net/blog/archives/2009/06/oauth_update_ux.html
]]></description>
			<content:encoded><![CDATA[<p>Yahoo! has updated their OAuth UI to be more contextual and streamlined so the the user experience on OAuth authentication</p>
<p><a href="http://">http://developer.yahoo.net/blog/archives/2009/06/oauth_update_ux.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/authentication-integration-with-yahoo-account-using-oauth/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Good console/irb for Ruby</title>
		<link>http://sprint.inspiresynergy.com/2009/07/04/good-consoleirb-for-ruby/</link>
		<comments>http://sprint.inspiresynergy.com/2009/07/04/good-consoleirb-for-ruby/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:22:14 +0000</pubDate>
		<dc:creator>tkwong</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://sprint.inspiresynergy.com/?p=16</guid>
		<description><![CDATA[A mini view framework for console/irb that&#8217;s easy to use, even while under its influence. Console goodies include a no-wrap table, auto-pager, tree and menu.
http://tagaholic.me/hirb/
]]></description>
			<content:encoded><![CDATA[<p>A mini view framework for console/irb that&#8217;s easy to use, even while under its influence. Console goodies include a no-wrap table, auto-pager, tree and menu.</p>
<p><a href="http://">http://tagaholic.me/hirb/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sprint.inspiresynergy.com/2009/07/04/good-consoleirb-for-ruby/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
