codeclimate-services 0.6.1 → 0.6.2

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: 7ab95a199e23c8ea5ec3e08e43feb92198fa59ab
4
- data.tar.gz: 19da981dc308bd704faf700938dd1379665a092b
3
+ metadata.gz: a54f744a90038f57b0394f3fd4d98be62ab52ffa
4
+ data.tar.gz: dc870ec854172e950e2cb7eb9ebfd932f073236a
5
5
  SHA512:
6
- metadata.gz: 46e2ca4b77e147074f6a274fd15f2266009e7d229fed6b27f778ea1e2e23a3616cbcd8202ba813bb0e31c26df5bf0c019b10f2878b910e317eb9f94a83282af9
7
- data.tar.gz: 96fa02d19dad4b5ccbc4a3f2854d6fd552dbac25ce0e80123d2f6dc0f4f851887c4b3edfa1f945abf91c80f26bd398c299b07face264b92410aa49ef35d154c4
6
+ metadata.gz: c7e8ee7f277ff54a9e9d77dbfc0268b1b5cc4bced5512594ce75d0448f6a98c501039a3f02cc00d0a1bf448f233c9fb08bc2363336414fe001283987313c3171
7
+ data.tar.gz: 2e2c7ac2be8a98a00977860623b5523de21f1078a21368e673ca6bc32943bbbb5dde377037063160e09692576e94a9a396ee776a5ff5486e4eb05d7eea96454f
@@ -1,13 +1,13 @@
1
1
  class CC::Service::Asana < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :api_key, String, label: "API key"
3
+ attribute :api_key, Axiom::Types::String, label: "API key"
4
4
 
5
- attribute :workspace_id, String, label: "Workspace ID"
5
+ attribute :workspace_id, Axiom::Types::String, label: "Workspace ID"
6
6
 
7
- attribute :project_id, String, label: "Project ID",
7
+ attribute :project_id, Axiom::Types::String, label: "Project ID",
8
8
  description: "(optional)"
9
9
 
10
- attribute :assignee, String, label: "Assignee",
10
+ attribute :assignee, Axiom::Types::String, label: "Assignee",
11
11
  description: "Assignee email address (optional)"
12
12
 
13
13
  validates :api_key, presence: true
@@ -1,10 +1,10 @@
1
1
  class CC::Service::Campfire < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :subdomain, String,
3
+ attribute :subdomain, Axiom::Types::String,
4
4
  description: "The Campfire subdomain for the account"
5
- attribute :token, String,
5
+ attribute :token, Axiom::Types::String,
6
6
  description: "Your Campfire API auth token"
7
- attribute :room_id, String,
7
+ attribute :room_id, Axiom::Types::String,
8
8
  description: "Check your campfire URL for a room ID. Usually 6 digits."
9
9
 
10
10
  validates :subdomain, presence: true
@@ -1,6 +1,6 @@
1
1
  class CC::Service::Flowdock < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :api_token, String,
3
+ attribute :api_token, Axiom::Types::String,
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,15 +1,15 @@
1
1
  class CC::Service::GitHubIssues < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :oauth_token, String,
3
+ attribute :oauth_token, Axiom::Types::String,
4
4
  label: "OAuth Token",
5
5
  description: "A personal OAuth token with permissions for the repo"
6
- attribute :project, String,
6
+ attribute :project, Axiom::Types::String,
7
7
  label: "Project",
8
8
  description: "Project name on GitHub (e.g 'thoughtbot/paperclip')"
9
- attribute :labels, String,
9
+ attribute :labels, Axiom::Types::String,
10
10
  label: "Labels (comma separated)",
11
11
  description: "Comma separated list of labels to apply to the issue"
12
- attribute :base_url, String,
12
+ attribute :base_url, Axiom::Types::String,
13
13
  label: "Github API Base URL",
14
14
  description: "Base URL for the Github API",
15
15
  default: "https://api.github.com"
@@ -2,20 +2,20 @@ require "cc/presenters/pull_requests_presenter"
2
2
 
3
3
  class CC::Service::GitHubPullRequests < CC::Service
4
4
  class Config < CC::Service::Config
5
- attribute :oauth_token, String,
5
+ attribute :oauth_token, Axiom::Types::String,
6
6
  label: "OAuth Token",
7
7
  description: "A personal OAuth token with permissions for the repo."
8
- attribute :update_status, Boolean,
8
+ attribute :update_status, Axiom::Types::Boolean,
9
9
  label: "Update status?",
10
10
  description: "Update the pull request status after analyzing?"
11
- attribute :add_comment, Boolean,
11
+ attribute :add_comment, Axiom::Types::Boolean,
12
12
  label: "Add a comment?",
13
13
  description: "Comment on the pull request after analyzing?"
14
- attribute :base_url, String,
14
+ attribute :base_url, Axiom::Types::String,
15
15
  label: "Github API Base URL",
16
16
  description: "Base URL for the Github API",
17
17
  default: "https://api.github.com"
18
- attribute :context, String,
18
+ attribute :context, Axiom::Types::String,
19
19
  label: "Github Context",
20
20
  description: "The integration name next to the pull request status",
21
21
  default: "codeclimate"
@@ -1,12 +1,12 @@
1
1
  class CC::Service::HipChat < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :auth_token, String,
