hullio 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  .config
5
5
  .yardoc
6
6
  Gemfile.lock
7
+ Gemfile*.lock
7
8
  InstalledFiles
8
9
  _yardoc
9
10
  coverage
@@ -16,3 +17,4 @@ test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
  example
20
+ .env*
data/Gemfile CHANGED
@@ -1,4 +1,22 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in hullio.gemspec
3
+ gem 'faraday', '0.8.9'
4
+
5
+ group :development, :test do
6
+ gem 'rake'
7
+ gem 'guard', '~> 2.6'
8
+ gem 'guard-rspec', '~> 4', require: false
9
+ gem 'typhoeus' unless defined? JRUBY_VERSION
10
+ gem 'pry-debugger'
11
+ end
12
+
13
+ group :test do
14
+ gem 'rspec', '~> 3.0'
15
+ gem 'webmock'
16
+ end
17
+
18
+ gem 'jruby-openssl' if defined? JRUBY_VERSION
19
+
4
20
  gemspec
21
+
22
+
data/README.md CHANGED
@@ -51,6 +51,9 @@ with Hull entities :
51
51
  Hull.get('entity', { uid: 'http://example.com' })
52
52
  Hull.put('entity', { uid: 'http://example.com', name: 'My super Page' })
53
53
  Hull.delete('entity', { uid: 'http://example.com' })
54
+
55
+ # Get comments on the Entity identified by 'http://example.com'
56
+ Hull.get('entity/comments', { uid: 'http://example.com' })
54
57
  ```
55
58
 
56
59
  ### Making API calls as as a User
data/Rakefile CHANGED
@@ -1,2 +1,9 @@
1
- #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :test => :spec
8
+
9
+ task :default => [:spec]
@@ -16,12 +16,11 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Hull::VERSION
17
17
 
18
18
  # Dependencies
19
- gem.add_dependency 'faraday'
19
+ gem.add_dependency 'faraday', '>= 0.8'
20
20
  gem.add_dependency 'faraday_middleware'
21
21
  gem.add_dependency 'multi_json'
22
22
  gem.add_dependency 'mime-types'
23
23
 
24
24
  # Development Dependencies
25
- gem.add_development_dependency 'activesupport', ['>= 2.3.9', '< 4']
26
-
25
+ gem.add_development_dependency 'activesupport', ['>= 2.3.9', '< 4']
27
26
  end
@@ -16,7 +16,7 @@ module Hull
16
16
  Hull::Client.new({ user_id: user_id })
17
17
  end
18
18
 
19
- # Delegate to hull::Client
19
+ # Delegate to Hull::Client
20
20
  def method_missing(method, *args, &block)
21
21
  return super unless new.respond_to?(method)
22
22
  new.send(method, *args, &block)
@@ -20,9 +20,7 @@ module Hull
20
20
  },
21
21
  :ssl => {:verify => false},
22
22
  :url => options.fetch(:org_url, org_url),
23
- :timeout => 10,
24
- :proxy => options.fetch(:proxy, proxy),
25
- :open_timeout => 10
23
+ :proxy => options.fetch(:proxy, proxy)
26
24
  }
27
25
  @connection ||= Faraday.new(default_options.deep_merge(connection_options)) do |builder|
28
26
  builder.use Hull::Request::Auth, credentials
@@ -36,9 +36,17 @@ module Hull
36
36
 
37
37
  # Perform an HTTP request
38
38
  def request(method, path, params={}, options={})
39
- Hull.log("#{method.upcase} #{path} - params: #{params.to_json}")
39
+ Hull.log("#{method.upcase} #{path} - params: #{params.to_json} - options: #{options.inspect}")
40
40
  response = connection(options).run_request(method, nil, nil, nil) do |request|
41
- request.options[:raw] = true if options[:raw]
41
+
42
+ if request.options.is_a?(Hash)
43
+ request.options[:timeout] ||= options.fetch(:timeout, 10)
44
+ request.options[:open_timeout] ||= options.fetch(:open_timeout, 10)
45
+ elsif request.options.respond_to?(:timeout)
46
+ request.options.timeout ||= options.fetch(:timeout, 10)
47
+ request.options.open_timeout ||= options.fetch(:open_timeout, 10)
48
+ end
49
+
42
50
  case method.to_sym
43
51
  when :delete, :get
44
52
  request.url(path, params)
@@ -1,3 +1,3 @@
1
1
  module Hull
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hullio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-07 00:00:00.000000000 Z
13
+ date: 2014-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: '0.8'
22
22
  none: false
23
23
  prerelease: false
24
24
  type: :runtime
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: '0.8'
30
30
  none: false
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: faraday_middleware
@@ -148,3 +148,4 @@ signing_key:
148
148
  specification_version: 3
149
149
  summary: Hull Ruby Client
150
150
  test_files: []
151
+ has_rdoc: