ratchetio 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Brian Rue
1
+ Copyright (c) 2012 Ratchet, Inc.
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
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.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -22,6 +22,12 @@ Then, run the following command from your rails root:
22
22
 
23
23
  That will create the file `config/initializers/ratchetio.rb`, which holds the configuration values (currently just your access token) and is all you need to use Ratchet.io with Rails.
24
24
 
25
+ To confirm that it worked, run:
26
+
27
+ $ rake ratchetio:test
28
+
29
+ This will raise an exception within a test request; if it works, you'll see a stacktrace in the console, and the exception will appear in the Ratchet.io dashboard.
30
+
25
31
  ## Help / Support
26
32
 
27
33
  If you run into any issues, please email me at brian@ratchet.io
@@ -1,9 +1,10 @@
1
- require 'ratchetio'
2
1
  require 'rails'
2
+ require 'ratchetio'
3
3
 
4
4
  module Ratchetio
5
5
  class Railtie < ::Rails::Railtie
6
6
  rake_tasks do
7
+ require 'ratchetio/rake_tasks'
7
8
  end
8
9
 
9
10
  config.after_initialize do
@@ -0,0 +1,57 @@
1
+ require 'ratchetio'
2
+
3
+ namespace :ratchetio do
4
+ desc "Verify your gem installation by sending a test exception to Ratchet.io"
5
+ task :test => [:environment] do
6
+ Rails.logger = defined?(ActiveSupport::TaggedLogging) ?
7
+ ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) :
8
+ Logger.new(STDOUT)
9
+
10
+ Rails.logger.level = Logger::DEBUG
11
+ Ratchetio.configure do |config|
12
+ config.logger = Rails.logger
13
+ end
14
+
15
+ require './app/controllers/application_controller'
16
+
17
+ class RatchetioTestingException < RuntimeError; end
18
+
19
+ unless Ratchetio.configuration.access_token
20
+ puts "Ratchet.io needs an access token configured. Check the README for instructions."
21
+ exit
22
+ end
23
+
24
+ unless defined?(ApplicationController)
25
+ puts "No ApplicationController found"
26
+ exit
27
+ end
28
+
29
+ puts "Setting up the controller."
30
+ class ApplicationController
31
+ prepend_before_filter :test_ratchetio
32
+ def test_ratchetio
33
+ puts "Raising RatchetioTestingException to simulate app failure."
34
+ raise RatchetioTestingException.new, 'Testing ratchetio with "rake ratchetio:test". If you can see this, it works.'
35
+ end
36
+
37
+ def verify
38
+ end
39
+
40
+ def logger
41
+ nil
42
+ end
43
+ end
44
+
45
+ class RatchetioTestController < ApplicationController; end
46
+
47
+ Rails.application.routes_reloader.execute_if_updated
48
+ Rails.application.routes.draw do
49
+ match 'verify' => 'application#verify', :as => 'verify'
50
+ end
51
+
52
+ puts "Processing..."
53
+ env = Rack::MockRequest.env_for("/verify")
54
+
55
+ Rails.application.call(env)
56
+ end
57
+ end
@@ -1,3 +1,3 @@
1
1
  module Ratchetio
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratchetio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -31,6 +31,7 @@ files:
31
31
  - lib/ratchetio/rails/controller_methods.rb
32
32
  - lib/ratchetio/rails/middleware/exception_catcher.rb
33
33
  - lib/ratchetio/railtie.rb
34
+ - lib/ratchetio/rake_tasks.rb
34
35
  - lib/ratchetio/version.rb
35
36
  - ratchetio.gemspec
36
37
  - spec/ratchetio_spec.rb