wiki-yggdrasil 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cc1cce532c4bfc26091aed492571b4d9ee5e149144d77b5dae53c94e29ad5cc
4
- data.tar.gz: 5e2c2a615348df19eb218c49354cc155f9f80a9ea5617ba10dc74f7eccd492e9
3
+ metadata.gz: 00dbd9fd8629186246281bb70c2e34567e9ea204b683641ecf80c9cbed397255
4
+ data.tar.gz: 7b95633e1f77dee6f21e80b3fb00a49a2e49bd676ed839833514c561ffaaca07
5
5
  SHA512:
6
- metadata.gz: 5c62586eaabd45d830f865a9028d0711097306d52ffb309efbd5af283d96e7debd1f2bb2e688ed93d3dbbba0d02383541bb8095f799114ffbd7c30c43364ec99
7
- data.tar.gz: cc5b5e8582137e133c7a53e36ed7e32339bd7ea1afea4b80db483e9b8d03c09887f84bb73f643fcd9cead54c51b4a841eb7ba4a701b89738ec1101ca0d26f20d
6
+ metadata.gz: 9e48c1fbc87939aefc000e28cf3d5c31c2d11494f287155e0e74186435e0b2cec7f89e470074908b4caa5e170175eb9c55465c3854157f30a8799526e93c4321
7
+ data.tar.gz: ab38422b60f2f2e27c802d9b68c0f38355cefc50787965626db5f36a30c19f51482dfbb41a37fb03176a71bddf5998f8c871dad51d6d84e9cd9828dacbc693f0
data/README.md CHANGED
@@ -12,7 +12,30 @@ Wiki::Yggdrasil takes a Wikipedia URI as an argument, and proceeds to spider out
12
12
  require 'wiki/yggdrasil'
13
13
 
14
14
  @tree = Wiki::Yggdrasil::Yggdrasil.new(uri: 'http://en.wikipedia.org/wiki/Yggdrasil')
15
- referenced_articles = @tree.children(depth: 3) ## A hash of of articles linked by the parent
15
+ referenced_articles = @tree.children(depth: 1) ## A hash of of articles linked by the parent
16
+ ```
17
+ The preceeding code produces a structure as follows:
18
+ ```ruby
19
+ {:name=>"Help:IPA/English", :children=>[]}
20
+ {:name=>"Help:IPA/English", :children=>[]}
21
+ {:name=>"Old Norse", :children=>[]}
22
+ {:name=>"Help:IPA", :children=>[]}
23
+ {:name=>"Trees in mythology", :children=>[]}
24
+ {:name=>"Norse cosmology", :children=>[]}
25
+ {:name=>"<i>Poetic Edda</i>", :children=>[]}
26
+ {:name=>"<i>Prose Edda</i>", :children=>[]}
27
+ {:name=>"Snorri Sturluson", :children=>[]}
28
+ {:name=>"<i>Fraxinus excelsior</i>", :children=>[]}
29
+ {:name=>"Æsir", :children=>[]}
30
+ {:name=>"Thing (assembly)", :children=>[]}
31
+ {:name=>"Urðarbrunnr", :children=>[]}
32
+ {:name=>"Hvergelmir", :children=>[]}
33
+ {:name=>"Mímisbrunnr", :children=>[]}
34
+ {:name=>"Níðhöggr", :children=>[]}
35
+ {:name=>"Veðrfölnir and eagle", :children=>[]}
36
+ {:name=>"Dáinn, Dvalinn, Duneyrr and Duraþrór", :children=>[]}
37
+ {:name=>"Sacred trees and groves in Germanic paganism and mythology", :children=>[]}
38
+ {:name=>"Ragnarök", :children=>[]}
16
39
  ```
17
40
 
18
41
  ## FAQ
@@ -20,9 +43,6 @@ referenced_articles = @tree.children(depth: 3) ## A hash of of articles linked b
20
43
  ### This is taking a long time. Is that normal?
21
44
  Yes. This is normal. Any Yggdrasil object created with a depth of three or higher will likely take a few minutes to scrape the necessary information.
22
45
 
23
- ### Why didn't you just use Wikipedia's API?
24
- Wikipedia's API doesn't have an endpoint that allows you to programatically view the summary section of each article and its children. If it did that would obviously be the ideal choice.
25
-
26
46
  ## Installation
27
47
 
28
48
  Add this line to your application's Gemfile:
@@ -30,7 +30,7 @@ module Wiki
30
30
  end
31
31
  end
32
32
 
33
- @children ||= get_children.call(depth, article_children)
33
+ @children ||= { name: self.root.name, children: get_children.call(depth, article_children) }
34
34
  end
35
35
 
36
36
  end
@@ -1,5 +1,5 @@
1
1
  module Wiki
2
2
  module Yggdrasil
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wiki-yggdrasil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alex0112
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-03 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri