Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Rename bundle.json to tack.json
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen committed Oct 14, 2018
1 parent 03802b8 commit d202aaa
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ actor Main

```bash
stable fetch
# The dependencies listed in `bundle.json` will be fetched
# The dependencies listed in `tack.json` will be fetched
# and/or updated into the local `.deps` directory.
```
```
Expand All @@ -193,7 +193,7 @@ Checking connectivity... done.

```bash
stable env ponyc --debug
# The local paths to the dependencies listed in `bundle.json`
# The local paths to the dependencies listed in `tack.json`
# will be included in the `PONYPATH` environment variable,
# available to `use` in the `ponyc` invocation.
# You can run any custom command here - not just `ponyc`.
Expand Down
2 changes: 1 addition & 1 deletion stable/_bundle_locator.pony
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ primitive _BundleLocator
var path = start_path
while path.size() > 0 do
let candidate = try
FilePath(env.root as AmbientAuth, path)?.join("bundle.json")?
FilePath(env.root as AmbientAuth, path)?.join("tack.json")?
else
return None
end
Expand Down
6 changes: 3 additions & 3 deletions stable/_test.pony
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class _TestBundleLocator is UnitTest
h.assert_eq[String]("stable/test/testdata/nested/deeply",
_BundleLocator(h.env, bundle("nested/deeply")) as String)

// nested/empty has no bundle.json
// nested/empty has no tack.json
h.assert_eq[String]("stable/test/testdata/nested",
_BundleLocator(h.env, bundle("nested/empty")) as String)

// stable itself has no bundle.json, so this ancestor-checking
// from stable/test/testdata/empty yields no bundle.json
// stable itself has no tack.json, so this ancestor-checking
// from stable/test/testdata/empty yields no tack.json
h.assert_eq[None](None, _BundleLocator(h.env, bundle("empty")) as None)
4 changes: 2 additions & 2 deletions stable/bundle.pony
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Bundle
path = path'
log = log'

let bundle_path = path.join("bundle.json")?
let bundle_path = path.join("tack.json")?

if not bundle_path.exists() then
if create_on_missing then
Expand Down Expand Up @@ -87,5 +87,5 @@ class Bundle
else JsonArray
end
deps_array.data.push(dep_json)
let file = CreateFile(path.join("bundle.json")?) as File
let file = CreateFile(path.join("tack.json")?) as File
file.write(json.string(" ", true))
4 changes: 2 additions & 2 deletions stable/main.pony
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ actor Main
""
" A simple dependency manager for the Pony language."
""
" Invoke in a working directory containing a bundle.json."
" Invoke in a working directory containing a tack.json."
""
"Commands:"
" help - Print this message"
Expand All @@ -41,7 +41,7 @@ actor Main
if create_on_missing then
Bundle(FilePath(env.root as AmbientAuth, cwd)?, log, true)?
else
log("No bundle.json in current working directory or ancestors.")
log("No tack.json in current working directory or ancestors.")
error
end
end
Expand Down
46 changes: 23 additions & 23 deletions stable/test/integration/test_env.pony
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ actor EnvTests is TestList
class TestEnvNoBundle is UnitTest
new iso create() => None

fun name(): String => "integration.Env(no bundle.json)"
fun name(): String => "integration.Env(no tack.json)"

fun apply(h: TestHelper) =>
h.long_test(2_000_000_000)
Expand All @@ -35,7 +35,7 @@ class TestEnvNoBundle is UnitTest

let notifier: ProcessNotify iso = _ExpectClient(h,
None,
["No bundle.json in current working directory or ancestors."],
["No tack.json in current working directory or ancestors."],
0)
_Exec(h, "stable env", tmp.path, consume notifier)

Expand All @@ -59,13 +59,13 @@ class TestEnvEmptyBundleInSameDir is UnitTest

let f =
try
Directory(tmp)?.create_file("bundle.json")?
Directory(tmp)?.create_file("tack.json")?
else
h.fail("failed to create bundle.json in temporary directory")
h.fail("failed to create tack.json in temporary directory")
h.complete(false)
return
end
h.assert_true(f.write("{\"deps\":[]}\n"), "prepare bundle.json")
h.assert_true(f.write("{\"deps\":[]}\n"), "prepare tack.json")

let notifier: ProcessNotify iso = _ExpectClient(h,
["PONYPATH=\n"], // empty
Expand Down Expand Up @@ -93,9 +93,9 @@ class TestEnvBundleInSameDir is UnitTest

let f =
try
Directory(tmp)?.create_file("bundle.json")?
Directory(tmp)?.create_file("tack.json")?
else
h.fail("failed to create bundle.json in temporary directory")
h.fail("failed to create tack.json in temporary directory")
h.complete(false)
return
end
Expand All @@ -104,7 +104,7 @@ class TestEnvBundleInSameDir is UnitTest
{\"type\": \"local-git\", \"local-path\":\"../local-git/b\"},
{\"type\": \"github\", \"repo\":\"github/c\"},
{\"type\": \"gitlab\", \"repo\":\"gitlab/d\"}
]}\n"), "prepare bundle.json")
]}\n"), "prepare tack.json")

let expected =
try
Expand Down Expand Up @@ -144,15 +144,15 @@ class TestEnvBundleInSameDirWithCall is UnitTest

