profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/palkan/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Vladimir Dementyev palkan @evilmartians Moscow, Russia https://twitter.com/palkan_tula Code & Cats & Rock'n'Roll!

evilmartians/lefthook 1747

Fast and powerful Git hooks manager for any type of projects.

ai/autoprefixer-rails 1197

Autoprefixer for Ruby and Ruby on Rails

evilmartians/terraforming-rails 567

Terraforming legacy Rails applications guides and tools

clowne-rb/clowne 268

A flexible gem for cloning models

DmitryTsepelev/graphql-ruby-fragment_cache 108

graphql-ruby plugin for caching parts of the response

anycable/anycable_demo 53

Anycable demo application

Arkweid/graphql-smart_select 50

Plugin for graphql-ruby which helps to select only the required fields from the database.

Casecommons/with_model 45

Dynamically build an Active Record model (with table) within a test context

anycable/anycable-client 20

AnyCable / Action Cable JavaScript client for web, Node.js & React Native

push eventpalkan/store_attribute

Vladimir Dementyev

commit sha 3d6f578197187278b6a84152cf4db655e2a2cbc6

chore: drop ruby 2.4, upgrade RuboCop

view details

push time in 3 hours

issue commentpalkan/store_attribute

Dirty tracking methods erroring out when used in callback proc

Thanks for the report! Fixed and will be released soon.

NgariNdungu

comment created time in 3 hours

issue closedpalkan/store_attribute

Dirty tracking methods erroring out when used in callback proc

<!-- This template is for bug reports. If you are reporting a bug, please continue on. If you are here for another reason, feel free to skip the rest of this template. -->

Tell us about your environment

Ruby Version: 3.0.0

Rails Version: 6.1.4.1

PostgreSQL Version: 13.2

Store Attribute Version: 0.9.0

What did you do?

I ran bundle update, which updated store_attribute to 0.9.0 from 0.8.1.

What did you expect to happen?

What actually happened?

After update, my test suite is failing on a model that uses store_attribute and uses dirty tracking methods in conditional callbacks;

  store_attribute :settings, :apis, :string  
  before_update :activate, if: -> { apis_changed? }

On binding and calling the method directly I get;

NoMethodError: undefined method `each' for nil:NilClass
from /home/deploy/.bundle/gems/store_attribute-0.9.0/lib/store_attribute/active_record/store.rb:74:in `block (3 levels) in store_accessor'

closed time in 3 hours

NgariNdungu

push eventpalkan/store_attribute

Vladimir Dementyev

commit sha 39a0859df5b929bd79002311998afcb0426b39a6

fix: handle nullable stores Fixes #19

view details

Vladimir Dementyev

commit sha 646aebb02f274cb599a8f3535eaeb1f1c792c632

chore: drop ruby 2.4, upgrade RuboCop

view details

push time in 3 hours

created tagruby-next/ruby-next

tagv0.13.0

Ruby Next makes modern Ruby code run in older versions and alternative implementations

created time in 3 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha c781833bc677f4c288ce9b08f628bf448021c7e9

Bump 0.13.0

view details

push time in 3 hours

push eventanycable/anycable-web

Vladimir Dementyev

commit sha 99e0540481d959e7aa52c7e8aea2936e828e582c

upd authentication intro

view details

push time in 4 hours

push eventanycable/anycable-web

Vladimir Dementyev

commit sha 766a1c4ff3552a855ff36366f0e0df7e12195cf6

upd intro

view details

push time in 4 hours

issue commenttest-prof/test-prof

StackProf integration: outputted flamegraph generator command broken

Thanks for suggestion! Updated.

prostko

comment created time in 4 hours

push eventtest-prof/test-prof

Vladimir Dementyev

commit sha 6bec4dc5641f000cbc194cb1c128ea4eeedf2f83

upd: suggest using d3-flamegraph for stack_prof Closes #222

view details

push time in 4 hours

issue closedtest-prof/test-prof

StackProf integration: outputted flamegraph generator command broken

<!-- This template is for bug reports. If you are reporting a bug, please continue on. If you are here for another reason, please, go to Discussions: https://github.com/test-prof/test-prof/discussions -->

Tell us about your environment

Ruby Version: 2.6.5

Framework Version (RSpec, Minitest, FactoryGirl, Rails, whatever): Rails 4.2.11.3

TestProf Version: 1.0.7

StackProf Version
stackprof (0.2.17)

What did you do?

Attempting to profile boot time -> TEST_STACK_PROF=boot be rspec spec/services/

which ran successfully, creating tmp/test_prof/stack-prof-report-wall-raw-boot.dump as expected. However, as you know, this is just data. The flamegraph isn't generated yet. Super helpfully (love this gem, y'all) you out put the command to go ahead and generate that viewable flamegraph. This is the bug, at least for me.

stackprof --flamegraph tmp/test_prof/stack-prof-report-wall-raw-total.dump > tmp/test_prof/stack-prof-report-wall-raw-total.html && stackprof --flamegraph-viewer=tmp/test_prof/stack-prof-report-wall-raw-total.html

What did you expect to happen?

I expected the generated file ...html to be viewable in the browser.

What actually happened?

When I run this command, it populates ...html with a ton of data, flamegraph({ <data> }) but that isn't viewable at all, not in chrome, brave, firefox or safari.

Suggestion

(Happy to submit a PR as well)

Quick look at StackProf docs, and trying the commands they give, some of which didn't work -- generating a flamegraph with the D3 flag worked like a charm, and everything came out nice just like the FactoryProfiler graphs.

stackprof --d3-flamegraph tmp/test_prof/stack-prof-report-wall-raw-total.dump > tmp/test_prof/stack-prof-report-wall-raw-total.html

Again, thanks y'all love your work. Really appreciate what you do.

closed time in 4 hours

prostko

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha 36fac87aa5eda27d1170d20f08cb48125eea7f3d

ci: run truffle tests independently This way we try to avoid OOM on CI

view details

push time in 4 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha f1b7b95b0d0cd21f8872e9a715a054c6d32ba200

ci: run truffle tests independently

view details

push time in 4 hours

push eventpalkan/anyway_config

Vladimir Dementyev

commit sha 4cb83c1143f81e1b420201f58f835b459da52cbd

ci: use bundler-cache from setup-ruby

view details

push time in 5 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha 363347cbeed29da5e2848ebfb252bc0041dd93db

ci: run truffle tests independently

view details

push time in 5 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha 74aba69ca1cdaab2fd88de385bdb2b2066aea8c6

ci: downgrade to jruby-9.2

view details

push time in 5 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha 238191b1d78887b5055dfaf789382ea69eeae8f7

ci: downgrade to jruby-9.2

view details

push time in 5 hours

issue openedjruby/jruby

Refinements vs. respond_to? regression in 9.3.0.0

Environment Information

  • JRuby version: jruby 9.3.0.0 (2.6.8) 2021-09-17 85c20e780f OpenJDK 64-Bit Server VM 25.302-b08 on 1.8.0_302-b08 +jit [linux-x86_64]

Expected Behavior

Here is an example code:

using(Module.new do
  refine Hash do
    def deconstruct_keys(_)
      self
    end
  end
end)

a = { a: 1, b: [2, 3] }

puts a.deconstruct_keys([:a])
puts a.respond_to?(:deconstruct_keys)

Expected output:

{:a=>1, :b=>[2, 3]}
true

Actual Behavior

Actual output:

{:a=>1, :b=>[2, 3]}
false

created time in 5 hours

push eventpalkan/anyway_config

Vladimir Dementyev

commit sha 3a36e0d7740e7ba98bf0680817b6d7de0bdc5f97

fix: remove right-hand assignment

view details

push time in 6 hours

issue commentpalkan/action_policy

Make RSpec describe_rule DRY

@dgarwood Thanks for reporting. Looks like this (already fixed) issue: https://github.com/rubocop/rubocop-rspec/issues/1126

I guess, we need to specify inherit_mode in our configuration. @pirj Hey, could you confirm please?

kaka-ruto

comment created time in 6 hours

push eventpalkan/anyway_config

Vladimir Dementyev

commit sha 74d37beaa284028b3dffa5f9c6c49d1c490972a6

fix: remove right-hand assignment

view details

push time in 6 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha 9830d146f935e3a288f7a23726361ce8a2685f1a

fix: use realpath when searching for a load index in setup_self Fixes #78

view details

push time in 6 hours

issue commentruby-next/ruby-next

`TypeError: no implicit conversion from nil to integer` when `$LOAD_PATH` contains symlinks

Thanks for reporting!

Pushed a fix.

sangster

comment created time in 7 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha 6ab08ed90d08cceb9c5ea1ac4ffe4f741da32b7b

fix: use realpath when searching for a load index in setup_self Fixes #78

view details

push time in 7 hours

issue closedruby-next/ruby-next

`TypeError: no implicit conversion from nil to integer` when `$LOAD_PATH` contains symlinks

What did you do?

Rake rake -T (or anything evokes bundler), when ruby-next's entry in $LOAD_PATH includes a symlink.

What did you expect to happen?

I expect the command to complete successfully without errors.

What actually happened?

TypeError: no implicit conversion from nil to integer @ lib/ruby-next/setup_self.rb#L17

Additional context

There are a couple places where ruby-next hunts for itself (or another gem) inside of $LOAD_PATH; however, the path it searches for is actually its realpath. If its entry in $LOAD_PATH includes a symlink, it will fail to find itself, resulting in an error.

Example

Say $LOAD_PATH == ["/srv/my-server/ruby/gems/2.6.0/gems/ruby-next-core-0.12.0/lib"], but /srv/my-server/ruby is a symlink to /var/lib/ruby.

Then the line lib_path = File.realpath(File.join(__dir__, "..")) (from setup_self.rb) will return /var/lib/ruby/gems/2.6.0/gems/ruby-next-core-0.12.0/lib. Then the next line ($LOAD_PATH.index(lib_path)) will return nil.

Potential solutions

I'm too inexperienced with this code to know what an ideal solution would be, but I would try:

  • Don't realise symlinks. Instead of File.realpath(File.join(__dir__, "..")), just do File.join(__dir__, "..").
  • When searching $LOAD_PATH, realise all its entries first. I have an example of this below.

Lame proof-of-concept patch

The very-naive patch below "fixes" this bug, but it's pretty lame. I would submit a pull-request, but I'm not familiar enough with this code not to make a mess of it. Hopefully this is enough to give you some ideas on a proper fix.

diff --git a/lib/ruby-next/language/setup.rb b/lib/ruby-next/language/setup.rb
index dc0f266..eee9667 100644
--- a/lib/ruby-next/language/setup.rb
+++ b/lib/ruby-next/language/setup.rb
@@ -49,7 +49,7 @@ module RubyNext
 
         GemTranspiler.maybe_transpile(File.dirname(dirname), lib_dir, next_dirname) if transpile
 
-        current_index = $LOAD_PATH.find_index do |load_path|
+        current_index = $LOAD_PATH.map { |p| File.realpath(p) rescue p }.find_index do |load_path|
           Pathname.new(load_path).cleanpath.to_s == dirname
         end
 
diff --git a/lib/ruby-next/setup_self.rb b/lib/ruby-next/setup_self.rb
index c745cbf..ce2a07d 100644
--- a/lib/ruby-next/setup_self.rb
+++ b/lib/ruby-next/setup_self.rb
@@ -6,7 +6,7 @@
 version = RubyNext.next_ruby_version
 next_dirname = File.join(__dir__, "..", ".rbnext")
 lib_path = File.realpath(File.join(__dir__, ".."))
-current_index = $LOAD_PATH.index(lib_path)
+current_index = $LOAD_PATH.map { |p| File.realpath(p) rescue p }.index(lib_path)
 
 loop do
   break unless version

Environment

Ruby version: 2.6.6

<!-- Make sure you have verified the problem with the latest patch versions of the libraries below -->

Ruby Next version: v0.12.0

Parser version: I'm not sure what this is.

Unparser version: My apologies, but I don't know what this refers to either.

closed time in 7 hours

sangster

push eventpalkan/anyway_config

Vladimir Dementyev

commit sha 8e1704629b3e4790dffe87e518d47fbfcbb891dc

feat: RBS support

view details

push time in 7 hours

push eventpalkan/anyway_config

Vladimir Dementyev

commit sha 49255331c5aab2222a6f91ea80fe95057f1710ea

feat: RBS support

view details

push time in 7 hours

push eventruby-next/ruby-next

Vladimir Dementyev

commit sha eefb9dde52dd9f21bdbaa2f69fb8ca73bfab4307

fix: make Unparser unknown node warning more generic

view details

push time in 7 hours

CommitCommentEvent

push eventpalkan/anyway_config

Vladimir Dementyev

commit sha 503321558b7d835d9cd8208c01bdb6bc22bbf072

feat: RBS support

view details

push time in 7 hours