Skip to content

Enable warnings during spec execution and fix warnings #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-12-21 15:49:54 +0000 using RuboCop version 0.42.0.
# on 2016-12-21 20:00:37 +0000 using RuboCop version 0.42.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -9,7 +9,7 @@
# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 108
Max: 109

# Offense count: 89
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [#105](https://github.com/codegram/hyperclient/pull/105), [#108](https://github.com/codegram/hyperclient/pull/108): Added Danger, PR linter - [@dblock](https://github.com/dblock).
* [#109](https://github.com/codegram/hyperclient/pull/109): Allow disabling asynchronous behavior per-instance - [@Talkdesk](https://github.com/Talkdesk).
* [#110](https://github.com/codegram/hyperclient/pull/110): Fixed ruby warnings - [@ivoanjo](https://github.com/ivoanjo).
* Your contribution here.

### 0.8.1 (March 15, 2016)
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
t.warning = true
end

desc 'runs the whole spinach suite'
Expand Down
7 changes: 7 additions & 0 deletions lib/hyperclient.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'hyperclient/collection'
require 'hyperclient/link'
require 'hyperclient/attributes'
require 'hyperclient/curie'
require 'hyperclient/entry_point'
require 'hyperclient/link_collection'
require 'hyperclient/resource'
require 'hyperclient/resource_collection'
require 'hyperclient/version'

# Public: Hyperclient namespace.
Expand Down
2 changes: 0 additions & 2 deletions lib/hyperclient/attributes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'hyperclient/collection'

module Hyperclient
# Public: A wrapper class to easily acces the attributes in a Resource.
#
Expand Down
2 changes: 0 additions & 2 deletions lib/hyperclient/curie.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'hyperclient/resource'

module Hyperclient
# Internal: Curies are named tokens that you can define in the document and use
# to express curie relation URIs in a friendlier, more compact fashion.
Expand Down
4 changes: 2 additions & 2 deletions lib/hyperclient/entry_point.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'hyperclient/link'
require 'faraday_middleware'
require 'faraday_hal_middleware'
require_relative '../faraday/connection'
Expand Down Expand Up @@ -31,7 +30,7 @@ class EntryPoint < Link
extend Forwardable

# Public: Delegates common methods to be used with the Faraday connection.
def_delegators :connection, :basic_auth, :digest_auth, :token_auth, :headers, :headers=, :params, :params=
def_delegators :connection, :basic_auth, :digest_auth, :token_auth, :params, :params=

# Public: Initializes an EntryPoint.
#
Expand All @@ -40,6 +39,7 @@ def initialize(url, &_block)
@link = { 'href' => url }
@entry_point = self
@options = { async: true }
@connection = nil
yield self if block_given?
end

Expand Down
2 changes: 1 addition & 1 deletion lib/hyperclient/link.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'hyperclient/resource'
require 'uri_template'
require 'futuroscope'

Expand All @@ -18,6 +17,7 @@ def initialize(key, link, entry_point, uri_variables = nil)
@link = link
@entry_point = entry_point
@uri_variables = uri_variables
@resource = nil
end

# Public: Indicates if the link is an URITemplate or a regular URI.
Expand Down
4 changes: 0 additions & 4 deletions lib/hyperclient/link_collection.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
require 'hyperclient/collection'
require 'hyperclient/link'
require 'hyperclient/curie'

module Hyperclient
# Public: A wrapper class to easily acces the links in a Resource.
#
Expand Down
3 changes: 0 additions & 3 deletions lib/hyperclient/resource.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require 'forwardable'
require 'hyperclient/attributes'
require 'hyperclient/link_collection'
require 'hyperclient/resource_collection'

module Hyperclient
# Public: Represents a resource from your API. Its responsability is to
Expand Down
3 changes: 0 additions & 3 deletions lib/hyperclient/resource_collection.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'hyperclient/collection'
require 'hyperclient/resource'

module Hyperclient
# Public: A wrapper class to easily acces the embedded resources in a
# Resource.
Expand Down
2 changes: 1 addition & 1 deletion test/hyperclient/attributes_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/attributes'
require 'hyperclient'

module Hyperclient
describe Attributes do
Expand Down
2 changes: 1 addition & 1 deletion test/hyperclient/collection_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/resource'
require 'hyperclient'

module Hyperclient
describe Collection do
Expand Down
3 changes: 1 addition & 2 deletions test/hyperclient/curie_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/curie'
require 'hyperclient/entry_point'
require 'hyperclient'

module Hyperclient
describe Curie do
Expand Down
2 changes: 1 addition & 1 deletion test/hyperclient/entry_point_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/entry_point'
require 'hyperclient'

module Hyperclient
describe EntryPoint do
Expand Down
2 changes: 1 addition & 1 deletion test/hyperclient/link_collection_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/link_collection'
require 'hyperclient'

module Hyperclient
describe LinkCollection do
Expand Down
3 changes: 1 addition & 2 deletions test/hyperclient/link_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/link'
require 'hyperclient/entry_point'
require 'hyperclient'

module Hyperclient
describe Link do
Expand Down
2 changes: 1 addition & 1 deletion test/hyperclient/resource_collection_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/resource_collection'
require 'hyperclient'

module Hyperclient
describe ResourceCollection do
Expand Down
2 changes: 1 addition & 1 deletion test/hyperclient/resource_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../test_helper'
require 'hyperclient/resource'
require 'hyperclient'

module Hyperclient
describe Resource do
Expand Down