smith 0.7.6 → 0.7.7
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/smith/commands/agency/list.rb +14 -6
- data/lib/smith/messaging/receiver.rb +0 -15
- data/lib/smith/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2cc8959d34747160c59a7a05ec820ec2e27c5682
         | 
| 4 | 
            +
              data.tar.gz: aac86c9b5eeb61288c2bc9d6233df3d48a364e5d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6a917e6fb2e800c94ddf20db84425c780beac39f1dcd9bd445ff15cbc24cff767625fbef4094154ea53fca11a0a252b2b32d8b3b2ed5be4f0eda4cece7525e1b
         | 
| 7 | 
            +
              data.tar.gz: 707db2b0981c8ce05f284c337634fb5abf5ee540352bcfc80b51ba941e3e74867c7ecfcb210f91d154531dadd645fda9604efae94617741bca80c45ae406a8d9
         | 
| @@ -9,17 +9,20 @@ module Smith | |
| 9 9 | 
             
                  include Common
         | 
| 10 10 |  | 
| 11 11 | 
             
                  def execute
         | 
| 12 | 
            -
                     | 
| 12 | 
            +
                    case
         | 
| 13 | 
            +
                    when target.size > 0
         | 
| 13 14 | 
             
                      selected_agents = agents.find_by_name(target)
         | 
| 15 | 
            +
                    when options[:group] && options[:all]
         | 
| 16 | 
            +
                      selected_agents = agent_group(options[:group]).map do |agent_name|
         | 
| 17 | 
            +
                        a = agents.find_by_name(agent_name)
         | 
| 18 | 
            +
                        (a.empty?) ? AgentProcess.new(nil, :name => agent_name, :uuid => nil_uuid) : a.first
         | 
| 19 | 
            +
                      end
         | 
| 20 | 
            +
                    when options[:group]
         | 
| 21 | 
            +
                      selected_agents = agents.find_by_name(agent_group(options[:group]))
         | 
| 14 22 | 
             
                    else
         | 
| 15 23 | 
             
                      selected_agents = (options[:all]) ? agents.to_a : agents.state(:running)
         | 
| 16 24 | 
             
                    end
         | 
| 17 25 |  | 
| 18 | 
            -
                    if options[:group]
         | 
| 19 | 
            -
                      group_names = agent_group(options[:group])
         | 
| 20 | 
            -
                      selected_agents = selected_agents.select { |a| group_names.include?(a.name) }
         | 
| 21 | 
            -
                    end
         | 
| 22 | 
            -
             | 
| 23 26 | 
             
                    responder.succeed((selected_agents.empty?) ? '' : format(selected_agents, options[:long]))
         | 
| 24 27 | 
             
                  end
         | 
| 25 28 |  | 
| @@ -63,6 +66,11 @@ module Smith | |
| 63 66 | 
             
                    end
         | 
| 64 67 | 
             
                  end
         | 
| 65 68 |  | 
| 69 | 
            +
                  # Produces a null version 4 UUID.
         | 
| 70 | 
            +
                  def nil_uuid
         | 
| 71 | 
            +
                    '00000000-0000-4000-0000-000000000000'
         | 
| 72 | 
            +
                  end
         | 
| 73 | 
            +
             | 
| 66 74 | 
             
                  def options_spec
         | 
| 67 75 | 
             
                    banner "List the running agents.", "<agent name[s]>"
         | 
| 68 76 |  | 
| @@ -207,26 +207,11 @@ module Smith | |
| 207 207 |  | 
| 208 208 | 
             
                  attr_accessor :metadata
         | 
| 209 209 |  | 
| 210 | 
            -
                  def m(o)
         | 
| 211 | 
            -
                    (o.methods -  Object.methods).sort
         | 
| 212 | 
            -
                  end
         | 
| 213 | 
            -
             | 
| 214 210 | 
             
                  def initialize(metadata, data, opts={}, requeue_opts, &blk)
         | 
| 215 211 | 
             
                    @metadata = metadata
         | 
| 216 212 | 
             
                    @reply_queue = opts[:reply_queue]
         | 
| 217 | 
            -
                    # @queue_name = (metadata.methods -  Object.methods).sort
         | 
| 218 213 | 
             
                    @requeue_opts = requeue_opts
         | 
| 219 214 |  | 
| 220 | 
            -
                    pp m(metadata)
         | 
| 221 | 
            -
                    puts '====================='
         | 
| 222 | 
            -
                    pp m(metadata.channel)
         | 
| 223 | 
            -
                    puts '====================='
         | 
| 224 | 
            -
                    pp metadata.channel.class
         | 
| 225 | 
            -
                    puts '====================='
         | 
| 226 | 
            -
                    pp m(metadata.channel.queue)
         | 
| 227 | 
            -
                    puts '====================='
         | 
| 228 | 
            -
                    pp metadata.channel.queue.status
         | 
| 229 | 
            -
             | 
| 230 215 | 
             
                    @acl_type_cache = AclTypeCache.instance
         | 
| 231 216 |  | 
| 232 217 | 
             
                    @time = Time.now
         | 
    
        data/lib/smith/version.rb
    CHANGED