Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Feb 21, 2012
0 parents commit d8f6278
Show file tree
Hide file tree
Showing 21 changed files with 1,335 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .document
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lib/**/*.rb
bin/*
-
ChangeLog.md
COPYING.txt
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
doc
pkg
vendor/cache
Gemfile.lock
.bundle
.DS_Store
.yardoc
*.db
*.log
*.swp
*~
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--colour --format documentation
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--markup markdown --title 'Ronin UI IRC Documentation' --protected
674 changes: 674 additions & 0 deletions COPYING.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### 0.1.0 / 2012-02-20

* Initial release:

37 changes: 37 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
source 'https://rubygems.org'

RONIN_URI = 'http://github.com/ronin-ruby'

gemspec

# gem 'ronin-support', '~> 0.4.0', :git => "#{RONIN_URI}/ronin-support.git"
# gem 'ronin', '~> 1.4.0', :git => "#{RONIN_URI}/ronin.git"

group :development do
gem 'rake', '~> 0.8'
gem 'kramdown', '~> 0.12'

gem 'ore-tasks', '~> 0.4'
gem 'rspec', '~> 2.4'
end

#
# To enable additional DataMapper adapters for development work or for
# testing purposes, simple set the ADAPTER or ADAPTERS environment
# variable:
#
# export ADAPTER="postgres"
# bundle install
#
# ./bin/ronin --database postgres://ronin@localhost/ronin
#
require 'set'

DM_ADAPTERS = Set['postgres', 'mysql', 'oracle', 'sqlserver']

adapters = (ENV['ADAPTER'] || ENV['ADAPTERS']).to_s
adapters = Set.new(adapters.to_s.tr(',',' ').split)

(DM_ADAPTERS & adapters).each do |adapter|
gem "dm-#{adapter}-adapter", DM_VERSION #, :git => "#{DM_URI}/dm-#{adapter}-adapter.git"
end
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Ronin UI IRC

* [Source](http://github.com/ronin-ruby/ronin-ui-irc)
* [Issues](http://github.com/ronin-ruby/ronin-ui-irc/issues)
* [Documentation](http://rubydoc.info/gems/ronin-ui-irc/frames)
* [Mailing List](http://groups.google.com/group/ronin-ruby)
* [irc.freenode.net #ronin](http://webchat.freenode.net/?channels=ronin&uio=Mj10cnVldd)

## Description

Ronin UI IRC is an IRC bot for Ronin.

## Features

## Synopsis

$ ronin irc

## Examples

## Requirements

* [cinch](http://github.com/cinchrb/cinch#readme) ~> 1.1
* [ronin](http://github.com/ronin-ruby/ronin#readme) ~> 1.4

## Install

$ gem install ronin-ui-irc

## License

Copyright (c) 2012 Hal Brodigan (postmodern.mod3 at gmail.com)

This file is part of Ronin UI IRC.

Ronin Ui Irc is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Ronin Ui Irc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
29 changes: 29 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require 'rubygems'

begin
require 'bundler'
rescue LoadError => e
warn e.message
warn "Run `gem install bundler` to install Bundler."
exit e.status_code
end

begin
Bundler.setup(:development)
rescue Bundler::BundlerError => e
warn e.message
warn "Run `bundle install` to install missing gems"
exit e.status_code
end

require 'rake'

require 'ore/tasks'
Ore::Tasks.new

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :default => :spec

require 'yard'
YARD::Rake::YardocTask.new
25 changes: 25 additions & 0 deletions bin/ronin-irc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env ruby

require 'rubygems'

root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
if File.directory?(File.join(root_dir,'.git'))
Dir.chdir(root_dir) do |path|
require 'bundler'

begin
Bundler.setup(:default)
rescue Bundler::BundlerError => e
warn e.message
warn "Run `bundle install` to install missing gems"
exit e.status_code
end
end
end

lib_dir = File.join(root_dir,'lib')
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)

require 'ronin/ui/cli/commands/irc'

Ronin::UI::CLI::Commands::Irc.start
27 changes: 27 additions & 0 deletions bin/ronin-ui-irc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby

require 'rubygems'

root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
if File.directory?(File.join(root_dir,'.git'))
Dir.chdir(root_dir) do |path|
require 'bundler'

begin
Bundler.setup(:default)
rescue Bundler::BundlerError => e
warn e.message
warn "Run `bundle install` to install missing gems"
exit e.status_code
end
end
end

lib_dir = File.join(root_dir,'lib')
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)

require 'ronin/ui/console'
require 'ronin/ui/cli/commands/console'

Ronin::UI::Console.auto_load << 'ronin/ui-irc'
Ronin::UI::CLI::Commands::Console.start
20 changes: 20 additions & 0 deletions gemspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ronin-ui-irc
summary: An IRC bot for Ronin.
description:
Ronin UI IRC is an IRC bot for Ronin.

license: GPL-3
authors: Postmodern
email: postmodern.mod3@gmail.com
homepage: http://ronin-ruby.github.com/
has_yard: true

required_ruby_version: ">= 1.9.2"

dependencies:
cinch: ~> 1.1
ronin: ~> 1.4

development_dependencies:
bundler: ~> 1.0
yard: ~> 0.7
102 changes: 102 additions & 0 deletions lib/ronin/ui/cli/commands/irc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#
# Copyright (c) 2012 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This file is part of Ronin UI IRC.
#
# Ronin Ui Irc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin Ui Irc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/ui/irc/bot'
require 'ronin/ui/cli/command'

module Ronin
module UI
module CLI
module Commands
#
# Starts the Ronin IRC bot
#
# ## Usage
#
# ronin irc [options]
#
# ## Options
#
# -v, --[no-]verbose Enable verbose output.
# -q, --[no-]quiet Disable verbose output.
# --[no-]silent Silence all output.
# --[no-]color Enables color output.
# -H, --host [HOST] Host to connect to.
# -p, --port [NUM] Port to connect to.
# -P, --password [PASSWORD] Server password.
# -S, --[no-]ssl Specifies whether to use SSL.
# -u, --user [USER] Username to login with.
# Default: "ronin"
# -n, --nick [NICK] Nickname to login with.
# Default: "ronin-bot"
# -c, --channels [CHANNELS [...]] Channel(s) to join.
#
class Irc < Command

summary 'Starts the Ronin IRC bot'

option :host, :type => String,
:flag => '-H',
:description => 'Host to connect to'

option :port, :type => Integer,
:flag => '-p',
:description => 'Port to connect to'

option :password, :type => String,
:flag => '-P',
:description => 'Server password'

option :ssl, :type => true,
:flag => '-S',
:description => 'Specifies whether to use SSL'

option :user, :type => String,
:flag => '-u',
:default => UI::IRC::Bot::DEFAULT_USER,
:description => 'Username to login with'

option :nick, :type => String,
:flag => '-n',
:default => UI::IRC::Bot::DEFAULT_NICK,
:description => 'Nickname to login with'

option :channels, :type => Array[String],
:flag => '-c',
:description => 'Channel(s) to join'

def execute
bot = UI::IRC::Bot.new(
:host => @host,
:port => @port,
:password => @password,
:ssl => @ssl,
:user => @user,
:nick => @nick,
:channels => @channels
)

bot.start
end

end
end
end
end
end
20 changes: 20 additions & 0 deletions lib/ronin/ui/irc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright (c) 2012 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This file is part of Ronin UI IRC.
#
# Ronin Ui Irc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin Ui Irc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/ui/irc/version'
Loading

0 comments on commit d8f6278

Please sign in to comment.