hyperoslo / Compass

:earth_africa: Compass helps you setup a central navigation system for your application
http://hyper.no
Other
825 stars 47 forks source link

Return clean argument keys #12

Closed zenangst closed 8 years ago

zenangst commented 8 years ago

Personally I think it looks kinda weird that the delimiter is included in the arguments dictionary that you get when you resolve arguments. I'd like to strip it out from the key entirely.

Before

Compass.parse(url) { route, arguments in
  XCTAssertEqual("login:{username}:{password}", route)
  XCTAssertEqual(arguments["{username}"], "JohnHyperseed")
  XCTAssertEqual(arguments["{password}"], "secret")
}

After

Compass.parse(url) { route, arguments in
  XCTAssertEqual("login:{username}:{password}", route)
  XCTAssertEqual(arguments["username"], "JohnHyperseed")
  XCTAssertEqual(arguments["password"], "secret")
}
vadymmarkov commented 8 years ago

@zenangst Yeah, totally agree. I was thinking about that too, but forgot to tell you :smile:

zenangst commented 8 years ago

@vadymmarkov look, a wild pull request appeared :sunglasses: