find 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.github/dependabot.yml +6 -0
 - data/.github/workflows/test.yml +13 -9
 - data/Gemfile +1 -0
 - data/find.gemspec +9 -2
 - data/lib/find.rb +4 -2
 - metadata +4 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3b1a5a3a6fabeb224745fc8a582d8073f8e4367197b0cabd63ded6ac07f87d0b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ae770bf6b655abc71b4d908f958d8e57c71a8c3dd532f2daf645e5ba43671f45
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cbc2bc0e48483d1040594d18ef8230a81173b5af812a735e9d02dd59db92272933fb7ebcfeeb666619b3ebbbfdd0f12aaa05dea9990bfd9b6d7856e0123681dd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: cf24528722659c2c521fb38643e7ad2b6eb04403aefe227d05d52b14dd53182e9b54bd8d0a241a897a7db60a37b6d72fdfa7052bb1bde1210fe904d781893fa6
         
     | 
    
        data/.github/workflows/test.yml
    CHANGED
    
    | 
         @@ -3,22 +3,26 @@ name: test 
     | 
|
| 
       3 
3 
     | 
    
         
             
            on: [push, pull_request]
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            jobs:
         
     | 
| 
       6 
     | 
    
         
            -
               
     | 
| 
      
 6 
     | 
    
         
            +
              ruby-versions:
         
     | 
| 
      
 7 
     | 
    
         
            +
                uses: ruby/actions/.github/workflows/ruby_versions.yml@master
         
     | 
| 
      
 8 
     | 
    
         
            +
                with:
         
     | 
| 
      
 9 
     | 
    
         
            +
                  engine: cruby
         
     | 
| 
      
 10 
     | 
    
         
            +
                  min_version: 2.5
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              test:
         
     | 
| 
      
 13 
     | 
    
         
            +
                needs: ruby-versions
         
     | 
| 
       7 
14 
     | 
    
         
             
                name: build (${{ matrix.ruby }} / ${{ matrix.os }})
         
     | 
| 
       8 
15 
     | 
    
         
             
                strategy:
         
     | 
| 
       9 
16 
     | 
    
         
             
                  matrix:
         
     | 
| 
       10 
     | 
    
         
            -
                    ruby:  
     | 
| 
       11 
     | 
    
         
            -
                    os: [ ubuntu-latest, macos-latest ]
         
     | 
| 
      
 17 
     | 
    
         
            +
                    ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
         
     | 
| 
      
 18 
     | 
    
         
            +
                    os: [ ubuntu-latest, macos-latest, windows-latest ]
         
     | 
| 
       12 
19 
     | 
    
         
             
                runs-on: ${{ matrix.os }}
         
     | 
| 
       13 
20 
     | 
    
         
             
                steps:
         
     | 
| 
       14 
     | 
    
         
            -
                - uses: actions/checkout@ 
     | 
| 
      
 21 
     | 
    
         
            +
                - uses: actions/checkout@v4
         
     | 
| 
       15 
22 
     | 
    
         
             
                - name: Set up Ruby
         
     | 
| 
       16 
23 
     | 
    
         
             
                  uses: ruby/setup-ruby@v1
         
     | 
| 
       17 
24 
     | 
    
         
             
                  with:
         
     | 
| 
       18 
25 
     | 
    
         
             
                    ruby-version: ${{ matrix.ruby }}
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                  run: |
         
     | 
| 
       21 
     | 
    
         
            -
                    gem install bundler --no-document
         
     | 
| 
       22 
     | 
    
         
            -
                    bundle install
         
     | 
| 
      
 26 
     | 
    
         
            +
                    bundler-cache: true
         
     | 
| 
       23 
27 
     | 
    
         
             
                - name: Run test
         
     | 
| 
       24 
     | 
    
         
            -
                  run: rake test
         
     | 
| 
      
 28 
     | 
    
         
            +
                  run: bundle exec rake test
         
     | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/find.gemspec
    CHANGED
    
    | 
         @@ -1,6 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            name = File.basename(__FILE__, ".gemspec")
         
     | 
| 
      
 2 
     | 
    
         
            +
            version = ["lib", Array.new(name.count("-")+1).join("/")].find do |dir|
         
     | 
| 
      
 3 
     | 
    
         
            +
              break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
         
     | 
