mortise 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/mortise.rb +2 -0
- data/lib/mortise/checker.rb +5 -4
- data/lib/mortise/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c160e80e7d2bf57d71765533222c01bbde05bd2
|
4
|
+
data.tar.gz: 2ab31e586b921e43c1a59fd0dc3a79229a11c5eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5464aa671747bbac28ab54aa5f22f9e84f1ba2b3a47fb7a3be7c2fb2aa8d82eb945a83184ead439462b193bad7c6a58450d5114b1c81ced535ee244e379e6121
|
7
|
+
data.tar.gz: 45aee7b7854f6f834a126c1fbb5c014d590cbf713b5767b125512beef6429570d7603c33d5c17668572ee8e12869470a751dfbd5ef4c52d77b7a22ec34caea9b
|
data/README.md
CHANGED
@@ -65,7 +65,19 @@ The `issues` array contains all issues returned by the checker, but you'll typic
|
|
65
65
|
|
66
66
|
By default, Mortise will query the Tenon.io API at http://tenon.io/api/ but if you're using your own Tenon Enterprise instance you can set its location like this:
|
67
67
|
|
68
|
+
```ruby
|
68
69
|
Mortise.check('http://example.com', 'YOUR-API-KEY', tenon_uri: 'http://yourchecker.com')
|
70
|
+
```
|
71
|
+
|
72
|
+
## Specifying a different Tenon App ID
|
73
|
+
|
74
|
+
By default, Mortise will pass its own identifier on the `appID` parameter, so that Tenon can keep usage stats for Mortise.
|
75
|
+
|
76
|
+
If you want to use a different value, you can override it like this:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
Mortise.check('http://example.com', 'YOUR-API-KEY', tenon_app_id: 'your-app-id')
|
80
|
+
```
|
69
81
|
|
70
82
|
## Development
|
71
83
|
|
data/lib/mortise.rb
CHANGED
data/lib/mortise/checker.rb
CHANGED
@@ -3,7 +3,7 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Mortise
|
5
5
|
class Checker
|
6
|
-
attr_reader :url, :tenon_uri, :key
|
6
|
+
attr_reader :url, :tenon_uri, :key, :tenon_app_id
|
7
7
|
|
8
8
|
def initialize(url, key, options = {})
|
9
9
|
options = defaults.merge(options)
|
@@ -11,7 +11,8 @@ module Mortise
|
|
11
11
|
@url = url
|
12
12
|
@key = key
|
13
13
|
|
14
|
-
@tenon_uri
|
14
|
+
@tenon_uri = options[:tenon_uri]
|
15
|
+
@tenon_app_id = options[:tenon_app_id]
|
15
16
|
end
|
16
17
|
|
17
18
|
def raw
|
@@ -33,7 +34,7 @@ module Mortise
|
|
33
34
|
private
|
34
35
|
|
35
36
|
def defaults
|
36
|
-
{ tenon_uri: 'https://tenon.io/api/' }
|
37
|
+
{ tenon_uri: 'https://tenon.io/api/', tenon_app_id: Mortise::TENON_APP_ID }
|
37
38
|
end
|
38
39
|
|
39
40
|
def response
|
@@ -43,7 +44,7 @@ module Mortise
|
|
43
44
|
end
|
44
45
|
|
45
46
|
def tenon_response
|
46
|
-
@tenon_response ||= HTTParty.post(tenon_uri, body: { url: url, key: key },
|
47
|
+
@tenon_response ||= HTTParty.post(tenon_uri, body: { url: url, key: key, appID: tenon_app_id },
|
47
48
|
headers: { 'Content-Type' => 'application/x-www-form-urlencoded',
|
48
49
|
'Cache-Control' => 'no-cache' })
|
49
50
|
end
|
data/lib/mortise/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mortise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaime Iniesta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.4.5
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Ruby client for the Tenon accessibility checker
|