watchdocs-rails 0.4.6 → 0.5.0

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
  SHA1:
3
- metadata.gz: 6dcf0c065bed8e1747b77e24d2c46070478ed6eb
4
- data.tar.gz: 2c67516e0a5d5f5c9c4dd91cdbcbd53936bed3a2
3
+ metadata.gz: c23ba266af8e362dea8a252ee94b8f14ea674b04
4
+ data.tar.gz: 1ad9a1c35537eef31a26556ce1d3089359c07438
5
5
  SHA512:
6
- metadata.gz: 661a88417ee80260e69213cc9931d46e7c8a2f846729f47e4121570afebd5b1db7421fef8c1763294c4d5fb3fed433aa2f4c7e6dbc67512309af1abf2840b0c8
7
- data.tar.gz: 8ca057ac30025b78599582fccc4fe01ed1942d3c373d36f790eb403ec31f529a811bca82dc0a061384edf34646a59cd108b768df95dd582f26843fca7767c77a
6
+ metadata.gz: 2e8e923956c0d9f084484ea0a91e007ca3f811b71c4f44c1b9dbd4fff2a84386d403e8306bd25ab3ae81e483c132948de4a72f49932cdf34bda9dce30dd9c03b
7
+ data.tar.gz: b4ef7736521736cfa8d7c33c719e04b1772e27d840e7dc81380338af88d239ff5152eec7c2b7388929abf364e1eb32ae9c28f46c2460c9c43f38f8d5626fe4f8
data/.DS_Store CHANGED
Binary file
data/README.md CHANGED
@@ -26,7 +26,9 @@ Create `config/initializers/watchdocs.rb` and configure the gem if you need to c
26
26
  Watchdocs::Rails.configure do |c|
27
27
  c.buffer_size = 50
28
28
  c.temp_directory = 'tmp'
29
- c.export_url = 'http://demo8792890.mockable.io/requests'
29
+ c.export_url = 'https://watchdocs-api.herokuapp.com/api/v1/project/10/reports'
30
+ c.api_key = '8L9qh77q9570H0LIz90Aj00T5mcOHW1w'
31
+ c.api_secret = 'G52uFXHPjyxRY3JdBIsw562uJ8bUdrE2'
30
32
  end
31
33
  ```
32
34
 
@@ -46,9 +48,21 @@ Directory to store temporary file with recordings.
46
48
 
47
49
  ### export_url
48
50
 
49
- **Default:** http://demo8792890.mockable.io/requests
51
+ **Default:** https://watchdocs-api.herokuapp.com/api/v1/project/10/reports
50
52
 
51
- URL for exporting recorgings to your Watchdocs project.
53
+ URL for exporting recorgings to your Watchdocs project. (Change 10 to a random number)
54
+
55
+ ### api_key
56
+
57
+ **Default:** 8L9qh77q9570H0LIz90Aj00T5mcOHW1w
58
+
59
+ API Key which you can get for your Watchdocs project in settings section.
60
+
61
+ ### api_secret
62
+
63
+ **Default:** G52uFXHPjyxRY3JdBIsw562uJ8bUdrE2
64
+
65
+ API Secret which you can get for your Watchdocs project in settings section.
52
66
 
53
67
  ## Usage
54
68
 
@@ -5,12 +5,16 @@ module Watchdocs
5
5
  include Configurations
6
6
  configurable :buffer_size,
7
7
  :temp_directory,
8
- :export_url
8
+ :export_url,
9
+ :api_key,
10
+ :api_secret
9
11
 
10
12
  configuration_defaults do |c|
11
13
  c.buffer_size = 50
12
14
  c.temp_directory = 'tmp'
13
- c.export_url = 'http://demo8792890.mockable.io/requests'
15
+ c.export_url = 'https://watchdocs-api.herokuapp.com/api/v1/project/10/reports'
16
+ c.api_key = '8L9qh77q9570H0LIz90Aj00T5mcOHW1w'
17
+ c.api_secret = 'G52uFXHPjyxRY3JdBIsw562uJ8bUdrE2'
14
18
  end
15
19
  end
16
20
  end
@@ -13,7 +13,8 @@ module Watchdocs
13
13
  response = HTTParty.post(
14
14
  api_url,
15
15
  body: payload.to_json,
16
- headers: { 'Content-Type' => 'application/json' }
16
+ headers: { 'Content-Type' => 'application/json' },
17
+ basic_auth: api_auth
17
18
  )
18
19
  check_response(response)
19
20
  end
@@ -40,6 +41,13 @@ module Watchdocs
40
41
  def api_url
41
42
  Watchdocs::Rails.configuration.export_url
42
43
  end
44
+
45
+ def api_auth
46
+ {
47
+ username: Watchdocs::Rails.configuration.api_key,
48
+ password: Watchdocs::Rails.configuration.api_secret
49
+ }
50
+ end
43
51
  end
44
52
  end
45
53
  end
@@ -1,5 +1,5 @@
1
1
  module Watchdocs
2
2
  module Rails
3
- VERSION = '0.4.6'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchdocs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mazikwyry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler