From 38613bb9ff7cd09657562a07c0908be6182127c3 Mon Sep 17 00:00:00 2001 From: Alberto Rocha Date: Fri, 15 Nov 2024 18:47:17 -0300 Subject: [PATCH] Add documentation --- .github/workflows/documentation.yml | 37 +++++++++++++++++++++++++++++ .yardopts | 10 ++++++++ Gemfile | 12 ++++++---- Gemfile.lock | 11 +++++++++ 4 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/documentation.yml create mode 100644 .yardopts diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..18c5a90 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,37 @@ +name: Documentation + +on: + push: + branches: + - main + +jobs: + documentation: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3.5' + bundler-cache: true + + - name: Install Dependencies + run: | + gem install yard + gem install redcarpet + + - name: Generate Documentation + run: yard doc + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc + enable_jekyll: false + allow_empty_commit: true + force_orphan: true + commit_message: "Docs: Update documentation" \ No newline at end of file diff --git a/.yardopts b/.yardopts new file mode 100644 index 0000000..f0e9216 --- /dev/null +++ b/.yardopts @@ -0,0 +1,10 @@ +--markup markdown +--markup-provider redcarpet +--readme README.md +--title 'ElectionBuddy Ruby' +--protected +--private +lib/**/*.rb +- +LICENSE.txt +CHANGELOG.md \ No newline at end of file diff --git a/Gemfile b/Gemfile index 2af37ba..a261ea7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,10 +5,12 @@ source "https://rubygems.org" # Specify your gem's dependencies in electionbuddy-ruby.gemspec gemspec -gem "rake", "~> 13.0" - +gem "debug", "~> 1.9", ">= 1.9.2" gem "minitest", "~> 5.16" - +gem "rack", "~> 3.1", ">= 3.1.8" +gem "rackup", "~> 2.2", ">= 2.2.1" +gem "rake", "~> 13.0" +gem "redcarpet", "~> 3.6" gem "rubocop", "~> 1.21" - -gem "debug", "~> 1.9", ">= 1.9.2" +gem "webrick", "~> 1.9" +gem "yard", "~> 0.9.37" diff --git a/Gemfile.lock b/Gemfile.lock index fa4ca4a..68a347e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,10 +34,14 @@ GEM psych (5.1.2) stringio racc (1.8.1) + rack (3.1.8) + rackup (2.2.1) + rack (>= 3) rainbow (3.1.1) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) + redcarpet (3.6.0) regexp_parser (2.9.2) reline (0.5.10) io-console (~> 0.5) @@ -57,6 +61,8 @@ GEM stringio (3.1.1) unicode-display_width (2.6.0) uri (0.13.1) + webrick (1.9.0) + yard (0.9.37) PLATFORMS ruby @@ -66,8 +72,13 @@ DEPENDENCIES debug (~> 1.9, >= 1.9.2) electionbuddy-ruby! minitest (~> 5.16) + rack (~> 3.1, >= 3.1.8) + rackup (~> 2.2, >= 2.2.1) rake (~> 13.0) + redcarpet (~> 3.6) rubocop (~> 1.21) + webrick (~> 1.9) + yard (~> 0.9.37) BUNDLED WITH 2.5.16