...nil inside of #m. Affected Ruby Versions Affected version: 2.2.0, 2.2.1, 2.2.2 Unaffected versions: 1.x, 2.0, 2.1, 2.2.3+, 2.3+ How to Expose it The following code exposes the bug...
...the second keyword argument Oo # - there is a double-splat argument def vulnerable_method_1(p: 'p', lost: 'lost', **options) _report(__method__, lost) end def vulnerable_method_2(p: 'p...
...error message above. There are multiple solutions to this issue. Option 0: Use Bundler 1.14 It might fix this issue, or at least print some helpful hints. Unfortunately Bundler 1.14.2...
...dumps core on corrupt Gemfiles with Ruby 1.8.7. Option 1: Make bundle install succeed now, but leave it broken for future installs This parameter will make the installation pass on...
j and k to navigate in the diff u again to stage/unstage chunks 1 to stage/unstage only lines \ to split large chunks F5 to refresh the view
Hey, this is foo.example.com calling. I just sent two ICMP packets to 1.2.3.4 and that failed apparently. Here is a traceroute to 1.2.3.4: HOST: foo.example.com Loss% Snt Last...
...Avg Best Wrst StDev 1.|-- 10.10.13.1 0.0% 10 0.4 0.3 0.2 0.5 0.1 2.|-- 10.179.144.1 0.0% 10 0.7 0.7 0.7 0.8 0.0 3.|-- 212.18.7.63 0.0% 10...
Lock haml to '= 3.1.7' Unlock andand Unlock rake Lock test-unit to '= 1.2.3' Lock database_cleaner to '< 1.3' Lock cucumber to '< 2' Lock launchy to '~> 2.1 ' Lock paperclip...
...It will simplify debugging failing features. require 'capybara-screenshot/cucumber' Capybara::Screenshot.prune_strategy = { keep: 12 } # parallel_tests TODO: Add rspec-patches gem from PH Code changes Remove UTF8 hints at...
...ARGF.each_line { |l| m = l.match(/^INSERT INTO \`.+\` .+ VALUES \((\d+),/); puts l if !m || m[1].to_i < 200_000 || l =~ /schema_migrations/ }' | mysql -uUSER -pSECRET DATABASE_NAME The command above does...
...which opens two database connections and uses active record for the legacy system, too: 1. Add you database information to you config/database.yml. data_migration: database: your_application_data_migration...
...in the migration models, e.g. app/data_migration/user.rb. class DataMigration::MigrationUser < DataMigration::MigrationRecord self.table_name = 'zz_1234_0' # you will need this if the table name is not data_migration_migration_users...
...to move data between the client (HTML, Javascript) and the server (Ruby, Rails). Step 1: Moving HTML snippets Add a find-as-you-type search to MovieDB. Above the list...
...fails to install for Ruby 2.5 if you use a version equal or below 1.8.3. Run bundle update json --conservative to solve this issue. The backtrace you will encounter looks...
...option ‘-Wno-parentheses-equality’ Makefile:241: recipe for target 'generator.o' failed make: *** [generator.o] Error 1 make failed, exit code 2 Gem files will remain installed in /home/user/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/json-1.8.3 for inspection.
PATH=/opt/firefox-for-selenium:$PATH cucumber features/foo.feature Issues When you get the following error: ./firefox-bin: 1: Syntax error: "(" unexpected ... then you have a 32 bit Linux but downloaded a 64 bit...
...the gem from /usr/lib/ruby/gems/1.8/gems/foolib-1.2.3 to vendor/gems/foolib-1.2.3. Make sure the folder name actually ends in ...-1.2.3. cd to the gem. Check if a foolib.gemspec exists. If it doesn't, run rake...
...allocate SQLHENV from /usr/lib/ruby/1.8/dbd/odbc/driver.rb:36:in `connect' from /usr/lib/ruby/1.8/dbi/handles/driver.rb:33:in `connect' from /usr/lib/ruby/1.8/dbi.rb:148:in `connect' from (irb):1 from /usr/local/lib/site_ruby/1.8/rubygems/dependency_list.rb:14 I installed the gem ruby-odbc instead...
...store its content in a buffer and write it into the file system every 1000 lines. This will come back to bite you when using Rails.logger.info to write log output...
...to write after each line. On production environments the Rails logger writes only every 1000 lines -- and not upon shell or script termination as you might expect -- so Rake tasks...
...time you run the rake task to rebuild your po files. Holy cow! Fix 1: Cheat Use the following hack to define classes inside your scripts and trick the gem...
...this step by step, do not just copy the whole thing into the console! # 1. Get old paths by doing something like this on the console: old_paths = ModelWithAttachment.all.collect { |m...
...that CSS selectors cannot do, add the following selector in selectors.rb: when /^"(.+?)" \(xpath\)$/ [:xpath, $1] Then use it like this: Then I should see "Application title" in the page source...
Example (broken in IE): flex: 0 1 calc(50% - 20px) Workaround: flex-basis: calc(50% - 20px) flex-grow: 0 // Default, can be omitted for this example flex-shrink: 1 // Default...
...which we were using for most Rails 2.3 projects, does not run on Ubuntu 14.04 any more. Here is how to update affected projects. Update (or create) .firefox-version with...
...with these versions: gem 'sanitize', '< 3' # 3+ depends on crass which depends on Ruby 1.9 gem 'cucumber_factory' Run bundle update on any added/changed gem, e.g. bundle update cucumber capybara...
Travis changed their default distribution from Ubuntu 14.04 (trusty) to 16.04 (precise). This might break your test setup for new builds. You can solve this issue by freezing your test...
...distribution in the .travis.yml to Ubuntu 14.04 until you have the time to solve all the issues you will have in 16.04: dist: trusty Error details Here are few indicators...
...I was asked to check my yarn integrity: error Integrity check failed error Found 1 errors. ======================================== Your Yarn packages are out of date! Please run `yarn install --check-files` to...
...bit ASCII value or UTF-8 codepoint (0-127) you can use Integer#chr: 116.chr # => "t" To get a character for values larger than 127, you need to pass the...
...intuitive, but does not require passing an encoding option. You need the U* directive. [116].pack('U*') # => "t" [252].pack('U*') # => "ü" Note that you must wrap your value numbers...
page.execute_script <<-JS field = $('#{field[:id]}') field.blur() field.fire('autocomplete:done') JS sleep 1 end In the javascript: /* * Listening on "blur" events does not work in tests because Firefox...
...s date picker and date time picker doesn't work on touch interfaces. Solution 1: Use Mobiscroll Another way is to detect touch devices and for those devices use the...
...bzipped) file in bytes on the server (ls -l). In our case, it's 1234567890. Know your (local) MySQL root password. We'll use SECRET below. Know your (local) target...
...name. For us: my_project_development. Go wild: ^ ssh user@example.com "cat /mnt/dumps/my_project.dump.bz2" | pv -s 1234567890 | bzip2 -d | mysql -uroot -pSECRET my_project_development That will: Print the (bzipped) file to...