rackdog-agent 0.0.1

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: d6cd843af13cdd8a94ac4d88e097916700e6f8ed
4
+ data.tar.gz: e65aa598f3a89cbbcf4030e408bcff8732563eac
5
+ SHA512:
6
+ metadata.gz: e766cf4f4bee97614018e79322f43cb3025fec39fb8359a8703b6231b5f475d1d3da4adea15c2429bfcb50cbd9a7221d1fcca848527da0ddc4bbe2d13b901037
7
+ data.tar.gz: a6af4cbf2bd24fb98ad76168c9bf206258a3e3ac1c391febcc1730df96b75e1ebd635ae2a97fc1240b21ad4dcaeb62cc909613485f2dbf4624f9e150a216f0b1
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .idea
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Alexander Ablayev
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ <<<<<<< HEAD
2
+ # Rackdog::Agent
3
+
4
+ Rackdog is a self-hosted solution for rails app exceptions monitoring.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'rackdog-agent'
11
+
12
+ And then execute:
13
+
14
+ $ bundle install
15
+
16
+ ## Configuration
17
+
18
+ Run rails generator:
19
+
20
+ $ rails g rackdog:install
21
+
22
+ This generator will provide Rackdog initilizer:
23
+
24
+ config/initializers/rackdog.rb
25
+
26
+ You need to provide 2 options there:
27
+
28
+ - **host** - rackdog-server address
29
+ - **token** - token for current application
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it ( https://github.com/[my-github-username]/rackdog-agent/fork )
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create a new Pull Request
38
+ =======
39
+ rackdog-agent
40
+ =============
41
+
42
+ rackdog-agent
43
+ >>>>>>> 3909cbc3b5cc43e322b996b497d9d857274b4fe6
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,9 @@
1
+ module Rackdog
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../../templates', __FILE__)
4
+ desc 'Creates Rackdog initializer for your application'
5
+ def copy_initializer
6
+ template 'rackdog.rb', 'config/initializers/rackdog.rb'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ Rackdog::Agent.configure do |config|
2
+ config.host = 'http://localhost:3000/'
3
+ config.token = 'abcdefg'
4
+ end
@@ -0,0 +1,26 @@
1
+ require 'rackdog/agent/version'
2
+ require 'rackdog/agent/railtie' if defined? Rails
3
+ require 'rackdog/agent/middleware'
4
+ require 'rackdog/agent/reporter'
5
+
6
+ module Rackdog
7
+ module Agent
8
+
9
+ class << self
10
+ attr_accessor :configuration
11
+ end
12
+
13
+ def self.configure
14
+ self.configuration ||= Configuration.new
15
+ yield configuration
16
+ end
17
+
18
+ class Configuration
19
+ attr_accessor :host, :token
20
+ # def initialize
21
+ # @option = 'default_option'
22
+ # end
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ module Rackdog
2
+ module Agent
3
+ class Middleware
4
+ def initialize(app)
5
+ @app = app
6
+ end
7
+
8
+ def call(env)
9
+ @app.call(env)
10
+ rescue => exception
11
+ Rackdog::Agent::Reporter.exception exception
12
+ raise exception
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ module Rackdog
2
+ module Agent
3
+ class Railtie < Rails::Railtie
4
+ initializer 'rackdog_agent.configure_rails_initialization' do
5
+ Rails.application.middleware.use Rackdog::Agent::Middleware
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ module Rackdog
2
+ module Agent
3
+ class Reporter
4
+ def self.exception exception
5
+ uri = URI.parse "#{Rackdog::Agent.configuration.host}reporter"
6
+ http = Net::HTTP.new uri.host, uri.port
7
+ request = Net::HTTP::Post.new uri.request_uri
8
+ request['Content-Type'] = 'application/json'
9
+ request.set_form_data({token: Rackdog::Agent.configuration.token, exception: exception.message, backtrace: exception.backtrace.to_json})
10
+ http.request(request)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ module Rackdog
2
+ module Agent
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rackdog/agent/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'rackdog-agent'
8
+ spec.version = Rackdog::Agent::VERSION
9
+ spec.authors = ['Alexander Ablayev']
10
+ spec.email = ['a.ablayev@gmail.com']
11
+ spec.summary = %q(Short summary. Required.)
12
+ spec.description = %q(Longer description. Optional.)
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.6'
22
+ spec.add_development_dependency 'rake'
23
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rackdog-agent
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Ablayev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-05 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.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Longer description. Optional.
42
+ email:
43
+ - a.ablayev@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/generators/rackdog/install_generator.rb
54
+ - lib/generators/templates/rackdog.rb
55
+ - lib/rackdog/agent.rb
56
+ - lib/rackdog/agent/middleware.rb
57
+ - lib/rackdog/agent/railtie.rb
58
+ - lib/rackdog/agent/reporter.rb
59
+ - lib/rackdog/agent/version.rb
60
+ - rackdog-agent.gemspec
61
+ homepage: ''
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.2.2
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Short summary. Required.
85
+ test_files: []