Sha256: 4a673859d77d0ee2fd0fecd98f443db9f9d3fd93abb69e03d447a3cd22f28b5f
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
# -*- encoding: utf-8 -*- module Coco # @todo The app is full of <tt>Dir.pwd</tt>. This is the root project directory # and must be in Configuration class (or Coco module ?). module Helpers # Get html filename (from a ruby filename) suitable for the coverage # directory. # # @example # ruby = '/home/user/my_project/lib/source.rb' # html = Helpers.rb2html(ruby) # => '_lib_source.rb.html' # # @param [String] name Ruby filename # @return [String] Html filename def Helpers.rb2html name name.sub(Dir.pwd, '').tr('/\\', '_') + '.html' end # @return [String] The title of the index.html file def Helpers.index_title "Coco #{File.read(File.join($COCO_PATH, 'VERSION')).strip}, code coverage for #{File.basename(Dir.pwd)}" end # @param [Array<String>] files List of filenames # @return [Array<String>] def Helpers.expand files files.map {|file| File.expand_path file} end # @return [Array<String>] The list of ruby source files from +directory+. Recursive. def Helpers.rb_files_from directory rb_files = File.join(directory, "**", "*.rb") Dir.glob(rb_files) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
coco-0.6 | lib/coco/helpers.rb |
coco-0.5.1 | lib/coco/helpers.rb |
coco-0.5 | lib/coco/helpers.rb |