Skip to content

Commit

Permalink
v4.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nightroman committed Dec 12, 2013
1 parent 934344d commit b02281f
Show file tree
Hide file tree
Showing 16 changed files with 415 additions and 181 deletions.
18 changes: 15 additions & 3 deletions .build.ps1
Expand Up @@ -167,7 +167,7 @@ task Package ConvertMarkdown, @{UpdateScript=1}, {
Release-Notes.htm
}

# Set $script:Version = assembly version
# Set $script:Version = assembly version as 'X.Y.Z'
task Version {
assert ((Get-Item $ModuleRoot\Mdbc.dll).VersionInfo.FileVersion -match '^(\d+\.\d+\.\d+)')
$script:Version = $matches[1]
Expand Down Expand Up @@ -202,7 +202,19 @@ features like bson/json file collections which do not require MongoDB.
exec { NuGet pack z\Package.nuspec -NoPackageAnalysis }
}

# Check files.
# Push to the repository with a version tag.
task PushRelease Version, {
exec { git push }
exec { git tag -a "v$Version" -m "v$Version" }
exec { git push origin "v$Version" }
}

# Make and push the NuGet package.
task PushNuGet NuGet, {
exec { NuGet push "Mdbc.$Version" }
}

# Check expected files.
task CheckFiles {
$Pattern = '\.(cs|csproj|md|ps1|psd1|psm1|ps1xml|sln|txt|xml|gitignore)$'
foreach ($file in git status -s) { if ($file -notmatch $Pattern) {
Expand All @@ -213,7 +225,7 @@ task CheckFiles {
# Call tests.
task Test {
Invoke-Build ** Tests -Result result
$testCount = 141
$testCount = 144
if ($testCount -ne $result.Tasks.Count) {Write-Warning "Unexpected test count:`n Sample : $testCount`n Result : $($result.Tasks.Count)"}
},
CleanTest
Expand Down
2 changes: 1 addition & 1 deletion Module/Mdbc.psd1
@@ -1,7 +1,7 @@

@{
Author = 'Roman Kuzmin'
ModuleVersion = '4.5.0'
ModuleVersion = '4.5.1'
CompanyName = 'https://github.com/nightroman/Mdbc'
Description = 'Mdbc module - MongoDB Cmdlets for PowerShell'
Copyright = '(C) 2011-2013 Roman Kuzmin. All rights reserved.'
Expand Down
25 changes: 21 additions & 4 deletions Module/en-US/Mdbc.dll-Help.ps1
Expand Up @@ -201,6 +201,9 @@ Specifies the data file format:
Auto (default)
The format is defined by the file extension: ".json" is for JSON,
other extensions are for BSON.
Input JSON is a sequence of objects and arrays of objects. Arrays are unrolled.
Top objects and arrays are optionally separated by spaces, tabs, and new lines.
'@

### Connect-Mdbc
Expand Down Expand Up @@ -1253,6 +1256,7 @@ Specifies the path to the BSON file where objects will be restored from.
As = $AsParameter
FileFormat = $FileFormatParameter
}

inputs = @()
outputs = @(
@{
Expand All @@ -1264,11 +1268,16 @@ Specifies the path to the BSON file where objects will be restored from.
description = 'Custom objects specified by the parameter As.'
}
)

examples = @(
@{
code = $ExampleIOCode
}
@{code=$ExampleIOCode}
@{code={
# Import data produced by ConvertTo-Json (PowerShell V3)
Get-Process | ConvertTo-Json | Set-Content process.json
Import-MdbcData process.json
}}
)

links = @(
@{ text = 'Export-MdbcData' }
@{ text = 'Open-MdbcFile' }
Expand Down Expand Up @@ -1337,9 +1346,17 @@ is simply stored for saving, the source file is not touched at this moment.
CollectionVariable = $CollectionVariable
FileFormat = $FileFormatParameter
}

inputs = @()
outputs = @()
examples = @($OpenSaveExample)

examples = $OpenSaveExample, @{code={
# Open and query data produced by ConvertTo-Json (PowerShell V3)
Get-Process | ConvertTo-Json -Depth 1 | Set-Content process.json
Open-MdbcFile process.json -Simple
Get-MdbcData @{Name='mongod'}
}}

links = @(
@{ text = 'Save-MdbcFile' }
@{ text = 'Get-MdbcData' }
Expand Down
6 changes: 3 additions & 3 deletions Module/en-US/about_Mdbc.help.txt
Expand Up @@ -43,12 +43,12 @@ LONG DESCRIPTION

Invoke-MdbcCommand

Bson file data persistence even without MongoDB:
bson/json data persistence without MongoDB:

Export-MdbcData
Import-MdbcData

Bson file collections even without MongoDB:
bson/json file collections without MongoDB:

Open-MdbcFile
Save-MdbcFile
Expand All @@ -58,7 +58,7 @@ LONG DESCRIPTION
Mdbc.ps1

FILE COLLECTIONS
Mdbc introduces bson data file collections which do not require MongoDB.
Mdbc introduces bson/json file collections which do not require MongoDB.
They are opened and saved by Open-MdbcFile and Save-MdbcFile and support
commands Get-MdbcData, Add-MdbcData, Remove-MdbcData, and Update-MdbcData.

Expand Down
13 changes: 13 additions & 0 deletions Release-Notes.md
@@ -1,6 +1,19 @@
Mdbc Release Notes
==================

## v4.5.1

Input JSON format. It does not have to be one object per line. It is a sequence
of objects and arrays of objects. Arrays are unrolled. Top objects and arrays
are optionally separated by spaces, tabs, and new lines.

As a result, output of PowerShell `ConvertTo-Json` (V3) saved to a file can be
read and processed by Mdbc cmdlets:

Get-Process | ConvertTo-Json -Depth 1 | Set-Content process.json
Open-MdbcFile process.json -Simple
Get-MdbcData @{Name='mongod'}

## v4.5.0

**JSON file collections and data files**
Expand Down
2 changes: 1 addition & 1 deletion Src/AssemblyInfo.cs
Expand Up @@ -4,7 +4,7 @@
using System;

[assembly: AssemblyProduct("Mdbc")]
[assembly: AssemblyVersion("4.5.0")]
[assembly: AssemblyVersion("4.5.1")]
[assembly: AssemblyTitle("Mdbc module - MongoDB Cmdlets for PowerShell")]
[assembly: AssemblyCompany("https://github.com/nightroman/Mdbc")]
[assembly: AssemblyCopyright("Copyright (c) 2011-2013 Roman Kuzmin")]
Expand Down
1 change: 1 addition & 0 deletions Src/CodeAnalysisDictionary.xml
Expand Up @@ -4,6 +4,7 @@
</Unrecognized>
<Recognized>
<Word>Bor</Word>
<Word>Bson</Word>
<Word>Mdbc</Word>
</Recognized>
<Deprecated>
Expand Down
2 changes: 1 addition & 1 deletion Src/Commands/ImportDataCommand.cs
Expand Up @@ -36,7 +36,7 @@ protected override void BeginProcessing()
var documentAs = _ParameterAs ?? new ParameterAs(null);
Path = GetUnresolvedProviderPathFromPSPath(Path);

foreach (var doc in FileCollection.GetDocumentsFromFileAs(documentAs.Type, Path, FileFormat))
foreach (var doc in FileCollection.ReadDocumentsAs(documentAs.Type, Path, FileFormat))
WriteObject(doc);
}
}
Expand Down
32 changes: 32 additions & 0 deletions Src/Enum.cs
@@ -0,0 +1,32 @@

/* Copyright 2011-2013 Roman Kuzmin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Mdbc
{
public enum FileFormat
{
Auto,
Bson,
Json
}
public enum OutputType
{
Default,
Lazy,
Raw,
PS
}
}

0 comments on commit b02281f

Please sign in to comment.