Skip to content

Instantly share code, notes, and snippets.

View gabrielbentog's full-sized avatar
🎯
Focusing

Gabriel Bento gabrielbentog

🎯
Focusing
  • Instituto de Ensino Superior de Brasília
View GitHub Profile
@gabrielbentog
gabrielbentog / insomnia_collection.rb
Last active July 25, 2024 14:25
Generate a ruby on rails insomnia collection
routes_json = `rails routes > routes.txt`
routes = []
crud_methods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']
File.open("routes.txt").each do |line|
next if line.strip.empty? || line.start_with?('Prefix', 'Routes')
find_method = crud_methods.find { |method| line.include?(method) }
if find_method
parts = line.split
routes << {