diff --git a/.gitignore b/.gitignore index 3ce05225..8ad9a4c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ /.crystal /.shards -/libs +/lib /bin/shards /test/.repositories /test/.shards -/test/.libs +/test/.lib /tmp diff --git a/SPEC.md b/SPEC.md index 527ab8e7..6fc836b5 100644 --- a/SPEC.md +++ b/SPEC.md @@ -235,7 +235,7 @@ installed or upgraded in a project that requires it. This may be used to compile a C library, to build tools to help working on the project, or anything else. The script will be run from the dependency's installation directory, for example -`libs/foo` for a Shard named `foo`. +`lib/foo` for a Shard named `foo`. ```yaml scripts: diff --git a/src/config.cr b/src/config.cr index 23dc0de0..236de2f6 100644 --- a/src/config.cr +++ b/src/config.cr @@ -13,7 +13,7 @@ module Shards end def self.install_path - @@install_path ||= ENV.fetch("SHARDS_INSTALL_PATH") { File.join(Dir.current, "libs") } + @@install_path ||= ENV.fetch("SHARDS_INSTALL_PATH") { File.join(Dir.current, "lib") } end def self.install_path=(@@install_path : String) diff --git a/src/man/shards.1 b/src/man/shards.1 index 0caf632b..5fd282cf 100644 --- a/src/man/shards.1 +++ b/src/man/shards.1 @@ -48,7 +48,7 @@ Prints the Shards version. .PP \fBinstall\fR .RS 4 -Resolves and installs dependencies into the \fIlibs\fR folder. If not already +Resolves and installs dependencies into the \fIlib\fR folder. If not already present, generates a \fIshard.lock\fR file from resolved dependencies, locking version numbers or Git commits. .PP @@ -60,7 +60,7 @@ doesn't generate a conflict, thus generating a new \fIshard.lock\fR file. .PP \fBupdate\fR .RS 4 -Resolves and updates all dependencies into the \fIlibs\fR folder again, +Resolves and updates all dependencies into the \fIlib\fR folder again, whatever the locked versions and commits in the \fIshard.lock\fR file. Eventually generates a new \fIshard.lock\fR file. .RE diff --git a/test/integration/install_test.cr b/test/integration/install_test.cr index 44066e5b..b7ea9dae 100644 --- a/test/integration/install_test.cr +++ b/test/integration/install_test.cr @@ -225,7 +225,7 @@ class InstallCommandTest < Minitest::Test def test_runs_postinstall_script with_shard({ dependencies: { post: "*" } }) do run "shards install" - assert File.exists?(File.join(application_path, "libs", "post", "made.txt")) + assert File.exists?(File.join(application_path, "lib", "post", "made.txt")) end end @@ -234,7 +234,7 @@ class InstallCommandTest < Minitest::Test ex = assert_raises(FailedCommand) { run "shards install --no-color" } assert_match "E: Failed make:\n", ex.stdout assert_match "test -n ''\n", ex.stdout - refute Dir.exists?(File.join(application_path, "libs", "fails")) + refute Dir.exists?(File.join(application_path, "lib", "fails")) end end diff --git a/test/integration/prune_test.cr b/test/integration/prune_test.cr index 6731a3e4..19107dbd 100644 --- a/test/integration/prune_test.cr +++ b/test/integration/prune_test.cr @@ -20,18 +20,18 @@ class PruneCommandTest < Minitest::Test end def test_removes_directories - Dir.mkdir(File.join(application_path, "libs", "test")) + Dir.mkdir(File.join(application_path, "lib", "test")) Dir.cd(application_path) { run "shards prune" } assert_equal ["web"], installed_dependencies end def test_wont_remove_files - File.write(File.join(application_path, "libs", ".keep"), "") + File.write(File.join(application_path, "lib", ".keep"), "") Dir.cd(application_path) { run "shards prune" } assert_equal [".keep", "web"], installed_dependencies.sort end private def installed_dependencies - Dir[File.join(application_path, "libs", "*")].map { |path| File.basename(path) } + Dir[File.join(application_path, "lib", "*")].map { |path| File.basename(path) } end end diff --git a/test/integration_helper.cr b/test/integration_helper.cr index fb1791ae..61a7e4cb 100644 --- a/test/integration_helper.cr +++ b/test/integration_helper.cr @@ -113,7 +113,7 @@ class Minitest::Test end def install_path(project, *path_names) - File.join(application_path, "libs", project, *path_names) + File.join(application_path, "lib", project, *path_names) end def debug(command) diff --git a/test/test_helper.cr b/test/test_helper.cr index 5ee04205..9d417ed9 100644 --- a/test/test_helper.cr +++ b/test/test_helper.cr @@ -4,7 +4,7 @@ require "../src/logger" require "../src/manager" Shards.cache_path = File.join(__DIR__, ".shards") -Shards.install_path = File.join(__DIR__, ".libs") +Shards.install_path = File.join(__DIR__, ".lib") require "./support/factories" require "./support/mock_resolver"