ship_shape 0.1.5

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NGZkMDE0M2RhY2ZmMWQyYmEzNGZmY2M3MTcwNzU4OWQ0ZDZjY2Y4MA==
5
+ data.tar.gz: !binary |-
6
+ OWJiZWRiZThlYjViNDAxYmFiMmNlODE4ZTEyMzRlNzlhZmU4ZjIwOA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OWM3Nzk3ZjgzYmJkN2U0ZDgwODZiYjUwMWU1ZWI4ZDBiYzZlZTc1ZmM2Yjk1
10
+ YjY5MGViMjYwNTY4YWUwMWM4ZmM1MGJmZDhkOGEwYmNiMTc1ZDUyNWMyNzll
11
+ Zjg4M2ViYjE0MzEwNjVmN2IwNDdjZTFhYmVhMmE4OTBiMGExZTk=
12
+ data.tar.gz: !binary |-
13
+ NGNiYjZjYWZmOTFiNWM3N2I1MzEzMzgyNjI4MzVlOGMwOGMzYWJhMzhiN2M3
14
+ MjYyOWU5OGRhNzc2NzZkMDNhNDA0MGNkZmY0YWY1NzFmZGYxYzg1ZDVmNWYz
15
+ ZmMzYzdhYjY5ZTQwNTgwZTBkNzMxYTM3OGU1MGQzZmEwZDFjNmY=
data/lib/ship.rb ADDED
@@ -0,0 +1,29 @@
1
+ class Ship
2
+ @@exception_reporting_enabled = false
3
+ @@api_url = ""
4
+ @@license = ""
5
+ class_attribute :license
6
+ class_attribute :api_url
7
+ class_attribute :exception_reporting_enabled
8
+ def self.config(exception_reporting_enabled, api_url, license)
9
+ self.license = license
10
+ self.api_url = api_url
11
+ self.exception_reporting_enabled = exception_reporting_enabled
12
+ end
13
+
14
+ def self.handle_exception(e,env)
15
+ if self.exception_reporting_enabled
16
+ params = {:message => e.message, :trace => e.backtrace.to_s, :error_type => e.class.to_s}
17
+ url = "#{self.api_url}/#{self.license}/"
18
+ RestClient.post "#{self.api_url}/#{self.license}/skirmish/new",
19
+ params
20
+ end
21
+ end
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+ end
@@ -0,0 +1,17 @@
1
+ require "ship"
2
+ class ShipMiddleware
3
+ def initialize(app)
4
+ @app = app
5
+ end
6
+
7
+ def call(env)
8
+ #do something here
9
+ @app.call(env)
10
+
11
+ rescue StandardError => e
12
+ puts e
13
+ Ship.handle_exception(e,env)
14
+ raise e
15
+
16
+ end
17
+ end
data/lib/ship_shape.rb ADDED
@@ -0,0 +1,7 @@
1
+ module ShipShape
2
+ #def self.hi
3
+ # puts "Hello world!"
4
+ #end
5
+
6
+ end
7
+ require_relative '../railtie' if defined?(Rails)
data/railtie.rb ADDED
@@ -0,0 +1,9 @@
1
+ require_relative "../ship_shape/lib/ship_middleware"
2
+ module ShipShape
3
+ class Railtie < Rails::Railtie
4
+ initializer "armada.configure_rails_initialization" do
5
+ Rails.application.middleware.use ShipMiddleware
6
+ end
7
+
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ship_shape
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
+ platform: ruby
6
+ authors:
7
+ - Jessiah Ratliff
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Keep your fleet afloat!
14
+ email: jessiahr@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/ship_shape.rb
20
+ - railtie.rb
21
+ - lib/ship_middleware.rb
22
+ - lib/ship.rb
23
+ homepage: http://rubygems.org/gems/ship_shape
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.1.10
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Ship Shape
47
+ test_files: []