Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Commit

Permalink
Release 0.25.3 and fix Parameter decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
kipz committed Apr 13, 2017
1 parent 2a8c114 commit 099e1c6
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

[Unreleased]: https://github.com/atomist/rug/compare/0.25.2...HEAD
[Unreleased]: https://github.com/atomist/rug/compare/0.25.3...HEAD

## [0.25.3] - 2017-04-13

[0.25.3]: https://github.com/atomist/rug/compare/0.25.2...0.25.3

Parameter release

### Changed

- Parameter decorator now takes a copy of the parameter configuration.
It _was_ overwriting its contents.

## [0.25.2] - 2017-04-13

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.atomist</groupId>
<artifactId>rug</artifactId>
<version>0.26.0-SNAPSHOT</version>
<version>0.25.3</version>
<packaging>jar</packaging>
<name>rug</name>
<description>Rug Runtime</description>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {HandleCommand, Instruction, Response, HandlerContext, Plan, DirectedMessage, UserAddress} from '@atomist/rug/operations/Handlers'
import {CommandHandler, Parameter, Tags, Intent} from '@atomist/rug/operations/Decorators'
import {Build} from "@atomist/rug/cortex/stub/Build"

let config = {description: "desc", pattern: "@any"}

@CommandHandler("SameConfig", "Uses same config object")
class SameConfig implements HandleCommand{

@Parameter(config)
foo: number

@Parameter(config)
bar: number

handle(ctx: HandlerContext) {
return new Plan();
}
}

export let command = new SameConfig();
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ class JavaScriptCommandHandlerTest extends FlatSpec with Matchers {
val simpleCommandHandlerWithBadStubUse = StringFileArtifact(atomistConfig.handlersRoot + "/Handler.ts",
contentOf(this, "SimpleCommandHandlerWithBadStubUse.ts"))

val simpleCommandHandlerWithSameParametersConfig = StringFileArtifact(atomistConfig.handlersRoot + "/Handler.ts",
contentOf(this, "SimpleCommandHandlerWithSameParametersConfig.ts"))

it should "not overwrite parameters when we reuse the same parametes object" in {
val rugArchive = TypeScriptBuilder.compileWithExtendedModel(
SimpleFileBasedArtifactSource(simpleCommandHandlerWithSameParametersConfig))
val rugs = RugArchiveReader(rugArchive)
val handler = rugs.commandHandlers.head
val params = handler.parameters
assert(params.head.name == "foo")
assert(params(1).name == "bar")
}

it should "#488: get good error message from generated model stubs" in {
val rugArchive = TypeScriptBuilder.compileWithExtendedModel(
SimpleFileBasedArtifactSource(simpleCommandHandlerWithBadStubUse))
Expand Down

0 comments on commit 099e1c6

Please sign in to comment.