ruboty-gen 1.1.0 → 1.2.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/README.md +1 -1
- data/lib/ruboty/gen/cli.rb +1 -0
- data/lib/ruboty/gen/gem.rb +3 -1
- data/lib/ruboty/gen/version.rb +1 -1
- data/templates/ruboty/newgem/actions/newgem_rescue.rb.tt +19 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b0c354a8883b91d2ebfbc07b727cab59e91a2807
         | 
| 4 | 
            +
              data.tar.gz: 6ab253e502f895e28c50d577f3cbcef946fec520
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4af2b9edb5b61ab6b2308c79f57f2429ed0fd3165aaee8de6ca3ed79fa2e0a87df542c9e2f62e27bad4e059d91f229ecfe09372987a5ed7acffcfa20e5b20179
         | 
| 7 | 
            +
              data.tar.gz: 331c59dcb975636d502d5e6bae01e4bf4ec930bcc63d6c2feaabcac7039952022e846b79d569a9359ee2434a6fdd41f5c651414a3a804d0e7b884ec0e31df8b8
         | 
    
        data/README.md
    CHANGED
    
    
    
        data/lib/ruboty/gen/cli.rb
    CHANGED
    
    | @@ -20,6 +20,7 @@ module Ruboty | |
| 20 20 | 
             
                  end
         | 
| 21 21 |  | 
| 22 22 | 
             
                  desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a ruboty plugin"
         | 
| 23 | 
            +
                  option :rescue, type: :boolean, desc: 'generate rescue logic'
         | 
| 23 24 | 
             
                  def gem(name, *actions)
         | 
| 24 25 | 
             
                    actions = [name] if actions.size.zero?
         | 
| 25 26 | 
             
                    Bundler::CLI::Gem.new(options, "ruboty-#{name}", self).run
         | 
    
        data/lib/ruboty/gen/gem.rb
    CHANGED
    
    | @@ -42,9 +42,11 @@ module Ruboty | |
| 42 42 | 
             
                    }
         | 
| 43 43 |  | 
| 44 44 | 
             
                    thor.template(File.join('ruboty/handlers/newgem.rb.tt'),       File.join(target, "lib/ruboty/handlers/#{ruboty_plugin_name}.rb"),            opts)
         | 
| 45 | 
            +
                    action_template = @options['rescue'] ? 'newgem_rescue.rb.tt' : 'newgem.rb.tt'
         | 
| 45 46 | 
             
                    actions.each do |action|
         | 
| 46 47 | 
             
                      opts[:constant_action] = camelize(action)
         | 
| 47 | 
            -
                       | 
| 48 | 
            +
                      opts[:action] = action
         | 
| 49 | 
            +
                      thor.template(File.join("ruboty/newgem/actions/#{action_template}"), File.join(target, "lib/ruboty/#{ruboty_plugin_name}/actions/#{action}.rb"), opts)
         | 
| 48 50 | 
             
                    end
         | 
| 49 51 | 
             
                  end
         | 
| 50 52 |  | 
    
        data/lib/ruboty/gen/version.rb
    CHANGED
    
    
| @@ -0,0 +1,19 @@ | |
| 1 | 
            +
            module Ruboty
         | 
| 2 | 
            +
              module <%= config[:ruboty_plugin_constant_name] %>
         | 
| 3 | 
            +
                module Actions
         | 
| 4 | 
            +
                  class <%= config[:constant_action] %> < Ruboty::Actions::Base
         | 
| 5 | 
            +
                    def call
         | 
| 6 | 
            +
                      message.reply(<%= config[:action] %>)
         | 
| 7 | 
            +
                    end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                    private
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    def <%= config[:action] %>
         | 
| 12 | 
            +
                      "TODO: write your logic."
         | 
| 13 | 
            +
                    rescue => e
         | 
| 14 | 
            +
                      e.message
         | 
| 15 | 
            +
                    end
         | 
| 16 | 
            +
                  end
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ruboty-gen
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - block_given?
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014- | 
| 11 | 
            +
            date: 2014-12-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -75,6 +75,7 @@ files: | |
| 75 75 | 
             
            - templates/newgem/newgem.gemspec.tt
         | 
| 76 76 | 
             
            - templates/ruboty/handlers/newgem.rb.tt
         | 
| 77 77 | 
             
            - templates/ruboty/newgem/actions/newgem.rb.tt
         | 
| 78 | 
            +
            - templates/ruboty/newgem/actions/newgem_rescue.rb.tt
         | 
| 78 79 | 
             
            homepage: https://github.com/blockgiven/ruboty-gen
         | 
| 79 80 | 
             
            licenses:
         | 
| 80 81 | 
             
            - MIT
         |