Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Broke ||= but added --environment option, so its a trade off

  • Loading branch information...
commit 21b007a9013f66479d9a55b5f560458f938dafa2 1 parent 84fa97c
Ian Ownbey authored
Showing with 21 additions and 5 deletions.
  1. +13 −0 lib/backpacking.io
  2. +7 −4 lib/util.io
  3. +1 −1  main.io
View
13 lib/backpacking.io
@@ -7,6 +7,19 @@ doFile("lib/db.io")
Socket
BackPack := Object clone do(
+ Config := Object clone do(
+ setDefaults := method(
+ self env := "development"
+ ) call
+
+ parse := method(args,
+ if(args type == List type,
+ System getOptions(args) foreach(k, v,
+ if(k == "environment", self env := v)
+ )
+ )
+ ) call(System args)
+ )
handle := method(
command := self request command
View
11 lib/util.io
@@ -47,8 +47,11 @@ Object squareBrackets := method(
)
# Add the ||= to set if not already set
-OperatorTable addAssignOperator("||=", "setIfNotSet")
-Object setIfNotSet := method(
- if(call sender hasSlot(call message argAt(0) asString), return call sender getSlot(call message argAt(0) asString), call sender setSlot(call message argAt(0) asString, call message argAt(1)))
-)
+# TODO: Fix this
+
+# Object setIfNotSet := method(
+# if(call target hasSlot(call message argAt(0) asString), return call target getSlot(call message argAt(0) asString), call target setSlot(call message argAt(0) asString, call message argAt(1)))
+# )
+
+# OperatorTable addAssignOperator("||=", "setIfNotSet")
View
2  main.io
@@ -1,4 +1,5 @@
doFile("lib/backpacking.io")
+
MyApp := BackPacking clone
People := DBSrc clone do(
@@ -23,7 +24,6 @@ UsersList := MyApp controller("/people") do(
self get
)
)
-
Views := MyApp views do(
index := method(controller,
Please sign in to comment.
Something went wrong with that request. Please try again.