...attr_writer :browser_died def scenario_started self.browser_died = false end def scenario_ended return unless session.driver.is_a?(::Capybara::Selenium::Driver) self.driver_scenario_count += 1 if !browser_died? && driver_scenario...
...image_tag), Rails will compile your entire assets within its process before that helper returns. This will cause your helper to freeze for many seconds. Since Webpack needs to boot...
ls -1tr * | tail -1 Used switches The -1 switch makes ls return 1 file per line, -t orders by modification time and -r causes sorting from oldest...
...to newest. tail -1 then returns the last line, containing the newest file's name. If you require only a subset of files, adjust the "*" mask accordingly or use other...
...Laden von Models passieren # search_spec.rb describe Search, search: true do # enable indexing # ... it 'only returns posts for a post query' do post = create(:post) create(:event) Post.search_index.refresh # force index to...
# or b.label(class: "my-#{ b.object.class.name.parameterize }", 'data-value': b.value) { b.check_box + b.text } end The return values of each call will be joined and returned. You may of course render HTML...
...can use Hash#key. It's available in Ruby 1.9+. Hash#key(value) → key # => Returns the key of the first occurrence of a given value. If the value is not...
...found, returns nil. hash = { "a" => 100, "b" => 200, "c" => 300, "d" => 300 } hash.key(200) #=> "b" hash.key(300) #=> "c" hash.key(999) #=> nil
Enumerable#count can do three things. With no argument provided, it returns the number of items. With an argument, it returns the number of items matching the given value.
RuntimeError: can't modify frozen String /home/user/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/version.rb:191:in `strip!': #stringify_keys - returns hash or session hash with keys stringified /home/user/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/version.rb:191:in `initialize' /home/user/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/pry-0.13.1/lib/pry/pry_class.rb:13:in `new...
...form = up.element.first(formSelector) element.addEventListener('click', (event) => { event.preventDefault() let linkTag = buildLinkTag(form) if (linkTag == null) return window.parent.postMessage({ mceAction: 'insertContent', content: linkTag, }); window.parent.postMessage({ mceAction: 'insertContent', content: ' ', }) window.parent.postMessage({ mceAction: 'close' }); }) function buildLinkTag(form...
...parentheses) instead of using it as a keyword import (without parentheses). The import() function returns a promise with the exported variables: let exports = await import('large-library') console.log("A named...
Ruby's String#split returns an array of substrings from the given string. Usually, this is missing the split characters: >> 'user@example.com'.split('@') => ["user", "example.com"] If you want to join those...
...video's initial playback time. Setting this value seeks to the new time. readyState returns a value in [0:4] indicating its state. Caveats On iOS, the video.preload attribute is...
..... Your supported Ruby versions for this gem must be >= 2.3. When rake release returns an error rake aborted! Your rubygems.org credentials aren't set. Run `gem push` to set...
...pattern below. Note how the class is replaced by a constructor function newDog, which returns an object that has the object's public methods as properties: function newDog(name) {
console.log(name + " is a good boy"); } } function walk(additionalMeters) { meters += additionalMeters; } function isHungry() { return meters > 50; } return { bark: bark, walk: walk } } As function isHungry() is not returned, it remains...
SELECT enum_range(NULL::portal) # Returns an array of all possible values SELECT unnest(enum_range(NULL::portal)) # Unnests the array and returns a row for each value Whereas portal...
...directly from the database and create GIDs from them. # Note that we do not return GlobalID objects, but GID URI strings. columns = [primary_key] columns << inheritance_column if column_names.include?(inheritance...
...actually keeps a list of custom identifiers. Other identifiers will not work and simply return nil. >> Time.zone_offset('BST') => nil >> Time.zone_offset('Berlin') => nil I'm confident there are other...
..and prefer CSS, you may rewrite it: field.ancestor('div.form-group') Both versions will return the outermost matching element. Use the #order option find the closest parent: field.ancestor('div.form-group...
and focused.instance == "sun-awt-X11-XDialogPeer" and c.instance == "sun-awt-X11-XFramePeer" then return end if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end)
...d even like to patch Prototype so it behaves like jQuery: Element.addMethods({ visible: function() { return offsetWidth > 0 && offsetHeight...
...with a very old version of Bundler. For reasons unknown, the Bundler dependency API returns different dependencies for some gems (like ruby-debug or rainpress) than the dependencies found in...
...OF_TEST_PACKETS $TARGET status=$? if [ $status -ne 0 ]; then mail_traceroute $TARGET fi return $status } function mail_traceroute { MTR_OUTPUT=$(mtr -n -r $@) HOSTNAME=$(hostname -f) mail -s "Monitoring...
...link or a press a button on a Selenium-controlled browser, the call will return control to your test before the next page is loaded. This can lead to concurrency...
code: | 15 | def type_cast_from_database(value) 5811 (5.4%) / 5811 (5.4%) | 16 | return if value.nil? 1661 (1.5%) / 1661 (1.5%) | 17 | value.to_i | 18 | end