32 Matching Annotations
  1. May 2024
    1. # This is manual way to describe complex parameters parameter :one_level_array, type: :array, items: {type: :string, enum: ['string1', 'string2']}, default: ['string1'] parameter :two_level_array, type: :array, items: {type: :array, items: {type: :string}} let(:one_level_array) { ['string1', 'string2'] } let(:two_level_array) { [['123', '234'], ['111']] }
  2. Mar 2023
  3. Dec 2022
  4. Aug 2022
  5. Mar 2022
    1. Capybara can get us part of the way there. It allows us to work with an API rather than manipulating the HTML directly, but what it provides isn't an application specific API. It gives us low-level API methods like find, fill_in, and click_button, but it doesn't provide us with high-level methods to do things like "sign in to the app" or "click the Dashboard item in the navigation bar".
    1. # Optionally, you can write a description for the migration, which you can use for # documentation and changelogs. describe 'The _id suffix has been removed from the author property in the Articles API.'
    2. apply_to '/api/v1/articles/:id'
  6. Aug 2021
    1. When people talk about internal DSLs I see two styles: internal minilanguages and language enhancements.
    2. An internal DSL (often called an Embedded DSL) is a DomainSpecificLanguage that is written inside an existing host language. It's a common way of thinking in a number of programming language communities - particularly the Lisp community. It's now gaining a lot of attention as DSLs are a common way of thinking in the rapidly growing Ruby community.
  7. Mar 2021
  8. Feb 2021
    1. In combination with [Track()], the :magnetic_to option allows for a neat way to spawn custom tracks outside of the conventional Railway or FastTrack schema.

      Instead of magnetic_to:, I propose wrapping the steps that are on a separate track in something like...

        DefTrack do :paypal do
          step :charge_paypal
        end
      

      or

        paypal_track = RailwayTrack do :paypal do
          step :charge_paypal
        end
      

      so we can reference it from outputs, like we can with tracks created with Path helper.

    2. Output() in combination with Path() allow very simple modelling for alternive routes.
    3. In both filters, you’re able to rename and coerce variables. This gives you a bit more control than the simpler DSL.
    1. Operations define the flow of their logic using the DSL and implement the particular steps with pure Ruby.
  9. Dec 2020
  10. Nov 2020
    1. I'm thinking of creating something similar to a utility-first CSS framework like Tailwind, here's how it could look like:StyledText( style: [selfAlignRight, padding(8), fontSize(20), fontBold], text: 'hello' )
  11. Oct 2020
  12. Apr 2020
    1. no need to learn a new framework it's just Ruby's syntax + new methods and actually that's one of the reasons Google invented a simple and stupid language called Golang instead of a magical one to prevent developers from doing magic and just shipping features instead of playing with DSLs.
  13. Jun 2018
  14. Jul 2017
  15. Jun 2017
    1. internal dsl in java 8 in three ways:

      1. by Method Chaining
      2. by Nested Functions
      3. by Lambda Expression