oeis 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/english-numbers.rb +7 -0
- data/examples/sum-of-digits.rb +14 -0
- data/lib/oeis.rb +3 -3
- data/lib/oeis/version.rb +1 -1
- metadata +13 -5
data/lib/oeis.rb
CHANGED
@@ -14,15 +14,15 @@ module OEIS
|
|
14
14
|
doc = Nokogiri::HTML(open(url))
|
15
15
|
|
16
16
|
first_result = doc.css('table table:eq(2)').first
|
17
|
-
info = first_result.css('tr:eq(3) table > tr
|
17
|
+
info = first_result.css('tr:eq(3) table > tr').first
|
18
18
|
|
19
19
|
if info.nil?
|
20
20
|
puts 'No sequence found.'
|
21
21
|
return nil
|
22
22
|
end
|
23
23
|
|
24
|
-
@id = info.
|
25
|
-
@title = info.
|
24
|
+
@id = info.css('td:eq(1) > a').text.strip
|
25
|
+
@title = info.css('td:eq(3)').text.strip
|
26
26
|
|
27
27
|
digits = first_result.css('tr:eq(4) table tr tt').text.split(', ')
|
28
28
|
@sequence = digits.map &:to_i
|
data/lib/oeis/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oeis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: '1.4'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.4'
|
25
30
|
description: Allows you to fetch results from OEIS using a list of integers
|
26
31
|
email:
|
27
32
|
- scalesjordan@gmail.com
|
@@ -33,6 +38,8 @@ files:
|
|
33
38
|
- Gemfile
|
34
39
|
- README.md
|
35
40
|
- Rakefile
|
41
|
+
- examples/english-numbers.rb
|
42
|
+
- examples/sum-of-digits.rb
|
36
43
|
- examples/thue-morse.rb
|
37
44
|
- lib/oeis.rb
|
38
45
|
- lib/oeis/version.rb
|
@@ -57,8 +64,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
64
|
version: '0'
|
58
65
|
requirements: []
|
59
66
|
rubyforge_project: oeis
|
60
|
-
rubygems_version: 1.8.
|
67
|
+
rubygems_version: 1.8.24
|
61
68
|
signing_key:
|
62
69
|
specification_version: 3
|
63
70
|
summary: On-Line Encyclopedia of Integer Sequences gem
|
64
71
|
test_files: []
|
72
|
+
has_rdoc:
|