This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Conductor | |
| include ActiveModel::Conversion | |
| extend ActiveModel::Naming | |
| include ActiveModel::Validations | |
| class_attribute :object_names | |
| def self.presents(*object_names) | |
| self.object_names = object_names | |
| object_names.each do |object_name| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Auto-correct files that get generated | |
| g.after_generate do |files| | |
| parsable_files = files.filter { |file| File.exist?(file) && file.end_with?(".rb") } | |
| unless parsable_files.empty? | |
| system("bundle", "exec", | |
| "rubocop", | |
| "--autocorrect-all", | |
| "--fail-level=E", | |
| "--format=quiet", | |
| *parsable_files, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| class_eval <<-EOS, __FILE__, __LINE__ | |
| def bar=(*args, &block) | |
| puts args.inspect | |
| end | |
| EOS | |
| end | |
| Foo.new.bar= 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| module Tesseract | |
| module Transaction | |
| module Steps | |
| # Executes the step in a background job. Argument is either an ActiveJob | |
| # or another Transaction (or anything that implements `#perform_later`. | |
| # | |
| # If the provided transaction implements a `validate` step, then that | |
| # validator will be called on the input before the job is enqueued. This |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module MyExt | |
| refine String do | |
| def foo | |
| "foo" | |
| end | |
| end | |
| end | |
| class Parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SettingsSchema = Dry::Schema.JSON do | |
| optional(:custom_object).hash do | |
| required(:active).filled(:bool) | |
| optional(:entity_name).maybe(:string) | |
| end | |
| end | |
| module Macros | |
| def self.included(validator) | |
| validator.register_macro(:custom_object_entity_name) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1.8.7 | |
| | Ruby Class | Hash Model | Datapathy #new | Datapathy #new_from_attributes | DM 0.10.2 | AR 3.0.pre | | |
| ------------------------------------------------------------------------------------------------------------------------------------------- | |
| #new (no attributes) x100000 | 0.562 | 0.348 | 0.534 | 0.669 | 0.478 | 10.931 | | |
| #new (3 attributes) x100000 | 0.362 | 0.383 | 1.596 | 0.539 | 16.030 | 28.158 | | |
| # 1.9.1 | |
| | Ruby Class | Hash Model | Datapathy #new | Datapathy #new_from_attributes | DM 0.10.2 | AR 3.0.pre | | |
| ------------------------------------------------------------------------------------------------------------------------------------------- | |
| #new (no attributes) x100000 | 0.281 | 0.216 | 0.231 | 0.302 | 0.294 | 10.477 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| module MigrationUtils | |
| module CreateEnum | |
| # :reek:TooManyStatements :reek:NestedIterators | |
| def create_enum(name, values) | |
| reversible do |dir| | |
| dir.up do | |
| say_with_time "create_enum(:#{name})" do | |
| suppress_messages do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/wiki_toc.yml | |
| name: Update wiki table of contents | |
| on: | |
| - gollum | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: 3m17s debug: #<Async::Reactor:0x1a302b8 (running)> [pid=20043] [2019-11-26 03:02:16 +0000] | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: | @ready = [] @running = [] | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: 3m17s debug: #<Async::Reactor:0x1a302b8 (running)> [pid=20043] [2019-11-26 03:02:16 +0000] | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: | Selecting with 1 children with interval = infinite... | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: 3m17s debug: #<Async::Reactor:0x1a301dc (running)> [pid=20044] [2019-11-26 03:02:16 +0000] | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: | @ready = [] @running = [] | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: 3m17s debug: #<Async::Reactor:0x1a301dc (running)> [pid=20044] [2019-11-26 03:02:16 +0000] | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: | Selecting with 1 children with interval = infinite... | |
| Nov 26 03:02:16 logsnarf-1 falcon[20041]: 3m18s debug: #<Async::Reactor:0x1a30100 (running)> [pid=20045] [2019-11-26 03:02:16 +0000] | |
| Nov 26 0 |
NewerOlder