`

console for sinatra

阅读更多
git://github.com/sickill/racksh.git

也是用来做同样的事。

只是可以模拟http请求

# make GET request
$rack.get uri, params, env

# make POST request
$rack.post uri, params, env

# make PUT request
$rack.put uri, params, env

# make DELETE request
$rack.delete uri, params, env


写sinatra的时候想找类似 rails console
就用


$ irb -r ./my_sinatra_app.rb 


还可以配合pry使用

 gem install pry; pry -r my_sinatra_app.rb



怎么用debugger 后续 Pry可以

CREATE TABLE animals (
     id MEDIUMINT NOT NULL AUTO_INCREMENT,
     name CHAR(30) NOT NULL,
     PRIMARY KEY (id)
) ENGINE=MyISAM;

INSERT INTO animals (name) VALUES
    ('dog'),('cat'),('penguin'),
    ('lax'),('whale'),('ostrich');

SELECT * FROM animals;
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics