gitall 1.1.9 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gitall.rb +16 -7
  3. data/lib/gitall/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd77d2480b7bb2ac132b2decfb2df7224ae85309c3e4b91ae8cd01cd44113cd2
4
- data.tar.gz: dff9fa74eab42f751fa6c61bfba11f5e731c9e8452d317390ee83aba6724fd99
3
+ metadata.gz: 0b87b74056ecf7302282fffc1abcd09863414f2ef9022032ad2bd72f038c9f13
4
+ data.tar.gz: 3b64c413804b641bce25961c1c1874d12f35525dea1391e12a1943b408d59de7
5
5
  SHA512:
6
- metadata.gz: 06756ae1c1c656efd25e0079789646f739d8ca68d4a9c94e4e609f8634650f80f5d058aeac0622250caccf87121d9de2015905c851263d071e500310c678c49e
7
- data.tar.gz: c553ab965d02d4544b298820ccb80c6cec12d1e770c90aac06c0d0d3c038a841895c63383e40c19cec6229c2443c91495b32a79f056f0a2496e12eabefb62022
6
+ metadata.gz: 22f3bf4f34060e3d9012b5bfef84e57007f7e86bcabc05a4cf5acf211a98b5a64304aaf24ce79b108bd525c18ea98850fc158c207f389b7f8522549da61d6d40
7
+ data.tar.gz: '09bfa099a58a924c6f6194860c02443c99f4efec94557fdc37115e1521988b556031ad4e341fc32059ae61598eeb4b21514c218300219488ed8c34e4f7803cbd'
@@ -43,11 +43,19 @@ module GitAll
43
43
  password == pass
44
44
  end
45
45
  end
46
- GitAll::USERS.each do |user, hash|
47
- password = hash['password']
48
- role = hash['role']
49
- @users << User.new(user, password, role)
46
+
47
+ def self.users
48
+ @users
50
49
  end
50
+
51
+ def self.init_users
52
+ GitAll::USERS.each do |user, hash|
53
+ password = hash['password']
54
+ role = hash['role']
55
+ @users << User.new(user, password, role)
56
+ end
57
+ end
58
+
51
59
  end
52
60
  class Bots
53
61
  attr :bots, :config
@@ -60,6 +68,7 @@ module GitAll
60
68
  end
61
69
 
62
70
  def self.add_bots
71
+ GitAll::Bot::Users.init_users
63
72
  @config['networks'].each do |name, ncfg|
64
73
  bot = Cinch::Bot.new do
65
74
  configure do |c|
@@ -123,7 +132,7 @@ module GitAll
123
132
  c.authentication.fetch_user = lambda { |nickname|
124
133
  # If you were using an ORM, you'd probably do something like
125
134
  # `User.first(:nickname => nickname)` here.
126
- Users.users.find { |user| user.nickname == nickname } }
135
+ GitAll::Bot::Users.users.colect { |user| user.nickname == nickname } }
127
136
  # The Authentication mixin will call these lambdas to check if a user is
128
137
  # allowed to run a command.
129
138
  c.authentication.users = lambda { |user| user.type == 'user' }
@@ -161,7 +170,7 @@ module GitAll
161
170
  set :port, 8008
162
171
  set :bind, '127.0.0.1'
163
172
  set :environment, 'production'
164
- #set :threaded, true
173
+ set :threaded, false
165
174
  post '/hook/?' do
166
175
  request.body.rewind
167
176
  payload = request.body.read
@@ -203,7 +212,7 @@ module GitAll
203
212
  network = channet.split(',')[1]
204
213
  resp.each {
205
214
  |n|
206
- GitAll::Bots.bots[network].Channel(channel).send("#{n}")
215
+ GitAll::Bot::Bots.bots[network].Channel(channel).send("#{n}")
207
216
  }
208
217
  }
209
218
  end
@@ -1,3 +1,3 @@
1
1
  module GitAll
2
- VERSION = '1.1.9'
2
+ VERSION = '1.1.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitall
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer