bibsonomy 0.4.7 → 0.4.8
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 +4 -4
- data/lib/bibsonomy/csl.rb +6 -3
- data/lib/bibsonomy/version.rb +1 -1
- data/test/csl_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2dc63bd9e3b259ddf0c5808f4f7c2aaf70a86ae0
|
|
4
|
+
data.tar.gz: 68b95dc7e2123f176cf04ee8df9bd959fa3d99e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9946d9fb4ab157a8d5b2509b86cbb67ad46cc5458793a08878368b41d46c24f37b499a15fdc7d00853938e194431f348dce9527d39c152c3e3a42428f83dc9a5
|
|
7
|
+
data.tar.gz: 1d9e13932a6e3e4d85f91a95b58d9487f89a824760f78888593a925e5c93881190c47e944bca32e60b0ffb155751e5d4de735af784039f5139d61f48129d764f
|
data/lib/bibsonomy/csl.rb
CHANGED
|
@@ -21,6 +21,8 @@ require 'bibsonomy'
|
|
|
21
21
|
# - group
|
|
22
22
|
#
|
|
23
23
|
# Changes:
|
|
24
|
+
# 2017-05-31
|
|
25
|
+
# - added support to get posts of a group
|
|
24
26
|
# 2017-01-19
|
|
25
27
|
# - added optional parameter group to control which posts are
|
|
26
28
|
# included based on their viewability for a specific group (not yet activated!)
|
|
@@ -103,13 +105,14 @@ module BibSonomy
|
|
|
103
105
|
#
|
|
104
106
|
# Download `count` posts for the given `user` and `tag(s)` and render them with {http://citationstyles.org/ CSL}.
|
|
105
107
|
#
|
|
106
|
-
# @param
|
|
108
|
+
# @param grouping [String] the type of the name (either "user" or "group")
|
|
109
|
+
# @param name [String] the name of the group or user
|
|
107
110
|
# @param tags [Array<String>] the tags that all posts must contain (can be empty)
|
|
108
111
|
# @param count [Integer] number of posts to download
|
|
109
112
|
# @return [String] the rendered posts as HTML
|
|
110
|
-
def render(
|
|
113
|
+
def render(grouping, name, tags, count)
|
|
111
114
|
# get posts from BibSonomy
|
|
112
|
-
posts = JSON.parse(@bibsonomy.
|
|
115
|
+
posts = JSON.parse(@bibsonomy.get_posts(grouping, name, 'publication', tags, 0, count))
|
|
113
116
|
|
|
114
117
|
# render them with citeproc
|
|
115
118
|
cp = CiteProc::Processor.new style: @style, format: 'html'
|
data/lib/bibsonomy/version.rb
CHANGED
data/test/csl_test.rb
CHANGED
|
@@ -12,7 +12,7 @@ class BibSonomyCSLTest < Minitest::Test
|
|
|
12
12
|
|
|
13
13
|
def test_render
|
|
14
14
|
VCR.use_cassette('render') do
|
|
15
|
-
html = @csl.render("bibsonomy-ruby", [], 10)
|
|
15
|
+
html = @csl.render("user", "bibsonomy-ruby", [], 10)
|
|
16
16
|
|
|
17
17
|
assert_equal "<h3>2010</h3>", html[0..12]
|
|
18
18
|
assert_equal "</ul>", html[-6..-2]
|