profile
viewpoint

bjfish/barkeep 1

The friendly code review system.

bjfish/bench-mem 1

A new grails application with H2 removed and the app-info plugin installed

bjfish/ample-search 0

SaaS application search aggregator

bjfish/arel 0

A Relational Algebra

bjfish/assemblyscript 0

A TypeScript to WebAssembly compiler 🚀

bjfish/awesome-elixir 0

A curated list of amazingly awesome Elixir and Erlang libraries, resources and shiny things. Updates:

bjfish/bcrypt-ruby 0

bcrypt-ruby is a Ruby binding for the OpenBSD bcrypt() password hashing algorithm, allowing you to easily store a secure hash of your users' passwords.

bjfish/bcrypt_pbkdf-ruby 0

Ruby gem implementing bcrypt_pbkdf

bjfish/BitHub 0

BTC + BitHub = An experiment in funding privacy OSS.

bjfish/bootsnap 0

Boot large Ruby/Rails apps faster

issue closedoracle/truffleruby

GC.stat({}) doesn't work

From https://github.com/Shopify/gctime/pull/1#issuecomment-974125795, found by @casperisfine @bjfish Can you fix it?

closed time in 6 days

eregon

issue commentoracle/truffleruby

GC.stat({}) doesn't work

These issues are now fixed at https://github.com/oracle/truffleruby/commit/91546e7a81599a9d7d1c50248f10cbbb10e8290e.

eregon

comment created time in 6 days

issue closedoracle/truffleruby

Kernel#print doesn't print $_ when no arguments are given

seq 100 | ruby -ne 'print'

per manual it should work as -p but currently it doesn't work

closed time in 14 days

gogainda

issue commentoracle/truffleruby

Kernel#print doesn't print $_ when no arguments are given

@gogainda This is now fixed at https://github.com/oracle/truffleruby/commit/82c9521e06f758a9f1064ddacde71f83727d4cca.

gogainda

comment created time in 14 days

startednuxt/nuxt.js

started time in 19 days

push eventbjfish/rails

Chris Coetzee

commit sha decf7485bf6597cc492d632d9b6780bf41c0cb1a

Expand gemspec files within gem directory

view details

Michał Begejowicz

commit sha 2cf41d7a5eb2f3d09b14673d91a91c5de04d2c9e

Add support for generated columns in PostgreSQL

view details

Stefan Stüben

commit sha 64fd666e161771ee30d3440bc4d3dd881019b39b

Incorporate feedback

view details

Nikita Fedyashev

commit sha 077003ea1ecb293f4d5c11ac2d3f96b4fd754d23

Add missing DOM ids to rails/mailers/email.html template

view details

Oli Peate

commit sha a8ae85a33191a0f22669a3c13fbfaa12877af084

Support clearing acronyms in ActiveSupport::Inflector::Inflections Previously calling ActiveSupport::Inflector::Inflections.clear(:acronyms) reset the instance variable to an empty Array, which is not the correct default. The next time an acronym is added a TypeError is thrown.

view details

Nikita Fedyashev

commit sha abacb36f0efe356cc7254e5c44785e4c709f2891

Downcase id attribute values

view details

HParker

commit sha 5c7a785fcec3ae15f9452847688a8fc7f0697883

Allow permitting numeric params When specifying numeric parameters, strong params lets you permit them all using the same permitted params for each. For example params like, ```ruby book: { authors_attributes: { '0': { name: "William Shakespeare", age_of_death: "52" }, '1': { name: "Unattributed Assistant" }, '2': "Not a hash", 'new_record': { name: "Some name" } } } ``` can be permitted with, ``` permit book: { authors_attributes: [ :name ] } ``` This returns the name keys for each of the numeric keyed params that have a name field, ```ruby { "book" => { "authors_attributes" => { "0" => { "name" => "William Shakespeare" }, "1" => { "name" => "Unattributed Assistant" } } } } ``` This is exactly what you want most of the time. Rarely you might need to specify different keys for particular numeric attributes. This allows another strong params syntax for those cases where you can specify the keys allowed for each individual numerically keys attributes hash. After this change using the same params above, you can permit the name and age for only the `0` key and only the name for the `1` key, ```ruby permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } } ``` This returns exactly the parameters that you specify, ```ruby { "book" => { "authors_attributes" => { "0" => { "name" => "William Shakespeare", "age_of_death" => "52" }, "1" => { "name" => "Unattributed Assistant" } } } } ``` Sidenote: this allows `permit` to do the equivalent to ```ruby params.require(:book).permit(authors_attributes: { '1': [:name]}) ``` without raising when `book: ... ` is not present. The simpler syntax should be preferred, but in cases where you need more control, this is a nice option to have.

view details

Alex Ghiculescu

commit sha de238125ef0baab1d1af0f27f61fc700f9e18e55

