Class: Precious::Views::Commit
- Defined in:
- lib/gollum/views/commit.rb
Constant Summary
Constants included from RouteHelpers
Constants included from LocaleHelpers
LocaleHelpers::NO_METHOD_MESSAGE, LocaleHelpers::YAML_VARIABLE_REGEXP
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from Compare
#allow_editing, #diff, #page, #versions
Attributes inherited from Layout
Instance Method Summary collapse
- #author ⇒ Object
- #authored_date ⇒ Object
- #datetime ⇒ Object
- #files ⇒ Object
- #message ⇒ Object
- #title ⇒ Object
Methods inherited from Compare
#after, #before, #git_line?, #left_diff_line_number, #line_class, #lines, #right_diff_line_number, #show_revert
Methods included from HasPage
#escaped_url_path, #format, #id, #path
Methods inherited from Layout
#base_url, #critic_markup, #css, #custom_css, #custom_js, #custom_path, #escaped_name, #has_path, #history, #js, #latest_changes, #mathjax_config_path, #mathjax_js, #overview, #partial, #per_page_uploads, #search, #show_local_time
Methods included from TemplateCascade
#first_path_available, #template_file, #template_priority_path, #template_priority_path=
Methods included from OcticonHelpers
included, #octicon, #rocticon, #rocticon_css
Methods included from RouteHelpers
#clean_url, included, #page_route, parse_routes
Methods included from SprocketsHelpers
included, #sprockets_asset_path, #sprockets_image_path, #sprockets_javascript_tag, #sprockets_stylesheet_tag
Methods included from LocaleHelpers
Methods included from AppHelpers
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'lib/gollum/views/commit.rb', line 7 def version @version end |
Instance Method Details
#author ⇒ Object
13 14 15 |
# File 'lib/gollum/views/commit.rb', line 13 def @commit..name end |
#authored_date ⇒ Object
17 18 19 |
# File 'lib/gollum/views/commit.rb', line 17 def @commit. end |
#datetime ⇒ Object
21 22 23 |
# File 'lib/gollum/views/commit.rb', line 21 def datetime .utc.iso8601 end |
#files ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gollum/views/commit.rb', line 29 def files files = @diff.force_encoding(Encoding::UTF_8).scan(%r{ ^diff\ --git\ # diff start .+? # diff body (?=^diff\ --git|\Z) # scan until next diff or string }sxmu) files.map do |diff| match = diff.match(%r{^diff --git (")?[ab]/(.+)(?(1)") (")?[ab]/(.+)(?(3)")}) path = match[2] path = match[4] if path.nil? { path: path, lines: lines(diff) } end end |
#message ⇒ Object
25 26 27 |
# File 'lib/gollum/views/commit.rb', line 25 def @commit. end |
#title ⇒ Object
9 10 11 |
# File 'lib/gollum/views/commit.rb', line 9 def title "Changes in #{@version[0..6]}: #{}" end |