Properly hijack require, i.e., properly define require hooks and customizations
Node require hooks
Quickly attach multiple ESM Loaders and/or --require hooks together
Some libraries to setup require hooks
Properly hijack require, i.e., properly define require hooks and customizations
Just a little module for plugins.
Utility function to load nyc configuration
A dictionary of file extensions and associated module loaders.
ESLint rules for React Hooks
Task and Message Queues with Multiple Providers
Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.
Async middleware for JavaScript and TypeScript
Next-generation take on pre/post function hooks
A draggable and resizable grid layout with responsive breakpoints, for React.
List of Git hooks
Hooks for require, vm and script used in istanbul
Event Emitting and Middleware Hooks
Core Inquirer prompt API
pre/post hooks for leveldb
Simple and complete React hooks testing utilities that encourage good testing practices.
A lightweight React utility library by inspectph
A collection of 50+ hooks for state and UI management
programmatic API for managing npm registry hooks
Set of CodeceptJS config hooks to simplify configuration
Require Hooks provide infrastructure for intercepting require/load calls in Ruby
Extend ActiveSupport to run blocks before or after a file is "require_or_load"ed into memory.
Git Post-Receive hook for Flowdock. Gem requirements patched for use with Gitlab.
Hooks into require to allow directly requiring gobject libraries via GIR files and gir_ffi.
Provides DHCP management for Foreman via the ISC Kea API, requiring the host_cmds and lease_cmds hooks.
Adds `before_extended`, `before_included`, and `before_prepended` methods hooks which would be called before the standard `extended`, `included`, and `prepended` Ruby hooks, respectively. Especially useful when you require to "do" something just before the module gets `extended` or `included` to a module/class. In particular, in my specific case, I needed to "do" something if a specific method already exists in the `base` class.
This gem is pack of methods to convert or validate different formats of strings and texts in model, like telephone numbers (CZ/SK format), email, or (european) names (currently). Or to clean string of too much whitespaces. It provides *convert* methods for attributes of model (getter and setter method in object is enough). They are used in save hooks. There are also *validator* methods for ActiveModel nd hook for automatic ActiveRecord integration. Just type: (`require 'paranoid_starlight/active_record'`) Specs included.
This gem gives you convenient hooks around calls to `load`, `require`, and `require_relative`, which can be used to define configuration or setup code that will eventually be run when the library is actually loaded. This helps prevent loading unnecessary gems and configuration code in contexts where they are not needed.
Hookie provides a way to write git hooks with ruby without too much worrying about any of the plumbing required, you can easily write your own plugins and focus on the core of your functionality. Hookie includes plugins for Jenkins, FishEye, and HipChat.
CsvWizard provides a simple framework to import CSV files into Rails models. It supports required fields, default values, row-level validation, and hooks for pre- and post-processing.
EasyOp wraps business logic in typed, composable operations. It keeps the Interactor mental model (shared ctx, fail!, hooks) while adding rescue_from, pluggable type adapters, and chainable result callbacks — all without requiring ActiveSupport.
========================================================= FreeSWITCHeR Copyright (c) 2009 The Rubyists (Jayson Vaughn, Tj Vanderpoel, Michael Fellinger, Kevin Berry) Distributed under the terms of the MIT License. ========================================================== ABOUT ----- A ruby library for interacting with the "FreeSWITCH" (http://www.freeswitch.org) opensource telephony platform REQUIREMENTS ------------ * ruby (>= 1.8) * eventmachine (If you wish to use Outbound and Inbound listener) USAGE ----- An Outbound Event Listener Example that reads and returns DTMF input: -------------------------------------------------------------------- Simply just create a subclass of FSR::Listner::Outbound and all new calls/sessions will invoke the "session_initiated" callback method. <b>NOTE</b>: FSR uses blocks within the 'session_inititated' method to ensure that the next "freeswich command" is not executed until the previous "Freeswitch command" has finished. This is kicked off by "answer do" #!/usr/bin/ruby require 'fsr' require 'fsr/listener/outbound' class OutboundDemo < FSR::Listener::Outbound def session_initiated exten = @session.headers[:caller_caller_id_number] FSR::Log.info "*** Answering incoming call from #{exten}" answer do FSR::Log.info "***Reading DTMF from #{exten}" read("/home/freeswitch/freeswitch/sounds/music/8000/sweet.wav", 4, 10, "input", 7000) do |read_var| FSR::Log.info "***Success, grabbed #{read_var.strip} from #{exten}" # Tell the caller what they entered speak("Got the DTMF of: #{read_var}") do #Hangup the call hangup end end end end end FSR.start_oes! OutboundDemo, :port => 8084, :host => "127.0.0.1" An Inbound Event Socket Listener example using FreeSWITCHeR's hook system: -------------------------------------------------------------------------- #!/usr/bin/ruby require 'pp' require 'fsr' require "fsr/listener/inbound" # EXAMPLE 1 # This adds a hook on CHANNEL_CREATE events. You can also create a method to handle the event you're after. See the next example FSL::Inbound.add_event_hook(:CHANNEL_CREATE) {|event| FSR::Log.info "*** [#{event.content[:unique_id]}] Channel created - greetings from the hook!" } # EXAMPLE 2 # Define a method to handle CHANNEL_HANGUP events. def custom_channel_hangup_handler(event) FSR::Log.info "*** [#{event.content[:unique_id]}] Channel hangup. The event:" pp event end # This adds a hook for EXAMPLE 2 FSL::Inbound.add_event_hook(:CHANNEL_HANGUP) {|event| custom_channel_hangup_handler(event) } # Start FSR Inbound Listener FSR.start_ies!(FSL::Inbound, :host => "localhost", :port => 8021) An Inbound Event Socket Listener example using the on_event callback method instead of hooks: --------------------------------------------------------------------------------------------- #!/usr/bin/ruby require 'pp' require 'fsr' require "fsr/listener/inbound" class IesDemo < FSR::Listener::Inbound def on_event(event) pp event.headers pp event.content[:event_name] end end FSR.start_ies!(IesDemo, :host => "localhost", :port => 8021, :auth => "ClueCon") An example of using FSR::CommandSocket to originate a new call in irb: ---------------------------------------------------------------------- irb(main):001:0> require 'fsr' => true irb(main):002:0> FSR.load_all_commands => [:sofia, :originate] irb(main):003:0> sock = FSR::CommandSocket.new => #<FSR::CommandSocket:0xb7a89104 @server="127.0.0.1", @socket=#<TCPSocket:0xb7a8908c>, @port="8021", @auth="ClueCon"> irb(main):007:0> sock.originate(:target => 'sofia/gateway/carlos/8179395222', :endpoint => FSR::App::Bridge.new("user/bougyman")).run => {"Job-UUID"=>"732075a4-7dd5-4258-b124-6284a82a5ae7", "body"=>"", "Content-Type"=>"command/reply", "Reply-Text"=>"+OK Job-UUID: 732075a4-7dd5-4258-b124-6284a82a5ae7"} SUPPORT ------- Home page at http://code.rubyists.com/projects/fs #rubyists on FreeNode