3
+ attribute :auth_token, Axiom::Types::String,
4
4
  description: "Your HipChat API auth token"
5
5
 
6
- attribute :room_id, String,
6
+ attribute :room_id, Axiom::Types::String,
7
7
  description: "The ID or name of the HipChat chat room to send notifications to"
8
8
 
9
- attribute :notify, Boolean, default: false,
9
+ attribute :notify, Axiom::Types::Boolean, default: false,
10
10
  description: "Should we trigger a notification for people in the room?"
11
11
 
12
12
  validates :auth_token, presence: true
@@ -2,20 +2,20 @@ require 'base64'
2
2
 
3
3
  class CC::Service::Jira < CC::Service
4
4
  class Config < CC::Service::Config
5
- attribute :domain, String,
5
+ attribute :domain, Axiom::Types::String,
6
6
  description: "Your JIRA host domain (e.g. yourjira.com:PORT, please exclude https://)"
7
7
 
8
- attribute :username, String,
8
+ attribute :username, Axiom::Types::String,
9
9
  description: "Must exactly match the 'username' that appears on your JIRA profile page."
10
10
 
11
- attribute :password, Password,
11
+ attribute :password, Axiom::Types::Password,
12
12
  label: "JIRA password",
13
13
  description: "Your JIRA password"
14
14
 
15
- attribute :project_id, String,
15
+ attribute :project_id, Axiom::Types::String,
16
16
  description: "Your JIRA project ID number (located in your JIRA admin panel). Project must support 'task' issue types and contain only the default required fields."
17
17
 
18
- attribute :labels, String,
18
+ attribute :labels, Axiom::Types::String,
19
19
  description: "Which labels to add to issues, comma delimited"
20
20
 
21
21
  validates :domain, presence: true
@@ -1,16 +1,16 @@
1
1
  class CC::Service::Lighthouse < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :subdomain, String,
3
+ attribute :subdomain, Axiom::Types::String,
4
4
  description: "Your Lighthouse subdomain"
5
5
 
6
- attribute :api_token, String,
6
+ attribute :api_token, Axiom::Types::String,
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
 
10
- attribute :project_id, String,
10
+ attribute :project_id, Axiom::Types::String,
11
11
  description: "Your Lighthouse project ID. You can find this from the URL to your Lighthouse project."
12
12
 
13
- attribute :tags, String,
13
+ attribute :tags, Axiom::Types::String,
14
14
  description: "Which tags to add to tickets, comma delimited"
15
15
 
16
16
  validates :subdomain, presence: true
@@ -1,12 +1,12 @@
1
1
  class CC::Service::PivotalTracker < CC::Service
2
2
  class Config < CC::Service::Config
3
- attribute :api_token, String,
3
+ attribute :api_token, Axiom::Types::String,
4
4
  description: "Your Pivotal Tracker API Token, from your profile page"
5
5
 
6
- attribute :project_id, String,
6
+ attribute :project_id, Axiom::Types::String,
7
7
  description: "Your Pivotal Tracker project ID"
8
8
 
9
- attribute :labels, String,
9
+ attribute :labels, Axiom::Types::String,
10
10
  label: "Labels (comma separated)",
11
11
  description: "Comma separated list of labels to apply to the story"
12
12
 
@@ -4,11 +4,11 @@ class CC::Service::Slack < CC::Service
4
4
  include CC::Service::QualityHelper
5
5
 
6
6
  class Config < CC::Service::Config
7
- attribute :webhook_url, String,
7
+ attribute :webhook_url, Axiom::Types::String,
8
8
  label: "Webhook URL",
9
9
  description: "The Slack webhook URL you would like message posted to"
10
10
 
11
- attribute :channel, String,
11
+ attribute :channel, Axiom::Types::String,
12
12
  description: "The channel to send to (optional). Enter # before the channel name."
13
13
  end
14
14
 
@@ -3,10 +3,10 @@ require "cc/presenters/pull_requests_presenter"
3
3
 
4
4
  class CC::Service::StashPullRequests < CC::Service
5
5
  class Config < CC::Service::Config
6
- attribute :domain, String,
6
+ attribute :domain, Axiom::Types::String,
7
7
  description: "Your Stash host domain (e.g. yourstash.com:PORT, please exclude https://)"
8
- attribute :username, String
9
- attribute :password, Password
8
+ attribute :username, Axiom::Types::String
9
+ attribute :password, Axiom::Types::Password
10
10
 
11
11
  validates :domain, presence: true
12
12
  validates :username, presence: true
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Services
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end
5
5
  end
@@ -279,6 +279,18 @@ class TestGitHubPullRequests < CC::Service::TestCase
279
279
  })
280
280
  end
281
281
 
282
+ def test_config_coerce_bool_true
283
+ c = CC::Service::GitHubPullRequests::Config.new(oauth_token: "a1b2c3", add_comment: "1")
284
+ assert c.valid?
285
+ assert_equal true, c.add_comment
286
+ end
287
+
288
+ def test_config_coerce_bool_false
289
+ c = CC::Service::GitHubPullRequests::Config.new(oauth_token: "a1b2c3", add_comment: "0")
290
+ assert c.valid?
291
+ assert_equal false, c.add_comment
292
+ end
293
+
282
294
  private
283
295
 
284
296
  def expect_status_update(repo, commit_sha, params)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp