Sha256: 3fbc36ed0495e91e373120ec7a59ea6f50e89b212321d47767059c25ad4b05b4

Contents?: true

Size: 646 Bytes

Versions: 11

Compression:

Stored size: 646 Bytes

Contents

BlackListStruct = Struct.new :channels, :users, :plugins

# Load Cached
if File.exists?(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb'))
  File.open(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb')) do |file|
    Blacklist = Marshal.load(file)
  end
else
  Blacklist = BlackListStruct.new([], [], [])
end


## Methods
def save_blacklist()
  File.open(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb'), 'w+') do |file|
    Marshal.dump(Blacklist, file)
  end
end

def clear_blacklist()
  Blacklist.users = []
  Blacklist.plugins = []
  Blacklist.channels = []
  File.delete(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb'))
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
zetabot-0.0.11 lib/Zeta/blacklist.rb
zetabot-0.0.10 lib/Zeta/blacklist.rb
zetabot-0.0.9 lib/Zeta/blacklist.rb
zetabot-0.0.8 lib/Zeta/blacklist.rb
zetabot-0.0.7 lib/Zeta/blacklist.rb
zetabot-0.0.6 lib/Zeta/blacklist.rb
zetabot-0.0.5 lib/Zeta/blacklist.rb
zetabot-0.0.4 lib/Zeta/blacklist.rb
zetabot-0.0.3 lib/Zeta/blacklist.rb
zetabot-0.0.2 lib/Zeta/blacklist.rb
zetabot-0.0.1 lib/Zeta/blacklist.rb