hubstats 0.5.9 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.markdown +5 -0
- data/app/controllers/hubstats/events_controller.rb +6 -1
- data/lib/hubstats/events_handler.rb +3 -3
- data/lib/hubstats/version.rb +1 -1
- data/spec/lib/hubstats/events_handler_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9407dea2556d0f7640e102654850da08473483ac
|
4
|
+
data.tar.gz: ce864b54f2b60bc227cfac653be1508b78e3b000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6304762c14ec9528011961391b84d35bf0d1cfd12b99ecbc6d0f0386dddf37a28405c3c58f1028c1eba8232d86de2248e7309ba34da3d86a563b48c9726e83
|
7
|
+
data.tar.gz: 2095ba48372a0eb5610fcf6f153b83d3224ef84e04e9c0912c57afa6bf5e3ffa4951069743d7480b56277fe2659b3c528cd76c23e36cfe4bc88954340a656f2a
|
data/.travis.yml
CHANGED
data/CHANGELOG.markdown
CHANGED
@@ -11,9 +11,14 @@ module Hubstats
|
|
11
11
|
# Returns - nothing, but makes a new event
|
12
12
|
def handler
|
13
13
|
verify_signature(request)
|
14
|
-
|
14
|
+
|
15
15
|
kind = request.headers['X-Github-Event']
|
16
16
|
event = params.with_indifferent_access
|
17
|
+
|
18
|
+
raw_payload = request.raw_post
|
19
|
+
original_payload = JSON.parse(raw_payload)
|
20
|
+
event[:github_action] = original_payload["action"]
|
21
|
+
|
17
22
|
eventsHandler = Hubstats::EventsHandler.new()
|
18
23
|
eventsHandler.route(event,kind)
|
19
24
|
|
@@ -55,13 +55,13 @@ module Hubstats
|
|
55
55
|
#
|
56
56
|
# Returns - nothing, but updates or makes the team
|
57
57
|
def team_processor(payload)
|
58
|
-
team = payload[:
|
58
|
+
team = payload[:team]
|
59
59
|
team_list = Hubstats.config.github_config["team_list"] || []
|
60
60
|
if team_list.include? team[:name]
|
61
61
|
Hubstats::Team.create_or_update(team.with_indifferent_access)
|
62
62
|
hubstats_team = Hubstats::Team.where(name: team[:name]).first
|
63
|
-
hubstats_user = Hubstats::User.create_or_update(payload[:
|
64
|
-
Hubstats::Team.update_users_in_team(hubstats_team, hubstats_user, payload[:
|
63
|
+
hubstats_user = Hubstats::User.create_or_update(payload[:member])
|
64
|
+
Hubstats::Team.update_users_in_team(hubstats_team, hubstats_user, payload[:github_action])
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/lib/hubstats/version.rb
CHANGED
@@ -67,7 +67,7 @@ module Hubstats
|
|
67
67
|
allow(payload).to receive(:[]).with(:event).and_return(payload)
|
68
68
|
allow(payload).to receive(:[]).with(:team).and_return({:name => "Team One"})
|
69
69
|
allow(payload).to receive(:[]).with(:member).and_return(user)
|
70
|
-
allow(payload).to receive(:[]).with(:
|
70
|
+
allow(payload).to receive(:[]).with(:github_action).and_return("added")
|
71
71
|
allow(Hubstats::User).to receive(:create_or_update).and_return(user)
|
72
72
|
expect(Hubstats::Team).to receive(:create_or_update)
|
73
73
|
expect(Hubstats::Team).to receive(:update_users_in_team)
|
@@ -84,7 +84,7 @@ module Hubstats
|
|
84
84
|
allow(payload).to receive(:[]).with(:event).and_return(payload)
|
85
85
|
allow(payload).to receive(:[]).with(:team).and_return({:name => "Team One"})
|
86
86
|
allow(payload).to receive(:[]).with(:member).and_return(user)
|
87
|
-
allow(payload).to receive(:[]).with(:
|
87
|
+
allow(payload).to receive(:[]).with(:github_action).and_return("added")
|
88
88
|
expect(Hubstats::Team).to receive(:update_users_in_team)
|
89
89
|
expect(Hubstats::Team).to receive(:create_or_update).and_return(team)
|
90
90
|
ehandler.route(payload, "MembershipEvent")
|