gitall 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitall.rb +16 -7
- data/lib/gitall/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b87b74056ecf7302282fffc1abcd09863414f2ef9022032ad2bd72f038c9f13
|
4
|
+
data.tar.gz: 3b64c413804b641bce25961c1c1874d12f35525dea1391e12a1943b408d59de7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22f3bf4f34060e3d9012b5bfef84e57007f7e86bcabc05a4cf5acf211a98b5a64304aaf24ce79b108bd525c18ea98850fc158c207f389b7f8522549da61d6d40
|
7
|
+
data.tar.gz: '09bfa099a58a924c6f6194860c02443c99f4efec94557fdc37115e1521988b556031ad4e341fc32059ae61598eeb4b21514c218300219488ed8c34e4f7803cbd'
|
data/lib/gitall.rb
CHANGED
@@ -43,11 +43,19 @@ module GitAll
|
|
43
43
|
password == pass
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
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.
|
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
|
-
|
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
|
data/lib/gitall/version.rb
CHANGED