From 98c4605dfc52744cff8425c97d9d1f52b8c0f775 Mon Sep 17 00:00:00 2001 From: grossiwm Date: Sun, 13 Oct 2024 05:12:12 -0300 Subject: [PATCH 1/7] fix: add spaces between directory and file names in ls output --- Gemfile.lock | 38 ++++++++++++++++++++------------------ lib/packages/ls.rb | 11 ++++++++++- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 774a14d..9050337 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,28 +1,30 @@ GEM remote: https://rubygems.org/ specs: - colorize (0.8.1) - diff-lcs (1.3) - os (1.0.0) - psych (2.1.0) - rake (12.3.3) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) + colorize (1.1.0) + diff-lcs (1.5.1) + os (1.1.4) + psych (5.1.2) + stringio + rake (13.2.1) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.1) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + stringio (3.1.1) PLATFORMS ruby - x86-mingw32 + x86_64-linux DEPENDENCIES bundler @@ -33,4 +35,4 @@ DEPENDENCIES rspec BUNDLED WITH - 1.15.4 + 2.5.21 diff --git a/lib/packages/ls.rb b/lib/packages/ls.rb index a6e39be..8673aaf 100755 --- a/lib/packages/ls.rb +++ b/lib/packages/ls.rb @@ -24,7 +24,7 @@ def self.main params end # Use the Core class of ShellRB to print result - Core.print_result result + Core.print_result prepared_result result result end @@ -49,4 +49,13 @@ def self.show_non_hidden end non_hidden end + + def self.prepared_result unprepared_result + array = unprepared_result.to_a + + array.each_with_index do |entry, index| + array[index] = "#{entry} " unless index == array.size - 1 + end + Set.new(array) + end end From a5b7b2e2828f43e6278e63f4931e20f8775c9f23 Mon Sep 17 00:00:00 2001 From: grossiwm Date: Sun, 13 Oct 2024 16:11:27 -0300 Subject: [PATCH 2/7] refactor: change ruby version for CI --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 5ce52a7..5090f09 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.6', '2.7', '3.0'] + ruby-version: ['3.3.0'] steps: - uses: actions/checkout@v3 From ccd12ff171bf70c44a90fec60022cf146a1f8c8c Mon Sep 17 00:00:00 2001 From: grossiwm Date: Sun, 13 Oct 2024 16:31:49 -0300 Subject: [PATCH 3/7] refactor: downgrade ruby version for CI --- .github/workflows/ruby.yml | 2 +- Gemfile.lock | 38 -------------------------------------- 2 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 5090f09..d57e5fc 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.3.0'] + ruby-version: ['3.1.2'] steps: - uses: actions/checkout@v3 diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 9050337..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,38 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - colorize (1.1.0) - diff-lcs (1.5.1) - os (1.1.4) - psych (5.1.2) - stringio - rake (13.2.1) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.1) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-mocks (3.13.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.1) - stringio (3.1.1) - -PLATFORMS - ruby - x86_64-linux - -DEPENDENCIES - bundler - colorize - os - psych - rake - rspec - -BUNDLED WITH - 2.5.21 From 260012f002a3b2419f624461158b3db5c612304b Mon Sep 17 00:00:00 2001 From: grossiwm Date: Sun, 13 Oct 2024 17:07:50 -0300 Subject: [PATCH 4/7] refactor: do not update ruby and bundler versions --- .github/workflows/ruby.yml | 4 ++-- Gemfile.lock | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 Gemfile.lock diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d57e5fc..d80aa8c 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ name: Ruby on: push: - branches: [ "master" ] + branches: [ "ci" ] pull_request: branches: [ "master" ] @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.1.2'] + ruby-version: ['2.6', '2.7', '3.0'] steps: - uses: actions/checkout@v3 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..e955523 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,36 @@ +GEM + remote: https://rubygems.org/ + specs: + colorize (0.8.1) + diff-lcs (1.3) + os (1.0.0) + psych (2.1.0) + rake (12.3.3) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + +PLATFORMS + ruby + x86-mingw32 + +DEPENDENCIES + bundler + colorize + os + psych + rake + rspec + +BUNDLED WITH + 1.15.4 \ No newline at end of file From 5c99f4277f1ec9c50e68101d66a6e3cdc2ed9300 Mon Sep 17 00:00:00 2001 From: grossiwm Date: Sun, 13 Oct 2024 17:15:58 -0300 Subject: [PATCH 5/7] refactor: ci running branch --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d80aa8c..5ce52a7 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ name: Ruby on: push: - branches: [ "ci" ] + branches: [ "master" ] pull_request: branches: [ "master" ] From f0c6f2e29b52df80a26cc25c695651a7e8f4fda2 Mon Sep 17 00:00:00 2001 From: grossiwm Date: Sun, 13 Oct 2024 17:35:09 -0300 Subject: [PATCH 6/7] Gemlock from master --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e955523..774a14d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,4 +33,4 @@ DEPENDENCIES rspec BUNDLED WITH - 1.15.4 \ No newline at end of file + 1.15.4 From fcda6ed9d0ac96876ededf2a32d954a40dc693a1 Mon Sep 17 00:00:00 2001 From: grossiwm Date: Mon, 14 Oct 2024 23:05:09 -0300 Subject: [PATCH 7/7] top-level documentation to fix deepsource issue --- lib/packages/ls.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/packages/ls.rb b/lib/packages/ls.rb index 8673aaf..3f028fd 100755 --- a/lib/packages/ls.rb +++ b/lib/packages/ls.rb @@ -1,6 +1,10 @@ require 'set' require_relative 'core' +# The Ls class simulates a simplified version of the Unix 'ls' command, +# listing files and directories in the current working directory. +# It includes options for showing all files, including hidden ones, +# or just non-hidden files by default. class Ls def self.main params # Create new instance of Ruby data structure Set to add output to it