Skip to content

Commit

Permalink
making Nokogiri dep optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Nov 3, 2016
1 parent 1b4bf6e commit 959f94b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ooor/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the MIT license, see MIT-LICENSE file

require 'json'
require 'nokogiri'


module Ooor
autoload :InvalidSessionError, 'ooor/errors'
Expand Down Expand Up @@ -66,6 +66,10 @@ def login(db, username, password, kw={})
end

def csrf_token()
unless defined?(Nokogiri)
raise "You need to install the nokogiri gem for this feature"
end
require 'nokogiri'
@session.logger.debug "OOOR csrf_token"
conn = @session.get_client(:json, "#{@session.base_jsonrpc2_url}")
login_page = conn.get('/web/login') do |req|
Expand Down

0 comments on commit 959f94b

Please sign in to comment.