poj_org 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/poj_org/problem.rb +6 -1
- data/lib/poj_org/source.rb +5 -1
- metadata +2 -2
data/lib/poj_org/problem.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
class PojOrg::Problem
|
2
|
+
def self.url_for(id)
|
3
|
+
"http://poj.org/problem?id=#{id}"
|
4
|
+
end
|
5
|
+
|
2
6
|
attr_accessor :id, :title, :time_limit_in_ms, :memory_limit_in_kb
|
7
|
+
|
3
8
|
def initialize(new_id)
|
4
9
|
self.id = new_id
|
5
10
|
html = open(url).read
|
@@ -9,6 +14,6 @@ class PojOrg::Problem
|
|
9
14
|
end
|
10
15
|
|
11
16
|
def url
|
12
|
-
|
17
|
+
PojOrg::Problem.url_for id
|
13
18
|
end
|
14
19
|
end
|
data/lib/poj_org/source.rb
CHANGED
@@ -2,6 +2,10 @@ require 'open-uri'
|
|
2
2
|
require 'cgi'
|
3
3
|
|
4
4
|
class PojOrg::Source
|
5
|
+
def self.url_for(id)
|
6
|
+
"http://poj.org/showsource?solution_id=#{id}"
|
7
|
+
end
|
8
|
+
|
5
9
|
attr_accessor :id, :user, :time_in_ms, :memory_in_kb, :language, :source
|
6
10
|
|
7
11
|
def initialize(new_id)
|
@@ -18,6 +22,6 @@ class PojOrg::Source
|
|
18
22
|
end
|
19
23
|
|
20
24
|
def url
|
21
|
-
|
25
|
+
PojOrg::Source.url_for id
|
22
26
|
end
|
23
27
|
end
|
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.1.
|
4
|
+
version: 0.1.4
|
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: 2012-08-
|
12
|
+
date: 2012-08-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Fetch details of problem of source code from poj.org
|
15
15
|
email: pinepara@gmail.com
|