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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49e66b80ab1833e48468b3c0dbe6b64909397c73
4
- data.tar.gz: e238f828e3bba07e3ed7f1189653cd94ba37a7c4
3
+ metadata.gz: 1c160e80e7d2bf57d71765533222c01bbde05bd2
4
+ data.tar.gz: 2ab31e586b921e43c1a59fd0dc3a79229a11c5eb
5
5
  SHA512:
6
- metadata.gz: 47b508e119a6c467a499bc9d08bb7391ecc4b4eb706b8bea2accd079a667de98806366929a25ac7f138db9980f6137816e0a3c448109452a82cb71aa16f26898
7
- data.tar.gz: 6eea1ed441e99f33fe111048e8d61dc83e4803865c5878585c5be76ad71d89e5f09ba2211e305429b9d313960a347bd5ca603a93317d7df93012a222bb86948e
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
 
@@ -4,6 +4,8 @@ require "mortise/issue"
4
4
  require "mortise/errors"
5
5
 
6
6
  module Mortise
7
+ TENON_APP_ID = '490866e2ad3b501842cef0569e4c0ee0'
8
+
7
9
  def self.check(url, key, options = {})
8
10
  Mortise::Checker.new(url, key, options)
9
11
  end
@@ -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 = options[: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
@@ -1,3 +1,3 @@
1
1
  module Mortise
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-21 00:00:00.000000000 Z
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.2.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