Skip to content

Yard not working on Ruby 1.9.3 #1089

@jessebs

Description

@jessebs

Steps to reproduce

  1. Run the following command: yard -v on Ruby 1.9.3

Actual Output

jbowes@jbowes-mac ~/projects/nai-utils$ yard doc --no-private --debug
/Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/globals.rb:21:in log': /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/logging.rb:13: invalid multibyte char (US-ASCII) (SyntaxError) /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/logging.rb:13: invalid multibyte char (US-ASCII) /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/logging.rb:13: syntax error, unexpected $end, expecting keyword_end PROGRESS_INDICATORS = %w(⣷ ⣯ ⣟ ⡿ ⢿ ⣻ ⣽ ⣾) ^ from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/cli/command_parser.rb:57:in initialize'
from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/cli/command_parser.rb:54:in new' from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/lib/yard/cli/command_parser.rb:54:in run'
from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/gems/yard-0.9.9/bin/yard:13:in <top (required)>' from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/bin/yard:23:in load'
from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/bin/yard:23:in <main>' from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/bin/ruby_executable_hooks:15:in eval'
from /Users/jbowes/.rvm/gems/ruby-1.9.3-p551@nai-utils/bin/ruby_executable_hooks:15:in `

'

Expected Output

Expect yard to work

Environment details:

  • OS: CentOS 7 and MacOS 10.12.4
  • Ruby version (ruby -v): ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin16.0.0]
  • YARD version (yard -v): 0.9.9

Fix

In lib/yard/logging.rb, the encoding line must be the first line

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions