Skip to content

Instantly share code, notes, and snippets.

@ashaninBenjamin
Last active February 18, 2021 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashaninBenjamin/c36737da26c354c9540e0329008dc19b to your computer and use it in GitHub Desktop.
Save ashaninBenjamin/c36737da26c354c9540e0329008dc19b to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __FILE__)
require File.expand_path('../config/environment', __FILE__)
require_relative 'config/boot'
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
module Mod
module_function
def method1
'method1'
end
def method2
'method2'
end
end
method = ARGV[0]
raise ArgumentError, 'mo method passed' unless method
puts "#{method}..."
puts Mod.send(method)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment