sourcegraph / srclib-ruby

https://sourcegraph.com/sourcegraph/srclib-ruby
9 stars 9 forks source link

srclib-ruby Build Status

YARD

srclib-ruby uses Loren Segal's YARD for Ruby analysis. A git subtree of the Sourcegraph fork of YARD is in the yard/ subdirectory. Commits to that subtree should be regularly sent upstream to the github.com/sourcegraph/yard fork.

Running tests

The make test target analyzes sample repositories in testdata/case and checks that the actual output matches the expected output (which is committed to the repository).

The sample repositories are git submodules, so you'll have to git submodule init && git submodule update the first time you want to run the tests.

The output of the analyzer differs a bit depending on the version of Ruby you have installed. The expected output was generated using Ruby 2.2.2. If you're finding that your output differs from the expected, try both generating the stdlib index and running the tests with that version of Ruby. If you're using rvm, this means running the following commands:

# in case you built the stdlib index using a different version of Ruby (e.g.,
# your system Ruby)
rm -rf ruby-2.2.2/.yardoc

# rebuild the stdlib index using Ruby 2.2.2 (run `rvm install 2.2.2` if you
# haven't already installed Ruby 2.2.2)
rvm 2.2.2 do make stdlib

# install gem deps for the test repos using Ruby 2.2.2
rvm 2.2.2 do make test-dep

# run the tests with Ruby 2.2.2
rvm 2.2.2 do make test

The same applies when you're generating new expected test output (after making an improvement to the code, for example).

If you're having trouble getting your output to match the expected, post an issue.

Using srclib-ruby in Windows/Cygwin environment

Windows with Cygwin installed is required as a prerequisite. srclib-ruby has been tested with:

CYGWIN_NT-6.1-WOW Diana 2.0.4(0.287/5/3) 2015-06-09 12:20 i686 Cygwin

Windows installation instructions

Issue with OpenSSL

Ruby may not provide a default OpenSSL certificate authorities file. Thus, srclib-ruby may unable to communicate with external sites. Here is the workaround - see The Manual Way there.

TODO