activerabbit-ai 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe98bc8a7306fc309a569c8f0a92f07b59b262b04f5af662fb4c013adf63d7c6
4
- data.tar.gz: a3a593f4a8915d252134ed45484b89ce46b7947dde9aeb6d88817a439563821d
3
+ metadata.gz: ed92961a01e3d76a2d8fbc3c6eabb41d0a8aa2debb164cbba024eab9039e5ed8
4
+ data.tar.gz: 9eddb39edb4c0cb9ef537a78aacb72a5b69b9f2960200c9275a368ae820720d1
5
5
  SHA512:
6
- metadata.gz: c3a06dc356a466c53cd1bd4c43ec9993a76f97e72a306b18f3ce2d2e96e8b5b10473105ecd2402c5762042a35f44c2c1dad7125a4d7c5031d31c667ba29f41bc
7
- data.tar.gz: 37234153ce001a8c2fba490e398af69d11b85ed51e6a01a3067225f84d04d8dee1ed7ee44b37fa47dbd6054ffb28fd1439204a913e0d3bff56e5fe2fc43eb172
6
+ metadata.gz: 0ec5ff52ecb08dac5ac42224a0d979c37e07b74c4c5fd8d157433cf0319438bd8a08955cee58b57d128edaf467fc7d44d75f743ec4b815e733e5bed130b869af
7
+ data.tar.gz: 0bcbcf89df1dca20667cca88ab9545a11087210e36fc832f534735ad85974eb309f101b6b2207a4154e02e8cc3a1cb29a913f1199eccbe295e4fdf4e0e513de2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # ActiveRabbit::Client
1
+ # ActiveRabbit AI Client
2
2
 
3
- Ruby client library for ActiveRabbit application monitoring and error tracking. This gem provides comprehensive monitoring capabilities including error tracking, performance monitoring, N+1 query detection, and more for Ruby applications, with special focus on Rails integration.
3
+ Ruby client library for ActiveRabbit.ai application monitoring and error tracking. This gem provides comprehensive monitoring capabilities including error tracking, performance monitoring, N+1 query detection, and more for Ruby applications, with special focus on Rails integration.
4
4
 
5
5
  ## Features
6
6
 
@@ -18,7 +18,7 @@ Ruby client library for ActiveRabbit application monitoring and error tracking.
18
18
  Add this line to your application's Gemfile:
19
19
 
20
20
  ```ruby
21
- gem 'active_rabbit-client'
21
+ gem 'activerabbit-ai'
22
22
  ```
23
23
 
24
24
  And then execute:
@@ -27,18 +27,18 @@ And then execute:
27
27
 
28
28
  Or install it yourself as:
29
29
 
30
- $ gem install active_rabbit-client
30
+ $ gem install activerabbit-ai
31
31
 
32
32
  ## Quick Start
33
33
 
34
34
  ### Basic Configuration
35
35
 
36
36
  ```ruby
37
- # config/initializers/active_rabbit.rb
37
+ # config/initializers/activerabbit.rb
38
38
  ActiveRabbit::Client.configure do |config|
39
- config.api_key = ENV['active_rabbit_API_KEY']
40
- config.project_id = ENV['active_rabbit_PROJECT_ID']
41
- config.api_url = ENV.fetch('active_rabbit_API_URL', 'https://api.activerabbit.com')
39
+ config.api_key = ENV['ACTIVERABBIT_API_KEY']
40
+ config.project_id = ENV['ACTIVERABBIT_PROJECT_ID']
41
+ config.api_url = ENV.fetch('ACTIVERABBIT_API_URL', 'https://api.activerabbit.ai')
42
42
  config.environment = Rails.env
43
43
  end
44
44
  ```
@@ -48,10 +48,10 @@ end
48
48
  You can also configure the client using environment variables:
49
49
 
50
50
  ```bash
51
- export active_rabbit_API_KEY="your-api-key"
52
- export active_rabbit_PROJECT_ID="your-project-id"
53
- export active_rabbit_API_URL="https://api.activerabbit.com"
54
- export active_rabbit_ENVIRONMENT="production"
51
+ export ACTIVERABBIT_API_KEY="your-api-key"
52
+ export ACTIVERABBIT_PROJECT_ID="your-project-id"
53
+ export ACTIVERABBIT_API_URL="https://app.activerabbit.ai"
54
+ export ACTIVERABBIT_ENVIRONMENT="production"
55
55
  ```
56
56
 
57
57
  ## Usage
@@ -138,14 +138,14 @@ The gem automatically integrates with Rails when detected:
138
138
 
139
139
  ```ruby
140
140
  class ApplicationController < ActionController::Base
141
- before_action :set_active_rabbit_context
141
+ before_action :set_activerabbit_context
142
142
 
143
143
  private
144
144
 
145
- def set_active_rabbit_context
145
+ def set_activerabbit_context
146
146
  # Additional context can be added to all requests
147
- Thread.current[:active_rabbit_request_context] ||= {}
148
- Thread.current[:active_rabbit_request_context][:user_id] = current_user&.id
147
+ Thread.current[:activerabbit_request_context] ||= {}
148
+ Thread.current[:activerabbit_request_context][:user_id] = current_user&.id
149
149
  end
150
150
  end
151
151
  ```
@@ -310,7 +310,7 @@ bundle exec rspec spec/active_rabbit/client_spec.rb
310
310
 
311
311
  ## Contributing
312
312
 
313
- Bug reports and pull requests are welcome on GitHub at https://github.com/activerabbit/active_rabbit-client.
313
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bugrabbit/active_rabbit-client.
314
314
 
315
315
  ## License
316
316
 
Binary file
@@ -38,6 +38,16 @@ module ActiveRabbit
38
38
  make_request(:post, "api/v1/events/batch", { events: batch_data })
39
39
  end
40
40
 
41
+ def test_connection
42
+ response = make_request(:post, "api/v1/test/connection", {
43
+ gem_version: ActiveRabbit::Client::VERSION,
44
+ timestamp: Time.now.iso8601
45
+ })
46
+ { success: true, data: response }
47
+ rescue => e
48
+ { success: false, error: e.message }
49
+ end
50
+
41
51
  def flush
42
52
  return if @request_queue.empty?
43
53
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRabbit
4
4
  module Client
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -79,6 +79,17 @@ module ActiveRabbit
79
79
  )
80
80
  end
81
81
 
82
+ # Test connection to ActiveRabbit API
83
+ def test_connection
84
+ return { success: false, error: "ActiveRabbit not configured" } unless configured?
85
+
86
+ begin
87
+ http_client.test_connection
88
+ rescue => e
89
+ { success: false, error: e.message }
90
+ end
91
+ end
92
+
82
93
  # Flush any pending events
83
94
  def flush
84
95
  return unless configured?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerabbit-ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Shapalov
@@ -109,6 +109,7 @@ files:
109
109
  - README.md
110
110
  - Rakefile
111
111
  - TESTING_GUIDE.md
112
+ - activerabbit-ai-0.1.1.gem
112
113
  - examples/rails_app_testing.rb
113
114
  - examples/rails_integration.rb
114
115
  - examples/standalone_usage.rb