rollbar_api 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f297e1dcc05b3a1c408943d17a34ffc66952c725
4
+ data.tar.gz: 027c60c6fc1d8ae0e57190f594f765ff8b0eade9
5
+ SHA512:
6
+ metadata.gz: 13b92d0cf4b8472321d29f429285f821fbb61ea5cb574527b8d7073144f97d223878e02eebf541bd301d4a4834132688536d56b150ac8e0081d375843b685528
7
+ data.tar.gz: 32ee4ced56334c04890e986b18774a84b7a84ee0adc3611a2a38643e87df136024a9dc96238a8cf77f06b44fb5f85af90dc951866a83fbb24feedc7f6bbe2ce2
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /bin/
11
+ /CODE_OF_CONDUCT.md
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ cache: bundler
3
+ script: bundle exec rspec spec
4
+ rvm:
5
+ - 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rollbar_api.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Vlad Ragunovich
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,46 @@
1
+ ## Rollbar API ruby client library
2
+
3
+ [![Build Status](https://magnum.travis-ci.com/RagunovichVlad/rollbar_api.svg?token=sSGGAcKAtBywfMyZUSP2&branch=master)](https://magnum.travis-ci.com/RagunovichVlad/rollbar_api)
4
+ [![Test Coverage](https://codeclimate.com/repos/55c7b0666956804520006d34/badges/b2b37277e90562966c10/coverage.svg)](https://codeclimate.com/repos/55c7b0666956804520006d34/coverage)
5
+
6
+ Client library for talking to [Rollbar API](https://rollbar.com/docs/api_overview/).
7
+
8
+ #### Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'rollbar_api'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install rollbar_api
23
+
24
+ #### Usage
25
+
26
+ First of all, initialize client:
27
+
28
+ ```ruby
29
+ client = RollbarAPI::Client.new("MY_API_TOKEN")
30
+ ```
31
+
32
+ And then talk to API:
33
+
34
+ ```ruby
35
+ client.create_project("rollbar_api")
36
+ ```
37
+
38
+ #### Contributing
39
+
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/RagunovichVlad/rollbar_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
41
+
42
+
43
+ #### License
44
+
45
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
46
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,6 @@
1
+ require "httparty"
2
+ require "rollbar_api/version.rb"
3
+ require "rollbar_api/client.rb"
4
+
5
+ module RollbarAPI
6
+ end
@@ -0,0 +1,23 @@
1
+ require "rollbar_api/client/teams"
2
+ require "rollbar_api/client/projects"
3
+ require "rollbar_api/client/invites"
4
+ require "rollbar_api/client/items"
5
+
6
+ module RollbarAPI
7
+
8
+ class Client
9
+ include HTTParty
10
+ include RollbarAPI::Client::Teams
11
+ include RollbarAPI::Client::Projects
12
+ include RollbarAPI::Client::Invites
13
+ include RollbarAPI::Client::Items
14
+
15
+ format :json
16
+ base_uri 'https://api.rollbar.com/api/1'
17
+
18
+
19
+ def initialize(access_token)
20
+ self.class.default_options.merge!(query: {access_token: access_token})
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ module RollbarAPI
2
+ class Client
3
+
4
+ module Invites
5
+
6
+ def get_invite(invite_id)
7
+ self.class.get("/invite/#{invite_id}").parsed_response
8
+ end
9
+
10
+ def invites_for_team(team_id)
11
+ self.class.get("/team/#{team_id}/invites").parsed_response
12
+ end
13
+
14
+ def invite_user_to_team(team_id,email)
15
+ self.class.post("/team/#{team_id}/invites", body: {email: email}).parsed_response
16
+ end
17
+
18
+ def cancel_invite(invite_id)
19
+ self.class.delete("/invite/#{invite_id}").parsed_response
20
+ end
21
+
22
+ def cancel_accepted_invite(team_id, user_id)
23
+ self.class.delete("/team/#{team_id}/user/#{user_id}").parsed_response
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ module RollbarAPI
2
+ class Client
3
+
4
+ module Items
5
+
6
+ def get_item(item_id)
7
+ self.class.get("/item/#{id}").parsed_response
8
+ end
9
+
10
+ def item_by_counter(counter)
11
+ self.class.get("/item_by_counter/#{counter}").parsed_response
12
+ end
13
+
14
+ def all_items
15
+ self.class.get('/items/')
16
+ end
17
+
18
+ def update_item(item_id, status, resolved_in_version)
19
+ self.class.patch("/item/#{item_id}", body: {status: status, resolved_in_version: resolved_in_version}).parsed_response
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ module RollbarAPI
2
+ class Client
3
+
4
+ module Projects
5
+
6
+ def all_projects
7
+ self.class.get('/projects').parsed_response
8
+ end
9
+
10
+ def get_project(id)
11
+ self.class.get("/project/#{id}").parsed_response
12
+ end
13
+
14
+ def create_project(name)
15
+ self.class.post('/projects', body: {name: name}).parsed_response
16
+ end
17
+
18
+ def delete_project(id)
19
+ self.class.delete("/project/#{id}").parsed_response
20
+ end
21
+
22
+ def update_project_access_tokens(id, window_count, window_size)
23
+ self.class.patch("/project/#{id}/access_tokens", body: {rate_limit_window_count: window_count, rate_limit_window_size: window_size}).parsed_response
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,47 @@
1
+ module RollbarAPI
2
+ class Client
3
+
4
+ module Teams
5
+
6
+ def all_teams
7
+ self.class.get('/teams').parsed_response
8
+ end
9
+
10
+ def get_team(id)
11
+ self.class.get("/team/#{id}").parsed_response
12
+ end
13
+
14
+ def create_team(name, access_level = 'standard')
15
+ self.class.post('/teams', body: {name: name, access_level: access_level}).parsed_response
16
+ end
17
+
18
+ def delete_team(id)
19
+ self.class.delete("/team/#{id}").parsed_response
20
+ end
21
+
22
+ def check_project_in_team(team_id, project_id)
23
+ self.class.get("/team/#{team_id}/project/#{project_id}").parsed_response
24
+ end
25
+
26
+ def add_project_to_team(team_id, project_id)
27
+ self.class.put("/team/#{team_id}/project/#{project_id}").parsed_response
28
+ end
29
+
30
+ def remove_project_from_team(team_id, project_id)
31
+ self.class.delete("/team/#{team_id}/project/#{project_id}").parsed_response
32
+ end
33
+
34
+ def check_team_membership(team_id, user_id)
35
+ self.class.get("/team/#{team_id}/user/#{user_id}").parsed_response
36
+ end
37
+
38
+ def team_members(team_id)
39
+ self.class.get("/team/#{team_id}/users").parsed_response
40
+ end
41
+
42
+ def remove_user_from_team(team_id, user_id)
43
+ self.class.delete("/team/#{team_id}/user/#{user_id}").parsed_response
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,3 @@
1
+ module RollbarAPI
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rollbar_api/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rollbar_api"
8
+ spec.version = RollbarAPI::VERSION
9
+ spec.authors = ["Vlad Ragunovich"]
10
+ spec.email = ["vlad.ragunovich@gmail.com"]
11
+
12
+ spec.summary = %q{Client library for Rollbar API.}
13
+ spec.description = %q{Client library for Rollbar API.}
14
+ spec.homepage = "https://github.com/RagunovichVlad/rollbar_api"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.10"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "rspec"
33
+ spec.add_development_dependency "vcr"
34
+ spec.add_development_dependency "webmock"
35
+ spec.add_development_dependency "codeclimate-test-reporter"
36
+
37
+ spec.add_dependency "httparty"
38
+ end
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rollbar_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Vlad Ragunovich
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-08-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: vcr
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: codeclimate-test-reporter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: httparty
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Client library for Rollbar API.
112
+ email:
113
+ - vlad.ragunovich@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - .gitignore
119
+ - .rspec
120
+ - .travis.yml
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - lib/rollbar_api.rb
126
+ - lib/rollbar_api/client.rb
127
+ - lib/rollbar_api/client/invites.rb
128
+ - lib/rollbar_api/client/items.rb
129
+ - lib/rollbar_api/client/projects.rb
130
+ - lib/rollbar_api/client/teams.rb
131
+ - lib/rollbar_api/version.rb
132
+ - rollbar_api.gemspec
133
+ homepage: https://github.com/RagunovichVlad/rollbar_api
134
+ licenses:
135
+ - MIT
136
+ metadata:
137
+ allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - '>='
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - '>='
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ requirements: []
153
+ rubyforge_project:
154
+ rubygems_version: 2.0.14
155
+ signing_key:
156
+ specification_version: 4
157
+ summary: Client library for Rollbar API.
158
+ test_files: []