From 8e722050a47dcac29c71975cc7770309e8d2f796 Mon Sep 17 00:00:00 2001 From: jpkole Date: Mon, 11 May 2015 13:23:30 -0600 Subject: [PATCH 1/9] Increased minor rev to account for this change. --- lib/rally_api/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rally_api/version.rb b/lib/rally_api/version.rb index 9964fc7..7701575 100644 --- a/lib/rally_api/version.rb +++ b/lib/rally_api/version.rb @@ -4,5 +4,5 @@ #of the applicable Subscription Agreement between your company and #Rally Software Development Corp. module RallyAPI - VERSION = "1.2.0" + VERSION = "1.2.1" end From af92039bd150a456099c513bcdc28ad46ee4a2f9 Mon Sep 17 00:00:00 2001 From: jpkole Date: Mon, 11 May 2015 13:24:08 -0600 Subject: [PATCH 2/9] :limit was not being passed to Rally; :pagesize was wrongly being used.. --- lib/rally_api/rally_query.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rally_api/rally_query.rb b/lib/rally_api/rally_query.rb index e98b9ae..71acc73 100644 --- a/lib/rally_api/rally_query.rb +++ b/lib/rally_api/rally_query.rb @@ -50,6 +50,7 @@ def make_query_params query_params[:projectScopeDown] = @project_scope_down unless @project_scope_down.nil? query_params[:order] = @order unless @order.nil? query_params[:pagesize] = @page_size unless @page_size.nil? + query_params[:limit] = @limit unless @limit.nil? query_params[:search] = @search unless @search.nil? query_params[:types] = @types unless @types.nil? @@ -128,6 +129,9 @@ def parse_query_hash(query_hash) @project_scope_down = query_hash[:project_scope_down] @project_scope_up = query_hash[:project_scope_up] @order = query_hash[:order] + if !query_hash[:pagesize].nil? && query_hash[:page_size].nil? + query_hash[:page_size] = query_hash[:pagesize] + end @page_size = query_hash[:page_size] @limit = query_hash[:limit] @workspace = query_hash[:workspace] From 938c9e8ca563df7064ac2750d3c214dea9c4bbc8 Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 11:13:19 -0700 Subject: [PATCH 3/9] .gitignore --- examples/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/.gitignore b/examples/.gitignore index bc66d83..1af2437 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,2 +1,2 @@ -00-config.rb +MyVars.rb *~ From 980089339fb7e3dc34558dbf8964d2981ff2e98c Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 11:13:45 -0700 Subject: [PATCH 4/9] 00-config.rb.template --- examples/00-config.rb.template | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/00-config.rb.template b/examples/00-config.rb.template index 17c56bf..bba32bf 100644 --- a/examples/00-config.rb.template +++ b/examples/00-config.rb.template @@ -15,3 +15,4 @@ headers.version = "Version client software" @config[:version] = "1.42" # If not set, will use default version defined in gem. @config[:headers] = headers +require 'MyVars.rb' From a2013c864547418f76d39c20828b1718da00bb65 Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 11:15:03 -0700 Subject: [PATCH 5/9] 09-get-attachment.rb --- examples/09-get-attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 examples/09-get-attachment.rb diff --git a/examples/09-get-attachment.rb b/examples/09-get-attachment.rb old mode 100644 new mode 100755 index 62f8007..d496b4a --- a/examples/09-get-attachment.rb +++ b/examples/09-get-attachment.rb @@ -1,4 +1,4 @@ -#! /usr/bin/env ruby +#!/usr/bin/env ruby require 'pp' require 'base64' From e69fd1b57f37e0db456ca163bf979b90711530e9 Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 11:15:44 -0700 Subject: [PATCH 6/9] 00-config.rb --- examples/12-attachment-query.rb | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 examples/12-attachment-query.rb diff --git a/examples/12-attachment-query.rb b/examples/12-attachment-query.rb new file mode 100755 index 0000000..923f971 --- /dev/null +++ b/examples/12-attachment-query.rb @@ -0,0 +1,60 @@ +#! /usr/bin/env ruby + +require 'rally_api' +require 'pp' + +#Configuration for rally connection specified in 00-config.rb +require_relative '00-config' + +def commatize(integer) + return integer.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse +end + +def show_results(title,results) + puts title + puts "-----------" + h1 = ' Size FormattedID DisplayName CreationDate Name' + h2 = ' ------------ ----------- ----------- ------------------------ ---------------------------------' + puts h1,h2 + total_size = 0 + sorted = results.sort_by {|r| r.Size} + sorted.each_with_index do |result,result_index| + printf("[%4d/%4d]: %12s %11s %11s %-24s %s\n", + result_index+1, + results.length, + commatize(result.Size.to_i), + result.Artifact.FormattedID, + result.User.DisplayName, + result.CreationDate, + result.Name + ) + total_size += result.Size + end + puts h2,h1 + puts "" + puts "Total Count: #{results.length}" + puts "Total Sizes: #{commatize(total_size)} bytes" +end + +begin + rally = RallyAPI::RallyRestJson.new(@config) + + # + # Get all attachments + # + query = RallyAPI::RallyQuery.new() + query.type = 'attachment' + query.fetch = 'Name,CreationDate,Size,Artifact,User,FormattedID,DisplayName' + query.page_size = 2000 + query.project_scope_up = true + query.project_scope_down = true + + results = rally.find(query) + show_results("All Attachemnts",results) + +rescue Exception=>boom + puts "Rescued #{boom.class}" + puts "Error Message: #{boom}" +end + +#[the end]# From 229ed8aa06549410c5799d8024c7483389ef2026 Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 11:15:55 -0700 Subject: [PATCH 7/9] 12-attachment-query.rb --- examples/00-config.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/00-config.rb diff --git a/examples/00-config.rb b/examples/00-config.rb new file mode 100644 index 0000000..a4ba1a1 --- /dev/null +++ b/examples/00-config.rb @@ -0,0 +1,18 @@ + +#Custom headers +headers = RallyAPI::CustomHttpHeader.new() +headers.name = "Company Name" +headers.vendor = "Vendor Name" +headers.version = "Version client software" + +# Config parameters +@config = {} +@config[:base_url] = "https://trial.rallydev.com/slm" # This is the default setting. +@config[:username] = "user@company.com" +@config[:password] = "password" +@config[:workspace] = "Workspace" +@config[:project] = "Project" +@config[:version] = "1.42" # If not set, will use default version defined in gem. +@config[:headers] = headers + +require_relative 'MyVars.rb' From 7c1ea6aaa5df559b52fbeee4a6390aa06f7e5560 Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 14:24:38 -0700 Subject: [PATCH 8/9] 00-config.rb --- examples/00-config.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/00-config.rb b/examples/00-config.rb index a4ba1a1..9c1d082 100644 --- a/examples/00-config.rb +++ b/examples/00-config.rb @@ -7,12 +7,15 @@ # Config parameters @config = {} -@config[:base_url] = "https://trial.rallydev.com/slm" # This is the default setting. +@config[:base_url] = "https://trial.rallydev.com/slm" @config[:username] = "user@company.com" @config[:password] = "password" +@config[:api_key] = "_Rd3...................................t8EU" # if present; this overrides un/pw @config[:workspace] = "Workspace" @config[:project] = "Project" -@config[:version] = "1.42" # If not set, will use default version defined in gem. +@config[:version] = "v2.0" @config[:headers] = headers -require_relative 'MyVars.rb' +if FileTest.exist?( './MyVars.rb' ) + require './MyVars.rb' +end From a9f7648dbac6974950da861ffdcdc8f0b9d2b705 Mon Sep 17 00:00:00 2001 From: "jpkole@ca.com" Date: Thu, 15 Nov 2018 14:24:52 -0700 Subject: [PATCH 9/9] 12-attachment-query.rb --- examples/12-attachment-query.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/12-attachment-query.rb b/examples/12-attachment-query.rb index 923f971..d54a40d 100755 --- a/examples/12-attachment-query.rb +++ b/examples/12-attachment-query.rb @@ -1,7 +1,6 @@ #! /usr/bin/env ruby require 'rally_api' -require 'pp' #Configuration for rally connection specified in 00-config.rb require_relative '00-config'