From 4fd71d7c3dd493ef4918b9cfcca220a04a778e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dorian=20Mari=C3=A9?= Date: Thu, 11 Jul 2024 16:37:50 +0200 Subject: [PATCH] dir-and-self --- Gemfile.lock | 4 ++-- bin/{dir => dir-and-self} | 2 ++ dorian-dir-and-self.gemspec | 15 +++++++++++++++ dorian-dir.gemspec | 15 --------------- spec/{dir_spec.rb => dir_and_self_spec.rb} | 3 ++- 5 files changed, 21 insertions(+), 18 deletions(-) rename bin/{dir => dir-and-self} (96%) create mode 100644 dorian-dir-and-self.gemspec delete mode 100644 dorian-dir.gemspec rename spec/{dir_spec.rb => dir_and_self_spec.rb} (86%) diff --git a/Gemfile.lock b/Gemfile.lock index d8bd1c0..7bc520f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dorian-dir (0.4.1) + dorian-dir-and-self (0.1.0) GEM remote: https://rubygems.org/ @@ -92,7 +92,7 @@ PLATFORMS ruby DEPENDENCIES - dorian-dir! + dorian-dir-and-self! rspec rubocop-rails-omakase diff --git a/bin/dir b/bin/dir-and-self similarity index 96% rename from bin/dir rename to bin/dir-and-self index 69d6fa7..07f9f50 100755 --- a/bin/dir +++ b/bin/dir-and-self @@ -8,6 +8,8 @@ end PATHS = ARGV.any? ? ARGV : ["."] +puts PATHS + PATHS.each do |path| puts( Dir diff --git a/dorian-dir-and-self.gemspec b/dorian-dir-and-self.gemspec new file mode 100644 index 0000000..20699d3 --- /dev/null +++ b/dorian-dir-and-self.gemspec @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +Gem::Specification.new do |s| + s.name = "dorian-dir-and-self" + s.version = "0.1.0" + s.summary = "List directories and self" + s.description = "#{s.summary}\n\ne.g. `dir-and-self`" + s.authors = ["Dorian MariƩ"] + s.email = "dorian@dorianmarie.com" + s.files = ["bin/dir-and-self"] + s.executables << "dir-and-self" + s.homepage = "https://github.com/dorianmariecom/dorian-dir-and-self" + s.license = "MIT" + s.metadata = { "rubygems_mfa_required" => "true" } +end diff --git a/dorian-dir.gemspec b/dorian-dir.gemspec deleted file mode 100644 index 800c9dd..0000000 --- a/dorian-dir.gemspec +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -Gem::Specification.new do |s| - s.name = "dorian-dir" - s.version = "0.4.1" - s.summary = "List directories" - s.description = "#{s.summary}\n\ne.g. `dir`" - s.authors = ["Dorian MariƩ"] - s.email = "dorian@dorianmarie.com" - s.files = ["bin/dir"] - s.executables << "dir" - s.homepage = "https://github.com/dorianmariecom/dorian-dir" - s.license = "MIT" - s.metadata = { "rubygems_mfa_required" => "true" } -end diff --git a/spec/dir_spec.rb b/spec/dir_and_self_spec.rb similarity index 86% rename from spec/dir_spec.rb rename to spec/dir_and_self_spec.rb index d3fc3a5..1f16f6c 100644 --- a/spec/dir_spec.rb +++ b/spec/dir_and_self_spec.rb @@ -13,7 +13,8 @@ `mkdir -p nested/dir/ectory bin spec` `touch a.rb a.js nested/file` - expect(`#{pwd}/bin/dir`).to eq(<<~OUTPUT) + expect(`#{pwd}/bin/dir-and-self`).to eq(<<~OUTPUT) + . bin nested spec