Generate less initializers in new/upgraded Rails apps Currently when you make a new Rails app, we generate a lot of initializers. For new users, I think we should try and include as few as possible - the less files, the less daunting a new app is. And for upgrades I'd like to [continue to simplify the update process](https://github.com/rails/rails/pull/41083), in this case by not bringing back initializers you have probably already dismissed or modified. In this PR I'm proposing we remove two initializers: `application_controller_renderer.rb` and `cookies_serializer.rb`: **`application_controller_renderer.rb`**. This configures [`ActionController::Renderer`](https://api.rubyonrails.org/classes/ActionController/Renderer.html), for rendering views outside of controller actions. I don't think this is something most Rails apps will need (certainly not on day 1); users can configure this feature when they need it. **`cookies_serializer.rb`**. This was added for [Rails 4.1](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#cookies-serializer). The behaviour is: - For new apps, the initializer says `:json`. - For upgraded apps that don't have the initializer, it is added with value `:marshal`. - If there's no initializer, the [default value](https://github.com/rails/rails/blob/c9a89a4067834a095a41084030b8c9ccdbce77d5/actionpack/lib/action_dispatch/middleware/cookies.rb#L589) is `:marshal`. Since nobody should be upgrading direct from Rails 4.0 to Rails 7.0, we can simplify this by using new framework defaults. So the behavior will now be: - For new apps, `config.load_defaults("7.0")` sets the value to `:json`. - The `new_framework_defaults_7_0.rb` file explains this, and suggests using `:hybrid` to be upgrade to JSON cookies. - No changes to [the code](https://github.com/rails/rails/blob/c9a89a4067834a095a41084030b8c9ccdbce77d5/actionpack/lib/action_dispatch/middleware/cookies.rb#L589); the default value is `:marshal` if you don't set one. So if you were not setting a `cookies_serializer` previously and you want to keep using `:marshal`, you'll need to explicitly set this before using `config.load_defaults("7.0")`, otherwise it will switch to `:json`. The upside of this is you won't get the `cookies_serializer.rb` file created for you every time you upgrade.

view details

leastbad

commit sha d573fb11d78e7d61881fdc704b4ccb92afd10112

add connection_identifier to ConnectionStub

view details

leastbad

commit sha 5d61773812a757b140e5d27ac6872efb3ac67a6f

ConnectionStub identifiers are methods, not ivars

view details

leastbad

commit sha b18e6ba6bd1596cb3ffbae05ad3c4680284baa13

add connection_identifier assertion to ConnectionStub test

view details

Andrey Novikov

commit sha a738295805b93ad272afa86c314d6ce43a6a1f14

Arel: Add support for FILTER clause (SQL:2003) Currently supported by PostgreSQL 9.4+ and SQLite 3.30+ See: - http://modern-sql.com/feature/filter - https://www.postgresql.org/docs/9.4/static/sql-expressions.html#SYNTAX-AGGREGATES - https://sqlite.org/lang_aggfunc.html#aggfilter Example: Model.all.pluck( Arel.star.count.as('records_total').to_sql, Arel.star.count.filter(Model.arel_table[:some_column].not_eq(nil)).as('records_filtered').to_sql, )

view details

Tom Prats

commit sha fcc46228c626b02f7ace689843dbbcf400d118df

Squashed commit of the following: commit 1dca99ad4f8082d8daaa17c6600f3036c25f8e50 Author: Tom Prats <tprats108@gmail.com> Date: Thu Aug 5 18:07:00 2021 -0400 Moved header commit 62201870ff5c4124d90912989745819b05d94516 Merge: 5fa3ecae74 c91a8135c7 Author: Tom Prats <tprats108@gmail.com> Date: Thu Aug 5 14:41:22 2021 -0400 Merge branch 'main' into active-storage-byte-range commit 5fa3ecae745b4f7c67a6b6b1b7ec420877c96fb8 Author: Tom Prats <tprats108@gmail.com> Date: Thu Aug 5 14:39:53 2021 -0400 Apply suggestions from code review Syntax updates Co-authored-by: Rafael França <rafael@franca.dev> commit b9553e3698a7af5105171f9d63bd7b89cbb7e2c3 Author: Tom Prats <tprats108@gmail.com> Date: Wed Jun 23 17:36:26 2021 -0400 Added Active Storage support for byte ranges

view details

Breno Gazzola

commit sha 77f2af34f91b04fa8e97b49d6f3a197c2a09c754

Fix open redirects in active storage

view details

Petrik de Heus

commit sha 68283345551d10eee260c3a74f1f8d069d1d8200

Add missing dots to changelogs

view details

John Hawthorn

commit sha da8140366596cb630670dc8591e6a548cb9e7b8d

Use TemplateDetails::Requested as details_key

view details

John Hawthorn

commit sha 76561430e5e64f64ce46b9bf4af00ef58def4782

Normalize locals in unbound templates

view details

John Hawthorn

commit sha 4db7ae52f8312ddee193d9902489a6c795c82d51

Remove cache from Template::Resolver

view details

John Hawthorn

commit sha bb5208692aed3a3b4200287fe69a032b169dd9eb

Avoid building full path objects when cached

view details

Jeremiah

commit sha b7560426b569e85675586d092e8853b430746265

Simplify `pluck(:value).first` to `pick(:value)`

view details

push time in 20 days

startednocodb/nocodb

started time in 20 days

CommitCommentEvent
CommitCommentEvent

push eventeregon/truffleruby-gem-tracker

Brandon Fish

commit sha 8c9d338d500e770a4833d5b2ca32ff2e453f3cb8

Use branch parameter to filter branches using API

view details

push time in 20 days

issue closedoracle/truffleruby

Implement C API methods for OpenSSL 2.2.1

It's not possible to install OpenSSL 2.2.1 with any released version of TruffleRuby or with the current dev version. This will show up as an error about rb_str_locktmp not being implemented:

ERROR:  While executing gem ... (RuntimeError)
    External LLVMFunction rb_str_locktmp cannot be found. (com.oracle.truffle.llvm.runtime.except.LLVMLinkerException)

The relevant commit in the OpenSSL extension is https://github.com/ruby/openssl/commit/d38274949f4a504c046a00a76ec33aff006e12a8. The full set of changes is https://github.com/ruby/openssl/compare/v2.2.0...v2.2.1. It looks like in addition to rb_str_locktmp we'll need to handle rb_str_unlocktmp and store the boolean flag that the pair of functions adjusts.

closed time in 21 days

nirvdrum

issue commentoracle/truffleruby

Implement C API methods for OpenSSL 2.2.1

@nirvdrum This is now implemented at https://github.com/oracle/truffleruby/commit/de750267b55c073bc0092f2d6c52f808b779ef6f.

nirvdrum

comment created time in 21 days

issue closedoracle/truffleruby

Incorrect exception message for exceptions that inherit from Errno exceptions

I noticed that TruffleRuby deviates from CRuby when an exception inherits from an Errno exception. The inherited Errno message (ex: No such file or directory) becomes lost.

Example

class CustomError < Errno::ENOENT
end

raise(CustomError,"custom message")

CRuby (3.0.2)

(irb):4:in `<main>': No such file or directory - custom message (CustomError)

TruffleRuby (21.3.0)

(irb):4:in `<top (required)>': unknown error - custom message (CustomError)

closed time in 25 days

postmodern

issue commentoracle/truffleruby

Incorrect exception message for exceptions that inherit from Errno exceptions

This is now fixed at https://github.com/oracle/truffleruby/commit/5776ef65c7fa5c2edbddc6c49593de3f507c8637.

postmodern

comment created time in 25 days

issue closedoracle/truffleruby

Support Fiber#raise after Fiber#transfer

See https://github.com/oracle/truffleruby/issues/2338#issuecomment-831213756 @bjfish Could you try to implement that? That's a Ruby 3 change, so we should add the spec in :next.

It does mean we'll need to mark as failing this spec: https://github.com/ruby/ruby/pull/3795/files#diff-184b163e2d8d9c8d74755a749a8d21df6692d2af454e60d3a747fcc18cfbc2faR81 but I think that's fine, probably nothing relies on that exception.

closed time in 25 days

eregon

issue commentoracle/truffleruby

Support Fiber#raise after Fiber#transfer

I think this is implemented since the spec/test here are passing: https://github.com/ruby/ruby/pull/3795/files#diff-184b163e2d8d9c8d74755a749a8d21df6692d2af454e60d3a747fcc18cfbc2faR81

Additional fiber transfer for Ruby 3 was implemented here: https://github.com/oracle/truffleruby/commit/d59b3fb70a8b125335a75a06963c2b772ab6f076

Additional Ruby 3 Fiber methods are still work in progress as tracked here: https://github.com/oracle/truffleruby/issues/2453

eregon

comment created time in 25 days

Pull request review commentoracle/truffleruby

Rework encoding negotiation

 public static StringAppendNode create() {             final Rope left = libString.getRope(string);

@eregon I think RopeWithEncoding would work the same here since RopeWithEncoding is pretty much a Pair itself.

Unless somehow the returned Rope doesn't have the returned RubyEncoding?

RopeWithEncoding does have the assertion assert rope.encoding == encoding.jcoding; so we'll know if this scenario happens in testing.

nirvdrum

comment created time in a month

PullRequestReviewEvent

issue closedoracle/truffleruby

RbConfig::CONFIG["WERRORFLAG"] is not set

$ ruby -ve 'p RbConfig::CONFIG["WERRORFLAG"]'
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
"-Werror"

$ ruby -ve 'p RbConfig::CONFIG["WERRORFLAG"]'
truffleruby 22.0.0-dev-2d94d3be, like ruby 3.0.2, GraalVM CE Native [x86_64-linux]
nil

From https://github.com/puma/puma/pull/2732#issuecomment-954801643 @bjfish Could you take care of that?

closed time in a month

eregon

issue commentoracle/truffleruby

RbConfig::CONFIG["WERRORFLAG"] is not set

This is resolved at: https://github.com/oracle/truffleruby/commit/f709b810385454a589febfb6ecd25f89932a3543

eregon

comment created time in a month

issue commentoracle/truffleruby

IO#write multiple arguments

This has been fixed at: https://github.com/oracle/truffleruby/commit/37c707047e00d4dad5832ebf0702cb6dd890bb91.

carlhoerberg

comment created time in a month

issue closedoracle/truffleruby

IO#write multiple arguments

Cruby/jruby supports multiple arguments to IO#write, and is then using writev instead of write (for IO's who support writev, not all does, eg. openssl sockets). Truffleruby only supports a single argument.

File.open("/tmp/a", "w") do |f|
  f.write("foo", "bar", "\n")
end
<internal:core> core/io.rb:2378:in `write': wrong number of arguments (given 3, expected 1) (ArgumentError)
        from wv.rb:2:in `block in <main>'
        from <internal:core> core/io.rb:695:in `open'
        from wv.rb:1:in `<main>'

closed time in a month

carlhoerberg

create barnchoracle/graal

branch : bfish/GR-17457-update-macos-to-1013

created branch time in 2 months

issue closedoracle/truffleruby

Object.constants includes :fatal

Found by @fniephaus

And so Object.constants.collect { |x| Object.const_get x } fails with wrong constant name fatal.

We should filter out constants with a lowercase name for Module#constants.

Avoiding attaching fatal as a constant of Object doesn't seem a proper fix because I think it can be queried from C exts, and on CRuby (on TruffleRuby too) there are also namespaced lowercase constants:

$ ruby -rstringio -e 'p StringIO.ancestors'
[StringIO, IO::generic_writable, IO::generic_readable, Enumerable, Data, Object, Kernel, BasicObject]

@bjfish Could you fix it?

closed time in 2 months

eregon

issue commentoracle/truffleruby

Object.constants includes :fatal

This is fixed at: https://github.com/oracle/truffleruby/commit/336721f6b6c8084871287b1ae9e6da091e532ec9

eregon

comment created time in 2 months

issue closedoracle/truffleruby

File.utime strips nanoseconds from mtime

touch orig.rb touch dest.rb

require 'pathname'
require 'fileutils'

puts "orig mtime", Pathname("./orig.rb").mtime.inspect
st = File.stat("orig.rb")
dest = File.path("dest.rb")
File.utime st.atime, st.mtime, dest
puts "copied mtime", Pathname("./dest.rb").mtime.inspect

closed time in 2 months

gogainda

issue commentoracle/truffleruby

File.utime strips nanoseconds from mtime

This is now fixed at https://github.com/oracle/truffleruby/commit/605d5b84cf222e6592050c410f6e47895f07b1da.

gogainda

comment created time in 2 months

issue closedoracle/truffleruby

The result of defined?(code) should be frozen

defined? returns nil or a String, I consider only when it returns a String here. It seems on CRuby since a very long time/the start the returned String is frozen:

$ ruby -ve 'p defined?(String).frozen?'
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
true

On TruffleRuby it's not currently:

ruby -ve 'p defined?(String).frozen?'
truffleruby 21.3.0-dev-fd0f34e7, like ruby 2.7.3, GraalVM CE Native [x86_64-linux]
false

We should add specs for this and change the behavior (e.g., return a cached ImmutableRubyString from the CoreString, or maybe not use CoreString for defined? altogether and replace it with FrozenStrings, a new class with final ImmutableRubyString fields). That will then avoid allocations in the interpreter and potentially some allocations in the compiled code too.

@bjfish Could you take care of it?

closed time in 2 months

eregon

issue commentoracle/truffleruby

The result of defined?(code) should be frozen

This is fixed at https://github.com/oracle/truffleruby/commit/fdbe239a2f753eabfda89e8f389638066560d822

eregon

comment created time in 2 months

issue openedruby/psych

Implementation specific build_exception

The current build_exception relies on the Exception implementation containing a instance variable mesg: https://github.com/ruby/ruby/blob/c8661de0143c1d434dd9f68910ae304c59f8576b/ext/psych/psych_to_ruby.c#L9-L16

Should this use rb_exc_new_str() (which would also call initialize)?

cc: @eregon

created time in 2 months

more