heroics 0.0.10 → 0.0.11
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/README.md +1 -1
- data/lib/heroics/schema.rb +12 -7
- data/lib/heroics/version.rb +1 -1
- data/lib/heroics/views/client.erb +2 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0c15b2dbfd69a0a90de845e61c2bcf8d6fbca977
         | 
| 4 | 
            +
              data.tar.gz: c1ae596e31f13f0c675aa7a2f4415b4aab0113d7
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 07f65432fcdb7b39850de5ec236757934c11cc1b38531301792bd7fd7abb67c4c28f174dbe57bd61e860b5a07c61f0dd3e94c4abbd136bdf1bf7d07c385a6eca
         | 
| 7 | 
            +
              data.tar.gz: 0334b0aba420505450b8f5843028512729c5ba6ead454b5d3256d2472832bed16c96e5965eccc3dd4c84934b57ed6d008d119685bf9e7dd312924b36fc0db9fe
         | 
    
        data/README.md
    CHANGED
    
    | @@ -92,7 +92,7 @@ end | |
| 92 92 |  | 
| 93 93 | 
             
            ## Contributing
         | 
| 94 94 |  | 
| 95 | 
            -
            1. [Fork the repository](https://github.com/ | 
| 95 | 
            +
            1. [Fork the repository](https://github.com/interagent/heroics/fork)
         | 
| 96 96 | 
             
            2. Create your feature branch (`git checkout -b my-new-feature`)
         | 
| 97 97 | 
             
            3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| 98 98 | 
             
            4. Push to the branch (`git push origin my-new-feature`)
         | 
    
        data/lib/heroics/schema.rb
    CHANGED
    
    | @@ -245,11 +245,10 @@ module Heroics | |
| 245 245 | 
             
                # @return [Array<Parameter|ParameterChoice>] A list of parameter instances
         | 
| 246 246 | 
             
                #   that represent parameters to be injected into the link URL.
         | 
| 247 247 | 
             
                def resolve_parameter_details(parameters)
         | 
| 248 | 
            -
                  properties = @schema['definitions'][@resource_name]['properties']
         | 
| 249 | 
            -
             | 
| 250 | 
            -
                  # URI decode parameters and strip the leading '{(' and trailing ')}'.
         | 
| 251 | 
            -
                  parameters = parameters.map { |parameter| URI.unescape(parameter[2..-3]) }
         | 
| 252 248 | 
             
                  parameters.map do |parameter|
         | 
| 249 | 
            +
                    # URI decode parameters and strip the leading '{(' and trailing ')}'.
         | 
| 250 | 
            +
                    parameter = URI.unescape(parameter[2..-3])
         | 
| 251 | 
            +
             | 
| 253 252 | 
             
                    # Split the path into components and discard the leading '#' that
         | 
| 254 253 | 
             
                    # represents the root of the schema.
         | 
| 255 254 | 
             
                    path = parameter.split('/')[1..-1]
         | 
| @@ -280,7 +279,7 @@ module Heroics | |
| 280 279 | 
             
                    parameter = info['$ref']
         | 
| 281 280 | 
             
                    path = parameter.split('/')[1..-1]
         | 
| 282 281 | 
             
                    info = lookup_parameter(path, @schema)
         | 
| 283 | 
            -
                    resource_name = path[1].gsub('-', '_')
         | 
| 282 | 
            +
                    resource_name = path.size > 2 ? path[1].gsub('-', '_') : nil
         | 
| 284 283 | 
             
                    name = path[-1]
         | 
| 285 284 | 
             
                    Parameter.new(resource_name, name, info['description'])
         | 
| 286 285 | 
             
                  end
         | 
| @@ -346,7 +345,7 @@ module Heroics | |
| 346 345 | 
             
                # The name of the parameter, with the resource included, suitable for use
         | 
| 347 346 | 
             
                # in a function signature.
         | 
| 348 347 | 
             
                def name
         | 
| 349 | 
            -
                   | 
| 348 | 
            +
                  [@resource_name, @name].compact.join("_")
         | 
| 350 349 | 
             
                end
         | 
| 351 350 |  | 
| 352 351 | 
             
                # A pretty representation of this instance.
         | 
| @@ -367,7 +366,13 @@ module Heroics | |
| 367 366 | 
             
                # A name created by merging individual parameter descriptions, suitable
         | 
| 368 367 | 
             
                # for use in a function signature.
         | 
| 369 368 | 
             
                def name
         | 
| 370 | 
            -
                  @parameters.map  | 
| 369 | 
            +
                  @parameters.map do |parameter|
         | 
| 370 | 
            +
                    if parameter.resource_name
         | 
| 371 | 
            +
                      parameter.name
         | 
| 372 | 
            +
                    else
         | 
| 373 | 
            +
                      "#{@resource_name}_#{parameter.name}"
         | 
| 374 | 
            +
                    end
         | 
| 375 | 
            +
                  end.join('_or_')
         | 
| 371 376 | 
             
                end
         | 
| 372 377 |  | 
| 373 378 | 
             
                # A description created by merging individual parameter descriptions.
         | 
    
        data/lib/heroics/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: heroics
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.11
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - geemus
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2014- | 
| 12 | 
            +
            date: 2014-07-14 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: bundler
         |