Project

ruboty-gen

0.01
No commit activity in last 3 years
No release in over 3 years
generators for creating ruboty plugin.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.0

Runtime

~> 1.7
>= 0
 Project Readme

Ruboty::Gen Gem Version

generators for creating ruboty plugin.

Installation

Add this line to your application's Gemfile:

gem 'ruboty-gen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruboty-gen

Usage

  ∩ ∩  ∠ i’m at ~/src/github.com/blockgiven
( ╹x╹) ruboty-gen gem yo action1 action2
      create  ruboty-yo/Gemfile
      create  ruboty-yo/Rakefile
      create  ruboty-yo/LICENSE.txt
      create  ruboty-yo/README.md
      create  ruboty-yo/.gitignore
      create  ruboty-yo/ruboty-yo.gemspec
      create  ruboty-yo/lib/ruboty/yo.rb
      create  ruboty-yo/lib/ruboty/yo/version.rb
Initializing git repo in /Users/block_given/src/github.com/blockgiven/ruboty-yo
      create  ruboty-yo/lib/ruboty/handlers/yo.rb
      create  ruboty-yo/lib/ruboty/yo/actions/action1.rb
      create  ruboty-yo/lib/ruboty/yo/actions/action2.rb
  ∩ ∩  ∠ i’m at ~/src/github.com/blockgiven
( ╹x╹) cd ruboty-yo
  ∩ ∩  ∠ i’m at ~/src/github.com/blockgiven/ruboty-yo [master] ✗
( ╹x╹) tree
.
├── Gemfile
├── LICENSE.txt
├── README.md
├── Rakefile
├── lib
│   └── ruboty
│       ├── handlers
│       │   └── yo.rb
│       ├── yo
│       │   ├── actions
│       │   │   ├── action1.rb
│       │   │   └── action2.rb
│       │   └── version.rb
│       └── yo.rb
└── ruboty-yo.gemspec

5 directories, 10 files
  • ./lib/ruboty/yo.rb (generated code)
require "ruboty/yo/version"
require "ruboty/handlers/yo"

module Ruboty
  module Yo
    # Your code goes here...
  end
end
  • ./lib/ruboty/handlers/yo.rb (generated code)
require "ruboty/yo/actions/action1"
require "ruboty/yo/actions/action2"

module Ruboty
  module Handlers
    class Yo < Base
      on /yo action1/, name: 'action1', description: 'TODO: write your description'
      on /yo action2/, name: 'action2', description: 'TODO: write your description'

      def action1(message)
        Ruboty::Yo::Actions::Action1.new(message).call
      end

      def action2(message)
        Ruboty::Yo::Actions::Action2.new(message).call
      end
    end
  end
end
  • ./lib/ruboty/yo/actions/action1.rb (generated code)
module Ruboty
  module Yo
    module Actions
      class Action1 < Ruboty::Actions::Base
        def call
          message.reply("TODO: write a message.")
        end
      end
    end
  end
end
  • ./lib/ruboty/yo/actions/action2.rb (generated code)
module Ruboty
  module Yo
    module Actions
      class Action2 < Ruboty::Actions::Base
        def call
          message.reply("TODO: write a message.")
        end
      end
    end
  end
end

Contributing

  1. Fork it ( https://github.com/blockgiven/ruboty-gen/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request