This repository has been archived by the owner on Apr 13, 2019. It is now read-only.
Missing documentation for bot configuration #261
Comments
I had to got in the code to see the default config to understand what is expected. cinch/lib/cinch/configuration/bot.rb Lines 13 to 44 in c66bbe7
# (see Configuration.default_config)
def self.default_config
{
:server => "localhost",
:port => 6667,
:ssl => Configuration::SSL.new,
:password => nil,
:nick => "cinch",
:nicks => nil,
:realname => "cinch",
:user => "cinch",
:modes => [],
:messages_per_second => nil,
:server_queue_size => nil,
:strictness => :forgiving,
:message_split_start => '... ',
:message_split_end => ' ...',
:max_messages => nil,
:plugins => Configuration::Plugins.new,
:channels => [],
:encoding => :irc,
:reconnect => true,
:max_reconnect_delay => 300,
:local_host => nil,
:timeouts => Configuration::Timeouts.new,
:ping_interval => 120,
:delay_joins => 0,
:dcc => Configuration::DCC.new,
:sasl => Configuration::SASL.new,
:shared => {},
}
end So in fact ssl is expecting an SSL object. |
Even knowing that and trying various configuration ssl = Cinch::Configuration::SSL.new do |ssl|
configure do |s|
s.use = true
s.verify = false
end
end I did not succeed to configure the bot to use SSL and connect to a 6697 port. |
The good syntax was bot = Cinch::Bot.new do |boti|
configure do |c|
c.server = "172.17.0.1"
c.port = 6697
c.ssl.use = true
c.nick = "plop"
end
...
By the way I see you are using OpenSSL to manage SSL connection but there is no `dependencies` section in the README or in the documentation.
![image](https://user-images.githubusercontent.com/16578570/47953558-98ab3d80-df7f-11e8-9594-26a86908885c.png) |
Why is that not put in yard? Look how I did it for this lib: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Ok there is this provided as
KnownOptions
of the bot configuration, but it is not clear what each key tag is expecting as value.For example it is obvious that server is expecting a string with an ip address or a domain but is port expecting a string or an integer (answer is integer), and ssl? I thought ssl was expecting a boolean true or false but I seems that's not that.
Each key expected value should be documented.
one should not have to do reverse engineering, calling
.default_config
to understand the expected values.Also this method is not working for the bot class and return an empty hash for the configuration parent class:
https://www.rubydoc.info/gems/cinch/Cinch/Configuration/Bot
The text was updated successfully, but these errors were encountered: