rally_api 1.0.0 → 1.0.1

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: 3dc909010959f93625ac7ef070f8650456279deb
4
- data.tar.gz: 7134c5cad3d07742da655cb4a3a2ab07f1da192a
3
+ metadata.gz: f088541d07551f9eeaaa0f67d0d041c051e9cb9d
4
+ data.tar.gz: 08086c868c3bd8a2c64a5676bdea99ec8aa9be8b
5
5
  SHA512:
6
- metadata.gz: fead7450a8b3b5dd2f7441c62031d6d1b03da1a030cd07711f7d9b8b5fcb33ac629f1b28fc0f6938e3fbee310346e7e30bb92f141058309c384160447b6bc2e7
7
- data.tar.gz: 78b9a05acc5daaee15b5a0111afd85f66d4aea7a9d3199a7c2719df0fd3e37602e9237cea869e2f4b2822be15997b93d0de3d910c79f22da1484fb8205a540c6
6
+ metadata.gz: 82c225cf0621301ab0e218e639bc6f6cafb16f680b391adc089900991f5f2a51b076a944967c2de48fbcec43d90ca6b73d76ecd2bcc719d22f1b843c231462a0
7
+ data.tar.gz: d3da317367171bb40b9c42262dc91d118f4a483b9c8f594a2a87ea598a965a445ab605ec1b07e97116331a416a0a941f04a64156e8b094ca3d9b50a2ea0dca2f
data/README.md CHANGED
@@ -46,6 +46,15 @@ Making a connection to Rally
46
46
 
47
47
  @rally = RallyAPI::RallyRestJson.new(config)
48
48
 
49
+ #Using api keys? -- currently rally1 only
50
+ Go to https://rally1.rallydev.com/login
51
+ You can generate an api key on this site and use it *instead* of username and password
52
+ config = {:base_url => "https://rally1.rallydev.com/slm"}
53
+ config[:api_key] = "_your_api_key_from_https://rally1.rallydev.com/login"
54
+ config[:workspace] = "Workspace Name"
55
+ config[:project] = "Project Name"
56
+ config[:headers] = headers #from RallyAPI::CustomHttpHeader.new()
57
+
49
58
 
50
59
  ### Querying Rally
51
60
 
@@ -127,14 +127,11 @@ module RallyAPI
127
127
  url_params[:key] = @security_token unless @security_token.nil?
128
128
  req_args[:query] = url_params if url_params.keys.length > 0
129
129
 
130
- req_headers = setup_request_headers
130
+ req_args[:header] = setup_request_headers(args[:method])
131
131
  if (args[:method] == :post) || (args[:method] == :put)
132
- req_headers["Content-Type"] = "application/json"
133
- req_headers["Accept"] = "application/json"
134
132
  text_json = args[:payload].to_json
135
133
  req_args[:body] = text_json
136
134
  end
137
- req_args[:header] = req_headers
138
135
 
139
136
  begin
140
137
  log_info("Rally API calling #{method} - #{url} with #{req_args}\n With cookies: #{@rally_http_client.cookie_manager.cookies}")
@@ -176,11 +173,12 @@ module RallyAPI
176
173
 
177
174
  private
178
175
 
179
- def setup_request_headers()
176
+ def setup_request_headers(http_method)
180
177
  req_headers = @rally_headers.headers
181
- zsession_c = @rally_http_client.cookies.find {|c| c.name == "ZSESSIONID" }
182
- if !@api_key.nil? && zsession_c.nil?
183
- req_headers[:zsessionid] = @api_key
178
+ req_headers[:ZSESSIONID] = @api_key unless @api_key.nil?
179
+ if (http_method == :post) || (http_method == :put)
180
+ req_headers["Content-Type"] = "application/json"
181
+ req_headers["Accept"] = "application/json"
184
182
  end
185
183
  req_headers
186
184
  end
@@ -191,8 +189,7 @@ module RallyAPI
191
189
  end
192
190
 
193
191
  def set_api_key(auth_info)
194
- @api_key_url = auth_info[:base_url]
195
- @api_key = auth_info[:api_key]
192
+ @api_key = auth_info[:api_key]
196
193
  end
197
194
 
198
195
  def run_threads(query_array)
@@ -4,5 +4,5 @@
4
4
  #of the applicable Subscription Agreement between your company and
5
5
  #Rally Software Development Corp.
6
6
  module RallyAPI
7
- VERSION = "1.0.0"
7
+ VERSION = "1.0.1"
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rally_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-17 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient