caliper 0.0.1 → 0.0.2

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,11 @@
1
+ ## 0.0.3 (unreleased)
2
+
3
+ ## 0.0.2
4
+ - Fixed Bug: Errors were being submitted to Caliper.io when in
5
+ development mode
6
+
7
+ - Fixed Bug: Rails application with engines were not correctly sending
8
+ routes. Disabled until Caliper can support tracing these routes.
9
+
10
+ ## 0.0.1
11
+ Initial Release
@@ -9,7 +9,6 @@ require 'caliper/app_error'
9
9
 
10
10
  require 'caliper_api/http'
11
11
 
12
-
13
12
  if defined? ::Rails
14
13
  if ::Rails::VERSION::MAJOR >= 3
15
14
  require 'caliper/railtie'
@@ -1,6 +1,8 @@
1
1
  module Caliper
2
2
  module AppError
3
3
  def self.create(exception, request_env)
4
+ return unless Caliper.config[:enabled]
5
+
4
6
  req = ::Rack::Request.new(request_env)
5
7
 
6
8
  remote_ip = request_env["action_dispatch.remote_ip"]
@@ -73,7 +73,7 @@ module Caliper
73
73
  def routes(all_routes)
74
74
  routes = collect_routes(all_routes)
75
75
 
76
- routes + routes_for_engines
76
+ routes #+ routes_for_engines
77
77
  end
78
78
 
79
79
  def collect_routes(routes)
@@ -1,3 +1,3 @@
1
1
  module Caliper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'zeus/rails'
2
+
3
+ class CustomPlan < Zeus::Rails
4
+
5
+ # def my_custom_command
6
+ # # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
7
+ # end
8
+
9
+ end
10
+
11
+ Zeus.plan = CustomPlan.new
@@ -44,7 +44,7 @@ class CaliperTest < ActionDispatch::IntegrationTest
44
44
  Caliper.config[:enabled] = true # set it back to enabled for other tests
45
45
  end
46
46
 
47
- test "calling finish and holding exception information in samples" do
47
+ test "posting error when endpoint has an error" do
48
48
  Caliper::AppError.expects(:create)
49
49
 
50
50
  # TODO: Add more tests to ensure sample information is correct
@@ -54,6 +54,17 @@ class CaliperTest < ActionDispatch::IntegrationTest
54
54
  end
55
55
  end
56
56
 
57
+ # enabled is used for having gem enabled in other environments
58
+ test "when not enabled don't post error" do
59
+ Caliper.config[:enabled] = false
60
+ CaliperApi.expects(:create_error).never
61
+
62
+ assert_raise ActionController::RoutingError do
63
+ get "/something_that_does_not_exist"
64
+ end
65
+ Caliper.config[:enabled] = true
66
+ end
67
+
57
68
  test "capturing no route errors" do
58
69
  Caliper::AppError.expects(:create)
59
70
 
@@ -0,0 +1,18 @@
1
+ {
2
+ "command": "ruby -rubygems -r./custom_plan -eZeus.go",
3
+
4
+ "plan": {
5
+ "boot": {
6
+ "default_bundle": {
7
+ "development_environment": {
8
+ "prerake": {"rake": []},
9
+ "console": ["c"],
10
+ "server": ["s"]
11
+ },
12
+ "test_environment": {
13
+ "test_helper": {"test": ["rspec", "testrb"]}
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: caliper
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kalvir Sandhu
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-29 00:00:00.000000000 Z
12
+ date: 2013-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  version_requirements: !ruby/object:Gem::Requirement
@@ -115,6 +115,7 @@ extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
117
  - .gitignore
118
+ - CHANGELOG.md
118
119
  - Gemfile
119
120
  - LICENSE.txt
120
121
  - README.md
@@ -166,6 +167,7 @@ files:
166
167
  - spec/dummy/config/initializers/wrap_parameters.rb
167
168
  - spec/dummy/config/locales/en.yml
168
169
  - spec/dummy/config/routes.rb
170
+ - spec/dummy/custom_plan.rb
169
171
  - spec/dummy/db/migrate/20121203233624_create_posts.rb
170
172
  - spec/dummy/db/schema.rb
171
173
  - spec/dummy/db/seeds.rb
@@ -186,6 +188,7 @@ files:
186
188
  - spec/dummy/vendor/assets/javascripts/.gitkeep
187
189
  - spec/dummy/vendor/assets/stylesheets/.gitkeep
188
190
  - spec/dummy/vendor/plugins/.gitkeep
191
+ - spec/dummy/zeus.json
189
192
  - spec/spec_helper.rb
190
193
  homepage: http://caliper.io
191
194
  licenses: []
@@ -247,6 +250,7 @@ test_files:
247
250
  - spec/dummy/config/initializers/wrap_parameters.rb
248
251
  - spec/dummy/config/locales/en.yml
249
252
  - spec/dummy/config/routes.rb
253
+ - spec/dummy/custom_plan.rb
250
254
  - spec/dummy/db/migrate/20121203233624_create_posts.rb
251
255
  - spec/dummy/db/schema.rb
252
256
  - spec/dummy/db/seeds.rb
@@ -267,4 +271,5 @@ test_files:
267
271
  - spec/dummy/vendor/assets/javascripts/.gitkeep
268
272
  - spec/dummy/vendor/assets/stylesheets/.gitkeep
269
273
  - spec/dummy/vendor/plugins/.gitkeep
274
+ - spec/dummy/zeus.json
270
275
  - spec/spec_helper.rb