informant-sinatra 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02f27a46d2c36eb6ddc7b96a0cf1562877ffbf2b287bce94c3e4472417281f04
4
- data.tar.gz: d2e4052d06c13b35016fec533114cc4061cf917766274d2d2ea07291dafab28f
3
+ metadata.gz: e44462144eac6b2daa31346f129806d256457490786457c3e91d6fd7e750ee2d
4
+ data.tar.gz: 608c620667d34536e8735e7d0c7cf9f42093ee167557c5c2cfb72be1c4244170
5
5
  SHA512:
6
- metadata.gz: 4df3eff5e97481b98e355b12047f3faae1c97e9ba9aa858bb93b00c0f181ac7e28fc3a46e4a01f321245237c81595338ee7c49243b404302200ae239ba5348d5
7
- data.tar.gz: 5fb9ac00ca156dfcb81c45dc60cef3289fe46fe0565578bd2e550be1854ac9ae93bdaff2614356da2aa36b9771caad0184e52d19c7ccbd669c5f5d15abbd8067
6
+ metadata.gz: d10660a1314fcff28d4378eda18a39eac22e3867e576037dfeaf4f8f4809ce036556853367b93e60550150e9b626a3a0c3cb7f946902c0a0d83e4ed6ba7bb0f1
7
+ data.tar.gz: 17e34af9c913ee4babf7c383c8fa5f024f4a46c8af0bd750e2ab70c4ed6aa6b1d6642b92002da4dc0da3565b57e0a6b68ea00d2f180f1bf5ec43480c04ba3ded
data/README.md CHANGED
@@ -15,9 +15,7 @@ validation tracking for ActiveRecord and Mongoid models.
15
15
 
16
16
  ## Installation
17
17
 
18
- 1. Sign up for an account on https://www.informantapp.com or through one of our
19
- parters, [Heroku](https://dashboard.heroku.com) or
20
- [Manifold](https://manifold.co).
18
+ 1. Sign up for an account on https://www.informantapp.com or through [Heroku](https://dashboard.heroku.com).
21
19
  2. Add the `informant-sinatra` gem to your `Gemfile`.
22
20
 
23
21
  ```
@@ -35,6 +33,10 @@ validation tracking for ActiveRecord and Mongoid models.
35
33
  5. Deploy with the gem installed.
36
34
  6. Submit a form and you'll see it appear in [our web interface](https://console.informantapp.com).
37
35
 
36
+ We've set up
37
+ [informant-sinatra-example](https://gitlab.com/informantapp/informant-sinatra-example)
38
+ as a demonstrate of installation and operation.
39
+
38
40
  ## Troubleshooting
39
41
 
40
42
  The Informant gem includes a rake task to diagnose connectivity problems. From
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
- if !ENV['APPRAISAL_INITIALIZED']
2
- require 'appraisal/task'
3
- Appraisal::Task.new
4
- task default: :appraisal
5
- else
1
+ if ENV['APPRAISAL_INITIALIZED']
6
2
  require 'rspec/core/rake_task'
7
3
  RSpec::Core::RakeTask.new
8
4
  task default: :spec
5
+ else
6
+ require 'appraisal/task'
7
+ Appraisal::Task.new
8
+ task default: :appraisal
9
9
  end
@@ -1,7 +1,7 @@
1
1
  module InformantSinatra
2
2
  module Bootstrap
3
3
  def self.registered(app)
4
- return unless InformantCommon::Config.enabled?
4
+ return unless InformantSinatra::Config.enabled?
5
5
 
6
6
  transmit_agent_info
7
7
 
@@ -8,6 +8,10 @@ module InformantSinatra
8
8
  InformantCommon::Config.api_token = api_token
9
9
  end
10
10
 
11
+ def self.enabled?
12
+ InformantCommon::Config.enabled?
13
+ end
14
+
11
15
  def self.exclude_models
12
16
  InformantCommon::Config.exclude_models
13
17
  end
@@ -5,11 +5,11 @@ module InformantSinatra
5
5
  end
6
6
 
7
7
  def run
8
- if Config.api_token.nil? || Config.api_token == ''
9
- puts missing_api_token_message
10
- else
8
+ if Config.enabled?
11
9
  response = InformantCommon::Client.transmit(test_form_submission).join.value
12
10
  display_response_message(response)
11
+ else
12
+ puts missing_api_token_message
13
13
  end
14
14
 
15
15
  puts assistance_message
@@ -46,7 +46,12 @@ module InformantSinatra
46
46
  def test_form_submission
47
47
  InformantCommon::Event::FormSubmission.new.tap do |form_submission|
48
48
  form_submission.handler = 'Connectivity#test'
49
- form_submission.process_model(InformantCommon::Model::ActiveModel.new(TestClass.new.tap(&:valid?)))
49
+ form_submission.process_model(
50
+ InformantCommon::Model::Base.new(
51
+ name: 'TestClass',
52
+ field_errors: [InformantCommon::FieldError.new('field_name', nil, "can't be blank")]
53
+ )
54
+ )
50
55
  end
51
56
  end
52
57
 
@@ -1,3 +1,3 @@
1
1
  module InformantSinatra
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'informant-sinatra'
2
+ require 'json'
2
3
 
3
4
  namespace :informant do
4
5
  desc 'Verify connectivity from your app to Informant'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: informant-sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Informant, LLC
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-31 00:00:00.000000000 Z
11
+ date: 2021-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: informant-common
@@ -73,7 +73,7 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: rubocop
76
+ name: rubocop-rspec
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
@@ -123,7 +123,7 @@ homepage: https://www.informantapp.com
123
123
  licenses:
124
124
  - MIT
125
125
  metadata: {}
126
- post_install_message:
126
+ post_install_message:
127
127
  rdoc_options: []
128
128
  require_paths:
129
129
  - lib
@@ -131,15 +131,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: '0'
134
+ version: 2.6.0
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.0.3
142
- signing_key:
141
+ rubygems_version: 3.1.6
142
+ signing_key:
143
143
  specification_version: 4
144
144
  summary: The Informant tracks server-side validation errors and gives you metrics
145
145
  you never dreamed of.