Skip to content

Directly require StackOverflow snippets from your Ruby code

License

Notifications You must be signed in to change notification settings

steinuil/require_so

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

require_so

Copying code from StackOverflow? In my DRY codebase? Not if I can help it!

Code snippet from a StackOverflow answer

$ cat dry.rb
require "require_so"
require_so "https://stackoverflow.com/a/61879644"

puts fast_next_smaller(907)
$ ruby dry.rb
790

Usage

  1. Require require_so
require "require_so"
  1. Copy the share link below your StackOverflow answer

Share button location

  1. Paste it into your code
require_so "https://stackoverflow.com/a/61877826"

You can also specify the index of the snippet you want to require

require_so "https://stackoverflow.com/a/61877826", 1 # will require the 2nd code snippet in the post
  1. Achieve DRYness

About

Directly require StackOverflow snippets from your Ruby code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages