Skip to content

Commit

Permalink
Merge pull request #50 from MITLibraries/yard-and-makefile
Browse files Browse the repository at this point in the history
Adds yard and makefile with development commands
  • Loading branch information
JPrevost authored Jun 27, 2024
2 parents 459b2f9 + 9cc4f95 commit 17c3abc
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@

.DS_Store
.vscode/
.yardoc
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--no-private --protected app/**/*.rb - docs/**/*.md
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ group :development do

# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
gem 'yard'
end

group :test do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.36)
zeitwerk (2.6.16)

PLATFORMS
Expand Down Expand Up @@ -370,6 +371,7 @@ DEPENDENCIES
vcr
web-console
webmock
yard

RUBY VERSION
ruby 3.2.2p53
Expand Down
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.PHONY: test

help: # display Makefile commands
@awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

#######################
# Local development commands
#######################

run: # runs server on localhost
bin/rails server

console: # runs console
bin/rails console

test: # Run tests
bin/rails test

coverage: test # Run tests and open coverage report in default web browser
open coverage/index.html

#######################
# Documentation commands
#######################

annotate: # update Rails models documentation header
bundle exec annotate --models

docserver: # runs local documentation server
rm -rf .yardoc # Clears cache as it's sketchy af
yard server --reload

#######################
# Dependency commands
#######################

install: # Install dependencies
bundle install

outdated: # List outdated dependencies
bundle outdated

####################################
# Code quality and safety commands
####################################

# coming soon!
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# TACOS: Tool for Analyzing and Categorization Of Searchterms

## Local development

There is a `Makefile` that contains some useful command shortcuts for typical development tasks.

To see a current list of commands, run `make help`.

## Environment Variables

### Required
Expand All @@ -16,6 +22,8 @@

## Documentation

### Architecture Decisions

[Architecture Decisions](docs/architecture-decisions/)

### Explanation/Overview
Expand All @@ -26,4 +34,9 @@

### Reference

`make docserver` will start a `yard` server using the RDoc comments from the codebase. RDoc in this application is a work-in-progress and should improve over time. As of this writing, the index page generated contains broken links to our markdown documentation, but they "files" navigation displays them properly.

> [!TIP]
> Prior to running `make docserver` the first time, you must install the bundled gems for this application using either `bundle install` or `make install` (they both do the same thing!).
[Class Diagram](docs/reference/classes.md)

0 comments on commit 17c3abc

Please sign in to comment.