Skip to content

Commit

Permalink
avoid autoload, for thread safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Navarrete and Jonas Nicklas committed Mar 15, 2013
1 parent 6429e5a commit 5fbd82e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lib/xpath.rb
@@ -1,12 +1,13 @@
require 'nokogiri'

require 'xpath/dsl'
require 'xpath/expression'
require 'xpath/literal'
require 'xpath/union'
require 'xpath/renderer'
require 'xpath/html'

module XPath
autoload :Expression, 'xpath/expression'
autoload :Literal, 'xpath/literal'
autoload :Union, 'xpath/union'
autoload :Renderer, 'xpath/renderer'
autoload :HTML, 'xpath/html'
autoload :DSL, 'xpath/dsl'

extend XPath::DSL::TopLevel
include XPath::DSL::TopLevel
Expand Down
2 changes: 1 addition & 1 deletion lib/xpath/html.rb
@@ -1,6 +1,6 @@
module XPath
module HTML
include XPath
include XPath::DSL::TopLevel
extend self

# Match an `a` link element.
Expand Down

0 comments on commit 5fbd82e

Please sign in to comment.