let f =
try
Directory(tmp)?.create_file("bundle.json")?
Directory(tmp)?.create_file("tack.json")?
else
h.fail("failed to create bundle.json in temporary directory")
h.fail("failed to create tack.json in temporary directory")
h.complete(false)
return
end
h.assert_true(f.write("{\"deps\":[
{\"type\": \"local\", \"local-path\":\"../local/a\"}
]}\n"), "prepare bundle.json")
]}\n"), "prepare tack.json")

let notifier: ProcessNotify iso = _ExpectClient(h,
["../local/a"],
Expand All @@ -163,7 +163,7 @@ class TestEnvBundleInSameDirWithCall is UnitTest
class TestEnvBundleInParentDir is UnitTest
new iso create() => None

fun name(): String => "integration.Env(bundle.json in parent dir)"
fun name(): String => "integration.Env(tack.json in parent dir)"

fun apply(h: TestHelper) =>
h.long_test(2_000_000_000)
Expand All @@ -182,15 +182,15 @@ class TestEnvBundleInParentDir is UnitTest
try
h.assert_true(Directory(tmp)?.mkdir("nested"), "create nested directory")
let n = tmp.join("nested")?
(Directory(tmp)?.create_file("bundle.json")?, n)
(Directory(tmp)?.create_file("tack.json")?, n)
else
h.fail("failed to create bundle.json in nested temporary directory")
h.fail("failed to create tack.json in nested temporary directory")
h.complete(false)
return
end
h.assert_true(f.write("{\"deps\":[
{\"type\": \"local\", \"local-path\":\"../local/a\"}
]}\n"), "prepare bundle.json")
]}\n"), "prepare tack.json")

let notifier: ProcessNotify iso = _ExpectClient(h,
["PONYPATH=" + Path.join(tmp.path, "../local/a")],
Expand All @@ -201,7 +201,7 @@ class TestEnvBundleInParentDir is UnitTest
class TestEnvBadBundleInNestedAndValidBundleInParentDir is UnitTest
new iso create() => None

fun name(): String => "integration.Env(invalid bundle.json in nested dir)"
fun name(): String => "integration.Env(invalid tack.json in nested dir)"

fun apply(h: TestHelper) =>
h.long_test(2_000_000_000)
Expand All @@ -220,21 +220,21 @@ class TestEnvBadBundleInNestedAndValidBundleInParentDir is UnitTest
try
h.assert_true(Directory(tmp)?.mkdir("nested"), "create nested directory")
let n = tmp.join("nested")?
(Directory(n)?.create_file("bundle.json")?,
Directory(tmp)?.create_file("bundle.json")?,
(Directory(n)?.create_file("tack.json")?,
Directory(tmp)?.create_file("tack.json")?,
n)
else
h.fail("failed to create bundle.json example data files")
h.fail("failed to create tack.json example data files")
h.complete(false)
return
end
h.assert_true(good_bundle.write("{\"deps\":[
{\"type\": \"local\", \"local-path\":\"../local/a\"}
]}\n"), "prepare good bundle.json")
h.assert_true(bad_bundle.write("{}"), "prepare bad bundle.json")
]}\n"), "prepare good tack.json")
h.assert_true(bad_bundle.write("{}"), "prepare bad tack.json")

// This verifies that the parent-dir bundle.json isn't picked up if the
// nested-dir bundle.json is invalid.
// This verifies that the parent-dir tack.json isn't picked up if the
// nested-dir tack.json is invalid.
let notifier: ProcessNotify iso = _ExpectClient(h,
["PONYPATH=$"],
["JSON error at: " + bad_bundle.path.path + ": missing \"deps\" array"],
Expand Down
12 changes: 6 additions & 6 deletions stable/test/test_bundle.pony
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class TestBundle is UnitTest

fun apply(h: TestHelper) ? =>
h.assert_error(_BundleCreate(h.env, "notfound")?, "nonexistant directory")
h.assert_error(_BundleCreate(h.env, bundle("empty"))?, "no bundle.json")
h.assert_error(_BundleCreate(h.env, bundle("bad/empty"))?, "empty bundle.json")
h.assert_error(_BundleCreate(h.env, bundle("bad/wrong_format"))?, "wrong bundle.json")
h.assert_error(_BundleCreate(h.env, bundle("empty"))?, "no tack.json")
h.assert_error(_BundleCreate(h.env, bundle("bad/empty"))?, "empty tack.json")
h.assert_error(_BundleCreate(h.env, bundle("bad/wrong_format"))?, "wrong tack.json")

h.assert_no_error(_BundleCreate(h.env, bundle("empty-deps"))?, "empty deps")
h.assert_no_error(_BundleCreate(h.env, bundle("github"))?, "github dep")
Expand All @@ -26,14 +26,14 @@ class TestBundle is UnitTest

h.assert_no_error(_BundleCreate(h.env, bundle("empty"), true)?, "create in directory with no bunde.json")

let file = FilePath(h.env.root as AmbientAuth, bundle("empty/bundle.json"))?
h.assert_true(file.exists(), "empty bundle.json created")
let file = FilePath(h.env.root as AmbientAuth, bundle("empty/tack.json"))?
h.assert_true(file.exists(), "empty tack.json created")
let f = OpenFile(file) as File
let content: String = f.read_string(f.size())
h.assert_eq[String]("{\"deps\":[]}\n", content)

fun tear_down(h: TestHelper) =>
let created_bundle = bundle("empty/bundle.json")
let created_bundle = bundle("empty/tack.json")
try
FilePath(h.env.root as AmbientAuth, created_bundle)?.remove()
else
Expand Down

0 comments on commit d202aaa

Please sign in to comment.