codeclimate-services 1.9.7 → 1.9.8

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: d335e785112de10c1ca27413100d2624c373f911
4
- data.tar.gz: b66f6c1ca29ec76b6e5d951e8e024fa560990568
3
+ metadata.gz: cd62622c4effd89f89c9285ec07b7cd2798148b5
4
+ data.tar.gz: 746d956aa4ffe90f01b60b138189f3470d0aa824
5
5
  SHA512:
6
- metadata.gz: eca2b1994c1d9916108a743faff0dd4f16e754f2554d70fb42ffff73259a36565e36ff7412621dcc1a615bdb81367860bcecab4a0042f2f4b826850905610609
7
- data.tar.gz: 50fca613d93497132f2b79c2ccb3ced9dc6cd323df1d26a9626b5331e67b7961d74f6beb885d6ae9b7400660e3455dc2bad08cc0bf7b6ceddfdc33b605de762a
6
+ metadata.gz: e5c2d4cb11d2af026062570d9d7d2cdba70c301fb8f82058538af93c5dae4d5b22d571fe697d3ceb015434770236d6f8e9befbc7f92a4605a01b3092de374ded
7
+ data.tar.gz: 13adce202c161bed06e78f28439e375834135b365e307234e5f45f1ccdd0c280d5716aa59ec218452968b2c2f4b0bd4d3c9411f5c75a05a8159267e803afc1f6
@@ -0,0 +1,7 @@
1
+ class Axiom::Types::Token < Axiom::Types::String
2
+ def self.infer(object)
3
+ if object == Axiom::Types::Token
4
+ self
5
+ end
6
+ end
7
+ end
data/lib/cc/service.rb CHANGED
@@ -6,6 +6,7 @@ module CC
6
6
  require "cc/service/formatter"
7
7
  require "cc/service/invocation"
8
8
  require "axiom/types/password"
9
+ require "axiom/types/token"
9
10
 
10
11
  dir = File.expand_path "../helpers", __FILE__
11
12
  Dir["#{dir}/*_helper.rb"].sort.each do |helper|
@@ -1,7 +1,7 @@
1
1
  class CC::Service::Asana < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :personal_access_token, Axiom::Types::String, label: "Personal Access Token"
4
- attribute :api_key, Axiom::Types::String, label: "API key (Deprecated)"
3
+ attribute :personal_access_token, Axiom::Types::Token, label: "Personal Access Token"
4
+ attribute :api_key, Axiom::Types::Token, label: "API key (Deprecated)"
5
5
 
6
6
  attribute :workspace_id, Axiom::Types::String, label: "Workspace ID"
7
7
 
@@ -2,7 +2,7 @@ class CC::Service::Campfire < CC::Service
2
2
  class Config < CC::Service::Config
3
3
  attribute :subdomain, Axiom::Types::String,
4
4
  description: "The Campfire subdomain for the account"
5
- attribute :token, Axiom::Types::String,
5
+ attribute :token, Axiom::Types::Token,
6
6
  description: "Your Campfire API auth token"
7
7
  attribute :room_id, Axiom::Types::String,
8
8
  description: "Check your campfire URL for a room ID. Usually 6 digits."
@@ -1,6 +1,6 @@
1
1
  class CC::Service::Flowdock < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :api_token, Axiom::Types::String,
3
+ attribute :api_token, Axiom::Types::Token,
4
4
  label: "API Token",
5
5
  description: "The API token of the Flow to send notifications to",
6
6
  link: "https://www.flowdock.com/account/tokens"
@@ -1,6 +1,6 @@
1
1
  class CC::Service::GitHubIssues < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :oauth_token, Axiom::Types::String,
3
+ attribute :oauth_token, Axiom::Types::Token,
4
4
  label: "OAuth Token",
5
5
  description: "A personal OAuth token with permissions for the repo"
6
6
  attribute :project, Axiom::Types::String,
@@ -2,7 +2,7 @@ require "cc/presenters/pull_requests_presenter"
2
2
 
3
3
  class CC::Service::GitHubPullRequests < CC::PullRequests
4
4
  class Config < CC::Service::Config
5
- attribute :oauth_token, Axiom::Types::String,
5
+ attribute :oauth_token, Axiom::Types::Token,
6
6
  label: "OAuth Token",
7
7
  description: "A personal OAuth token with permissions for the repo."
8
8
  attribute :base_url, Axiom::Types::String,
@@ -4,7 +4,7 @@ class CC::Service::GitlabMergeRequests < CC::PullRequests
4
4
  class Config < CC::Service::Config
5
5
  CONTEXT = "codeclimate".freeze
6
6
 
7
- attribute :access_token, Axiom::Types::String,
7
+ attribute :access_token, Axiom::Types::Token,
8
8
  label: "Access Token",
9
9
  description: "A personal access token with permissions for the repo."
10
10
  attribute :base_url, Axiom::Types::String,
@@ -1,6 +1,6 @@
1
1
  class CC::Service::HipChat < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :auth_token, Axiom::Types::String,
3
+ attribute :auth_token, Axiom::Types::Token,
4
4
  description: "Your HipChat API auth token"
5
5
 
6
6
  attribute :room_id, Axiom::Types::String,
@@ -3,7 +3,7 @@ class CC::Service::Lighthouse < CC::Service
3
3
  attribute :subdomain, Axiom::Types::String,
4
4
  description: "Your Lighthouse subdomain"
5
5
 
6
- attribute :api_token, Axiom::Types::String,
6
+ attribute :api_token, Axiom::Types::Token,
7
7
  label: "API Token",
8
8
  description: "Your Lighthouse API Key (http://help.lighthouseapp.com/kb/api/how-do-i-get-an-api-token)"
9
9
 
@@ -1,6 +1,6 @@
1
1
  class CC::Service::PivotalTracker < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :api_token, Axiom::Types::String,
3
+ attribute :api_token, Axiom::Types::Token,
4
4
  description: "Your Pivotal Tracker API Token, from your profile page"
5
5
 
6
6
  attribute :project_id, Axiom::Types::String,
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Services
3
- VERSION = "1.9.7".freeze
3
+ VERSION = "1.9.8".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,14 @@
1
+ describe Axiom::Types::Token do
2
+ class TestConfiguration < CC::Service::Config
3
+ attribute :token_attribute, Token
4
+ attribute :str_attribute, String
5
+ end
6
+
7
+ it "token type inference" do
8
+ expect(Axiom::Types::Token).to eq(TestConfiguration.attribute_set[:token_attribute].type)
9
+ end
10
+
11
+ it "string type inference" do
12
+ expect(Axiom::Types::String).to eq(TestConfiguration.attribute_set[:str_attribute].type)
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.7
4
+ version: 1.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-03 00:00:00.000000000 Z
11
+ date: 2017-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -149,6 +149,7 @@ files:
149
149
  - config/cacert.pem
150
150
  - config/load.rb
151
151
  - lib/axiom/types/password.rb
152
+ - lib/axiom/types/token.rb
152
153
  - lib/cc/formatters/linked_formatter.rb
153
154
  - lib/cc/formatters/plain_formatter.rb
154
155
  - lib/cc/formatters/snapshot_formatter.rb
@@ -190,6 +191,7 @@ files:
190
191
  - pull_request_test.rb
191
192
  - service_test.rb
192
193
  - spec/axiom/types/password_spec.rb
194
+ - spec/axiom/types/token_spec.rb
193
195
  - spec/cc/formatters/snapshot_formatter_spec.rb
194
196
  - spec/cc/presenters/pull_requests_presenter_spec.rb
195
197
  - spec/cc/resolve_spec.rb
@@ -242,6 +244,7 @@ specification_version: 4
242
244
  summary: Service classes for Code Climate
243
245
  test_files:
244
246
  - spec/axiom/types/password_spec.rb
247
+ - spec/axiom/types/token_spec.rb
245
248
  - spec/cc/formatters/snapshot_formatter_spec.rb
246
249
  - spec/cc/presenters/pull_requests_presenter_spec.rb
247
250
  - spec/cc/resolve_spec.rb