Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add support for xml processing instructions in atom_feed_helper

#926

Add the ability to put XML processing instructions at the top of XML generated by atom feed helper.

Reported by Deleted User · August 28th, 2008 @ 05:36 PM

State: resolved
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • Title changed from add support for xml processing instructions in atom_feed_helper to Add support for xml processing instructions in atom_feed_helper
    • Tag changed from patch to actionpack, enhancement, patch, tests

    I think it should be use hash format :

    
    :instruct => { :target => {attribute => value} }
    

    August 30th, 2008 @ 04:41 PM

  2. Deleted User
    Deleted User

    I've never done this, but there might be a case where you would want two processing instructions with the same target.

    August 31st, 2008 @ 04:19 AM

  3. DHH
    DHH
    • State changed from new to incomplete

    In that case, the array should be at the target level, not the instruct level. target => [{attribute => value}, {attribute => value}]. Both forms should be taken, though. Since the normal way is not to have two targets.

    September 10th, 2008 @ 05:48 AM

  4. Deleted User
    Deleted User

    New patch that takes :instruct argument as

    {target => {attribute => value}}

    or

    {target => [{attribute => value}, {attribute => value}]}

    September 10th, 2008 @ 07:45 AM

  5. Deleted User
  6. Pratik
    Pratik
    • State changed from incomplete to open
    • Assigned user set to Pratik

    September 27th, 2008 @ 08:45 PM

  7. Pratik
    Pratik
    • State changed from open to incomplete

    Looks nice. But I'm getting one test failure :

    
      1) Failure:
    test_feed_xml_processing_instructions_duplicate_targets(AtomFeedTest)
        [template/atom_feed_helper_test.rb:244:in `test_feed_xml_processing_instructions_duplicate_targets'
         template/atom_feed_helper_test.rb:254:in `with_restful_routing'
         ./../lib/action_controller/test_process.rb:508:in `with_routing'
         template/atom_feed_helper_test.rb:250:in `with_restful_routing'
         template/atom_feed_helper_test.rb:241:in `test_feed_xml_processing_instructions_duplicate_targets'
         ./../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__'
         ./../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run']:
    <"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?target1 a=\"1\" b=\"2\"?>\n<?target1 d=\"4\" c=\"3\"?>\n<feed xml:lang=\"en-US\" xmlns=\"http://www.w3.org/2005/Atom\">\n  <id>tag:www.nextangle.com,2008:/scrolls?id=feed_with_xml_processing_instructions_duplicate_targets</id>\n  <link type=\"text/html\" rel=\"alternate\" href=\"http://www.nextangle.com\"/>\n  <link type=\"application/atom+xml\" rel=\"self\" href=\"http://www.nextangle.com/scrolls?id=feed_with_xml_processing_instructions_duplicate_targets\"/>\n  <title>My great blog!</title>\n  <updated>2007-12-12T15:00:00Z</updated>\n  <entry>\n    <id>tag:www.nextangle.com,2008:Scroll/1</id>\n    <published>2007-12-12T15:00:00Z</published>\n    <updated>2007-12-12T15:00:00Z</updated>\n    <link type=\"text/html\" rel=\"alternate\" href=\"http://www.nextangle.com/scrolls/1\"/>\n    <title>Hello One</title>\n    <content type=\"html\">Something &lt;i&gt;COOL!&lt;/i&gt;</content>\n    <author>\n      <name>DHH</name>\n    </author>\n  </entry>\n  <entry>\n    <id>tag:www.nextangle.com,2008:Scroll/2</id>\n    <updated>2007-12-12T15:00:00Z</updated>\n    <link type=\"text/html\" rel=\"alternate\" href=\"http://www.nextangle.com/scrolls/2\"/>\n    <title>Hello Two</title>\n    <content type=\"html\">Something Boring</content>\n    <author>\n      <name>DHH</name>\n    </author>\n  </entry>\n</feed>\n"> expected to be =~
    </<\?target1 c="3" d="4"\?>/>.
    

    October 4th, 2008 @ 03:15 PM

  8. Deleted User
    Deleted User

    Fixed. I was relying on the order of the hash in the test.

    October 4th, 2008 @ 06:57 PM

  9. Repository
    Repository
    • State changed from incomplete to resolved

    (from [42cbd710bb116998f92029adacb45698905a2e3b]) Add support for xml processing instructions in atom_feed_helper [#926 Add support for xml processing instructions in atom_feed_helper state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    October 13th, 2008 @ 05:48 PM