- 浏览: 113884 次
- 性别:
- 来自: 南京
-
最新评论
文章列表
(rdb:1) disp $!.inspect
13: $!.inspect = #<NoMethodError: undefined method `merge!' for nil:NilClass>
$!.backtrace
$0 文件名
wsdl2ruby << Logger::Application
log(FATAL, "Detected an exception. Stopping ... #{$!} (#{$!.class})\n" << $@.join("\n"))
active_support
- 博客分类:
- gems
136, 145] in /home/wenbo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/core_ext/string/inflections.rb
136 #
137 # Singular names are not handled correctly.
138 #
139 # "business".classify # => "Busines"
140 def classify
= ...
Sinatra::Base#helpers
- 博客分类:
- sinatra
1185 public
1186 # Makes the methods defined in the block and in the Modules given
1187 # in `extensions` available to the handlers and templates
1188 def helpers(*extensions, &block)
=> 1189 class_eval(&block) if block_given?
1190 ...
Sinatra::Base#get
- 博客分类:
- sinatra
1107 # Defining a `GET` handler also automatically defines
1108 # a `HEAD` handler.
1109 def get(path, opts={}, &block)
1110 conditions = @conditions.dup
1111 route('GET', path, opts, &block)
1112
1113 @conditions = conditions
1114 route(' ...
Rakc::Test::Methods#get
- 博客分类:
- rack
(Rack::Test::Methods)#get
48 # Issue a GET request for the given URI with the given params and Rack
49 # environment. Stores the issues request object in #last_request and
50 # the app's response in #last_response. Yield #last_response to a block
51 # if given.
52 ...
1140 def compile!(verb, path, block, options = {})
1141 options.each_pair { |option, args| send(option, *args) }
1142 method_name = "#{verb} #{path}"
1143
1144 define_method(method_name, &block)
1145 unbound_method = instance_method method ...
nokogiri
- 博客分类:
- ruby in rails
227 class Builder
228 # The current Document object being built
229 attr_accessor :doc
230
231 # The parent of the current node being built
232 attr_accessor :parent
233
234 # A context object for use when the block has no arguments
235 attr_accessor :context ...
The rspec command is installed when you install the rspec-core gem; it
provides a number of options that let you customize how RSpec works.
You can print a list of these options by asking for help
sinatra snippets
- 博客分类:
- sinatra
1214 # Use the specified Rack middleware
1215 def use(middleware, *args, &block)
1216 @prototype = nil
=> 1217 @middleware << [middleware, args, block]
1218 end
1219
1220 def quit!(server, handler_name)
1221 # ...
# If the current request matches pattern and conditions, fill params
# with keys and call the given block.
# Revert params afterwards.
#
# Returns pass block.
def process_route(pattern, keys, conditions)
@original_params ||= @params
route = @request.route
...
page.class = Capybara::Session
(rdb:1) disp __FILE__
1: __FILE__ = /home/wenbo/.rvm/gems/ruby-1.9.2-p290@/gems/capybara-1.0.1/lib/capybara/dsl.rb
(rdb:1) disp __LINE__
2: __LINE__ = 139
(rdb:1) disp method
3: method =
(rdb:1) disp Session::DSL_METHODS
4: Session::DSL_METHODS = [:all, :first, :att ...
Error Tips
- 博客分类:
- error
uninitialized constant Syck::Syck
gem update --system
# Not currently on any branch.
(no branch)means you end up in a DETACHED HEAD mode
It can happen either by explicitly detaching HEAD using "git checkout
<commit>", or if you used rebase and it is still in progress.
So make sure:
...
couchdb tips
- 博客分类:
- couch db
sudo apt-get install couchdb
couchdb$ curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"1.0.1"}
path => "/hi/:ba"
block, pattern, keys, conditions = compile! verb, path, block, options
pattern => /^\/hi\/([^\/?#]+)$/
22: self = Sinatra::Application
(rdb:1) disp self.routes
23: self.routes = {"GET"=>[[/^\/$/, [], [], #<Proc:0x90f5484@/home/wenbo/.rvm/gems/ruby-1 ...
ubuntu tips
- 博客分类:
- linux
E: Encountered a section with no Package: header
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
readelf -h chello
ldd chello
strip -s chello