code-snippets 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/code-snippets.rb +15 -2
  2. metadata +2 -2
data/lib/code-snippets.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- # file:code-snippets.rb
3
+ # file: code-snippets.rb
4
4
 
5
5
  require 'dynarex-usersblog'
6
6
  require 'nokogiri'
@@ -47,7 +47,20 @@ class CodeSnippets
47
47
  rss_cached(user+tag) { @blog.user(user).tag(tag).page(1) }
48
48
  end
49
49
 
50
- #private
50
+ def show(id)
51
+
52
+ doc = Document.new('<result><summary/><records/></result>')
53
+ entry = @blog.entry(id).dup
54
+ doc.root.elements['records'].add entry
55
+
56
+ (tags = " [%s]" % entry.text('tags').split(/\s/).join('] [')) if entry.text('tags')
57
+ doc.root.elements['summary'].add Element.new('title').add_text(entry.text('title').to_s + tags)
58
+ prepare_doc doc
59
+
60
+ render_html doc, @xsl_doc_single
61
+ end
62
+
63
+ private
51
64
 
52
65
  def html_page(n)
53
66
  @args = [n]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-snippets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-08-05 00:00:00 +01:00
12
+ date: 2010-08-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15