atomutil 0.0.4 → 0.0.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.
data/History.txt CHANGED
@@ -1,3 +1,17 @@
1
+ == 0.0.6 2008-05-01
2
+
3
+ Removed dependency on REXML::Formatters::Pretty,
4
+ because REXML::Formatters::Pretty inserts linebreaks into each tags...
5
+ But this isn't best solution.
6
+
7
+ == 0.0.5 2008-04-30
8
+
9
+ * bugfix: Atom::Content didn't work as expected with multibyte UTF-8 string.
10
+ Atom::Element::to_s didn't work well on ruby 1.8.6 or above, because
11
+ REXML::Document::to_s is deprecated and has a bug on 1.8.6 or 1.9 patched release.
12
+ require 'sha1' -> require 'digest/sha1'
13
+
14
+ Thanks to walf443, Elton Okada.
1
15
 
2
16
  == 0.0.4 2008-02-12
3
17
 
@@ -13,6 +27,8 @@
13
27
  * bugfix: now this handle URL which has query correctly.
14
28
  approved error messages.
15
29
 
30
+ Thanks to cho45.
31
+
16
32
  == 0.0.2 2007-12-05
17
33
 
18
34
  * documentation improvement:
data/lib/atomutil.rb CHANGED
@@ -33,7 +33,7 @@
33
33
  # and is not stable yet.
34
34
  # We need more document, more tutorials, and more tests by RSpec.
35
35
  #++
36
- require 'sha1'
36
+ require 'digest/sha1'
37
37
  require 'uri'
38
38
  require 'open-uri'
39
39
  require 'pathname'
@@ -55,7 +55,7 @@ module AtomUtil
55
55
  module VERSION#:nodoc:
56
56
  MAJOR = 0
57
57
  MINOR = 0
58
- TINY = 4
58
+ TINY = 6
59
59
  STRING = [MAJOR, MINOR, TINY].join('.')
60
60
  end
61
61
  end
@@ -757,7 +757,14 @@ module Atom
757
757
  end
758
758
 
759
759
  def body=(value)
760
- if value =~ /^[[:print:]]*$/
760
+ if value =~ /^(?:
761
+ [[:print:]]
762
+ |[\xc0-\xdf][\x80-\xbf]
763
+ |[\xe0-\xef][\x80-\xbf]{2}
764
+ |[\xf0-\xf7][\x80-\xbf]{3}
765
+ |[\xf8-\xfb][\x80-\xbf]{4}
766
+ |[\xfc-\xfd][\x80-\xbf]{5}
767
+ )*$/xs
761
768
  copy = "<div xmlns=\"http://www.w3.org/1999/xhtml\">#{value}</div>"
762
769
  is_valid = true
763
770
  begin
@@ -1305,7 +1312,7 @@ module Atompub
1305
1312
  unless params.has_key?(:auth)
1306
1313
  throw ArgumentError.new("Atompub::Client needs :auth as argument for constructor.")
1307
1314
  end
1308
- @auth = params[:auth]
1315
+ @auth = params.has_key?(:auth) && params[:auth].kind_of?(Auth::Abstract) ? params[:auth] : Auth::Abstract.new
1309
1316
  @cache = params.has_key?(:cache) && params[:cache].kind_of?(AbstractCache) ? params[:cache] : AbstractCache.instance
1310
1317
  @service_info = params.has_key?(:info) && params[:info].kind_of?(ServiceInfoStorage) ? params[:info] : ServiceInfoStorage.instance
1311
1318
  @http_class = Net::HTTP
@@ -1600,7 +1607,7 @@ module Atompub
1600
1607
  @res = http.request(@req)
1601
1608
  case @res
1602
1609
  when Net::HTTPSuccess
1603
- warn "Bad Status Code: #{@res.code}" unless @res.class == Net::HTTPOK || @res.class == Net::HTTPNoContent
1610
+ warn "Bad Status Code: #{@res.code}" unless @res.class == Net::HTTPOK || @res.class = Net::HTTPNoContent
1604
1611
  unless @res.body.nil?
1605
1612
  @rc = Atom::MediaType::ENTRY.is_a?(@res['Content-Type']) ? Atom::Entry.new(:stream => @res.body) : @res.body
1606
1613
  @cache.put uri.to_s, {
@@ -1638,6 +1645,12 @@ module Atompub
1638
1645
  end
1639
1646
  # Authentication classes
1640
1647
  module Auth
1648
+ class Abstract
1649
+ def initialize(params)
1650
+ end
1651
+ def authorize(req)
1652
+ end
1653
+ end
1641
1654
  # = Atompub::Auth::Wsse
1642
1655
  #
1643
1656
  # Class handles WSSE authentication
@@ -1649,7 +1662,7 @@ module Atompub
1649
1662
  # auth = Atompub::Auth::Wsse.new :username => username, :password => password
1650
1663
  # client = Atompub::Client.new :auth => auth
1651
1664
  #
1652
- class Wsse
1665
+ class Wsse < Abstract
1653
1666
  # initializer
1654
1667
  #
1655
1668
  # Set two parameters as hash
@@ -1692,7 +1705,7 @@ module Atompub
1692
1705
  # auth = Atompub::Auth::Basic.new :username => username, :password => password
1693
1706
  # client = Atompub::Client.new :auth => auth
1694
1707
  #
1695
- class Basic
1708
+ class Basic < Abstract
1696
1709
  # initializer
1697
1710
  #
1698
1711
  # Set two parameters as hash
data/script/txt2html CHANGED
@@ -11,9 +11,9 @@ end
11
11
  require 'redcloth'
12
12
  require 'syntax/convertors/html'
13
13
  require 'erb'
14
- require File.dirname(__FILE__) + '/../lib/atomutil/version.rb'
14
+ require File.dirname(__FILE__) + '/../lib/atomutil.rb'
15
15
 
16
- version = Atomutil::VERSION::STRING
16
+ version = AtomUtil::VERSION::STRING
17
17
  download = 'http://rubyforge.org/projects/atomutil'
18
18
 
19
19
  class Fixnum
data/website/index.html CHANGED
@@ -0,0 +1,93 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ atomutil
9
+ </title>
10
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
+ <style>
12
+
13
+ </style>
14
+ <script type="text/javascript">
15
+ window.onload = function() {
16
+ settings = {
17
+ tl: { radius: 10 },
18
+ tr: { radius: 10 },
19
+ bl: { radius: 10 },
20
+ br: { radius: 10 },
21
+ antiAlias: true,
22
+ autoPad: true,
23
+ validTags: ["div"]
24
+ }
25
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
26
+ versionBox.applyCornersToAll();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="main">
32
+
33
+ <h1>atomutil</h1>
34
+ <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/atomutil"; return false'>
35
+ <p>Get Version</p>
36
+ <a href="http://rubyforge.org/projects/atomutil" class="numbers">0.0.6</a>
37
+ </div>
38
+ <h1>&#x2192; &#8216;atomutil&#8217;</h1>
39
+
40
+
41
+ <h2>What</h2>
42
+
43
+
44
+ <h2>Installing</h2>
45
+
46
+
47
+ <p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">atomutil</span></pre></p>
48
+
49
+
50
+ <h2>The basics</h2>
51
+
52
+
53
+ <h2>Demonstration of usage</h2>
54
+
55
+
56
+ <h2>Forum</h2>
57
+
58
+
59
+ <p><a href="http://groups.google.com/group/atomutil">http://groups.google.com/group/atomutil</a></p>
60
+
61
+
62
+ <p><span class="caps">TODO</span> &#8211; create Google Group &#8211; atomutil</p>
63
+
64
+
65
+ <h2>How to submit patches</h2>
66
+
67
+
68
+ <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
69
+
70
+
71
+ <p>The trunk repository is <code>svn://rubyforge.org/var/svn/atomutil/trunk</code> for anonymous access.</p>
72
+
73
+
74
+ <h2>License</h2>
75
+
76
+
77
+ <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
78
+
79
+
80
+ <h2>Contact</h2>
81
+
82
+
83
+ <p>Comments are welcome. Send an email to <a href="mailto:FIXME"><span class="caps">FIXME</span> full name</a> email via the <a href="http://groups.google.com/group/atomutil">forum</a></p>
84
+ <p class="coda">
85
+ <a href="FIXME email">FIXME full name</a>, 12th February 2008<br>
86
+ Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
87
+ </p>
88
+ </div>
89
+
90
+ <!-- insert site tracking codes here, like Google Urchin -->
91
+
92
+ </body>
93
+ </html>
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: atomutil
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.4
7
- date: 2008-02-12 00:00:00 +09:00
6
+ version: 0.0.6
7
+ date: 2008-05-12 00:00:00 +09:00
8
8
  summary: Utilities for AtomPub / Atom Syndication Format
9
9
  require_paths:
10
10
  - lib