fanforce 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/fanforce.gemspec CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |gem|
20
20
  gem.require_paths = ["lib"]
21
21
 
22
22
  gem.add_development_dependency 'rake'
23
- gem.add_runtime_dependency 'rest-client'
24
- gem.add_runtime_dependency 'multi_json'
23
+ gem.add_runtime_dependency 'rest-client', '~> 1.6.7'
24
+ gem.add_runtime_dependency 'multi_json', '~> 1.3.6'
25
25
  end
data/lib/fanforce/main.rb CHANGED
@@ -6,7 +6,7 @@ class Fanforce
6
6
 
7
7
  ########################################################################
8
8
  def initialize(auth_key_or_hash=nil)
9
- auth(auth_key_or_hash) if auth_key_or_hash.present?
9
+ auth(auth_key_or_hash) if present?(auth_key_or_hash)
10
10
  end
11
11
 
12
12
  def get(path, requestParams={})
@@ -63,16 +63,17 @@ class Fanforce
63
63
  response
64
64
  end
65
65
 
66
- def auth(auth_key_or_hash=nil)
67
- if auth_key_or_hash.present?
68
- key = auth_key_or_hash.is_a?(Hash) ? auth_key_or_hash.symbolize_keys[:key] : auth_key_or_hash
69
- @auth_hash = {key: key} if key.present?
66
+ def auth(key_or_hash=nil)
67
+ if present?(key_or_hash)
68
+ key_or_hash.is_a?(Hash) ? auth_hash = key_or_hash.symbolize_keys : auth_hash = {key: key_or_hash}
69
+ @auth_hash = {key: key} if present?(auth_hash[:key])
70
+ @auth_hash[:fanforce_id] if present?(auth_hash[:fanforce_id])
70
71
  end
71
72
  @auth_hash
72
73
  end
73
74
 
74
75
  def valid_auth?
75
- @auth_hash.present? and @auth_hash[:key].present?
76
+ present?(@auth_hash) and present?(@auth_hash[:key])
76
77
  end
77
78
 
78
79
  def apply_auth(params)
@@ -1,3 +1,3 @@
1
1
  class Fanforce
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -32,33 +32,33 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: 1.6.7
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: 1.6.7
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: multi_json
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: 1.3.6
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.3.6
62
62
  description: Ruby API wrapper that interfaces with all six Fanforce APIs.
63
63
  email:
64
64
  - cclark@fanforce.com