clamp 1.3.1 → 1.3.2
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/.editorconfig +9 -0
- data/.rspec +1 -0
- data/.travis.yml +3 -4
- data/CHANGES.md +5 -1
- data/lib/clamp/attribute/definition.rb +2 -2
- data/lib/clamp/messages.rb +4 -1
- data/lib/clamp/option/declaration.rb +1 -1
- data/lib/clamp/subcommand/declaration.rb +3 -3
- data/lib/clamp/subcommand/definition.rb +3 -6
- data/lib/clamp/version.rb +1 -1
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c164c63137c57502ad15e11ab471b2607661868298e5330a8a4961dfea629537
         | 
| 4 | 
            +
              data.tar.gz: 297e0abb1ead811d567eea7e668a91ba7c99654657a358016abb5cdbfd13168d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 3773151ffa64b908d26c569877bb27704bf68efe658d9b6ebd48c009bcbc1a4d0a3fce2c4f16a02ed379e126dd436ef018ff1eac56334fcc8f467402fad6c995
         | 
| 7 | 
            +
              data.tar.gz: 8104ea9b1d9a42669234cb0d82cc441efd7a6f94ed5cba542a502ae1cb2797d977530a07bbe649d98dab551e9078b434711e091e9d0b3716799522c04436d8c9
         | 
    
        data/.editorconfig
    ADDED
    
    
    
        data/.rspec
    CHANGED
    
    
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGES.md
    CHANGED
    
    
    
        data/lib/clamp/messages.rb
    CHANGED
    
    
| @@ -47,7 +47,7 @@ module Clamp | |
| 47 47 |  | 
| 48 48 | 
             
                  def default_subcommand(*args, &block)
         | 
| 49 49 | 
             
                    if args.empty?
         | 
| 50 | 
            -
                      @default_subcommand
         | 
| 50 | 
            +
                      @default_subcommand ||= false
         | 
| 51 51 | 
             
                    else
         | 
| 52 52 | 
             
                      $stderr.puts "WARNING: Clamp default_subcommand syntax has changed; check the README."
         | 
| 53 53 | 
             
                      $stderr.puts "  (from #{caller(1..1).first})"
         | 
| @@ -59,10 +59,10 @@ module Clamp | |
| 59 59 | 
             
                  private
         | 
| 60 60 |  | 
| 61 61 | 
             
                  def declare_subcommand_parameters
         | 
| 62 | 
            -
                    if  | 
| 62 | 
            +
                    if default_subcommand
         | 
| 63 63 | 
             
                      parameter "[SUBCOMMAND]", "subcommand",
         | 
| 64 64 | 
             
                                attribute_name: :subcommand_name,
         | 
| 65 | 
            -
                                default:  | 
| 65 | 
            +
                                default: default_subcommand,
         | 
| 66 66 | 
             
                                inheritable: false
         | 
| 67 67 | 
             
                    else
         | 
| 68 68 | 
             
                      parameter "SUBCOMMAND", "subcommand",
         | 
| @@ -3,16 +3,13 @@ | |
| 3 3 | 
             
            module Clamp
         | 
| 4 4 | 
             
              module Subcommand
         | 
| 5 5 |  | 
| 6 | 
            -
                Definition = Struct.new(: | 
| 6 | 
            +
                Definition = Struct.new(:names, :description, :subcommand_class) do
         | 
| 7 7 |  | 
| 8 8 | 
             
                  def initialize(names, description, subcommand_class)
         | 
| 9 | 
            -
                     | 
| 10 | 
            -
                     | 
| 11 | 
            -
                    @subcommand_class = subcommand_class
         | 
| 9 | 
            +
                    names = Array(names)
         | 
| 10 | 
            +
                    super
         | 
| 12 11 | 
             
                  end
         | 
| 13 12 |  | 
| 14 | 
            -
                  attr_reader :names, :description, :subcommand_class
         | 
| 15 | 
            -
             | 
| 16 13 | 
             
                  def is_called?(name)
         | 
| 17 14 | 
             
                    names.member?(name)
         | 
| 18 15 | 
             
                  end
         | 
    
        data/lib/clamp/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: clamp
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.3. | 
| 4 | 
            +
              version: 1.3.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Mike Williams
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2020-08-20 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: |
         | 
| 14 14 | 
             
              Clamp provides an object-model for command-line utilities.
         | 
| @@ -19,6 +19,7 @@ extensions: [] | |
| 19 19 | 
             
            extra_rdoc_files: []
         | 
| 20 20 | 
             
            files:
         | 
| 21 21 | 
             
            - ".autotest"
         | 
| 22 | 
            +
            - ".editorconfig"
         | 
| 22 23 | 
             
            - ".gitignore"
         | 
| 23 24 | 
             
            - ".rspec"
         | 
| 24 25 | 
             
            - ".rubocop.yml"
         | 
| @@ -87,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 87 88 | 
             
                - !ruby/object:Gem::Version
         | 
| 88 89 | 
             
                  version: '0'
         | 
| 89 90 | 
             
            requirements: []
         | 
| 90 | 
            -
             | 
| 91 | 
            -
            rubygems_version: 2.7.6
         | 
| 91 | 
            +
            rubygems_version: 3.1.2
         | 
| 92 92 | 
             
            signing_key: 
         | 
| 93 93 | 
             
            specification_version: 4
         | 
| 94 94 | 
             
            summary: a minimal framework for command-line utilities
         |