hubstats 0.5.7 → 0.5.9
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/CHANGELOG.markdown +6 -0
- data/lib/hubstats/events_handler.rb +4 -6
- data/lib/hubstats/version.rb +1 -1
- data/spec/lib/hubstats/events_handler_spec.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ac691a2eef5173765eff6de2e617a2a92db3a2
|
4
|
+
data.tar.gz: 04fbcaa356ca69934d6ba6c9d5508188bf536e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a233f831c1e00ddabe10c5e5d782a6af9ffa135cfb856ed0a1ca6f247b0a28d0e6bfc46a8bb042bb8c3bb52a30104e1816a1e91a3bbc43bc904d63a306f3ca99
|
7
|
+
data.tar.gz: da299e668685fda5532ff04f654c0777c3a8cc7fc51ce0aa01604e5bdfaba33992f53a27c4d641c605c26e96f936640da45df41e60df6c5f101501a36fbe087c
|
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#### v0.5.9
|
2
|
+
#### v0.5.8
|
3
|
+
* Fixing bug that resulted in no data being updated from org webhooks
|
4
|
+
|
5
|
+
> Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/85
|
6
|
+
|
1
7
|
#### v0.5.7
|
2
8
|
#### v0.5.6
|
3
9
|
* Fixing bug that makes metrics not show up on teams and repos page
|
@@ -7,7 +7,7 @@ module Hubstats
|
|
7
7
|
# type - the type of data that payload is
|
8
8
|
#
|
9
9
|
# Returns - nothing
|
10
|
-
def route(payload, type)
|
10
|
+
def route(payload, type)
|
11
11
|
case type
|
12
12
|
when "issue_comment", "IssueCommentEvent"
|
13
13
|
comment_processor(payload, "Issue")
|
@@ -55,15 +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[:team]
|
59
|
-
team[:action] = payload[:action]
|
60
|
-
team[:current_user] = payload[:member]
|
58
|
+
team = payload[:event][:team]
|
61
59
|
team_list = Hubstats.config.github_config["team_list"] || []
|
62
60
|
if team_list.include? team[:name]
|
63
61
|
Hubstats::Team.create_or_update(team.with_indifferent_access)
|
64
62
|
hubstats_team = Hubstats::Team.where(name: team[:name]).first
|
65
|
-
hubstats_user = Hubstats::User.create_or_update(
|
66
|
-
Hubstats::Team.update_users_in_team(hubstats_team, hubstats_user,
|
63
|
+
hubstats_user = Hubstats::User.create_or_update(payload[:event][:member])
|
64
|
+
Hubstats::Team.update_users_in_team(hubstats_team, hubstats_user, payload[:event][:action])
|
67
65
|
end
|
68
66
|
end
|
69
67
|
|
data/lib/hubstats/version.rb
CHANGED
@@ -64,10 +64,14 @@ module Hubstats
|
|
64
64
|
payload = build(:team_payload_hash)
|
65
65
|
user = build(:user)
|
66
66
|
allow(Hubstats).to receive_message_chain(:config, :github_config, :[]).with("team_list") { ["Team One", "Team Two", "Team Three"] }
|
67
|
+
allow(payload).to receive(:[]).with(:event).and_return(payload)
|
68
|
+
allow(payload).to receive(:[]).with(:team).and_return({:name => "Team One"})
|
69
|
+
allow(payload).to receive(:[]).with(:member).and_return(user)
|
70
|
+
allow(payload).to receive(:[]).with(:action).and_return("added")
|
67
71
|
allow(Hubstats::User).to receive(:create_or_update).and_return(user)
|
68
72
|
expect(Hubstats::Team).to receive(:create_or_update)
|
69
73
|
expect(Hubstats::Team).to receive(:update_users_in_team)
|
70
|
-
ehandler.route(payload,
|
74
|
+
ehandler.route(payload, "MembershipEvent")
|
71
75
|
end
|
72
76
|
|
73
77
|
it 'should successfully create_or_update the team' do
|
@@ -77,9 +81,13 @@ module Hubstats
|
|
77
81
|
user = build(:user)
|
78
82
|
allow(Hubstats).to receive_message_chain(:config, :github_config, :[]).with("team_list") { ["Team One", "Team Two", "Team Three"] }
|
79
83
|
allow(Hubstats::User).to receive(:create_or_update).and_return(user)
|
84
|
+
allow(payload).to receive(:[]).with(:event).and_return(payload)
|
85
|
+
allow(payload).to receive(:[]).with(:team).and_return({:name => "Team One"})
|
86
|
+
allow(payload).to receive(:[]).with(:member).and_return(user)
|
87
|
+
allow(payload).to receive(:[]).with(:action).and_return("added")
|
80
88
|
expect(Hubstats::Team).to receive(:update_users_in_team)
|
81
89
|
expect(Hubstats::Team).to receive(:create_or_update).and_return(team)
|
82
|
-
ehandler.route(payload,
|
90
|
+
ehandler.route(payload, "MembershipEvent")
|
83
91
|
end
|
84
92
|
end
|
85
93
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Hursh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|