Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#### Developer

- [ ] All new ENV is documented in README
- [ ] All new ENV has been added to Heroku Pipeline, Staging and Prod
- [ ] ANDI or Wave has been run in accordance to
[our guide](https://mitlibraries.github.io/guides/basics/a11y.html) and
all issues introduced by these changes have been resolved or opened as new
issues (link to those issues in the Pull Request details above)
- [ ] Stakeholder approval has been confirmed (or is not needed)

#### Code Reviewer

- [ ] The commit message is clear and follows our guidelines
(not just this pull request message)
- [ ] There are appropriate tests covering any new functionality
- [ ] The documentation has been updated or is unnecessary
- [ ] The changes have been verified
- [ ] New dependencies are appropriate or there were no changes

#### Requires database migrations?

YES | NO

#### Includes new or updated dependencies?

YES | NO
10 changes: 10 additions & 0 deletions .github/workflows/mit-libraries-ruby-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
shared:
uses: mitlibraries/.github/.github/workflows/ruby-shared-ci.yml@main
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/log/*.log
/pkg/
/spec/reports/
/tmp/
/test/dummy/db/*.sqlite3
/test/dummy/db/*.sqlite3-*
/test/dummy/log/*.log
/test/dummy/storage/
/test/dummy/tmp/

.DS_Store
*.gem
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.2
10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Specify your gem's dependencies in mitlibraries-theme.gemspec
gemspec

gem "sqlite3"

gem "sprockets-rails"

# Start debugger with binding.b [https://github.com/ruby/debug]
# gem "debug", ">= 1.0.0"
185 changes: 108 additions & 77 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,98 +1,104 @@
PATH
remote: .
specs:
mitlibraries-theme (0.7.0)
rails (>= 5, < 8)
sassc (~> 2)
mitlibraries-theme (0.9.0)
rails (>= 6, < 8)
sassc-rails (~> 2)

GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.2.3)
actionpack (= 7.0.2.3)
activesupport (= 7.0.2.3)
actioncable (7.0.3.1)
actionpack (= 7.0.3.1)
activesupport (= 7.0.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.2.3)
actionpack (= 7.0.2.3)
activejob (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
actionmailbox (7.0.3.1)
actionpack (= 7.0.3.1)
activejob (= 7.0.3.1)
activerecord (= 7.0.3.1)
activestorage (= 7.0.3.1)
activesupport (= 7.0.3.1)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.2.3)
actionpack (= 7.0.2.3)
actionview (= 7.0.2.3)
activejob (= 7.0.2.3)
activesupport (= 7.0.2.3)
actionmailer (7.0.3.1)
actionpack (= 7.0.3.1)
actionview (= 7.0.3.1)
activejob (= 7.0.3.1)
activesupport (= 7.0.3.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.2.3)
actionview (= 7.0.2.3)
activesupport (= 7.0.2.3)
actionpack (7.0.3.1)
actionview (= 7.0.3.1)
activesupport (= 7.0.3.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.2.3)
actionpack (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
actiontext (7.0.3.1)
actionpack (= 7.0.3.1)
activerecord (= 7.0.3.1)
activestorage (= 7.0.3.1)
activesupport (= 7.0.3.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.2.3)
activesupport (= 7.0.2.3)
actionview (7.0.3.1)
activesupport (= 7.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.2.3)
activesupport (= 7.0.2.3)
activejob (7.0.3.1)
activesupport (= 7.0.3.1)
globalid (>= 0.3.6)
activemodel (7.0.2.3)
activesupport (= 7.0.2.3)
activerecord (7.0.2.3)
activemodel (= 7.0.2.3)
activesupport (= 7.0.2.3)
activestorage (7.0.2.3)
actionpack (= 7.0.2.3)
activejob (= 7.0.2.3)
activerecord (= 7.0.2.3)
activesupport (= 7.0.2.3)
activemodel (7.0.3.1)
activesupport (= 7.0.3.1)
activerecord (7.0.3.1)
activemodel (= 7.0.3.1)
activesupport (= 7.0.3.1)
activestorage (7.0.3.1)
actionpack (= 7.0.3.1)
activejob (= 7.0.3.1)
activerecord (= 7.0.3.1)
activesupport (= 7.0.3.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.2.3)
activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
builder (3.2.4)
concurrent-ruby (1.1.10)
crass (1.0.6)
debug (1.6.2)
irb (>= 1.3.6)
reline (>= 0.3.1)
digest (3.1.0)
erubi (1.10.0)
docile (1.4.0)
erubi (1.11.0)
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
loofah (2.16.0)
io-console (0.5.11)
irb (1.4.1)
reline (>= 0.3.0)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.14.4)
minitest (5.16.3)
net-imap (0.2.3)
digest
net-protocol
Expand All @@ -108,60 +114,85 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
racc (1.6.0)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.2.3)
actioncable (= 7.0.2.3)
actionmailbox (= 7.0.2.3)
actionmailer (= 7.0.2.3)
actionpack (= 7.0.2.3)
actiontext (= 7.0.2.3)
actionview (= 7.0.2.3)
activejob (= 7.0.2.3)
activemodel (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
rack (2.2.4)
rack-test (2.0.2)
rack (>= 1.3)
rails (7.0.3.1)
actioncable (= 7.0.3.1)
actionmailbox (= 7.0.3.1)
actionmailer (= 7.0.3.1)
actionpack (= 7.0.3.1)
actiontext (= 7.0.3.1)
actionview (= 7.0.3.1)
activejob (= 7.0.3.1)
activemodel (= 7.0.3.1)
activerecord (= 7.0.3.1)
activestorage (= 7.0.3.1)
activesupport (= 7.0.3.1)
bundler (>= 1.15.0)
railties (= 7.0.2.3)
railties (= 7.0.3.1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
railties (7.0.2.3)
actionpack (= 7.0.2.3)
activesupport (= 7.0.2.3)
railties (7.0.3.1)
actionpack (= 7.0.3.1)
activesupport (= 7.0.3.1)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.3)
rake (13.0.6)
reline (0.3.1)
io-console (~> 0.5)
sassc (2.4.0)
ffi (~> 1.9)
strscan (3.0.1)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.4)
strscan (3.0.4)
thor (1.2.1)
timeout (0.2.0)
tzinfo (2.0.4)
tilt (2.0.11)
timeout (0.3.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.5.4)
zeitwerk (2.6.0)

PLATFORMS
ruby
x86_64-darwin-19

DEPENDENCIES
bundler (~> 2.0)
minitest (~> 5.0)
debug (~> 1)
mitlibraries-theme!
rake (~> 13.0)
simplecov (~> 0)
simplecov-lcov (~> 0)
sprockets-rails
sqlite3

BUNDLED WITH
2.1.4
2.3.7
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ $ gem install mitlibraries-theme

## Usage

After you bundle, delete your application local `app/views/layouts/application.rb` to use the layout the gem provides.
### Controllers

The gem includes a link helper class, which provides a function - `nav_link_to` - which renders links with particular classes and ARIA roles that are suited for site navigation. The default navigation partial at `app/views/layouts/_site_nav.html.erb` makes use of this function, and we recommend you copy this partial into your application with appropriate updates for your app.

In order to make this function available to your application, please add the following line near the top of your local `app/controllers/application_controller.rb`:

```ruby
helper Mitlibraries::Theme::Engine.helpers
```

### Layouts and stylesheets

After you update your controller and bundle, delete your application local `app/views/layouts/application.rb` to use the layout the gem provides.

Rename your `app/assets/stylesheets/application.css` to `app/assets/stylesheets/application.scss` and remove anything like:

Expand Down
14 changes: 6 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require "bundler/setup"

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/*_test.rb']
end
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
load "rails/tasks/engine.rake"

task default: :test
load "rails/tasks/statistics.rake"

require "bundler/gem_tasks"
1 change: 1 addition & 0 deletions app/assets/config/mitlibraries_theme_manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= link_directory ../stylesheets/mitlibraries/theme .css
Empty file.
15 changes: 15 additions & 0 deletions app/assets/stylesheets/mitlibraries/theme/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
Empty file added app/controllers/concerns/.keep
Empty file.
Loading