Is it possible in Jasmine to spy on a getter such as
myObject[key]? We want to know when local storage is accessed.
Local storage has a functionally equivalent
getValue function, which you can spy on, but the spy is not triggered when you access the value via
On unicorn, the random number generator is seeded before the fork. So if you are depending on a set of unicorns to generate different random numbers, you need to reseed the random number generator manually after the fork.
If you want to make absolutely sure you aren’t generating any queries in your Rails views, try no_querying_views – which explodes if your query comes from view code.
Other ways to track down inefficient queries that folks have successfully used: bullet and query_reviewer
Skype 5 beta is out for Mac, which allows group video chat. Everyone must be on the beta for it to work.
Do people put bundler in the Gemfile?
Yes. Bundler is smart enough to omit it from the cache. It does, however, still follow the rules for version. We recommend using
~> 1.0.0 as the version string, because 1.x is supposed to be backwards-compatible with the current Gemfile format.
If you instead use
= 1.0.0 and your managed hosting environment updates bundler to something more recent, things will ASPLODE.
- Tech talk that was going to be today has moved to Thursday, due mostly to noise concerns. See you tomorrow.
We made a branch in git called “–track” by accident, and now we can’t get rid of it. git thinks it’s a command-line argument, even when it’s in quotes.
Here’s the command what did it:
$ git checkout -b --track origin/actual_branch_name
Branch --track set up to track remote branch refs/remotes/origin/actual_branch_name.
Switched to a new branch "--track"
Consensus: kill it through RubyMine or gitX. There is also a way through the command line:
$ git branch -d -- --track
…but make sure you get the dashes in all the right places.
reset after tail – sometimes, if your PS1 has colors (or square brackets, or … ?) you can lose your Terminal after tailing a file. To get it back, type
reset, which should work even if you can’t see it echoing. You may need an extra return before it.
The Giants seem to have won! There’s a parade tomorrow, right in front of the office. If you’re coming for the tech talk, leave extra time as streets will be closed and they’re expecting a crowd.
- Testing blocks. If you have a block and you want to spy on the internals as it executes, what do you do? Suggestions were:
- Have each method called internally throw a symbol and check for that.
- Turn it into a proc, and set expectations on that.
- Stub the methods being called internally and set expectations on those.
- pass the block to a spy object.
Other suggestions welcome. The project is using rr, which apparently can’t do this last option, though that would be ideal.
- Routes in Rails are case-sensitive? /products/1/edit and /Products/1/edit don’t both resolve to the same place (unless you specify in routes.rb). Rumor has it that the RFC for URIs says that the path portion of a URL is case-sensitive, as opposed to the case-insensitive domain name.
If anyone wants to read through that document and confirm…feel free.