Skip to content

Commit afa4f7f

Browse files
committed
update readme
1 parent 5afb636 commit afa4f7f

File tree

1 file changed

+60
-17
lines changed

1 file changed

+60
-17
lines changed

README.md

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,79 @@
1-
# Sentry
1+
# Sentry Ruby API
22

3-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sentry`. To experiment with that code, run `bin/console` for an interactive prompt.
4-
5-
TODO: Delete this and the text above, and describe your gem
3+
Sentry Ruby API is a Ruby wrapper for the [getsentry/sentry API](https://docs.sentry.io/hosted/api/). **And it still being developed, and not published yet.**
64

75
## Installation
86

9-
Add this line to your application's Gemfile:
7+
add to a Gemfile:
108

119
```ruby
12-
gem 'sentry'
10+
gem 'sentry', :path => '/path/to/sentry'
1311
```
1412

15-
And then execute:
13+
## Usage
1614

17-
$ bundle
15+
Configuration example:
1816

19-
Or install it yourself as:
17+
```ruby
18+
Sentry.configure do |config|
19+
config.endpoint = 'http://example.com/api/0'
20+
config.auth_token = 'your_auth_token'
21+
config.default_org_slug = 'sentry-sc'
22+
end
23+
```
2024

21-
$ gem install sentry
25+
(Note: If you are using getsentry.com's hosted service, your endpoint will be `https://app.getsentry.com/api/0`)
2226

23-
## Usage
27+
Usage examples:
2428

25-
TODO: Write usage instructions here
29+
```ruby
30+
# set an API endpoint
31+
Sentry.endpoint = 'http://example.com/api/0'
32+
# => "http://example.com/api/0"
2633

27-
## Development
34+
# set a user private token
35+
Sentry.auth_token = 'your_auth_token'
36+
# => "your_auth_token"
37+
38+
# configure a proxy server
39+
Sentry.http_proxy('proxyhost', 8888)
40+
# proxy server w/ basic auth
41+
Sentry.http_proxy('proxyhost', 8888, 'user', 'pass')
42+
43+
# list projects
44+
Sentry.projects
2845

29-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
46+
# initialize a new client
47+
s = Sentry.client(endpoint: 'https://api.example.com', auth_token: 'your_auth_token', default_org_slug: 'sentry-sc')
48+
49+
# a paginated response
50+
projects = Sentry.projects
51+
52+
# check existence of the next page
53+
projects.has_next_page?
54+
55+
# retrieve the next page
56+
projects.next_page
57+
58+
# iterate all projects
59+
projects.auto_paginate do |project|
60+
# do something
61+
end
62+
63+
# retrieve all projects as an array
64+
projects.auto_paginate
65+
```
66+
67+
## Development
68+
The basic framework had been finished, meanwhile the APIs of Organizations,Projects and Events had been added, more APIs will be added later. You are welcome to help me with it.
3069

31-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
70+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
71+
`rake spec` to run the tests. You can also run `bin/console` for an interactive
72+
prompt that will allow you to experiment.
3273

33-
## Contributing
74+
## License
3475

35-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sentry.
76+
Released under the BSD 2-clause license. See LICENSE.txt for details.
3677

78+
## Special Thank
79+
Thanks to NARKOZ's [gitlab](https://github.com/NARKOZ/gitlab) ruby wrapper which really gives me a lot of inspiration.

0 commit comments

Comments
 (0)