Skip to content

Commit

Permalink
Merge pull request #19 from MITLibraries/update_sentry
Browse files Browse the repository at this point in the history
Updates javascript sentry for all apps using theme
  • Loading branch information
JPrevost authored Nov 2, 2021
2 parents 9aeaf16 + cada72c commit 2dbb1e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@ gem 'mitlibraries-theme'

And then execute:

$ bundle
```shell
$ bundle
```

Or install it yourself as:

$ gem install mitlibraries-theme
```shell
$ gem install mitlibraries-theme
```

## Usage

After you 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:
```

```ruby
*= require_tree .
*= require_self
```

Add
`@import "libraries-main";`

Expand All @@ -46,7 +52,7 @@ If you need to make changes to other templates, you can also copy those to your

You can load additional js to individual pages using:

```
```ruby
<% content_for :additional_js do %>
<script>alert("hi");</script>
<% end %>
Expand All @@ -61,7 +67,7 @@ for adding external support libraries. For JS you are writing, include via
You can load additional meta headers to individual pages using:
```
```ruby
<% content_for :additional_meta_tag do %>
<meta name="description" content="Words and stuff about stuff or something.">
<meta name="keywords" content="words,stuff,yoyos">
Expand All @@ -81,6 +87,7 @@ Run `make help` for details.
If your goal is to fetch the latest assets from the style repo and publish the
changes, this would get you there:
- `make update`
- manually update the version in `lib/mitlibraries/theme/version.rb`
- `make dist`
Expand Down
14 changes: 12 additions & 2 deletions app/views/layouts/_js_exception_handler.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<% if ENV['JS_EXCEPTION_LOGGER_KEY'].present? %>
<script src="https://cdn.ravenjs.com/3.25.2/raven.min.js" crossorigin="anonymous"></script>
<script>Raven.config('<%= ENV['JS_EXCEPTION_LOGGER_KEY'] %>').install()</script>
<script
src="https://browser.sentry-cdn.com/6.13.3/bundle.min.js"
integrity="sha384-sGMbmxgVprpEFMz6afNDyADd4Kav86v5Tvo2Y6w5t8tHUn1P1at3lCjN7IQo2c7E"
crossorigin="anonymous"
></script>

<script>
Sentry.init({
dsn: <%= ENV['JS_EXCEPTION_LOGGER_KEY'] %>,
maxBreadcrumbs: 50,
});
</script>
<% end %>
2 changes: 1 addition & 1 deletion lib/mitlibraries/theme/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Mitlibraries
module Theme
VERSION = '0.5.0'.freeze
VERSION = '0.6.0'.freeze
end
end

0 comments on commit 2dbb1e8

Please sign in to comment.