<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>WyeWorks Blog - Home</title>
  <id>tag:blog.wyeworks.com,2012:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://blog.wyeworks.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.wyeworks.com/" rel="alternate" type="text/html"/>
  <updated>2011-12-27T15:28:55Z</updated>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>santiago.pastorino</name>
    </author>
    <id>tag:blog.wyeworks.com,2011-12-27:11903</id>
    <published>2011-12-27T15:25:00Z</published>
    <updated>2011-12-27T15:28:55Z</updated>
    <category term="Ruby"/>
    <category term="bundler"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2011/12/27/bundle-exec-rails-executes-bundler-setup-3-times" rel="alternate" type="text/html"/>
    <title>bundle exec rails &#8230; executes Bundler.setup 3 times</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: don&#8217;t run &lt;em&gt;bundle exec&lt;/em&gt; before &lt;em&gt;rails&lt;/em&gt; command, rails already checks the presence of &lt;em&gt;Bundler&lt;/em&gt; through the &lt;em&gt;Gemfile&lt;/em&gt; and sets up everything according to it without the overhead of &lt;em&gt;bundle exec&lt;/em&gt;. &lt;em&gt;rails&lt;/em&gt; command is the only exception to the rule. Additionally I&#8217;ve added a &lt;a href=&quot;https://github.com/carlhuda/bundler/commit/2c838255ccadadeab5298b7c2bbc39035e59f248&quot;&gt;patch&lt;/a&gt; to &lt;em&gt;Bundler&lt;/em&gt; that avoids calling Bundler.setup which adds unnecessary overhead.&lt;/p&gt;


	&lt;p&gt;I was researching on a huge &lt;em&gt;Bundler 1.1&lt;/em&gt; performance regression, &lt;a href=&quot;http://twitter.com/masterkain&quot;&gt;@masterkain&lt;/a&gt; was hitting when running &lt;em&gt;bundle exec rails runner &#8217;&#8217;&lt;/em&gt; (you shouldn&#8217;t run bundle exec before the &lt;em&gt;rails&lt;/em&gt; command, but keep reading for now). I started to profile it using &lt;em&gt;ruby-prof&lt;/em&gt; and one of the things I realized was that &lt;em&gt;Bundler.setup&lt;/em&gt; (which is a considerable slow method because it calls &lt;a href=&quot;https://github.com/carlhuda/bundler/blob/2a38a24a295b6e978f0c982d454a3a9f11399abc/lib/bundler/runtime.rb#L7-42&quot;&gt;Bundler::Runtime#setup&lt;/a&gt;) was ran 3 times. My first reaction was &lt;span class=&quot;caps&quot;&gt;WTF&lt;/span&gt;?? 3 times??. I will write about my other findings in another blog post.&lt;/p&gt;


	&lt;p&gt;After analyzing the code, I found out that the first call to &lt;em&gt;Bundle.setup&lt;/em&gt; is in &lt;a href=&quot;https://github.com/carlhuda/bundler/blob/2a38a24a295b6e978f0c982d454a3a9f11399abc/lib/bundler/cli.rb#L398&quot;&gt;Bundler::CLI#exec&lt;/a&gt; right before shelling out to run &lt;em&gt;rails runner &#8217;&#8217;&lt;/em&gt;.
The second call is on &lt;a href=&quot;https://github.com/rails/rails/blob/d2abe28ed342443f8c374a6e02977ccb0c3b3f95/railties/lib/rails/generators/rails/app/templates/config/boot.rb#L6&quot;&gt;boot.rb&lt;/a&gt; as part of the boot process (well actually it&#8217;s required from &lt;em&gt;bundle exec&lt;/em&gt; through &lt;a href=&quot;https://github.com/carlhuda/bundler/blob/2a38a24a295b6e978f0c982d454a3a9f11399abc/lib/bundler/runtime.rb#L227&quot;&gt;this rubyopt&lt;/a&gt; and on boot.rb the require returns false because it&#8217;s already required).
And the last call starts on &lt;a href=&quot;https://github.com/rails/rails/blob/d2abe28ed342443f8c374a6e02977ccb0c3b3f95/railties/lib/rails/generators/rails/app/templates/config/application.rb#L17&quot;&gt;config/application.rb&lt;/a&gt;
which ends up calling &lt;a href=&quot;https://github.com/carlhuda/bundler/blob/2a38a24a295b6e978f0c982d454a3a9f11399abc/lib/bundler.rb#L120-122&quot;&gt;Bundler.require&lt;/a&gt; to finally call &lt;em&gt;Bundler.setup&lt;/em&gt; for the third time. 
The second and third calls are run on the same process so &lt;em&gt;Bundler.setup&lt;/em&gt; caches the result in &lt;a href=&quot;https://github.com/carlhuda/bundler/blob/2a38a24a295b6e978f0c982d454a3a9f11399abc/lib/bundler.rb#L105&quot;&gt;@setup&lt;/a&gt; so there&#8217;s no slow down between those 2 calls.
But the command passed to &lt;em&gt;bundle exec&lt;/em&gt; runs in a different process (remember I said before that we were shelling out to run &lt;em&gt;rails runner &#8217;&#8217;&lt;/em&gt;) so the resulting execution of the first &lt;em&gt;Bundler.setup&lt;/em&gt; won&#8217;t be available to the &#8220;rails runner process&#8221; and doesn&#8217;t make any sense. All that &lt;em&gt;bundle exec&lt;/em&gt; needs to do is to &lt;a href=&quot;https://github.com/carlhuda/bundler/blob/2a38a24a295b6e978f0c982d454a3a9f11399abc/lib/bundler/runtime.rb#L209-231&quot;&gt;setup the rubyopts&lt;/a&gt; needed to run the command you are passing to &lt;em&gt;bundle exec&lt;/em&gt;. I&#8217;ve &lt;a href=&quot;https://github.com/carlhuda/bundler/commit/2c838255ccadadeab5298b7c2bbc39035e59f248&quot;&gt;patched&lt;/a&gt; &lt;em&gt;Bundler&lt;/em&gt; to do the right thing.&lt;/p&gt;


	&lt;p&gt;So don&#8217;t run &lt;em&gt;bundle exec&lt;/em&gt; before &lt;em&gt;rails&lt;/em&gt; command, this command is already aware of &lt;em&gt;Bundler&lt;/em&gt; and sets up everything according to what you have on your &lt;em&gt;Gemfile&lt;/em&gt;.
If you prepend &lt;em&gt;bundle exec&lt;/em&gt; before &lt;em&gt;rails&lt;/em&gt; command all you will be adding is overhead of opening another process from &lt;em&gt;Bundler&lt;/em&gt; and executing useless code since &lt;em&gt;rails&lt;/em&gt; already does the right thing.&lt;/p&gt;


	&lt;p&gt;You probably already know about that, but I&#8217;ve seen a lot of proficient Rails developers doing it.&lt;/p&gt;


	&lt;p&gt;Read more about the topic in &lt;a href=&quot;http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/&quot;&gt;Yehuda&#8217;s blog&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>santiago.pastorino</name>
    </author>
    <id>tag:blog.wyeworks.com,2011-11-01:9897</id>
    <published>2011-11-01T16:52:00Z</published>
    <updated>2011-11-01T16:53:15Z</updated>
    <category term="1.9.3"/>
    <category term="ruby"/>
    <category term="ruby-debug"/>
    <link href="http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug" rel="alternate" type="text/html"/>
    <title>Ruby 1.9.3 and ruby-debug</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;As you probably know Ruby (MRI so brixen doesn&#8217;t get mad at me :P) &lt;a href=&quot;http://www.ruby-lang.org/en/news/2011/10/31/ruby-1-9-3-p0-is-released/&quot;&gt;1.9.3 was released&lt;/a&gt;. I&#8217;ve been using 1.9.3 for a while now and as part of my RubyConf Uruguay talk I wanted to show ruby-debug. So my first attempt was:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ gem install ruby-debug19
Fetching: linecache19-0.5.12.gem (100%)
Building native extensions.  This could take a while...
Fetching: ruby-debug-base19-0.11.25.gem (100%)
Building native extensions.  This could take a while...
Fetching: ruby-debug19-0.11.6.gem (100%)
Successfully installed linecache19-0.5.12
Successfully installed ruby-debug-base19-0.11.25
Successfully installed ruby-debug19-0.11.6
3 gems installed&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Then require &#8216;ruby-debug&#8217; and booom!!&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ irb
irb(main):001:0&amp;gt; require 'ruby-debug'
LoadError: dlopen(/Users/santiago/.rbenv/versions/1.9.3/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_current_thread
  Referenced from: /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
  Expected in: flat namespace
 in /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `&amp;lt;top (required)&amp;gt;'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `&amp;lt;top (required)&amp;gt;'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /Users/santiago/.rbenv/versions/1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from (irb):1
    from /Users/santiago/.rbenv/versions/1.9.3/bin/irb:12:in `&amp;lt;main&amp;gt;'&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;So after some research on the internet I found out that the author of ruby-debug had a fix for it which he considered unstable and didn&#8217;t push it to rubygems.org yet. Since I prefer an unstable ruby-debug than a non working one :P, I gave it a try &#8230;&lt;/p&gt;


	&lt;p&gt;First download linecache19-0.5.13.gem and ruby-debug-base19-0.11.26.gem from &lt;a href=&quot;http://rubyforge.org/frs/?group_id=8883&quot;&gt;http://rubyforge.org/frs/?group_id=8883&lt;/a&gt;, then …&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ gem install linecache19-0.5.13.gem 
Building native extensions.  This could take a while...
Successfully installed linecache19-0.5.13
1 gem installed
$ gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/Users/santiago/.rbenv/source/ruby-1.9.3-p0  
Building native extensions.  This could take a while...
Successfully installed ruby-debug-base19-0.11.26
1 gem installed
$ irb
irb(main):001:0&amp;gt; require 'ruby-debug'
=&amp;gt; true&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;and voilá.&lt;/p&gt;


	&lt;p&gt;So while we wait for an official release, you can enjoy a working ruby-debug.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>sebastian.martinez</name>
    </author>
    <id>tag:blog.wyeworks.com,2011-04-11:7153</id>
    <published>2011-04-11T07:01:00Z</published>
    <updated>2011-04-11T20:04:33Z</updated>
    <category term="clients"/>
    <category term="management"/>
    <link href="http://blog.wyeworks.com/2011/4/11/client-developer-relationships" rel="alternate" type="text/html"/>
    <title>Client - Developer relationships</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;There is an old joke that illustrates how the relationship between clients and developers is that I&#8217;d like to share with you:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;A man is flying in a hot air balloon when realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts: 
- &quot;Excuse me, can you tell me where I am?&quot; 
The man below says: 
- &quot;Yes you're in a hot air balloon, hovering 30 feet above this field.&quot; 
- &quot;You must be a software developer,&quot; says the balloonist.
- &quot;I am,&quot; replies the man. &quot;How did you know?&quot; 
- &quot;Well,&quot; says the balloonist, &quot;everything you have told me is technically correct, but it's of no use to anyone.&quot; 
The man below says, 
- &quot;You must work in business as a manager.&quot; 
- &quot;I do,&quot; replies the balloonist, &quot;but how did you know?&quot; 
- &quot;Well,&quot; says the man, &quot;you don't know where you are or where you are going, but you expect me to be able to help. You're in the same position you were before we met but now it's my fault.&quot; &lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Developing successful client relationships are critical to any business. Preserving these relationships is crucial for making the time spent on projects more enjoyable and satisfying, as well as for referrals and future business.&lt;/p&gt;


&lt;h2&gt;So how can I improve this relationship?&lt;/h2&gt;

	&lt;p&gt;It ain&#8217;t the purpose of this post to be a silver bullet, but to share some practices that have given us some good results in the past.&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;h4&gt;Spend some time getting to know your client&lt;/h4&gt;
You will likely spend many hours with the client during the project. It is important in order to strengthen the relationship to get to know your client&#8217;s interests, try to feel what they feel. After all, we are all human thus have natural highs and lows, and it is important to understand when someone is having a hard day.&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Educate your client&lt;/h4&gt;
Educating clients about web development is crucial to the success of a project. The pace of change on the web is staggering and it is our responsibility to help clients make good decisions regarding their web presence. You need to tell your client that changes are a good thing and should be welcomed.&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Be willing to say NO&lt;/h4&gt;
In many cases, clients ask us to do things that our experience says that doing so will, far from contributing to the project, cause users to run away. You need to take the time to understand why your client is asking you to do this, let them know your reasons against it, and try to find another solution together. This is healthy. Don&#8217;t just say &#8220;yes&#8221; because &lt;i&gt;the client is always right.&lt;/i&gt;&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Be willing to say &lt;span class=&quot;caps&quot;&gt;YES&lt;/span&gt;&lt;/h4&gt;
Say yes to the jobs that may require you to work harder. The client will be grateful. Specially in those cases when it is important for the client to have this particular feature deployed, as it will represent and lead to a full stack of opportunities. Doing this will make you more valuable in your clients eyes, and also by sharing the stress of the deadline you&#8217;ll become closer to the client, so don&#8217;t be afraid to embrace these opportunities. Now, this concept should not be taken as the regular way to go, meaning no one can expect us to work every single day giving a 150%. Pushing yourself a little bit every once in a while is ok, but when it becomes normal, then something&#8217;s wrong.&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Keep your distance&lt;/h4&gt;
We become more valuable the more we work in an organization, but we need to define and maintain our role clearly. Even as we build the relationships that make us successful, we need to be diligent in keeping our distance so we can continue to provide valued advice and expertise. The idea is to have a respectful relationship, always keeping it professional.&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Be transparent&lt;/h4&gt;
There might be cases when some tasks take longer than you expected. What should you do then? &lt;strong&gt;Be transparent.&lt;/strong&gt; Explain your client the complications you ran into, and that these complications will probably make you work a little bit longer on this task, there&#8217;s nothing wrong with that. Anything can get complicated. Complications are part of our job. Being transparent to your client about this is definitely the way to go.&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Gain your client&#8217;s &lt;span class=&quot;caps&quot;&gt;TRUST&lt;/span&gt;&lt;/h4&gt;
Best way to gain your client&#8217;s trust is to stay focused on your deliverables. When we deliver &lt;strong&gt;what&lt;/strong&gt; we say and &lt;strong&gt;when&lt;/strong&gt; we say we will deliver it, we build our credibility and enhance our relationships. The trust the client gives us increases, and will help us when we state &#8220;this task will take two days&#8221; for example, when they think it&#8217;s just a simple tweak and shouldn&#8217;t take more than a couple of hours. The most important thing is letting them know that we are part of the team, we are both on the same boat, aiming to the same goals. Once your client understands that their failures are also your failures, and their achievements are your achievements as well and the other way around, then you&#8217;ll be a step further in gaining their trust.&lt;/li&gt;

&lt;li&gt;&lt;h4&gt;Work at it&lt;/h4&gt;
Recognize that the client relationship is part of the job. Working on the relationship will make you more successful on current projects, enhance your chance for future work, and make the project much more enjoyable.&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;Hopefully by following this you&#8217;ll have a smoother relationship with your clients, and what&#8217;s more, make you feel comfortable working with them on the daily basis.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>jose.costa</name>
    </author>
    <id>tag:blog.wyeworks.com,2011-03-25:7224</id>
    <published>2011-03-25T20:02:00Z</published>
    <updated>2011-03-25T20:18:58Z</updated>
    <category term="RailsConf"/>
    <category term="Ruby"/>
    <category term="caike"/>
    <category term="interview"/>
    <category term="rails"/>
    <category term="railsconf"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2011/3/25/railsconf-2010-interview-with-caike-souza" rel="alternate" type="text/html"/>
    <title>RailsConf 2010: Interview with Caike Souza</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;We&#8217;re opening the box of RailsConf 2010 memories! Yep &#8230; we suck at journalism, so it turns out we have this almost one year old interview with Caike Souza we never shared before. So sorry Caike!&lt;/p&gt;


	&lt;p&gt;Caike (&lt;a href=&quot;http://twitter.com/caike&quot;&gt;@caike&lt;/a&gt;) is a passionate agile software craftsman and founder of the &lt;a href=&quot;http://orlandodojo.org/&quot;&gt;Orlando Code Dojo&lt;/a&gt; group, where programmers get together to practice coding to improve their skills once a month. He is currently working at &lt;a href=&quot;http://envylabs.com/&quot;&gt;Envy Labs&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Thanks for your time and great vibe!&lt;/p&gt;



          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>santiago.pastorino</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-11-04:5069</id>
    <published>2010-11-04T14:26:00Z</published>
    <updated>2010-11-04T14:29:47Z</updated>
    <category term="Ruby"/>
    <category term="class_eval"/>
    <category term="define_method"/>
    <category term="metaprogramming"/>
    <category term="method_missing"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2010/11/4/metaprogramming-in-ruby-slides-from-my-talk-at-rubyconf-uruguay" rel="alternate" type="text/html"/>
    <title>Metaprogramming in Ruby slides from my talk at RubyConf Uruguay</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;div&gt;&lt;/i&gt;sse5634072&#8221; width=&#8221;425&#8221; height=&#8221;355&#8221;&amp;gt;&lt;div&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/spastorino&quot;&gt;Santiago Pastorino&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>sebastian.martinez</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-09-23:4718</id>
    <published>2010-09-23T15:41:00Z</published>
    <updated>2010-09-23T18:45:47Z</updated>
    <category term="Ruby"/>
    <category term="generator"/>
    <category term="rails"/>
    <link href="http://blog.wyeworks.com/2010/9/23/creating-your-own-generators-on-rails-2-3" rel="alternate" type="text/html"/>
    <title>Creating your own generators on Rails 2.3</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;Time has come for me to write a Rails generator, and as you&#8217;re guessing right now, my first step was taking a look at the &lt;a href=&quot;http://guides.rubyonrails.org/generators.html&quot;&gt;Guides&lt;/a&gt;.
They give you a pretty good idea on what you can do (despite of being for Rails 3.0), but as my friend Santiago always say, there&#8217;s no better documentation than the source code itself. So, my second step was to dive into the &lt;a href=&quot;http://github.com/rails/rails/tree/2-3-stable/railties/lib/rails_generator/&quot;&gt;code&lt;/a&gt;. You should definitely read the code, great stuff there.&lt;/p&gt;


	&lt;p&gt;After some time reading, I decided it was time for me to start playing around with that, so here it comes:&lt;/p&gt;


	&lt;p&gt;First thing you should know, is that all Rails generators are derived from a class called “Rails::Generator::Base.” But, if we derive our generator class from NamedBase instead of Base, then we’ll get the ability to take a name parameter from the script/generate command line. With that in mind, you can start writing the generator &lt;strong&gt;skeleton&lt;/strong&gt;:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;class WidgetGenerator &amp;lt; Rails::Generator::NamedBase
  def manifest
    record do |m|
      # Do something
    end
  end
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;In order to make the generator work on your Rails 2.3 application, you should place this file under &lt;strong&gt;&#8216;lib/generators/widget/widget_generator.rb&#8217;&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Is on the manifest method where the magic occurs. Depending on what exactly we want our generator to do, is what we&#8217;re going to code inside it.
In my case, I wanted to behave very similar to the scaffold, so I wanted a controller class, a model, views, migration, etc&#8230; You can look at the templates of the scaffold generator, they will give you a very clear idea on how to use them. Then, you should place your templates under &lt;strong&gt;&#8216;lib/generators/widget/templates/&#8217;&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;In most cases, you will want your generator to receive several arguments. Best way is to have an initialize method to take care of that, just like this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
class WidgetGenerator &amp;lt; Rails::Generator::NamedBase
  attr_reader   :controller_class_name,
                :class_name
  attr_accessor :attributes

def initialize(runtime_args, runtime_options = {})
    super
    @name = runtime_args.first
    @controller_class_name = @name.pluralize.capitalize
    @attributes = []

    runtime_args[1..-1].each do |arg|
      if arg.include? ':'
        @attributes &amp;lt;&amp;lt; Rails::Generator::GeneratedAttribute.new(*arg.split(&quot;:&quot;))
      end
    end
  end

  def manifest
    record do |m|
      # Do something
    end
  end
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Until now, we&#8217;re just initializing the generator, but it&#8217;s not doing anything yet. Let&#8217;s add some action on our manifest method:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;def manifest
    record do |m|
      m.template('controller.rb', &quot;app/controllers/#{name.pluralize}_controller.rb&quot;)
      m.template('model.rb', &quot;app/models/#{name}.rb&quot;)
      m.migration_template(&quot;migration.rb&quot;, &quot;db/migrate&quot;, :migration_file_name =&amp;gt; &quot;create_#{name.underscore.pluralize.camelize}&quot;)

      m.directory(File.join('app/views', name.pluralize))
      for action in %w[ new edit show ]
        m.template(
          &quot;view_#{action}.html.erb&quot;,
          File.join('app/views', controller_file_name, &quot;#{action}.html.erb&quot;)
        )
      end
    end
  end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Cool, now we are generating a controller from our template, a model, a migration, among others&#8230;Nice!&lt;/p&gt;


	&lt;p&gt;You can also add a protected banner method, to display the usage of the generator right on the console:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;protected
    def banner
      &quot;Usage: #{$0} widget WidgetName [field:type, field:type]&quot; 
    end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And that&#8217;s all !! You can now generate all the widgets you want.
The command to run this would be:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ ./script/generate widget MyWidget title:string viewing:integer&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Have fun generating!!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>jose.costa</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-07-28:4381</id>
    <published>2010-07-28T17:35:00Z</published>
    <updated>2010-07-28T17:35:21Z</updated>
    <category term="RailsConf"/>
    <category term="Ruby"/>
    <category term="george"/>
    <category term="guimaraes"/>
    <category term="interview"/>
    <category term="rails"/>
    <category term="railsconf"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2010/7/28/railsconf-2010-interview-with-george-guimaraes" rel="alternate" type="text/html"/>
    <title>RailsConf 2010: Interview with George Guimar&#227;es</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;Among the great people we met at the RailsConf was George Guimarães (&lt;a href=&quot;http://twitter.com/georgeguimaraes&quot;&gt;@georgeguimaraes&lt;/a&gt;), by no surprise he was a very cool and funny dude, and he was open to talk and hang around with us.&lt;/p&gt;


	&lt;p&gt;George is co-founder of &lt;a href=&quot;http://plataformatec.com.br/&quot;&gt;Plataforma Tec&lt;/a&gt;, that many of us got to know well through their amazing set of gems/plugins and the stunning work José Vailm has been doing as a Rails Core team member. Kind of what I hope it&#8217;s happening with the great work Santiago Pastorino is doing with his contributions and how it&#8217;s reinforcing WyeWorks reputation.&lt;/p&gt;


	&lt;p&gt;But still there are a lot of guys behind the scenes that support this great Open Source effort that&#8217;s being carried in these companies, probably not so much by direct intervention but with more hard and &#8216;real&#8217; work as we like to say to joke around and bother the &lt;span class=&quot;caps&quot;&gt;OSS&lt;/span&gt; guys. The kind of work that pay the bills :P&lt;/p&gt;


	&lt;p&gt;Not that George doesn&#8217;t do &lt;span class=&quot;caps&quot;&gt;OSS&lt;/span&gt;, actually he&#8217;s currently involved in the development of &lt;a href=&quot;http://github.com/caelum/restfulie&quot;&gt;Restfulie&lt;/a&gt; that got many people pretty excited at the RailsConf this year, and much more stuff.&lt;/p&gt;


	&lt;p&gt;Hope you enjoy this not so serious take.&lt;/p&gt;


	&lt;p&gt;Thanks George!&lt;/p&gt;



          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>jose.costa</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-07-01:4283</id>
    <published>2010-07-01T16:17:00Z</published>
    <updated>2010-07-01T16:18:23Z</updated>
    <category term="RailsConf"/>
    <category term="Ruby"/>
    <category term="akita"/>
    <category term="fabio"/>
    <category term="interview"/>
    <category term="rails"/>
    <category term="railsconf"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2010/7/1/railsconf-2010-interview-with-fabio-akita" rel="alternate" type="text/html"/>
    <title>RailsConf 2010: Interview with Fabio Akita</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;In the last day of the RailsConf 2010 Santiago and I got the pleasure to hang out a few hours with Fabio Akita, a very successful guy in the Ruby and Rails community, but yet so humble and open as many of the great people we met in these past days.&lt;/p&gt;


	&lt;p&gt;Fabio is well known as a great evangelist of this movement, as a great speaker, for his bundle of plugins for the vim editor but also for carrying interviews with important people of the community on every conference he attends. The thing is that personally I never got to see him as the subject of the interview, and he is a wise guy that has a lot to say. So even though he was very tired, he accepted to do this improvised short interview with me, almost the first time I was holding a camera.&lt;/p&gt;


	&lt;p&gt;This is the first of a small series of interviews that will be posted soon.&lt;/p&gt;


	&lt;p&gt;I hope you all enjoy it and share his thoughts on what are the good things that makes this community so special, so that we never loose that spirit.&lt;/p&gt;


	&lt;p&gt;Thanks Fabio!&lt;/p&gt;



          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>sebastian.martinez</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-02-10:3061</id>
    <published>2010-02-10T11:43:00Z</published>
    <updated>2010-02-10T11:43:56Z</updated>
    <category term="Ruby"/>
    <category term="datamapper"/>
    <category term="paperclip"/>
    <category term="sinatra"/>
    <link href="http://blog.wyeworks.com/2010/2/10/making-paperclip-work-with-sinatra-datamapper" rel="alternate" type="text/html"/>
    <title>Making Paperclip work with Sinatra &amp; Datamapper</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;I was working lately on a Sinatra project, and got fascinated on how fast you can get things up and running.
Everything was beautiful, until I tried to upload a file using paperclip.&lt;/p&gt;


	&lt;p&gt;Although Paperclip was originally built for rails &lt;a href=&quot;http://invalidlogic.com/dm-paperclip/&quot;&gt;Ken Robertson&lt;/a&gt; ported it to Datamapper.
Let me explain in few steps how you can upload with Paperclip, using Datamapper.&lt;/p&gt;


Start declaring your model like this:
&lt;pre&gt;&lt;code&gt;class Resource
  include DataMapper::Resource
  include Paperclip::Resource

  property :id,     Serial

  has_attached_file :file,
                    :url =&amp;gt; &quot;/system/:attachment/:id/:style/:basename.:extension&quot;,
                    :path =&amp;gt; &quot;#{APP_ROOT}/public/system/:attachment/:id/:style/:basename.:extension&quot; 
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;You&#8217;ll need to specify your :url and :path options as the ones built into dm-paperclip are merb centric which won&#8217;t quite work. Also set &lt;span class=&quot;caps&quot;&gt;APP&lt;/span&gt;_ROOT to where ever your application root directory with your static Sinatra folder is.&lt;/p&gt;


Now your routes should look something like this:
&lt;pre&gt;&lt;code&gt;post '/upload' do
  resource = Resource.new(:file =&amp;gt; make_paperclip_mash(params[:file]))
  halt &quot;There were some errors processing your request...&quot; unless resource.save
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And there&#8217;s the tricky part, on the &lt;strong&gt;make_paperclip_mash&lt;/strong&gt; method.
Paperclip expects the file object loaded from the form to be in a different form than what is created by default. To fix this you should create a Mash (which is just a Hash, unless you&#8217;re actually using merb):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;def make_paperclip_mash(file_hash)
  mash = Mash.new
  mash['tempfile'] = file_hash[:tempfile]
  mash['filename'] = file_hash[:filename]
  mash['content_type'] = file_hash[:type]
  mash['size'] = file_hash[:tempfile].size
  mash
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And that&#8217;s it, now you can upload files using Paperclip right on your Sinatra app with Datamapper.
You can check out the code of this example at: &lt;a href=&quot;http://gist.github.com/291877&quot;&gt;sinatra_paperclip.rb&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>santiago.pastorino</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-02-01:3009</id>
    <published>2010-02-01T13:11:00Z</published>
    <updated>2010-02-01T13:12:47Z</updated>
    <category term="Ruby"/>
    <category term="lists"/>
    <category term="patch"/>
    <category term="ruby"/>
    <category term="timeline"/>
    <category term="twitter"/>
    <link href="http://blog.wyeworks.com/2010/2/1/4-ways-to-retrieve-a-twitter-list-timeline" rel="alternate" type="text/html"/>
    <title>4 Ways to Retrieve a Twitter List Timeline</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;For past few days we had been working on the new version of the WyeWorks site, so stay tunned.
This new version will have a twitter section, where the last 5 tweets of our team will be displayed.&lt;/p&gt;


So first thing I had to do was installing the twitter gem:
&lt;pre&gt;&lt;code&gt;gem install twitter&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;In order to achieve this, I&#8217;ve found 3 different ways using the twitter gem, plus one not yet implemented on the gem, that I&#8217;ve already proposed the patch.
The dumbest one would be:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;#!/usr/bin/env ruby

require 'rubygems'
require 'twitter'

users = %w(wyeworks spastorino joseicosta smartinez87 nartub)

tweets = users.map { |user_name| Twitter::Search.new.from(user_name) }.
               inject([]) { |tweets, search| tweets + search.fetch(5).results }.
               sort { |t1, t2| Date.parse(t2.created_at) &amp;lt;=&amp;gt; Date.parse(t1.created_at) }[0,5]

tweets.each do |tweet|
  puts tweet.created_at
  puts tweet.from_user
  puts tweet.profile_image_url
  puts tweet.text
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;What this does is retrieve the last 5 tweets of each user and merge them sorted by date.
Obviously, best thing to do would be directly retrieving the last 5 tweets from the @wyeworks/team list.
Only way to do this using the gem requires authentication, despite the list being public.
In order to authenticate, we may take two paths, the first one would be using &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Authentication:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;#!/usr/bin/env ruby

require 'rubygems'
require 'twitter'

httpauth = Twitter::HTTPAuth.new('wyeworks', 'password')
base = Twitter::Base.new(httpauth)
base.list_timeline('wyeworks', 'team', :page =&amp;gt; 1, :per_page =&amp;gt; 5).each do |tweet|
  puts tweet.created_at
  puts tweet.user.screen_name
  puts tweet.user.profile_image_url
  puts tweet.text
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The other and preferred way for authentication is OAuth, since we don&#8217;t have to send the user and password through the network.
In order to make OAuth work with twitter, we have to create an application at &lt;a href=&quot;http://twitter.com/apps&quot;&gt;http://twitter.com/apps&lt;/a&gt;
Once we&#8217;ve created the app, twitter provides us with a Consumer Key and a Consumer Secret, needed to authenticate using OAuth&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;#!/usr/bin/env ruby

require 'rubygems'
require 'twitter'

oauth = Twitter::OAuth.new('consumer token', 'consumer secret')

begin
  oauth.authorize_from_access(oauth.request_token.token, oauth.request_token.secret)

  base = Twitter::Base.new(oauth)
  base.list_timeline('wyeworks', 'team', :page =&amp;gt; 1, :per_page =&amp;gt; 5).each do |tweet|
    puts tweet.created_at
    puts tweet.user.screen_name
    puts tweet.user.profile_image_url
    puts tweet.text
 end
rescue OAuth::Unauthorized
  puts &quot;&amp;gt; FAIL!&quot; 
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Either of these ways works just fine, but no one completely satisfied me, since we are working with a &lt;strong&gt;public&lt;/strong&gt; list, so as far as I can see authentication is out the question, even more when anyone can see it directly from the web without authenticating.
For this reason, I started looking at the &lt;a href=&quot;http://apiwiki.twitter.com&quot;&gt;Twitter &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/a&gt; searching for a non-authentication way to do it: &lt;a href=&quot;http://apiwiki.twitter.com/Twitter-REST-API-Method:-GET-list-statuses&quot;&gt;Here&#8217;s&lt;/a&gt; what I found.
You can test that making a request to &lt;a href=&quot;http://api.twitter.com/1/wyeworks/lists/team/statuses.json?page=1&amp;amp;per_page=5&quot;&gt;http://api.twitter.com/1/wyeworks/lists/team/statuses.json?page=1&#38;per_page=5&lt;/a&gt;, obtaining the list as a json, or xml in case you change the .json to .xml&lt;/p&gt;


	&lt;p&gt;So I&#8217;ve came up with this monkey-patch:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;module Twitter
  # :per_page = max number of statues to get at once
  # :page = which page of tweets you wish to get
  def self.list_timeline(list_owner_username, slug, query = {})
    response = HTTParty.get(&quot;http://api.twitter.com/1/#{list_owner_username}/lists/#{slug}/statuses.json&quot;, :query =&amp;gt; query, :format =&amp;gt; :json)
    response.map{|tweet| Hashie::Mash.new tweet}
  end
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Being able to get the list without authenticating by:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;Twitter.list_timeline('wyeworks', 'team', :page =&amp;gt; 1, :per_page =&amp;gt; 5).each do |tweet|
   puts tweet.created_at
   puts tweet.user.screen_name
   puts tweet.user.profile_image_url
   puts tweet.text
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;I&#8217;ve already contacted the gem&#8217;s authors, proposing this patch: &lt;a href=&quot;http://github.com/spastorino/twitter/commit/aed3a298b613a508bb9caf93afc7f12c50626ad7&quot;&gt;http://github.com/spastorino/twitter/commit/aed3a298b613a508bb9caf93afc7f12c50626ad7&lt;/a&gt;. Wynn Netherland already told me it&#8217;s pretty probable that it will be approved.&lt;/p&gt;


	&lt;p&gt;Until then, you can make use of this functionality from my fork &lt;a href=&quot;http://twitter.com/spastorino/twitter&quot;&gt;http://twitter.com/spastorino/twitter&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;UPDATE&lt;/span&gt; #1:&lt;/strong&gt; My fork was merged into &lt;a href=&quot;http://github.com/jnunemaker/twitter&quot;&gt;http://github.com/jnunemaker/twitter&lt;/a&gt; master branch and twitter 0.8.3 was published through &lt;a href=&quot;http://gemcutter.org/gems/twitter&quot;&gt;Gemcutter&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>santiago.pastorino</name>
    </author>
    <id>tag:blog.wyeworks.com,2010-01-19:2907</id>
    <published>2010-01-19T20:10:00Z</published>
    <updated>2010-01-21T13:48:15Z</updated>
    <category term="Ruby"/>
    <category term="bugmash"/>
    <category term="rails"/>
    <link href="http://blog.wyeworks.com/2010/1/19/rails-bugmash-an-exciting-first-experience" rel="alternate" type="text/html"/>
    <title>Rails Bugmash an exciting first experience</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;As many of you must know, last weekend a &lt;a href=&quot;http://bugmash.com&quot;&gt;Railsbridge Bugmash&lt;/a&gt; was celebrated, and I had the honor to be part of it for the first time.
For those who are not aware about what this is, it&#8217;s a virtual event that takes place on irc.freenode.net at #railsbridge channel.
The general idea of these events is to work on the Rails Core, taking a look at the &lt;a href=&quot;https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/overview&quot;&gt;Rails Issue Tracker&lt;/a&gt;. However, given that Rails 3 is about to see the light, this opportunity was intended to deeply test it looking for:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Fix a known issue&lt;/li&gt;
		&lt;li&gt;Report a bug&lt;/li&gt;
		&lt;li&gt;Make sure your favorite gem or plugin still works. If not, fork it and make it so.&lt;/li&gt;
		&lt;li&gt;Write a blog post about a certain component&lt;/li&gt;
		&lt;li&gt;Write some documentation&lt;/li&gt;
		&lt;li&gt;Get an app up and running and document what you had to do to upgrade.&lt;/li&gt;
		&lt;li&gt;Create a screencast&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Each accepted contribution or patch done by a participant, gives him chances to win one of several &lt;a href=&quot;http://bugmash.com/sponsors&quot;&gt;prizes&lt;/a&gt;, the more contributions the more chances you have to win. For further details check out the &lt;a href=&quot;http://railsbridge.org/BugMashGuide.pdf&quot;&gt;Railsbridge Bugmash Guide&lt;/a&gt; and the &lt;a href=&quot;http://wiki.railsbridge.org&quot;&gt;RailsBridge Wiki&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Many bugs were fixed during the event, some &lt;a href=&quot;http://wiki.rubyonrails.org/rails/version3/plugins_and_gems&quot;&gt;plugins and gems were tested&lt;/a&gt;, really interesting discussions took place (specially regarding &lt;a href=&quot;http://guides.rails.info/generators.html&quot;&gt;generators&lt;/a&gt;) and some other articles were made. To mention some:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://caffeinedd.com/guides/331-making-generators-for-rails-3-with-thor&quot;&gt;Making Generators for Rails 3 with Thor&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://blog.envylabs.com/2010/01/getting-started-with-the-rails-3-bugmash&quot;&gt;Getting Started with the Rails 3 Bugmash&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://jamesarosen.com/post/339319063&quot;&gt;Getting Rails 3 (pre) up on &lt;span class=&quot;caps&quot;&gt;OSX&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger&quot;&gt;Rails 3 and Passenger&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://caffeinedd.com/guides/348-upgrading-to-rails-3&quot;&gt;Upgrading an Application to Rails 3 &#8211; Part 1&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://zigzag.github.com/2010/01/18/customizing-your-scaffold-template-become-easier-in-rails3.html&quot;&gt;Customizing your scaffold template become easier in Rails3&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://hasmanyquestions.wordpress.com/2010/01/17/let-your-sql-growl-in-rails-3&quot;&gt;Let your &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; Growl in Rails 3&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://blog.trydionel.com/2010/01/16/rails-bugmash-2010&quot;&gt;Rails Bugmash 2010&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.madcowley.com/madcode/?p=12&quot;&gt;migrating a rails app from 2.x to 3.0&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://blazingcloud.net/2010/01/17/notes-from-rails-3-bugmash&quot;&gt;Notes from Rails 3 bugmash&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://rails3.community-tracker.com/permalinks/5/notes-from-the-field-upgrading-to-rails-3&quot;&gt;Notes from the field upgrading to Rails 3&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;And then Jose Valim, motivated by the posts done regarding rails 3 generators, published one himself called &lt;a href=&quot;http://blog.plataformatec.com.br/2010/01/discovering-rails-3-generators&quot;&gt;Discovering Rails 3 Generators&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;This was my first participation and it was a bloody great experience. During the event I was specially devoted to search bugs on Rails 3 and try to patch them. I managed myself to find 4 code bugs and 1 documentation bug, proposing a solution for all of them. One of them was not approved though, for there was a bigger problem that required José Valim&#8217;s intervention, the 3 other patches were approved.&lt;/p&gt;


	&lt;p&gt;I would also want to highlight the gigantic work done by the organizers, the core team members, and also to all the participants. I strongly valued the support &lt;a href=&quot;http://twitter.com/josevalim&quot;&gt;José Valim&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/lifo&quot;&gt;Pratik Naik&lt;/a&gt; and &lt;a href=&quot;http://twitter.com/nzkoz&quot;&gt;Michael Koziarski&lt;/a&gt; gave me. They were a hell of a help when trying to find solutions for the bugs. Would also want to thank &lt;a href=&quot;http://twitter.com/ryanbigg&quot;&gt;Ryan Bigg&lt;/a&gt; for his cooperation, and specially to &lt;a href=&quot;http://twitter.com/lenary&quot;&gt;Sam Elliott&lt;/a&gt;, an incredible 18 year old guy with a great future ahead.
Besides working together with Ryan and Sam, we kept a really nice chat during almost the entire bugmash. The awesome will to help at #railsbridge really overwhelmed me, where everybody was willing to help each other, something that makes it so much easier for the ones starting to contribute to Rails.&lt;/p&gt;


	&lt;p&gt;I would also want to congrat and thank all the participants for trying to make Rails better. So don&#8217;t hesitate to join the next time, it&#8217;s not as hard as I expected it to be and you would definitely not regret it. Now I&#8217;m really motivated to help others so I&#8217;m going to join to &lt;a href=&quot;http://www.railsmentors.org&quot;&gt;Rails Mentors&lt;/a&gt; on &lt;a href=&quot;http://www.railsbridge.com&quot;&gt;RailsBridge&lt;/a&gt; to give back the good things I received during this experience.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>sebastian.martinez</name>
    </author>
    <id>tag:blog.wyeworks.com,2009-11-16:2167</id>
    <published>2009-11-16T14:57:00Z</published>
    <updated>2010-02-22T17:22:18Z</updated>
    <category term="active merchant"/>
    <category term="payment"/>
    <category term="recurring"/>
    <link href="http://blog.wyeworks.com/2009/11/16/active-merchant-recurring-billing-part-2" rel="alternate" type="text/html"/>
    <title>Modifying Recurring Billing Transactions</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;Ok, it&#8217;s been some time we don&#8217;t post something in the blog, past weeks have been crazy at the office but now everything is back to normal, hopefully.&lt;/p&gt;


	&lt;p&gt;In this post I just want to tell that we added an extra ability to the recurring billing for BeanStream Gateway: &lt;strong&gt;Modify an existing transaction.&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;It&#8217;s pretty easy, you just need to do something like this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;  response = gateway.update_recurring(new_amount ,  new_options) &lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Remember, same for canceling, as BeanStream uses another &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; for managing these kind of transactions, we need to use the account_id for identifying the same, so you must include it on the options.
Then all same options can be passed.&lt;/p&gt;


	&lt;p&gt;Check it out here: &lt;a href=&quot;http://github.com/wyeworks/active_merchant&quot;&gt;http://github.com/wyeworks/active_merchant&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;That&#8217;s all, don&#8217;t forget to comment!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>sebastian.martinez</name>
    </author>
    <id>tag:blog.wyeworks.com,2009-10-07:1237</id>
    <published>2009-10-07T11:28:00Z</published>
    <updated>2010-02-22T17:19:37Z</updated>
    <category term="active merchant"/>
    <category term="beanstream"/>
    <category term="billing"/>
    <category term="payment"/>
    <category term="recurring"/>
    <link href="http://blog.wyeworks.com/2009/10/7/active-merchant-recurring-billing" rel="alternate" type="text/html"/>
    <title>Active Merchant Recurring Billing</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;Working on a payment system we had to sort some difficulties when making recurring payments using active merchant. Why? Because we needed to use BeanStream gateway and active merchant does not support recurring billing for this gateway yet.
So I just added the functionality to it.&lt;/p&gt;


	&lt;p&gt;You can check out my fork of Active Merchant that supports recurring billing for this merchant on &lt;a href=&quot;http://github.com/wyeworks/active_merchant&quot;&gt;http://github.com/wyeworks/active_merchant&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Here I leave you an example on how to use it:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
require 'rubygems'
require 'active_merchant'

 ActiveMerchant::Billing::Base.mode = :test

  # ActiveMerchant accepts all amounts as Integer values in cents
  # $10.00
  amount = 1000

  # The card verification value is also known as CVV2, CVC2, or CID
  credit_card = ActiveMerchant::Billing::CreditCard.new(
                  :first_name         =&amp;gt; 'Bob',
                  :last_name          =&amp;gt; 'Bobsen',
                  :number             =&amp;gt; '4242424242424242',
                  :month              =&amp;gt; '8',
                  :year               =&amp;gt; '2012',
                  :verification_value =&amp;gt; '123'
                )

  # Validating the card automatically detects the card type
  if credit_card.valid?

    # Create a gateway object for the BeansTream service
    gateway = ActiveMerchant::Billing::BeanstreamGateway.new(
                :login =&amp;gt; 'TestMerchant',
                :password =&amp;gt; 'password',
                :pass_code =&amp;gt; 'pass_code'
              )

    # Make recurring payment for the amount
    response = gateway.recurring(amount, credit_card, {
      :recurring_billing =&amp;gt; {
         :end_of_month =&amp;gt; '1',
         :tax1 =&amp;gt; 0,
         :interval =&amp;gt; {
            :unit =&amp;gt; :months,
            :length =&amp;gt; '1'
          },
          :duration =&amp;gt; {
            :start_date =&amp;gt; Date.today,
            :occurrences =&amp;gt; 5
          }
        })

    if response.success?
      puts &quot;Successfully charged $#{sprintf(&quot;%.2f&quot;, amount / 100)} to the credit card #{credit_card.display_number}. The Account number is #{response.params['rbAccountId']}&quot; 
    else
      raise StandardError, response.message
    end
  end

&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And that&#8217;s it, you have now created a recurring billing payment.&lt;/p&gt;


	&lt;p&gt;Now, what if you want to cancel the same?
Heres is how to do that:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
 gateway.cancel_recurring({ :account_id =&amp;gt; account_id })
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Pretty easy&#8230;the account_id is the number the gateway responses with when making a recurrent payment, and the passcode is the way of authenticating  in order to make this kind of transactions, and you can find it at the beanstream administrative console.&lt;/p&gt;


	&lt;p&gt;So try it out and have fun!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>jose.costa</name>
    </author>
    <id>tag:blog.wyeworks.com,2009-09-18:622</id>
    <published>2009-09-18T16:22:00Z</published>
    <updated>2009-09-18T16:34:19Z</updated>
    <category term="Ruby"/>
    <category term="gems"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2009/9/18/generating-pdf-with-odf-report-and-images-support" rel="alternate" type="text/html"/>
    <title>Generating PDF with odf-report and images support</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;Well i guess many of you might have checked the last edition of the &lt;a href=&quot;http://railsmagazine.com/issues/4&quot;&gt;Rails Magazine&lt;/a&gt;. If not, you may should.&lt;/p&gt;


	&lt;p&gt;In particular one of the articles by Rodrigo Rosenfeld Rosas talks about &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; generation with odf templates, something I&#8217;ve been playing around in the last few weeks.
He explains the mechanism that can be used for this purpose and finally mentions the &lt;strong&gt;odf-report&lt;/strong&gt; gem by Sandro Duarte which i&#8217;ve been using and forked to add support for image substitutions.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;More info here&lt;/strong&gt;: &lt;a href=&quot;http://github.com/josecosta/odf-report&quot;&gt;http://github.com/josecosta/odf-report&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Give it a try!&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;UPDATE&lt;/span&gt;&lt;/strong&gt;
Fork was merged to &lt;a href=&quot;http://github.com/sandrods/odf-report&quot;&gt;master branch&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.wyeworks.com/">
    <author>
      <name>santiago.pastorino</name>
    </author>
    <id>tag:blog.wyeworks.com,2009-09-11:39</id>
    <published>2009-09-11T18:10:00Z</published>
    <updated>2009-09-12T00:14:41Z</updated>
    <category term="Emacs"/>
    <category term="Ruby"/>
    <category term="emacs"/>
    <category term="ide"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://blog.wyeworks.com/2009/9/11/my-emacs-for-rails" rel="alternate" type="text/html"/>
    <title>My Emacs for Rails</title>
    <!-- ckey="01574853" -->
<content type="html">
            &lt;p&gt;I&#8217;d like to share with the community my emacs init file and a set of plugins to give a nicer experience on Ruby on Rails development, which you can checkout from http://github.com/spastorino/my_emacs_for_rails/tree/master. 
I have been using this environment under emacs 23, and it has not been tested on other emacs versions, so all feedback is welcome, if something goes wrong please feel free to contact me.&lt;/p&gt;


	&lt;h2&gt;What&#8217;s in the package?&lt;/h2&gt;


	&lt;p&gt;The package provides my customized Emacs init file and some plugins I found very useful to enhance Ruby on Rails development experience.&lt;/p&gt;


	&lt;h3&gt;Plugins&lt;/h3&gt;


	&lt;ul&gt;
	&lt;li&gt;anything&lt;/li&gt;
		&lt;li&gt;auto-complete&lt;/li&gt;
		&lt;li&gt;autotest&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://cedet.sourceforge.net/&quot;&gt;cedet&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;color-theme&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://ecb.sourceforge.net/&quot;&gt;ecb&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;find-recursive&lt;/li&gt;
		&lt;li&gt;flymake&lt;/li&gt;
		&lt;li&gt;javascript&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html&quot;&gt;nxhtml&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://eigenclass.org/hiki.rb?rcodetools&quot;&gt;rcodetools&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;rdebug&lt;/li&gt;
		&lt;li&gt;redo&lt;/li&gt;
		&lt;li&gt;ri-emacs&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://rinari.rubyforge.org/&quot;&gt;rinari&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;ruby-block&lt;/li&gt;
		&lt;li&gt;ruby-mode&lt;/li&gt;
		&lt;li&gt;toggle&lt;/li&gt;
		&lt;li&gt;yaml-mode&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/yasnippet/&quot;&gt;yasnippet&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://github.com/eschulte/yasnippets-rails/tree/master&quot;&gt;yasnippets-rails&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Installation&lt;/h2&gt;


	&lt;p&gt;Before you can use some plugins you have to install a few packages:&lt;/p&gt;


To use rcodetools you need to install the rcodetools, gem with
&lt;pre&gt;&lt;code&gt;sudo gem install rcodetools&lt;/code&gt;&lt;/pre&gt;
To use autotest you need the ZenTest gem, install it with
&lt;pre&gt;&lt;code&gt;sudo gem install ZenTest&lt;/code&gt;&lt;/pre&gt;
On further post I&#8217;m going to explain how to set it up under the gnome environment using all the beauty that gnome-notifier has.

Checkout the package
&lt;pre&gt;&lt;code&gt;git clone github.com/spastorino/my_emacs_for_rails&lt;/code&gt;&lt;/pre&gt;
 and copy all the files under my_emacs_for_rails directory to ~/.emacs.d directory if it doesn&#8217;t exist you have to create it.

	&lt;h2&gt;Screenshot&lt;/h2&gt;


	&lt;p&gt;You can see here some screenshots to get a taste of the look and feel that this one has.&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://blog.wyeworks.com/assets/2009/9/11/emacs-screenshot-full.png&quot;&gt;&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
</feed>