| 
      
 4 
     | 
    
         
            +
                /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
         
     | 
| 
      
 5 
     | 
    
         
            +
              end rescue nil
         
     | 
| 
      
 6 
     | 
    
         
            +
            end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       1 
8 
     | 
    
         
             
            Gem::Specification.new do |spec|
         
     | 
| 
       2 
     | 
    
         
            -
              spec.name          =  
     | 
| 
       3 
     | 
    
         
            -
              spec.version       =  
     | 
| 
      
 9 
     | 
    
         
            +
              spec.name          = name
         
     | 
| 
      
 10 
     | 
    
         
            +
              spec.version       = version
         
     | 
| 
       4 
11 
     | 
    
         
             
              spec.authors       = ['Kazuki Tsujimoto']
         
     | 
| 
       5 
12 
     | 
    
         
             
              spec.email         = ['kazuki@callcc.net']
         
     | 
| 
       6 
13 
     | 
    
         | 
    
        data/lib/find.rb
    CHANGED
    
    | 
         @@ -27,6 +27,8 @@ 
     | 
|
| 
       27 
27 
     | 
    
         
             
            #
         
     | 
| 
       28 
28 
     | 
    
         
             
            module Find
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
      
 30 
     | 
    
         
            +
              VERSION = "0.2.0"
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
       30 
32 
     | 
    
         
             
              #
         
     | 
| 
       31 
33 
     | 
    
         
             
              # Calls the associated block with the name of every file and directory listed
         
     | 
| 
       32 
34 
     | 
    
         
             
              # as arguments, then recursively on their subdirectories, and so on.
         
     | 
| 
         @@ -49,14 +51,14 @@ module Find 
     | 
|
| 
       49 
51 
     | 
    
         
             
                      yield file.dup
         
     | 
| 
       50 
52 
     | 
    
         
             
                      begin
         
     | 
| 
       51 
53 
     | 
    
         
             
                        s = File.lstat(file)
         
     | 
| 
       52 
     | 
    
         
            -
                      rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
         
     | 
| 
      
 54 
     | 
    
         
            +
                      rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
         
     | 
| 
       53 
55 
     | 
    
         
             
                        raise unless ignore_error
         
     | 
| 
       54 
56 
     | 
    
         
             
                        next
         
     | 
| 
       55 
57 
     | 
    
         
             
                      end
         
     | 
| 
       56 
58 
     | 
    
         
             
                      if s.directory? then
         
     | 
| 
       57 
59 
     | 
    
         
             
                        begin
         
     | 
| 
       58 
60 
     | 
    
         
             
                          fs = Dir.children(file, encoding: enc)
         
     | 
| 
       59 
     | 
    
         
            -
                        rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
         
     | 
| 
      
 61 
     | 
    
         
            +
                        rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
         
     | 
| 
       60 
62 
     | 
    
         
             
                          raise unless ignore_error
         
     | 
| 
       61 
63 
     | 
    
         
             
                          next
         
     | 
| 
       62 
64 
     | 
    
         
             
                        end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: find
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Kazuki Tsujimoto
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-11-07 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: This module supports top-down traversal of a set of file paths.
         
     | 
| 
       14 
14 
     | 
    
         
             
            email:
         
     | 
| 
         @@ -17,6 +17,7 @@ executables: [] 
     | 
|
| 
       17 
17 
     | 
    
         
             
            extensions: []
         
     | 
| 
       18 
18 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       19 
19 
     | 
    
         
             
            files:
         
     | 
| 
      
 20 
     | 
    
         
            +
            - ".github/dependabot.yml"
         
     | 
| 
       20 
21 
     | 
    
         
             
            - ".github/workflows/test.yml"
         
     | 
| 
       21 
22 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       22 
23 
     | 
    
         
             
            - Gemfile
         
     | 
| 
         @@ -49,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       49 
50 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       50 
51 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       51 
52 
     | 
    
         
             
            requirements: []
         
     | 
| 
       52 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 53 
     | 
    
         
            +
            rubygems_version: 3.5.0.dev
         
     | 
| 
       53 
54 
     | 
    
         
             
            signing_key:
         
     | 
| 
       54 
55 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       55 
56 
     | 
    
         
             
            summary: This module supports top-down traversal of a set of file paths.
         
     |