Module: ScrumNinja::Server
- Defined in:
- lib/scrum_ninja/server.rb
Class Method Summary collapse
- .get_page_contents(url) ⇒ Object
- .get_stories(api_key, project_id) ⇒ Object
- .get_story(api_key, project_id, story_id) ⇒ Object
- .post_xml(url, xml) ⇒ Object
- .update_story(api_key, project_id, story_id, xml) ⇒ Object
Class Method Details
.get_page_contents(url) ⇒ Object
23 24 25 |
# File 'lib/scrum_ninja/server.rb', line 23 def get_page_contents(url) `curl -s "#{url}"` end |
.get_stories(api_key, project_id) ⇒ Object
7 8 9 |
# File 'lib/scrum_ninja/server.rb', line 7 def get_stories(api_key, project_id) get_page_contents "http://scrumninja.com/projects/#{project_id}/stories.xml?api_key=#{api_key}" end |
.get_story(api_key, project_id, story_id) ⇒ Object
11 12 13 |
# File 'lib/scrum_ninja/server.rb', line 11 def get_story(api_key, project_id, story_id) get_page_contents "http://scrumninja.com/projects/#{project_id}/stories/#{story_id}.xml?api_key=#{api_key}" end |
.post_xml(url, xml) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/scrum_ninja/server.rb', line 27 def post_xml(url, xml) f = Tempfile.new('curl_hackery') f << xml f.close `curl -s -H "Content-Type: application/xml; charset=utf-8" -X PUT -d @#{f.path} "#{url}"` end |
.update_story(api_key, project_id, story_id, xml) ⇒ Object
16 17 18 19 20 |
# File 'lib/scrum_ninja/server.rb', line 16 def update_story(api_key, project_id, story_id, xml) url = "http://scrumninja.com/projects/#{project_id}/stories/#{story_id}.xml?api_key=#{api_key}" # raise [story_id, url].inspect post_xml(url, xml) end |