[#8136] Confused exception handling in Continuation Context — "Robert Dober" <robert.dober@...>

Hi all

13 messages 2006/07/06

[#8248] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>

I just posted this to ruby-talk. But I would also like to discuss this

33 messages 2006/07/18
[#8264] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

From my experience using both tool chains on Windows (for the ruby-prof

[#8266] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/19

Tim, I'm going to top reply since your post was so long. I'm interested in

[#8267] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

> Tim, I'm going to top reply since your post was so long. I'm interested in

[#8271] my sandboxing extension!! — why the lucky stiff <ruby-core@...>

I have (what feels like) very exciting news. I finally sat down to code up my

17 messages 2006/07/19

[#8430] Re: doc patch: weakref. — "Berger, Daniel" <Daniel.Berger@...>

> -----Original Message-----

19 messages 2006/07/28
[#8434] Re: doc patch: weakref. — Yukihiro Matsumoto <matz@...> 2006/07/29

Hi,

[#8436] Re: doc patch: weakref. — Daniel Berger <djberg96@...> 2006/07/29

Yukihiro Matsumoto wrote:

[#8437] Re: doc patch: weakref. — Mauricio Fernandez <mfp@...> 2006/07/29

On Sat, Jul 29, 2006 at 07:37:24PM +0900, Daniel Berger wrote:

[#8441] Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...>

I have the following code:

18 messages 2006/07/30
[#8442] Re: Inconsistency in scoping during module_eval? — nobu@... 2006/07/30

Hi,

[#8443] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/30

Why does this:

[#8445] Re: Inconsistency in scoping during module_eval? — Yukihiro Matsumoto <matz@...> 2006/07/30

Hi,

[#8454] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/31

So to clarify...

Another look at RSS...

From: Hugh Sasse <hgs@...>
Date: 2006-07-18 17:04:43 UTC
List: ruby-core #8252
I've had another look at lib/rss and the patch below is mostly doc
changes, but I have also changed the method to_class_name.  My testing
with underscored names shows that it behaves the same, so hopefully 
I have not broken anything.  I think the code is clearer.  

This is against:
brains hgs 82 %> ls -ld stable-snapshot.tar.gz
-rw-r--r--   1 hgs      staff    4467357 Jul 18 17:08 stable-snapshot.tar.gz
brains hgs 83 %> md5sum !$
md5sum stable-snapshot.tar.gz
a3bce2a5618af323c07ed68431ea1ef2  stable-snapshot.tar.gz
brains hgs 84 %>

        HTH
        Hugh

--- ./lib/rss/utils.rb.orig	2006-06-18 14:42:43.000000000 +0100
+++ ./lib/rss/utils.rb	2006-07-18 17:32:24.047018000 +0100
@@ -1,10 +1,10 @@
 module RSS
   module Utils
     module_function
+
+    # Convert a name_with_underscores to CamelCase.
     def to_class_name(name)
-      name.split(/_/).collect do |part|
-        "#{part[0, 1].upcase}#{part[1..-1]}"
-      end.join("")
+      name.split(/_/).collect{|part| part.capitalize}.join("")
     end
     
     def get_file_and_line_from_caller(i=0)
@@ -12,11 +12,14 @@
       [file, line.to_i]
     end
 
+    # escape '&', '"', '<' and '>' for use in HTML.
     def html_escape(s)
       s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
     end
     alias h html_escape
     
+    # If +value+ is an instance of class +klass+, return it, else
+    # create a new instance of +klass+ with value +value+.
     def new_with_value_if_need(klass, value)
       if value.is_a?(klass)
         value
--- ./lib/rss/parser.rb.orig	2006-07-13 12:35:17.000000000 +0100
+++ ./lib/rss/parser.rb	2006-07-18 17:50:33.094732000 +0100
@@ -7,6 +7,11 @@
 
   class NotWellFormedError < Error
     attr_reader :line, :element
+
+    # Create a new NotWellFormedError for an error at +line+
+    # in +element+.  If a block is given the return value of
+    # the block ends up in the error message.
+    #
     def initialize(line=nil, element=nil)
       message = "This is not well formed XML"
       if element or line
@@ -85,13 +90,17 @@
     end
 
     private
+
+    # Try to get the XML associated with +rss+.
+    # Return +rss+ if it already looks like XML, or treat it as a URI,
+    # or a file to get the XML,
     def normalize_rss(rss)
       return rss if maybe_xml?(rss)
 
       uri = to_uri(rss)
       
       if uri.respond_to?(:read)
-        uri.read
+        uri.read        # FIXME? - do we care if the URI is tainted?
       elsif !rss.tainted? and File.readable?(rss)
         File.open(rss) {|f| f.read}
       else

In This Thread

Prev Next