Code Monkey home page Code Monkey logo

slack-ruby-eval's Introduction

RubyEvalBot

enter image description here

Description

RubyEvalBotはSlackでrubyのスニペットが投稿されたとき、安全に評価して標準出力を教えてくれるbotです。あなたがslackで仲間たちにちょっとしたショートコードを共有した際にどんな結果を得るかを実際の実行結果で示してくれます。

またコードの評価はセーフレベル1で実行され、処理時間は秒数制限されているため時間のかかる処理やコマンドラインの実行など危険なコードを避けてくれます。

[Warn] 評価の安全性は完全ではありませんし、悪意と技術があれば簡単に悪用可能です。参加者が限定されているクローズなSlackでの利用を想定しています。

Usage

もっとも簡単な形ではnohupでバックグラウンドジョブとして起動することで実行可能です。

$ git clone https://github.com/owlworks/slack-ruby-eval.git
$ cd ./slack-ruby-eval
$ bundle install
# config.ymlのslack.tokenを編集するか、環境変数ENV['SLACK_TOKEN']にボットアカウントのアクセストークンを設定して下さい
$ nohup eval_ruby.rb &

もちろんgodなどのプロセス管理ツールを利用するのも素晴らしいアイディアですね。

Details

  • コードを評価するためにはbotが参加しているチャットへ、言語をrubyに指定したスニペットが共有される必要があります
  • セーフレベル1で実行されない処理、およびFileやIOなど一部のメソッド呼び出しは利用できません
  • 完了に数秒以上かかるようなコードについても同様です
  • また長過ぎる標準出力については自動的に破棄あるいは省略されます

Enjoy slack.

slack-ruby-eval's People

Contributors

owl-bo avatar

Stargazers

Kouji OKAMOTO avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.