doc_my_routes 0.10.0 → 0.11.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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 54f18694c17c44df5a459dbd06eff87d4bd90bad
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6e6800ca18c370bfd7c8f468798b0982c52bf44d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 6ba99e20fdd9c3b31a0cd16414d557bfcb10bb0e3433b906676904a42aa3b935006bfb13d63502b40a32e6a606340549a1ede5888881bf58f79691e2e025aab6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 9595e10d9a9acd1d56ec57892553e9b5803c7efcad735e34f4c1579dc9cb17c708d62b6de5a2108dddeebb5e845535ec79917374aee277d37963f027c6596078
         
     | 
| 
         @@ -36,6 +36,10 @@ module DocMyRoutes 
     | 
|
| 
       36 
36 
     | 
    
         
             
                    Object.const_defined?('Rack::URLMap')
         
     | 
| 
       37 
37 
     | 
    
         
             
                  end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
      
 39 
     | 
    
         
            +
                  def inherit_mapping(child_class, super_class)
         
     | 
| 
      
 40 
     | 
    
         
            +
                    (@inherited_mappings ||= {})[child_class.to_s] = super_class.to_s
         
     | 
| 
      
 41 
     | 
    
         
            +
                  end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
       39 
43 
     | 
    
         
             
                  # This method associates to each route its namespace, if detected.
         
     | 
| 
       40 
44 
     | 
    
         
             
                  #
         
     | 
| 
       41 
45 
     | 
    
         
             
                  # Note: when application A is inherited by B and only B is mapped, from
         
     | 
| 
         @@ -100,15 +104,19 @@ module DocMyRoutes 
     | 
|
| 
       100 
104 
     | 
    
         
             
                    class_name = remapped_applications[class_name].first if \
         
     | 
| 
       101 
105 
     | 
    
         
             
                      remapped_applications.key?(class_name)
         
     | 
| 
       102 
106 
     | 
    
         | 
| 
       103 
     | 
    
         
            -
                     
     | 
| 
      
 107 
     | 
    
         
            +
                    validate_locations(class_name, extract_locations(class_name))
         
     | 
| 
      
 108 
     | 
    
         
            +
                  end
         
     | 
| 
       104 
109 
     | 
    
         | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
      
 110 
     | 
    
         
            +
                  def extract_locations(class_name)
         
     | 
| 
      
 111 
     | 
    
         
            +
                    route_mapping[class_name] || route_mapping[(@inherited_mappings || {})[class_name]]
         
     | 
| 
       106 
112 
     | 
    
         
             
                  end
         
     | 
| 
       107 
113 
     | 
    
         | 
| 
       108 
114 
     | 
    
         
             
                  # Detects if multiple locations are available and for now fail
         
     | 
| 
       109 
115 
     | 
    
         
             
                  def validate_locations(resource, locations)
         
     | 
| 
       110 
     | 
    
         
            -
                    fail "Resource #{resource} has  
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
      
 116 
     | 
    
         
            +
                    fail NoMappingDetected, "Resource #{resource} has no mapping, so we can't tell where " \
         
     | 
| 
      
 117 
     | 
    
         
            +
                      'it is mounted!' if locations.nil?
         
     | 
| 
      
 118 
     | 
    
         
            +
                    fail MultipleMappingDetected, "Resource #{resource} has multiple mappings, but that's " \
         
     | 
| 
      
 119 
     | 
    
         
            +
                      "not supported yet: #{locations}" if locations.size > 1
         
     | 
| 
       112 
120 
     | 
    
         | 
| 
       113 
121 
     | 
    
         
             
                    return locations.first if locations.size == 1
         
     | 
| 
       114 
122 
     | 
    
         | 
| 
         @@ -20,7 +20,7 @@ module DocMyRoutes 
     | 
|
| 
       20 
20 
     | 
    
         
             
                      namespace = format('%-50s', app_routes.first.namespace)
         
     | 
| 
       21 
21 
     | 
    
         
             
                      DocMyRoutes.logger.debug "Adding route to #{namespace} - #{app_name}"
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
                      app_routes.each { |rte| logger.debug " - #{rte}" }
         
     | 
| 
      
 23 
     | 
    
         
            +
                      app_routes.each { |rte| DocMyRoutes.logger.debug " - #{rte}" }
         
     | 
| 
       24 
24 
     | 
    
         
             
                    end
         
     | 
| 
       25 
25 
     | 
    
         
             
                  end
         
     | 
| 
       26 
26 
     | 
    
         
             
                end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: doc_my_routes
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.11.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Workday, Ltd.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-11-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |