freshdesk_apiclient 0.1.1 → 0.1.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: b843b0ad25aa39e9d7802c7df8c613f2a3e7460c
4
- data.tar.gz: 200cd00955154a5d72cb00be64272fd14f3e29df
3
+ metadata.gz: 187b3d6e3fdfb1db8a9a9402bbfefe81ed114850
4
+ data.tar.gz: 4fe413daf9829aaafd834d6e1b6f36a97a78d664
5
5
  SHA512:
6
- metadata.gz: 90592f93c709aed98ec8c3b7417d2bfdf4dd8316c7819ce9861fa154a06745c0040a198396359cf12092df1da2247115232ec9708181ea650aa5a1d7fb51c8b6
7
- data.tar.gz: 114932a708ed8dc2c7c9cb4b2f99649eb276290f5c0cd015f5d664c1998ae25874bb9f6e7963593b4927fdd2ffed11c88010c59b00cdc7ee72660c03d09f8bce
6
+ metadata.gz: 631b8a2ca96c31748eeeeefd40ffd2fb68ccbf11550b31b0485c7c6e934b9983bc12737199628f8f62e14bae916ba71c42d856a68fff27d6a5a4540d4d26fe36
7
+ data.tar.gz: 5e455c86ca9f317c170d3bbf7c977136915c8d2ffb937290dc29baceaf2db96ea60ae55d17821eebec4696e54ae777dc2a1a6abf9433bb7d772734963165ad8c
data/.travis.yml CHANGED
@@ -10,4 +10,9 @@ before_install:
10
10
  script:
11
11
  - bundle exec rspec
12
12
  notifications:
13
- email: false
13
+ email: false
14
+ addons:
15
+ code_climate:
16
+ repo_token: c10c2e0f19f128e1104891ce01b180b0f226ee1c58ba42a1bda3cfa0c7a2784d
17
+ after_success:
18
+ - bundle exec codeclimate-test-reporter
data/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # FreshdeskApiclient
2
+ ====
2
3
 
