RailsCasts Pro episodes are now free!

Learn more or hide this

Potiguar Faga's Profile

GitHub User: nasalis

Site: http://www.facebook.com/potiguar

Comments by Potiguar Faga

Avatar

Yeah I also noticed the low quality in this video. Some codec related issue it seems.

Avatar

True, I needed also to chown ubuntu /var/chef in order for it to work

Avatar

I'm getting in this episode the same strange thing some other user mentioned in another thread. It seems it's cut off in the end, interrupting Ryan mid-sentence... Probably just a few seconds of video cut off but I think it's worth mentioning.

Great episode as always.

Avatar

small correction, @14:42 you actually mean 5ms not 5s

Avatar

In my AWS server I need to use "ubuntu" server instead as the root user is disabled.

Avatar

I recently found that when using the method_missing trick in my base presenter class, it raises an exception when I try to use the capture method directly.

Dumb example:

ruby
class UserPresenter < BasePresenter
  def some_div(&block)
    content = capture(&block)
    content_tag(:div, content)
  end
end

This raises ArgumentError: wrong number of arguments (0 for 1)

From what I can tell, the reason is because it conflicts with Kernel::capture, maybe because Kernel always have precedence, or something.

In any case, I added a hard capture method to my base presenter class, to work around the issue:

ruby
  def capture(*args)
    @template.capture *args
  end
Avatar

I was just thinking: "It would be nice if Safari could render JSON in a more readable way... www.goo... oops" You beat Google! Great tip!

Avatar

The hack does fix it, thanks.

Avatar

Just noticed the same behaviour here, kinda weird.

Avatar

+1 kudos for also showing Test::Unit and not only RSpec!

Avatar

cool cool! I get it's a temp hack, sorry to sound so eager. Really excited about it I guess. =) And yes, it does work for the time being.

Regarding my RSpec "issue", I guess it's more of a situation that everyone who runs any sort of autotest suite runs into.. the moment you insert a debug hook in the code, the automated tests kick in because you save the file, and they fire the hook.

I really do enjoy using Pry! thank you. =)

Avatar

Hi John. It does work. Feels a bit hackish thou.

Also one thing I notice is that when using guard with rspec whenever I add a "binding.pry" line, the specs of course pause on that line. Would there be a way to avoid this? Well I guess I can always use...

binding.pry unless Rails.env.test? 
Avatar

Yeah would be nice to run with Pow if possible. Any clues?