Sha256: 81589b7af8981f6bb1531f294a5d45ff5f017bd2fb78aa9b93c99dc5c27e350c

Contents?: true

Size: 945 Bytes

Versions: 8

Compression:

Stored size: 945 Bytes

Contents

def stylesheets
  %w(css/solarized.css css/bootstrap.css css/global.css) + super
end

def javascripts
  javascripts = super
  javascripts.insert 1, 'js/jquery.stickyheaders.js', 'js/underscore.min.js'
end

def diskfile
  @file.attributes[:markup] ||= markup_for_file('', @file.filename)

  if @file.filename == 'README.md'
    contents = preprocess_index(@file.contents)
  else
    contents = @file.contents
  end

  data = htmlify(contents, @file.attributes[:markup])
  "<div id='filecontents'>" + data + "</div>"
end

def preprocess_index(contents)
  regex = /\[ (\w+) \] \( lib \/ ([^()]+) \.rb (?:\#L\d+)? \)/x

  contents.gsub(regex) do
    method_name, file_path = $1, $2

    module_name = file_path.split('/')[0..2].
      map do |value|
        value.
          split('_').
          map { |word| word[0].upcase + word[1..-1] }.
          join
      end.
      join('::')

    "{#{module_name}##{method_name} #{method_name}}"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shoulda-matchers-3.1.3 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-4.0.0.rc1 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-3.1.2 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-3.1.1 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-3.1.0 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-3.0.1 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-3.0.0 doc_config/yard/templates/default/layout/html/setup.rb
shoulda-matchers-3.0.0.rc1 doc_config/yard/templates/default/layout/html/setup.rb