3
- A ruby API client for freshdesk.com.
4
+ [![Gem Version](https://badge.fury.io/rb/freshdesk_apiclient.svg)](https://badge.fury.io/rb/freshdesk_apiclient)
5
+ [![Build Status](https://travis-ci.org/qbantek/freshdesk_apiclient.svg?branch=master)](https://travis-ci.org/qbantek/freshdesk_apiclient)
6
+ [![Code Climate](https://codeclimate.com/github/qbantek/freshdesk_apiclient/badges/gpa.svg)](https://codeclimate.com/github/qbantek/freshdesk_apiclient)
7
+ [![Test Coverage](https://codeclimate.com/github/qbantek/freshdesk_apiclient/badges/coverage.svg)](https://codeclimate.com/github/qbantek/freshdesk_apiclient/coverage)
8
+ [![Dependency Status](https://gemnasium.com/badges/github.com/qbantek/freshdesk_apiclient.svg)](https://gemnasium.com/github.com/qbantek/freshdesk_apiclient)
9
+ [![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://freshdesk_apiclient.mit-license.org)
10
+
11
+ A ruby client for [freshdesk.com](https://developer.freshdesk.com/api/) API.
4
12
 
5
13
  ## Installation
6
14
 
@@ -20,11 +20,13 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'rest-client', '~> 2.0', '>= 2.0.1'
23
+ spec.add_runtime_dependency 'rest-client', '~> 2.0', '>= 2.0.1'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.14', '>= 1.14.3'
26
- spec.add_development_dependency 'gem-release', '~> 0.7', '>= 0.7.4'
27
- spec.add_development_dependency 'rake', '~> 12.0', '>= 12.0.0'
28
- spec.add_development_dependency 'rspec', '~> 3.5', '>= 3.5.0'
29
- spec.add_development_dependency 'rubocop', '~> 0.47', '>= 0.47.1'
25
+ spec.add_development_dependency 'bundler', '~> 1.14', '>= 1.14.3'
26
+ spec.add_development_dependency 'gem-release', '~> 0.7', '>= 0.7.4'
27
+ spec.add_development_dependency 'rake', '~> 12.0', '>= 12.0.0'
28
+ spec.add_development_dependency 'rspec', '~> 3.5', '>= 3.5.0'
29
+ spec.add_development_dependency 'simplecov', '~> 0.11', '>= 0.11.2'
30
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.5'
31
+ spec.add_development_dependency 'rubocop', '~> 0.47', '>= 0.47.1'
30
32
  end
@@ -10,11 +10,11 @@ module FreshdeskApiclient
10
10
  # @param [String] domain
11
11
  # @param [String] username_or_api_key
12
12
  # @param [String] password
13
- # @param [Hash] options
14
- def initialize(domain, username_or_api_key, password='X', options={})
13
+ # @param [Logger] logger
14
+ def initialize(domain, username_or_api_key, password='X', logger=nil)
15
15
  @base_url = "https://#{domain}.freshdesk.com/api/v2/"
16
16
  @credentials = {username: username_or_api_key, password: password}
17
- @logger = options[:logger] if options.key?(:logger) && options[:logger].respond_to?(:info)
17
+ @logger = logger
18
18
  end
19
19
 
20
20
  # obj.method_missing(symbol [, *args] ) -> result
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module FreshdeskApiclient
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
@@ -30,17 +30,12 @@ describe FreshdeskApiclient::REST::Client do
30
30
  end
31
31
  end
32
32
 
33
- it 'sets the credentials for the given parameters' do
34
- expect(subject.instance_variable_get(:@credentials)[:username]).to eq(:api_key)
35
- expect(subject.instance_variable_get(:@credentials)[:password]).to eq('X')
36
- end
37
-
38
33
  context 'when a logger option is not provided' do
39
34
  it('does not sets the logger') { expect(subject.instance_variable_get(:@logger)).to be_nil }
40
35
  end
41
36
 
42
37
  context 'when a logger option is provided' do
43
- subject { FreshdeskApiclient::REST::Client.new(:domain, :api_key, nil, logger: Logger.new(STDOUT)) }
38
+ subject { FreshdeskApiclient::REST::Client.new(:domain, :api_key, nil, Logger.new(STDOUT)) }
44
39
  it('sets the logger') { expect(subject.instance_variable_get(:@logger)).to be_a(Logger) }
45
40
  end
46
41
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,11 @@
1
1
  # frozen_string_literal: true
2
+ if ENV['CODECLIMATE_REPO_TOKEN']
3
+ # require 'codeclimate-test-reporter'
4
+ # CodeClimate::TestReporter.start
5
+ require 'simplecov'
6
+ SimpleCov.start
7
+ end
8
+
2
9
  require 'bundler/setup'
3
10
  Bundler.setup
4
11
 
@@ -8,7 +15,13 @@ RSpec.configure do |config|
8
15
  # Enable flags like --only-failures and --next-failure
9
16
  config.example_status_persistence_file_path = '.rspec_status'
10
17
 
11
- config.expect_with :rspec do |c|
12
- c.syntax = :expect
13
- end
18
+ config.expect_with(:rspec) {|c| c.syntax = :expect }
19
+ config.mock_with(:rspec) {|mocks| mocks.verify_partial_doubles = true }
20
+ # config.filter_run_including :focus => true
21
+ config.default_formatter = 'doc' if config.files_to_run.one?
22
+ config.order = :random
23
+ config.example_status_persistence_file_path = 'spec/examples.txt'
24
+ config.warnings = true
25
+
26
+ Kernel.srand config.seed
14
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freshdesk_apiclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -110,6 +110,46 @@ dependencies:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: 3.5.0
113
+ - !ruby/object:Gem::Dependency
114
+ name: simplecov
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '0.11'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 0.11.2
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '0.11'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 0.11.2
133
+ - !ruby/object:Gem::Dependency
134
+ name: codeclimate-test-reporter
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '1.0'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 1.0.5
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '1.0'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 1.0.5
113
153
  - !ruby/object:Gem::Dependency
114
154
  name: rubocop
115
155
  requirement: !ruby/object:Gem::Requirement