public
Rubygem
Description: irccat is like `cat`, but here, the STDOUT is an IRC channel.
Homepage: http://irccat.rubyforge.org/
Clone URL: git://github.com/webs/irccat.git
Search Repo:
Click here to lend your support to: irccat and make a donation at www.pledgie.com !
Configuration generator
webs (author)
Sun Feb 17 09:00:48 -0800 2008
commit  9b82f9a8a5033de1b3506913d2ed75e29eb6530a
tree    7468e1dd632359acceaa19c421ab9505ff9a4f3d
parent  565d30255d6ea1896a6b40b6cf13ee902b1e6032
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
0
@@ -1 +1,68 @@
0
+#!/usr/bin/env ruby
0
+#
0
+# Configuration generator for irccat
0
+#
0
+# Created on 2008-2-17.
0
+# Copyright (c) 2008. All rights reserved.
0
+
0
+require 'rubygems'
0
+require 'optparse'
0
+require 'yaml'
0
+require 'highline/import'
0
+
0
+def irccat_config
0
+ config = Hash.new
0
+ puts "== IRC Configuration"
0
+ config['irc'] = Hash.new
0
+ config['irc']['host'] = ask("Hostname: ") { |q| q.default = "irc.freenode.net" }
0
+ config['irc']['port'] = ask("Port: ") { |q| q.default = "6667" }
0
+ config['irc']['nick'] = ask("Nickname: ") { |q| q.default = "irc_cat" }
0
+ config['irc']['channel'] = ask("Channel: ") { |q| q.default = "#irc_cat" }
0
+ puts "\n== HTTP Configuration"
0
+ config['http'] = Hash.new
0
+ if agree("Enable HTTP? ", true); config['http']['enabled'] = true; else; config['http']['enabled'] = false; end
0
+ if config['http']['enabled']
0
+ config['http']['host'] = ask("Hostname: ") { |q| q.default = "0.0.0.0" }
0
+ config['http']['port'] = ask("Port: ") { |q| q.default = "3489" }
0
+ if agree("Enable Basic HTTP send? ", true); config['http']['send'] = true; else; config['http']['send'] = false; end
0
+ if agree("Enable Github? ", true); config['http']['github'] = true; else; config['http']['github'] = false; end
0
+ end
0
+ puts "\n== TCP Configuration"
0
+ config['tcp'] = Hash.new
0
+ if agree("Enable TCP? ", true); config['tcp']['enabled'] = true; else; config['tcp']['enabled'] = false; end
0
+ if config['tcp']['enabled']
0
+ config['tcp']['host'] = ask("Hostname: ") { |q| q.default = "0.0.0.0" }
0
+ config['tcp']['port'] = ask("Port: ") { |q| q.default = "5678" }
0
+ config['tcp']['size'] = ask("Socket size: ") { |q| q.default = "400" }
0
+ end
0
+ puts "\n== Final steps"
0
+ file = ask("Configuration filename: ") { |q| q.default = "config.yml" }
0
+ puts "Warning: File exists! If you choose yes now the file will be overwritted" if File.exists?(File.expand_path(file))
0
+ if agree("Write configuration file? ", true)
0
+ File.open(File.expand_path(file), "w") { |yfile| YAML.dump(config, yfile) }
0
+ else
0
+ exit
0
+ end
0
+end
0
+
0
+def help
0
+ puts "irccat-config - configuration generator for irccat\n"
0
+ puts "Usage: #{File.basename($0)} irccat|client > configfile.yml"
0
+ exit 0
0
+end
0
+
0
+if ARGV[0].nil?
0
+ help
0
+else
0
+ case ARGV[0]
0
+ when 'irccat'
0
+ irccat_config
0
+ when 'client'
0
+ #client_config
0
+ # TODO: todo :D
0
+ help
0
+ else
0
+ help
0
+ end
0
+end
...
58
59
60
61
 
62
63
64
...
58
59
60
 
61
62
63
64
0
@@ -58,7 +58,7 @@
0
   
0
   # == Optional
0
   p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
0
- p.extra_deps = [ ['mongrel', '>= 1.1.3']'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
0
+ p.extra_deps = [ ['mongrel', '>= 1.1.3'], ['highline', '>= 1.4.0'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
0
   
0
   #p.spec_extras = {} # A hash of extra values to set in the gemspec.
0
   
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@
0
   module VERSION #:nodoc:
0
     MAJOR = 0
0
     MINOR = 2
0
- TINY = 0
0
+ TINY = 1
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end

Comments

    No one has commented yet.