iron_core 0.1.2 → 0.1.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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/iron_core/client.rb +6 -5
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -20,6 +20,7 @@ module IronCore
20
20
 
21
21
  load_from_hash(options)
22
22
  load_from_config(product, options[:config_file] || options['config_file'])
23
+ load_from_config(product, '.iron.json')
23
24
  load_from_config(product, 'iron.json')
24
25
  load_from_env('IRON_' + product.upcase)
25
26
  load_from_env('IRON')
@@ -70,7 +71,7 @@ module IronCore
70
71
  res
71
72
  end
72
73
 
73
- def common_request_hash
74
+ def common_headers
74
75
  {
75
76
  'Content-Type' => 'application/json',
76
77
  'Authorization' => "OAuth #{@token}",
@@ -84,7 +85,7 @@ module IronCore
84
85
 
85
86
  def get(method, params = {})
86
87
  request_hash = {}
87
- request_hash[:headers] = common_request_hash
88
+ request_hash[:headers] = common_headers
88
89
  request_hash[:params] = params
89
90
 
90
91
  IronCore::Logger.debug 'IronCore', "GET #{url + method} with params='#{request_hash.to_s}'"
@@ -94,7 +95,7 @@ module IronCore
94
95
 
95
96
  def post(method, params = {})
96
97
  request_hash = {}
97
- request_hash[:headers] = common_request_hash
98
+ request_hash[:headers] = common_headers
98
99
  request_hash[:body] = params.to_json
99
100
 
100
101
  IronCore::Logger.debug 'IronCore', "POST #{url + method} with params='#{request_hash.to_s}'"
@@ -104,7 +105,7 @@ module IronCore
104
105
 
105
106
  def put(method, params={})
106
107
  request_hash = {}
107
- request_hash[:headers] = common_request_hash
108
+ request_hash[:headers] = common_headers
108
109
  request_hash[:body] = params.to_json
109
110
 
110
111
  IronCore::Logger.debug 'IronCore', "PUT #{url + method} with params='#{request_hash.to_s}'"
@@ -114,7 +115,7 @@ module IronCore
114
115
 
115
116
  def delete(method, params = {})
116
117
  request_hash = {}
117
- request_hash[:headers] = common_request_hash
118
+ request_hash[:headers] = common_headers
118
119
  request_hash[:params] = params
119
120
 
120
121
  IronCore::Logger.debug 'IronCore', "DELETE #{url + method} with params='#{request_hash.to_s}'"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_core
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:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-18 00:00:00.000000000 Z
13
+ date: 2012-06-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -105,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: -831552671
108
+ hash: 255864819
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  none: false
111
111
  requirements: