Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
do not include Storage in the 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Mar 24, 2012
1 parent 198e53f commit bc957fa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 23 deletions.
1 change: 0 additions & 1 deletion docs/changes.md
Expand Up @@ -225,7 +225,6 @@ moved from {Cinch} to {Cinch::Constants}
#### {Cinch::Plugin} #### {Cinch::Plugin}


- {Cinch::Plugin#handlers} - {Cinch::Plugin#handlers}
- {Cinch::Plugin#storage}
- {Cinch::Plugin#timers} - {Cinch::Plugin#timers}
- {Cinch::Plugin#unregister} - {Cinch::Plugin#unregister}


Expand Down
1 change: 0 additions & 1 deletion docs/migrating.md
Expand Up @@ -18,7 +18,6 @@ shouldn't and usually mustn't overwrite:
- `#bot` - `#bot`
- `#config` - `#config`
- `#handlers` - `#handlers`
- `#storage`
- `#synchronize` - `#synchronize`
- `#timers` - `#timers`
- `#unregister` - `#unregister`
Expand Down
11 changes: 5 additions & 6 deletions lib/cinch/bot.rb
Expand Up @@ -47,7 +47,7 @@
require "cinch/configuration/plugins" require "cinch/configuration/plugins"
require "cinch/configuration/ssl" require "cinch/configuration/ssl"
require "cinch/configuration/timeouts" require "cinch/configuration/timeouts"
require "cinch/configuration/storage" # require "cinch/configuration/storage"
require "cinch/configuration/dcc" require "cinch/configuration/dcc"
require "cinch/configuration/sasl" require "cinch/configuration/sasl"


Expand Down Expand Up @@ -290,12 +290,11 @@ def start(plugins = true)
end while @config.reconnect and not @quitting end while @config.reconnect and not @quitting
end end


# TODO document this
def stop def stop
@plugins.each do |plugin| # @plugins.each do |plugin|
plugin.storage.save # plugin.storage.save
plugin.storage.unload # plugin.storage.unload
end # end
end end


# @endgroup # @endgroup
Expand Down
4 changes: 2 additions & 2 deletions lib/cinch/configuration/bot.rb
Expand Up @@ -8,7 +8,7 @@ class Bot < Configuration
:realname, :user, :messages_per_second, :server_queue_size, :realname, :user, :messages_per_second, :server_queue_size,
:strictness, :message_split_start, :message_split_end, :strictness, :message_split_start, :message_split_end,
:max_messages, :plugins, :channels, :encoding, :reconnect, :max_reconnect_delay, :max_messages, :plugins, :channels, :encoding, :reconnect, :max_reconnect_delay,
:local_host, :timeouts, :ping_interval, :storage, :dcc, :shared, :sasl] :local_host, :timeouts, :ping_interval, :dcc, :shared, :sasl]


# (see Configuration.default_config) # (see Configuration.default_config)
def self.default_config def self.default_config
Expand Down Expand Up @@ -37,7 +37,7 @@ def self.default_config
:timeouts => Configuration::Timeouts.new, :timeouts => Configuration::Timeouts.new,
:ping_interval => 120, :ping_interval => 120,
:delay_joins => 0, :delay_joins => 0,
:storage => Configuration::Storage.new, # :storage => Configuration::Storage.new,
:dcc => Configuration::DCC.new, :dcc => Configuration::DCC.new,
:sasl => Configuration::SASL.new, :sasl => Configuration::SASL.new,
:shared => {}, :shared => {},
Expand Down
16 changes: 4 additions & 12 deletions lib/cinch/plugin.rb
Expand Up @@ -10,7 +10,7 @@ module Cinch
# #
# Most of the instance methods are for use by the Cinch framework # Most of the instance methods are for use by the Cinch framework
# and part of the private API, but some will also be used by plugin # and part of the private API, but some will also be used by plugin
# authors, mainly {#config}, {#synchronize}, {#storage} and {#bot}. # authors, mainly {#config}, {#synchronize} and {#bot}.
module Plugin module Plugin
include Helpers include Helpers


Expand Down Expand Up @@ -196,15 +196,7 @@ def match(pattern, options = {})
# @overload listen_to(*types, options = {}) # @overload listen_to(*types, options = {})
# @param [String, Symbol, Integer] *types Events to listen to. Available # @param [String, Symbol, Integer] *types Events to listen to. Available
# events are all IRC commands in lowercase as symbols, all numeric # events are all IRC commands in lowercase as symbols, all numeric
# replies, and the following: # replies and all events listed in the {file:docs/events.md list of events}.
#
# - :channel (a channel message)
# - :private (a private message)
# - :message (both channel and private messages)
# - :error (IRC errors)
# - :ctcp (ctcp requests)
# - :action (actions, aka /me)
#
# @param [Hash] options # @param [Hash] options
# @option options [Symbol] :method (:listen) The method to # @option options [Symbol] :method (:listen) The method to
# execute # execute
Expand Down Expand Up @@ -441,14 +433,14 @@ def __register
attr_reader :timers attr_reader :timers


# @return [Storage] The per-plugin persistent storage # @return [Storage] The per-plugin persistent storage
attr_reader :storage # attr_reader :storage


# @api private # @api private
def initialize(bot) def initialize(bot)
@bot = bot @bot = bot
@handlers = [] @handlers = []
@timers = [] @timers = []
@storage = bot.config.storage.backend.new(@bot.config.storage, self) # @storage = bot.config.storage.backend.new(@bot.config.storage, self)
__register __register
end end


Expand Down
3 changes: 2 additions & 1 deletion lib/cinch/storage.rb
@@ -1,5 +1,6 @@
module Cinch module Cinch
# @since 2.0.0 # @note The interface of this class isn't fixed yet. You shouldn't
# use it yet.
class Storage class Storage
include Enumerable include Enumerable


Expand Down

0 comments on commit bc957fa

Please sign in to comment.