C0 code coverage information

Generated on Sat May 27 21:23:29 CEST 2006 with rcov 0.5.0


Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
Name Total lines Lines of code Total coverage Code coverage
app/apis/blogger_service.rb 97 79
100.0% 
100.0% 
 1 module BloggerStructs
 2   class Blog < ActionWebService::Struct
 3     member :url,      :string
 4     member :blogid,   :string
 5     member :blogName, :string
 6   end
 7   class User < ActionWebService::Struct
 8     member :userid, :string
 9     member :firstname, :string
10     member :lastname, :string
11     member :nickname, :string
12     member :email, :string
13     member :url, :string
14   end
15 end
16 
17 
18 class BloggerApi < ActionWebService::API::Base
19   inflect_names false
20 
21   api_method :deletePost,
22     :expects => [ {:appkey => :string}, {:postid => :int}, {:username => :string}, {:password => :string},
23                   {:publish => :bool} ],
24     :returns => [:bool]
25 
26   api_method :getUserInfo,
27     :expects => [ {:appkey => :string}, {:username => :string}, {:password => :string} ],
28     :returns => [BloggerStructs::User]
29     
30   api_method :getUsersBlogs,
31     :expects => [ {:appkey => :string}, {:username => :string}, {:password => :string} ],
32     :returns => [[BloggerStructs::Blog]]
33 
34   api_method :newPost,
35     :expects => [ {:appkey => :string}, {:blogid => :string}, {:username => :string}, {:password => :string},
36                   {:content => :string}, {:publish => :bool} ],
37     :returns => [:int]
38 end
39 
40 
41 class BloggerService < TypoWebService
42   web_service_api BloggerApi
43 
44   before_invocation :authenticate  
45   attr_reader :controller
46   
47   def initialize(controller)
This method was called by:

     24   app/controllers/backend_controller.rb: in ''

48     @controller = controller
49   end
50   
51   def deletePost(appkey, postid, username, password, publish)
This method was called by:

      1   vendor/rails/actionwebservice/lib/action_web_service/invocation.rb:144 in 'perform_invocation_without_interception'

52     article = Article.find(postid)
53     article.destroy
54     true
55   end
56   
57   def getUserInfo(appkey, username, password)
This method was called by:

      1   vendor/rails/actionwebservice/lib/action_web_service/invocation.rb:144 in 'perform_invocation_without_interception'

58     BloggerStructs::User.new(
59       :userid => username,
60       :firstname => "",
61       :lastname => "",
62       :nickname => username,
63       :email => "",
64       :url => controller.url_for(:controller => "/")
65     )
66   end
67   
68   def getUsersBlogs(appkey, username, password)
This method was called by:

      1   vendor/rails/actionwebservice/lib/action_web_service/invocation.rb:144 in 'perform_invocation_without_interception'

69     [BloggerStructs::Blog.new(
70       :url      => controller.url_for(:controller => "/"),
71       :blogid   => 1,
72       :blogName => config[:blog_name]
73     )]
74   end
75 
76   def newPost(appkey, blogid, username, password, content, publish)
This method was called by:

      4   vendor/rails/actionwebservice/lib/action_web_service/invocation.rb:144 in 'perform_invocation_without_interception'

77     title, categories, body = content.match(%r{^<title>(.+?)</title>(?:<category>(.+?)</category>)?(.+)$}mi).captures rescue nil
78 
79     article = Article.new 
80     article.body        = body || content || ''
81     article.title       = title || content.split.slice(0..5).join(' ') || ''
82     article.published   = publish ? 1 : 0
83     article.author      = username
84     article.created_at  = Time.now
85     article.user        = @user
86 
87     if categories
88       categories.split(",").each do |c|
89         article.categories << Category.find_by_name(c.strip) rescue nil
90       end
91     end
92 
93     article.save
94     article.id
95   end
96 
97 end

Generated using the rcov code coverage analysis tool for Ruby version 0.5.0.

Valid XHTML 1.0! Valid CSS!