Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

codetriage/docs_doctor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docs Doctor

Build Status

Manifesto

Having well documented methods and classes makes it much easier for coders to become contributors. This lib is intended to help maintainers and contributors find missing or lacking docs and fix them.

Want to get an easy commit on an open source project?

  • Write some docs

Want to understand the internals of a project better?

  • Write some docs

Want to make the world a better place for you and for future coders?

  • Write some docs

How

We use industry standard doc parsers (starting with RDoc, though other parsers and languages can be added later) to parse documentation for a given library. We store the results and flag undocumented methods/classes. Then anyone can sign up to receive an undocumented piece of code in their inbox.

Install Locally

Clone the repo then run:

$ bundle install

Setup Authentication

You'll need to set environment variables for login with GitHub. To do so, visit https://github.com/settings/applications.

Create a new app with these values:

You'll receive a Client ID and a Client Secret. Then, add them as environment variables.

The simplest way to get up and running is:

touch .env && echo "GITHUB_APP_SECRET=[your app secret here]\nGITHUB_APP_ID=[your app id here]" > .env

Restart your server to pick up these changes.

Import from Local rails/rails

reload!
repo    = Repo.where(full_name: "schneems/threaded").first_or_create
fetcher = GithubFetcher.new(repo.full_name)
parser  = DocsDoctor::Parsers::Ruby::Yard.new(fetcher.clone)
parser.process
parser.store(repo)
puts DocFile.last.path
repo    = Repo.where(full_name: "rails/rails").first_or_create
files   = '/Users/schneems/documents/projects/rails/**/*.rb'
files   = '/Users/schneems/Documents/projects/rails/activerecord/lib/rails/generators/active_record/model/model_generator.rb'
parser  = DocsDoctor::Parsers::Ruby::Rdoc.new(files)
parser.process
parser.store(repo)
# DocFile.destroy_all repo = Repo.last
doc  = repo.methods_missing_docs.first
doc.to_github


repo    = Repo.where(full_name: "rails/rails").first_or_create
files   = '/Users/schneems/documents/projects/rails/**/*.rb'
parser = DocsDoctor::Parsers::Ruby::Rdoc.new(files)
parser.process
parser.store(repo)

# DocFile.destroy_all repo = Repo.last
doc  = repo.methods_missing_docs.first

Grab all subscriptions, pull out one doc_method from each

reload!
fetcher = GithubFetcher.new(full_name)
parser  = DocsDoctor::Parsers::Ruby::Rdoc.new(fetcher.clone)
parser.process
parser.store(Repo.where("full_name" => full_name).first)

Current Status

  • Debug emails not being sent
reload!
repo    = Repo.where(full_name: "schneems/rrrretry").first_or_create
fetcher = GithubFetcher.new(repo.full_name)
parser  = DocsDoctor::Parsers::Ruby::Yard.new(fetcher.clone)
parser.process
parser.store(repo)


parser.yard_objects.select {|o| o.is_a?(YARD::CodeObjects::MethodObject) }

TODO