...but not as part of the whole test suite, make sure the filename is foo_spec.rb instead of just foo.rb...

apidock.com

FileUtils.touch 'example.txt' You may also pass an array of filenames: FileUtils.touch %w[ foo bar baz ], :mtime => Time.now - 2.hours Non-existent files will be created...

Let's say you want a transform that replaces substrings like "translate:foo" by the I18n translation for "foo". This transform will incorrectly discard characters left and right...

...from "translate:foo": Transform /\btranslate:(.+?)\b/ do |key| I18n.t(key) end A more correct version of that transform would be this: Transform /^(.*?)\btranslate:(.+?)\b(.*?)$/ do |left, key, right| left + I18n.t...

kadin.sdf-us.org

...for my own reference, of a few ways to easily delete the dot-underscore (._foo, ._bar, etc.) files created by (badly-behaved) Mac OS X systems on non-AFP server...

plnkr.co

...which IE fails to support properly. Example Consider the following HTML and CSS. foo bar .container { display: flex; flex-direction: column; } .child { flex: 1; } See it in action at Plunker...

makandra dev

...are three solutions for you. Easiest solution Rethink! Do you really need CONSTANT = %w[foo bar] to be constant? In many cases, setting it as a simple attribute will do...

Best results in other decks

...actually plan to display or change it. Understand that an expression like User.where(email: 'foo@bar.com') does not make an SQL query. It simply returns a scope object for further chaining...

...Queries in Rails Tips Preventing scopes from loading A scope like User.where(email: 'foo@bar.com') does not make an SQL query. It simply returns a scope object for further chaining with...

makandra Curriculum

...as. It should compare the attributes of two ActiveRecord instances: movie1 = create(:movie, title: 'Foo', year: 2007, description: 'Lorem ipsum') movie2 = create(:movie, title: 'Foo', year: 2007, description: 'Lorem ipsum...

...your arrays a #to_sentence method that may help you build the error message: ['foo', 'bar', 'baz'].to_sentence => "foo, bar and baz" Also see Where to put custom matchers...

Search in all decks