Sha256: a1116cfb5f1f8ba9e85ffcccb9efd68b4b4a68b5dcc315debd4c54bea6c33335

Contents?: true

Size: 714 Bytes

Versions: 32

Compression:

Stored size: 714 Bytes

Contents

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

# 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 = []
  Blacklist.urls = []
  Blacklist.masks = []
  File.delete(File.join(Dir.home, '.zeta', 'cache', 'blacklist.rb'))
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
zetabot-2.1.2 lib/Zeta/blacklist.rb
zetabot-2.1.1 lib/Zeta/blacklist.rb
zetabot-2.1.0 lib/Zeta/blacklist.rb
zetabot-2.0.9 lib/Zeta/blacklist.rb
zetabot-2.0.8 lib/Zeta/blacklist.rb
zetabot-2.0.7 lib/Zeta/blacklist.rb
zetabot-2.0.6 lib/Zeta/blacklist.rb
zetabot-2.0.5 lib/Zeta/blacklist.rb
zetabot-2.0.4 lib/Zeta/blacklist.rb
zetabot-2.0.3 lib/Zeta/blacklist.rb
zetabot-2.0.2 lib/Zeta/blacklist.rb
zetabot-2.0.1 lib/Zeta/blacklist.rb
zetabot-2.0.0 lib/Zeta/blacklist.rb
zetabot-1.1.0 lib/Zeta/blacklist.rb
zetabot-1.0.7 lib/Zeta/blacklist.rb
zetabot-1.0.6 lib/Zeta/blacklist.rb
zetabot-1.0.5 lib/Zeta/blacklist.rb
zetabot-1.0.4 lib/Zeta/blacklist.rb
zetabot-1.0.3 lib/Zeta/blacklist.rb
zetabot-1.0.2 lib/Zeta/blacklist.rb