Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plain ruby docs #374

Merged
merged 6 commits into from
Feb 9, 2016
Merged
Changes from 5 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
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,35 @@ class MyApp < Sinatra::Base
end
```

### If using Plain Ruby

Rollbar isn't dependent on Rack or Rails for most of its functionality. In a regular script, assuming you've
installed the rollbar gem:

1. Require rollbar
2. Configure rollbar
3. Send Rollbar data

```ruby
require 'rollbar'

Rollbar.configure do |config|
config.access_token = "SERVER_POST_ACCESS_TOKEN"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "POST_SERVER_ITEM_ACCESS_TOKEN" to be consistent with the rest of this file (and work with the replacements that happen in our logged-in site)

# Other Configuration Settings
end

Rollbar.debug "Running Script"

begin
run_script ARGV
rescue Exception => e # Never rescue Exception *unless* you re-raise in rescue body
Rollbar.error e
raise e
end

Rollbar.info "Script ran successfully"
```

## Test your installation

To confirm that it worked, run:
Expand Down