Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into issue-38
Browse files Browse the repository at this point in the history
  • Loading branch information
lipkau committed May 24, 2017
2 parents 18785a8 + 9362313 commit 961c604
Show file tree
Hide file tree
Showing 85 changed files with 2,830 additions and 1,132 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ config.xml
docs/_build/*
docs/_build.html/*

# Ignore Release directory generated by local builds
Release/*

#######
# Excerpts from https://www.gitignore.io
#######
Expand Down
37 changes: 37 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.2.0",
"configurations": [

{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File",
"script": "${file}",
"args": [],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File w/Args Prompt",
"script": "${file}",
"args": [
"${command:SpecifyScriptArgs}"
],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"processId": "${command:PickPSHostProcess}",
"runspaceId": 1
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"cwd": "${workspaceRoot}"
}
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.trimTrailingWhitespace": true
}
9 changes: 0 additions & 9 deletions .vscode/tasks.cmd

This file was deleted.

140 changes: 116 additions & 24 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,121 @@
// Do not edit! This file is generated by New-VSCodeTask.ps1
// Modify the build script instead and regenerate this file.
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${relativeFile}: the current opened file relative to workspaceRoot
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
"version": "0.1.0",
"command": ".\\.vscode\\tasks.cmd",
"suppressTaskName": false,
"showOutput": "always",
"tasks": [
{
"isBuildCommand": true,
"taskName": "."
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",

// Start PowerShell
"windows": {
"command": "${env.windir}\\system32\\windowspowershell\\v1.0\\PowerShell.exe"
},
{
"taskName": "Init"
"linux": {
"command": "/usr/bin/powershell"
},
{
"taskName": "Test"
"osx": {
"command": "/usr/local/bin/powershell"
},
{
"taskName": "Build"
},
{
"taskName": "Deploy"
},
{
"taskName": "?"
}
]

// The command is a shell script
"isShellCommand": true,

// Show the output window always
"showOutput": "always",

"args": [
"-NoProfile", "-ExecutionPolicy", "Bypass"
],

// Associate with test task runner
"tasks": [
{
"taskName": "Clean",
"suppressTaskName": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking psake on build.psake.ps1 -taskList Clean'; Invoke-psake build\\build.psake.ps1 -taskList Clean;",
"Invoke-Command { Write-Host 'Completed Clean task in task runner.' }"
]
},
{
"taskName": "Build",
"suppressTaskName": true,
"isBuildCommand": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking psake on build.psake.ps1 -taskList Build'; Invoke-psake build\\build.psake.ps1 -taskList Build;",
"Invoke-Command { Write-Host 'Completed Build task in task runner.' }"
]
},
{
"taskName": "BuildHelp",
"suppressTaskName": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking psake on build.psake.ps1 -taskList BuildHelp'; Invoke-psake build\\build.psake.ps1 -taskList BuildHelp;",
"Invoke-Command { Write-Host 'Completed BuildHelp task in task runner.' }"
]
},
{
"taskName": "Analyze",
"suppressTaskName": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking psake on build.psake.ps1 -taskList Analyze'; Invoke-psake build\\build.psake.ps1 -taskList Analyze;",
"Invoke-Command { Write-Host 'Completed Analyze task in task runner.' }"
]
},
{
"taskName": "Install",
"suppressTaskName": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking psake on build.psake.ps1 -taskList Install'; Invoke-psake build\\build.psake.ps1 -taskList Install;",
"Invoke-Command { Write-Host 'Completed Install task in task runner.' }"
]
},
{
"taskName": "Publish",
"suppressTaskName": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking psake on build.psake.ps1 -taskList Publish'; Invoke-psake build\\build.psake.ps1 -taskList Publish;",
"Invoke-Command { Write-Host 'Completed Publish task in task runner.' }"
]
},
{
"taskName": "Test",
"suppressTaskName": true,
"isTestCommand": true,
"showOutput": "always",
"args": [
"Write-Host 'Invoking Pester'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};",
"Invoke-Command { Write-Host 'Completed Test task in task runner.' }"
],
"problemMatcher": [
{
"owner": "powershell",
"fileLocation": ["absolute"],
"severity": "error",
"pattern": [
{
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
"message": 1
},
{
"regexp": "^\\s+at\\s+[^,]+,\\s*(.*?):\\s+line\\s+(\\d+)$",
"file": 1,
"line": 2
}
]
}
]
}
]
}
Binary file removed PSJira/Internal/ConvertFrom-Json2.Tests.ps1
Binary file not shown.
Binary file modified PSJira/Internal/ConvertFrom-Json2.ps1
Binary file not shown.
57 changes: 0 additions & 57 deletions PSJira/Internal/ConvertTo-JiraComponent.Tests.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion PSJira/Internal/ConvertTo-JiraIssue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function ConvertTo-JiraIssue
}
}

# Write-Debug "[ConvertTo-JiraIssue] Checking for any additional fields"
# Write-Debug "[ConvertTo-JiraIssue] Checking for any additional fields"
$extraFields = $i.fields.PSObject.Properties | Where-Object -FilterScript { $_.Name -notin $props.Keys }
foreach ($f in $extraFields)
{
Expand Down
88 changes: 88 additions & 0 deletions PSJira/Internal/ConvertTo-JiraLink.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
function ConvertTo-JiraLink
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $true,
Position = 0,
ValueFromPipeline = $true)]
[PSObject[]] $InputObject
)

process
{
foreach ($i in $InputObject)
{
# Write-Debug "[ConvertTo-JiraLink] Processing object: '$i'"

# Write-Debug "[ConvertTo-JiraLink] Defining standard properties"
$props = @{
'Id' = $i.id;
'RestUrl' = $i.self;
}

if ($i.globalId) {$props.globalId = $i.globalId}
if ($i.application) {
$props.application = New-Object PSObject -Prop @{
type = $i.application.type
name = $i.application.name
}
}
if ($i.relationship) {$props.relationship = $i.relationship}
if ($i.object) {
if ($i.object.icon)
{
$icon = New-Object PSObject -Prop @{
title = $i.object.icon.title
url16x16 = $i.object.icon.url16x16
}
} else { $icon = $null }

if ($i.object.status.icon)
{
$statusIcon = New-Object PSObject -Prop @{
link = $i.object.status.icon.link
title = $i.object.status.icon.title
url16x16 = $i.object.status.icon.url16x16
}
} else { $statusIcon = $null }

if ($i.object.status)
{
$status = New-Object PSObject -Prop @{
resolved = $i.object.status.resolved
icon = $statusIcon
}
} else { $status = $null }

$props.object = New-Object PSObject -Prop @{
url = $i.object.url
title = $i.object.title
summary = $i.object.summary
icon = $icon
status = $status
}
}

# Write-Debug "[ConvertTo-JiraLink] Creating PSObject out of properties"
$result = New-Object -TypeName PSObject -Property $props

# Write-Debug "[ConvertTo-JiraLink] Inserting type name information"
$result.PSObject.TypeNames.Insert(0, 'PSJira.Link')

# Write-Debug "[ConvertTo-JiraLink] Inserting custom toString() method"
$result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value {
Write-Output "$($this.Id)"
}

# Write-Debug "[ConvertTo-JiraLink] Outputting object"
Write-Output $result
}
}

end
{
# Write-Debug "[ConvertTo-JiraLink] Complete"
}
}


5 changes: 5 additions & 0 deletions PSJira/Internal/Invoke-JiraMethod.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ function Invoke-JiraMethod
# [Object] $Session
)

# load DefaultParameters for Invoke-WebRequest
# as the global PSDefaultParameterValues is not used
# TODO: find out why PSJira doesn't need this
$PSDefaultParameterValues = $global:PSDefaultParameterValues

$headers = @{
'Content-Type' = 'application/json; charset=utf-8';
}
Expand Down
Loading

0 comments on commit 961c604

Please sign in to comment.