tagcloudbase 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 139a16732431a06a456356d2eecad14e19b712fd
4
- data.tar.gz: 1be31195de0f092c0a6c5ab12a3c055a889f77d7
3
+ metadata.gz: 3108af6cf560a336bad9a1d46691a16081ceed3c
4
+ data.tar.gz: a7bde54f8d98ea3020fd9bbd258df5b574ec89ae
5
5
  SHA512:
6
- metadata.gz: 8471d5c30cd74e5c0ce834e4019d1922dd78b8cee9bdb53b4a5d3556f9949e1e47358931759f1e0ee273842e393177176c3dfe261baaaccd87b6edbec08e7907
7
- data.tar.gz: d44fe5767e266c404590a82d14a3a27df1c9d5e73cca1bfc142c1013cb3201606d4b9efbcc74b306d1308770eb73bd4b8a5e7cea63a66bed80cf5aea05e3d498
6
+ metadata.gz: d16ec07befd3e517599956eb5bd9a441c758d11dd571f1f2fa824d5010d129c493ddebffd3b2518ac8ae2a762f972c32ffdf57da60f0de9df8b2f699110686f1
7
+ data.tar.gz: 100906838afe285f9d88060ee33a5bb3f5373dfd94845eec52052f3650a2139badd67608c0e055d9d8c89e422a032a8655adb24cafb52fa5ace3f7e5a769c75b
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/tagcloudbase.rb CHANGED
@@ -11,12 +11,14 @@ class TagCloudBase
11
11
  attr_accessor :xsl
12
12
 
13
13
  def initialize(all_tags={})
14
+
14
15
  tags = all_tags.sort_by {|x| -x[-1][-1].to_i}
15
16
  biggest_tag = tags.first[-1][-1].to_i
16
17
  # sort in alphabetical order
17
18
  abc_tags = tags.sort_by &:first
18
19
 
19
20
  @to_dynarex = Dynarex.new('tags/tag(word,href,gauge,count)')
21
+
20
22
  abc_tags.each do |word, v|
21
23
  href, word_size = v
22
24
  weight = 100 / (biggest_tag / word_size.to_i)
@@ -24,15 +26,19 @@ class TagCloudBase
24
26
  gauge = 8 if gauge > 8
25
27
  @to_dynarex.create word: word, href: href, gauge: gauge.to_s, count: word_size
26
28
  end
29
+
27
30
  end
28
31
 
29
32
  def to_webpage()
30
33
 
31
34
  lib = File.dirname(__FILE__)
32
- xsl = open(lib + '/tagcloud.xsl').read
33
- css = open(lib + '/tagcloud.css').read
34
-
35
- html = Rexslt.new(@xsl || xsl, @to_dynarex.to_xml).to_s
35
+ xsl = File.read lib + '/tagcloud.xsl'
36
+ css = File.read lib + '/tagcloud.css'
37
+
38
+ doc = Nokogiri::XML(@to_dynarex.to_xml)
39
+ xslt = Nokogiri::XSLT(@xsl || xsl)
40
+ html = xslt.transform(Nokogiri::XML(@to_dynarex.to_xml))
41
+
36
42
  return {html: html, css: css}
37
43
  end
38
44
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tagcloudbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file