puts "Hello" end end While you can say create a block to call that method (using ampersand and colon) on Ruby 1.8, ... 1.8.7 > Foo.new.tap(&:test) Hello => # ... you cannot...

...do that on Ruby 1.9 or 2.0: 1.9.3 > Foo.new.tap(&:test) NoMethodError: private method `test' called for # ^ 2.0.0 > Foo.new.tap(&:test) NoMethodError: private method `test' called for #Foo:0x000000027bc738

...your recompile hit. To dig further, you may add options to the new SpeedMeasurePlugin call. Example: const smp = new SpeedMeasurePlugin({ outputFormat: "humanVerbose", loaderTopFiles: 20 }) const config = environment.toWebpackConfig() module.exports = smp.wrap(config...

makandra dev

...the conversation, use /alertson KEYWORD Note that multiple keywords must be defined with one call, as each call will overwrite previous keywords. Separate them by spaces: /alertson KEYWORD1 KEYWORD2

...I use this handy shell script to set one site as the current one. Call it just like this: apache-site makandra-com Note that it disables all other sites...

...Furthermore it will also enable the default site if that was available. When you call apache-site with no arguments, it will list all available sites. This script is part...

...a "read on" link), and html_safe knowledge. Prefer the truncate() helper Warning: truncate() calls html_safe if you're not escaping. FWIW, an HTML string may easily become invalid...

...Rail application. Upgrading the gem to version 1.21.0 fixed the issue. Traceback (most recent call last): 17: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 16: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb...

If a SOAP API expects you to call a remote method with arguments of complex types, Savon lets you manually set the xsi:type attribute like this: client.call(:rpc_method...

puts body.body # html of response body Instead of Rails.application you can also call any Rack application...

...block. You can use Object#method to obtain a method reference that responds to #call: foo_plus = "foo".method(:+) foo_plus.call("bar") # => "foobar" The method reference also understands #to_proc so...

markembling.info

...defined via the resource method. When you put resource 'user' into config/routes.rb, you can call users_path and get the path to the index action in the UsersController: /users.

...states, Rails creates a special _index_path for this scenario. Thus, you can simply call: sheep_index_path

...So if your project doesn't support Rails-XSS just remove all .html_safe calls.

...Ruby version only to make the release, then switch back. You will have to call the rake release command without bundle exec...

In order to prove multiple values from a single object, Ruby calls #to_a on the object: o = String.new('O') def o.to_a [1,2,3]

...a, b, c = o # Implicit call to #to_a here a # => 1 b # => 2 c # => 3 Hence, if you want your class to support multiple assignment, make sure to define...

Ruby 1.9 brings a shorter way to define lambdas using the -> operator: twice = -> (x) { 2 * x } twice.call(5) # => 10

undefined method `log' for # Your affected code might look similar to this call below and will work after the upgrade again. errors = page.driver.browser.manage.logs.get(:browser...

blog.jayfields.com

...possible security vulnerabilities caused by this. If you want to find out if the call was successful you can ask $?.success?. system – when you want to know how it went...

...server', '-p 3000' # fails and returns nil This is equivalent to running a command called "bundle exec rails" (including spaces in its filename). There is usually no such command anywhere...

postgresql.org

...arrays, true story.) Adding values Use the array_cat function, or the || operator. These calls will add the values "cats" and "mice" to users.topics: UPDATE users SET topics = array_cat...

...for a suitable revision there. Once you know where you want to downgrade to, call it once again # portdowngrade net-mgmt/collectd5 r497411 portdowngrade does NOT change /usr/ports in any...

...with_advisory_lock gem but you could easily use something else. class SidekiqMailersThrottle def call(worker, job_options, queue) if queue == 'mailers' ApplicationRecord.with_advisory_lock('mailers-throttle') do yield

...scope, but what if you need to pluck Global IDs? While you could just call map(&:to_global_id) on your scope, this approach would instantiate each record just to...

...This can easily be achieved through a Sidekiq middleware as follows. class RailsLoggerSidekiqServerMiddleware def call(worker, job_options, queue) tags = [worker.class.name, worker.jid] Rails.logger.tagged(*tags) { yield } end end Sidekiq.configure_server do...

Call geordi clean from a project root to remove unused and unnecessary files inside it. This script is part of our geordi gem on github. In Geordi > 1.2 you can...

...call geordi clean...

...form.build_nested_records(:actors, :minimum: 4, name: 'Foo', active: true) If you want to call a different method rather than build, you can pass a block: form.build_nested_records(:actors...

If you have multiple monitors and want to share a given screen with your call partner, drag the caller window to the desired monitor, then start sharing.