pivotoolz 2.2.0 → 2.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94e90398170d1e718943d5deed60a7d79d8a61b9b5a365a56497a3c69058eb2a
4
- data.tar.gz: d9eba00b2fca976d49f35cfc20dad9ad96c8b59dbc75edf6a682e0826be92839
3
+ metadata.gz: 648b707a351eb4f2b97c0a8a336f4bf7ac8efb96b9b619a903643d870839d136
4
+ data.tar.gz: d967f3097e9e3892aea0a4886e222a08780926afd200596aa9eec7215a56bc53
5
5
  SHA512:
6
- metadata.gz: 95c19644a4959d37793779391d3340bb5fa7cae45447b8022e0b7a7cf0582229f327a355c8f4c32c0714751903e3ab17c98c326d10b85ee1212c882d711dc6ef
7
- data.tar.gz: 78215c1d296e66a10702b9cbf81bd590cd0b9a46f7648f3506a88fe8930fde15559a45d7ab41adb7c0cea3cced68ee5a9c8dbbf7987d9a6b4e7e37e38f6af2a3
6
+ metadata.gz: d9e1e27ad6af6380c1c4842a8c54459aa734d3d00c82aeb5d48197797c5034389a3832c92bfbbbd46012318caf2610c134452240b030cbb3bfc5c4fc644bf310
7
+ data.tar.gz: 1ecc3da31218e2b0b989f569b3d50f3715d3d934ef8aa33ce8efe804185d114bdbe57dbe9f0283435e15a98b7ec63e6a8521d5e4764a3e67b1750871308d176f
@@ -11,7 +11,7 @@ def get_story_info(story_id, flags = [])
11
11
  begin
12
12
  include_owner_names = flags.any? { |f| f == '--owners' || f == '-O' }
13
13
  url = BASE_URL + "#{story_id}" + "/#{include_owner_names ? '?fields=:default,owners' : ''}"
14
- open(
14
+ URI.open(
15
15
  url,
16
16
  'X-TrackerToken' => ENV['PIVOTAL_TRACKER_API_TOKEN']
17
17
  ).read
@@ -9,9 +9,8 @@ def get_story_info(story_id, flags = [], subdomain)
9
9
  return nil if story_id.empty?
10
10
 
11
11
  begin
12
- include_owner_names = flags.any? { |f| f == '--owners' || f == '-O' }
13
- url = BASE_URL + "#{story_id}" + "/#{include_owner_names ? '?fields=:default,owners' : ''}"
14
- open(
12
+ url = BASE_URL + "#{story_id}"
13
+ URI.open(
15
14
  url,
16
15
  'Authorization' => "Basic #{ENV['JIRA_API_BASIC_AUTH_BASE64_ENCODED']}"
17
16
  ).read
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'json'
4
4
  require 'ostruct'
5
+ require 'uri'
5
6
 
6
7
  BASE_URL = ENV['JIRA_API_BASE_URL']
7
8
 
@@ -63,10 +64,12 @@ def as_json(story, include_owners, flags, subdomain)
63
64
  end
64
65
 
65
66
  def story_owner_names(story, flags)
66
- owners = story
67
- .owners
68
- .compact
69
- .map { |o| OpenStruct.new(o).name }
67
+ owners = *(
68
+ story
69
+ .fields
70
+ .assignee
71
+ &.displayName
72
+ )
70
73
 
71
74
  if flags.include? '--bold-owners'
72
75
  return to_sentence(owners.map { |o| "*#{o}*" })
@@ -85,7 +88,7 @@ stories_deployed = deployed_story_infos
85
88
  .split("\n")
86
89
  .compact
87
90
  .reduce([]) do |reduced, story_info|
88
- story = OpenStruct.new(JSON.parse(story_info))
91
+ story = JSON.parse(story_info, object_class: OpenStruct)
89
92
 
90
93
  if format_as_json
91
94
  reduced << as_json(story, include_owners, flags, subdomain)
@@ -1,3 +1,3 @@
1
1
  module Pivotoolz
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotoolz
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sufyan Adam
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client