rswag-schema_components 0.3.4 → 0.4.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/lib/rswag/schema_components/loader.rb +33 -5
 - data/lib/rswag/schema_components/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: cdbe6ec79d6079d3ff7cc0140aeff7f7b1601d28cc2c6162cc02ce93bdac955a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3986c07499d385764bd05f3e9f9676f55419ca253c034dc9a663278e472bb20b
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: eca7f4ff84bc270001afe84a2881c701eb712892753f4aecbad14173d0368c7d61004288e2bdb6d9cc7db5e5094be593b7c7a9f664528b17402a5be0c6a7515e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5f3883a422fd082716bf8c643d37266e973281e97a4428e953ef6a42230d69fe9be1f3910f498d7be25cf7071eb5bb233eabbf89181bc1bc5fe41b2e5d3438b6
         
     | 
| 
         @@ -59,12 +59,16 @@ module Rswag 
     | 
|
| 
       59 
59 
     | 
    
         
             
                  end
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                  private def load_classes
         
     | 
| 
       62 
     | 
    
         
            -
                     
     | 
| 
       63 
     | 
    
         
            -
                      next if File.directory?(file_path)
         
     | 
| 
      
 62 
     | 
    
         
            +
                    all_paths = base_paths
         
     | 
| 
       64 
63 
     | 
    
         | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
                        . 
     | 
| 
      
 64 
     | 
    
         
            +
                    all_paths.flat_map do |base_path|
         
     | 
| 
      
 65 
     | 
    
         
            +
                      Dir.glob(base_path.join("#{definitions_path}/**/*")).filter_map do |file_path|
         
     | 
| 
      
 66 
     | 
    
         
            +
                        next if File.directory?(file_path)
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                        file_path.gsub(base_path.to_s, "") # remove base_path
         
     | 
| 
      
 69 
     | 
    
         
            +
                          .gsub(".rb", "") # remove extension
         
     | 
| 
      
 70 
     | 
    
         
            +
                          .camelize.constantize
         
     | 
| 
      
 71 
     | 
    
         
            +
                      end
         
     | 
| 
       68 
72 
     | 
    
         
             
                    end
         
     | 
| 
       69 
73 
     | 
    
         
             
                  end
         
     | 
| 
       70 
74 
     | 
    
         | 
| 
         @@ -90,6 +94,30 @@ module Rswag 
     | 
|
| 
       90 
94 
     | 
    
         
             
                  private def base_path
         
     | 
| 
       91 
95 
     | 
    
         
             
                    @base_path ||= Rails.root.join(Rswag::SchemaComponents.components_base_path)
         
     | 
| 
       92 
96 
     | 
    
         
             
                  end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  private def base_paths
         
     | 
| 
      
 99 
     | 
    
         
            +
                    @base_paths ||= begin
         
     | 
| 
      
 100 
     | 
    
         
            +
                      paths = [base_path]
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                      if packs_rails_present?
         
     | 
| 
      
 103 
     | 
    
         
            +
                        paths.concat(packs_directories.map { |pack_dir| pack_dir.join(Rswag::SchemaComponents.components_base_path) })
         
     | 
| 
      
 104 
     | 
    
         
            +
                      end
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
                      paths
         
     | 
| 
      
 107 
     | 
    
         
            +
                    end
         
     | 
| 
      
 108 
     | 
    
         
            +
                  end
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                  private def packs_rails_present?
         
     | 
| 
      
 111 
     | 
    
         
            +
                    defined?(Packs)
         
     | 
| 
      
 112 
     | 
    
         
            +
                  rescue NameError
         
     | 
| 
      
 113 
     | 
    
         
            +
                    false
         
     | 
| 
      
 114 
     | 
    
         
            +
                  end
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
                  private def packs_directories
         
     | 
| 
      
 117 
     | 
    
         
            +
                    return [] unless packs_rails_present?
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                    Packs.all.map { |pack| Rails.root.join(pack.relative_path) }
         
     | 
| 
      
 120 
     | 
    
         
            +
                  end
         
     | 
| 
       93 
121 
     | 
    
         
             
                end
         
     | 
| 
       94 
122 
     | 
    
         
             
              end
         
     | 
| 
       95 
123 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rswag-schema_components
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.4.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Marten Klitzke
         
     | 
| 
       8 
8 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       9 
9 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       10 
     | 
    
         
            -
            date: 2025- 
     | 
| 
      
 10 
     | 
    
         
            +
            date: 2025-08-21 00:00:00.000000000 Z
         
     | 
| 
       11 
11 
     | 
    
         
             
            dependencies:
         
     | 
| 
       12 
12 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       13 
13 
     | 
    
         
             
              name: rails
         
     |