Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
Last active December 10, 2015 05:18
Show Gist options
  • Save satoshin2071/4386823 to your computer and use it in GitHub Desktop.
Save satoshin2071/4386823 to your computer and use it in GitHub Desktop.
[ruby][sinatra][pry]sintaraでpryを使うときのメモ
# encoding: utf-8
require 'rubygems'
require 'sinatra'
require './scraping.rb'
require 'pry'
get '/' do
'HerokuでSinatraを使ってHello world!'
links = Scraping.get_top_links
binding.pry
body links
end
ssato-no-Mac-mini% shotgun -O app.rb
== Shotgun/WEBrick on http://127.0.0.1:9393/
[2012-12-27 18:09:30] INFO WEBrick 1.3.1
[2012-12-27 18:09:30] INFO ruby 1.9.3 (2012-02-16) [x86_64-darwin10.8.0]
[2012-12-27 18:09:30] INFO WEBrick::HTTPServer#start: pid=12417 port=9393
ssato-no-Mac-mini% open http://127.0.0.1:9393/
From: /Users/ssato/ruby/test/app.rb @ line 11 self.GET /:
6: require 'pry'
7:
8: get '/' do
9: 'HerokuでSinatraを使ってHello world!'
10: links = Scraping.get_top_links
=> 11: binding.pry
12: body links
13: end
14:
15: get '/images/:page' do
16: images = Scraping.get_page_images(params[:page])
[1] pry(#<Sinatra::Application>)> links
=> ["1.html",
"2.html",
"3.html",
"4.html",
"5.html",
"6.html",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment