poj_org 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/poj_org/code.rb +2 -2
- metadata +3 -3
data/lib/poj_org/code.rb
CHANGED
@@ -17,8 +17,8 @@ module PojOrg
|
|
17
17
|
"http://poj.org/showsource?solution_id=#{id}"
|
18
18
|
end
|
19
19
|
|
20
|
-
def fetch_content(
|
21
|
-
|
20
|
+
def fetch_content(password)
|
21
|
+
PojOrg::User.new(username, password).login do |cookie|
|
22
22
|
html = Nokogiri::HTML(open(url, 'Cookie' => cookie))
|
23
23
|
if html.xpath('/html/head/title').text == 'Error'
|
24
24
|
raise PojOrg::Errors::CodeNotFound if html.xpath('/html/body/ul/li').text.include?('No such solution')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poj_org
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
60
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.8.
|
61
|
+
rubygems_version: 1.8.25
|
62
62
|
signing_key:
|
63
63
|
specification_version: 3
|
64
64
|
summary: API for poj.org
|