protonbot 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e32dd98edcadebac541ea89e89c7d9945ea50929
4
- data.tar.gz: d5a72e64cdea4d2aeb3d29739299b1c7d55d3357
3
+ metadata.gz: 3a0949566ae0887a4ee1a5f088d5c04c31e48e7b
4
+ data.tar.gz: 8eca8663367b3c77ebf445dbe464cae4cebd8ae0
5
5
  SHA512:
6
- metadata.gz: c32605501bc4afbe317b9fed90af8b6af7a33416ca88c97fef20b41ef160068b5a6130c06271eb90c06c07a5377abf3f29724e3d05ff0e9d672cf93f48107d3e
7
- data.tar.gz: 873895ef9bee5c6d63a419747249043d861e2196fba9b47c789a1a005a2fe1b9ad31b7b9bd59c50cbda8ae67f6ba1586962476058467bc2b5a9e300d54e9f93c
6
+ metadata.gz: 6037dc02298ed7f30697fe8329a1a01ea8627ec32b031486ef32e14fa56828ba89133c5372c4054817888c297faeac03bb647e48d37225686111b71fccdfd2a9
7
+ data.tar.gz: 773ea673e2555bb281537aaca4254ea562408f260deddae81d81b383969cf9b5894dfed5bb000c77522d2cde3c72e448cc5749f094f066c6daf89e51cddb9fca
@@ -4,4 +4,4 @@ if ARGV[0]
4
4
  else
5
5
  puts 'No filename provided!'
6
6
  puts "Usage: protonbot-cert <filename>"
7
- end
7
+ end
@@ -31,6 +31,7 @@ class ProtonBot::Bot
31
31
  # Basically clears plugin hash
32
32
  # @return [Bot] self
33
33
  def plugins_unload
34
+ @parr = []
34
35
  @plugins = {}
35
36
  self
36
37
  end
@@ -103,6 +104,20 @@ class ProtonBot::Bot
103
104
  self
104
105
  end
105
106
 
107
+ # Loads plugins by array of strings. If first char of item is period,
108
+ # then plugin is loaded from gem
109
+ # @param plugins [Array<String>]
110
+ # @return [Bot] self
111
+ def plugin_array(arr)
112
+ arr.each do |pl|
113
+ if pl[0] == '.'
114
+ gem pl[1,pl.length-1]
115
+ else
116
+ plugin pl
117
+ end
118
+ end
119
+ end
120
+
106
121
  # Loads plugin by path
107
122
  # @param path [String] Path
108
123
  # @return [Plugin] Loaded plugin
@@ -124,5 +124,5 @@ hook(type: :command, cmd: 'r') do |dat|
124
124
  dat[:bot].plugins_unload
125
125
  dat[:bot].plugins_load
126
126
  dat[:bot].log.info 'Reload: END'
127
- dat.nreply 'Done!'
127
+ dat.nreply "Done! Loaded %B#{dat[:bot].plugins.length}%N plugins"
128
128
  end.perm!('reload')
@@ -7,7 +7,7 @@ class ProtonBot::Plug
7
7
  s = s[0..-3]
8
8
  log.info "R > #{s}"
9
9
  begin
10
- emit(type: :raw, raw_data: s.clone, plug: self, db: db, bot: bot, core: bot.plugins['core'])
10
+ emit(type: :raw, raw_data: s.clone, plug: self, db: db, bot: bot)
11
11
  rescue => e
12
12
  log_err(e)
13
13
  end
@@ -1,4 +1,4 @@
1
1
  module ProtonBot
2
2
  # ProtonBot's version
3
- VERSION = '0.3.3'.freeze
3
+ VERSION = '0.3.4'.freeze
4
4
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'protonbot/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protonbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nickolay Ilyushin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-09 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler