Skip to content

Instantly share code, notes, and snippets.

View olleolleolle's full-sized avatar
🙌
In sunny Malmö in Sweden 🌞

Olle Jonsson olleolleolle

🙌
In sunny Malmö in Sweden 🌞
View GitHub Profile
@olleolleolle
olleolleolle / install_chromedriver.sh
Created February 22, 2024 10:43
Ready-to-use script, save it as script/circleci/install_chromedriver.sh
#!/bin/bash
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
# determine_chrome_version
if uname -a | grep Darwin >/dev/null 2>&1; then
echo "System detected as MacOS"
if [ -f "/usr/local/bin/google-chrome-stable" ]; then
CHROME_VERSION="$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version)"
else
CHROME_VERSION="$(/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version)"
begin
require "nokogiri"
rescue LoadError
abort "Nokogiri not found. Oh, you may need to 'gem install nokogiri'. Quitting."
end
url = ARGV[0]
body =
if File.exists?("/tmp/body")
@olleolleolle
olleolleolle / warnings-from-today-2020-04-02.txt
Last active April 3, 2020 10:33
Some Ruby warnings, perhaps to hunt!
# webmock - Warnings TODO - haha this led me to https://github.com/taf2/curb/pull/408
/Users/olle/.gem/ruby/2.6.4/gems/webmock-3.8.3/lib/webmock/http_lib_adapters/curb_adapter.rb:93: warning: instance variable @put_data not initialized
# Can VCR ask for Content-Type here?
/Users/olle/.rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http/generic_request.rb:186: warning: net/http: Content-Type did not set; using application/x-www-form-urlencoded
# httpclient Warnings - led me to make https://github.com/nahi/httpclient/pull/421 and https://github.com/nahi/httpclient/pull/422
/Users/olle/.gem/ruby/2.6.4/gems/httpclient-2.8.3/lib/httpclient/ssl_config.rb:370: warning: assigned but unused variable - pathlen
/Users/olle/.gem/ruby/2.6.4/gems/httpclient-2.8.3/lib/httpclient/ssl_config.rb:51: warning: method redefined; discarding old initialize
/Users/olle/.gem/ruby/2.6.4/gems/httpclient-2.8.3/lib/httpclient/ssl_config.rb:58: warning: method redefined; discarding old add_cert
@olleolleolle
olleolleolle / gh-fixing.md
Last active July 15, 2019 06:35
Automating mass fixes, pt I

Finding and fixing RubyGems

Lots of gems have outdated gemspec files.

Known Deprecations

  • [autorequire]
  • [default_executable]
  • [rubyforge_project]
  • [specification_version]
@olleolleolle
olleolleolle / hm.md
Last active March 22, 2019 22:47
An interaction
it "bails" do
begin
cli.parse_options(["--config=#{file}"])
rescue => e
pp e
pp e.cause
pp e.backtrace
end
end
@olleolleolle
olleolleolle / rubocop.md
Created March 19, 2019 07:43
RuboCop 0.66.0 has trouble with this piece of code

In This PR, I disabled a rule inline.

module Gemstash
  # Storage for application-wide variables and configuration.
  class Env
    module Helper
    # RuboCop 0.66.0 can not decide where to put that "private"

 private # rubocop:disable Layout/IndentationWidth
{
"name": "blockUI",
"title": "BlockUI",
"description": "Simulate synchronous ajax by blocking - not locking - the UI. This plugin lets you block user interaction with the page or with a specific element on the page. Also great at displaying modal dialogs.",
"keywords": [
"block",
"overlay",
"dialog",
"modal"
],
desc 'Use ampersand in argument to system'
task :runbatch do |task_name, args|
command = 'tbat.bat && cmd /c start tbattwo.bat'
puts command
system command
end
# client.rb
require 'drb/drb'
DRb.start_service
remote_object = DRbObject.new_with_uri('druby://localhost:9999')
p remote_object.greet #=> 'Hello, world!'

This bug will track all NEWS items new in Ruby 2.5. This list is based off https://github.com/ruby/ruby/blob/trunk/NEWS.

Only changes relevant to JRuby are listed here. MRI-specific internal changes and features are not included.

NOTE: Pull requests should be done against the ruby-2.5 branch.

Language changes