hubstats 0.4.2 → 0.4.4
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 +8 -8
- data/.travis.yml +2 -1
- data/CHANGELOG.markdown +6 -0
- data/app/controllers/hubstats/events_controller.rb +1 -1
- data/lib/hubstats.rb +8 -0
- data/lib/hubstats/version.rb +1 -1
- data/spec/lib/hubstats/github_api_spec.rb +6 -6
- data/spec/lib/hubstats_spec.rb +20 -0
- data/test/dummy/db/schema.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWQ3YTBhNDcwNThjYzIwYTQ4OTdiZjViM2RkYzAzYmZhYzIzNDE1Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjVlNzNhYjQwNzZlNmJmMjM5Nzk0MTQzOGNkZjQwNTE4NjBiNmE4ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTdiMjlkOTY2NDdiMjc2ZDY5MTI3Njg5NjU5ZDE0OWI3MmQxMTI2NDVlOGI2
|
10
|
+
MGQyYmRmODU5MjY2YTRkZGJhMjRhMDg4NjYwMjlmYmY4ODBmMTQ0ZjNiYTEx
|
11
|
+
MjYwNDJhNGRlMWFkOTczZDBmNTNjN2NmZjFiN2QyNjQxOWU0OTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Mzk0NGU2YjZjZmEwMGUzYWQ5NjY4OGY3YWNmNThkNjA5ZmUzZWU3ZDU5MjQ0
|
14
|
+
Y2E3NmVmNDNiYTM3MGIwN2E2NWMzYzNmODg5ZWEwZGU4OGZjMTFhM2ZjZWNm
|
15
|
+
ZDJiYzk5MDk2OGUwYWM2ZjE5ZGRhMWU4ZjIzODY2MzNhZDA2OWI=
|
data/.travis.yml
CHANGED
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#### v0.4.4
|
2
|
+
#### v0.4.3
|
3
|
+
* Fixes a bug introduced in v0.4.1 that removed the config method from Hubstats
|
4
|
+
|
5
|
+
> Andy Fleener, Emma Sax: : https://github.com/sportngin/hubstats/pull/73
|
6
|
+
|
1
7
|
#### v0.4.2
|
2
8
|
* Fixing bugs that made counts different in show pages and indices
|
3
9
|
|
data/lib/hubstats.rb
CHANGED
@@ -6,4 +6,12 @@ require "active_support/core_ext/numeric"
|
|
6
6
|
require "hubstats/config"
|
7
7
|
|
8
8
|
module Hubstats
|
9
|
+
# Public - Sets the config for the webhook to correctly receive and match the signatures
|
10
|
+
#
|
11
|
+
# DO NOT DELETE
|
12
|
+
#
|
13
|
+
# Returns - nothing
|
14
|
+
def self.config
|
15
|
+
@@config ||= Hubstats::Config.parse
|
16
|
+
end
|
9
17
|
end
|
data/lib/hubstats/version.rb
CHANGED
@@ -39,12 +39,12 @@ module Hubstats
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
context "with application authentication" do
|
43
|
-
before do
|
42
|
+
context "with application authentication" do
|
43
|
+
before do
|
44
44
|
allow(ENV).to receive(:[]).and_return(nil)
|
45
45
|
allow(ENV).to receive(:[]).with("CLIENT_ID").and_return("client_id")
|
46
46
|
allow(ENV).to receive(:[]).with("CLIENT_SECRET").and_return("client_secret")
|
47
|
-
end
|
47
|
+
end
|
48
48
|
|
49
49
|
it 'should intialize client with client-id environment variables' do
|
50
50
|
Hubstats::GithubAPI.configure()
|
@@ -55,11 +55,11 @@ module Hubstats
|
|
55
55
|
|
56
56
|
context "with wrong credentials" do
|
57
57
|
before do
|
58
|
-
allow(client).to receive(:user).and_return(
|
59
|
-
allow(ENV).to receive(:[]).and_return(
|
58
|
+
allow(client).to receive(:user).and_return( 'test' )
|
59
|
+
allow(ENV).to receive(:[]).and_return('creds')
|
60
|
+
allow(Octokit::Client).to receive(:new).with({:access_token=>"creds"}).and_raise(Octokit::Unauthorized)
|
60
61
|
end
|
61
62
|
|
62
|
-
# If this test begins to fail, it is because there are so many repeated calls to Octokit; just comment out
|
63
63
|
it 'should fail to initialize at all' do
|
64
64
|
Hubstats::GithubAPI.configure()
|
65
65
|
expect{Hubstats::GithubAPI.client}.to raise_error Octokit::Unauthorized
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hubstats
|
4
|
+
context ".config" do
|
5
|
+
subject { Hubstats }
|
6
|
+
after do
|
7
|
+
Hubstats.class_variable_set(:@@config, nil)
|
8
|
+
end
|
9
|
+
it "creates a new config object" do
|
10
|
+
expect(Hubstats::Config).to receive(:parse).once { double(:config) }
|
11
|
+
subject.config
|
12
|
+
end
|
13
|
+
|
14
|
+
it "memorizes the config object" do
|
15
|
+
expect(Hubstats::Config).to receive(:parse).once { double(:config) }
|
16
|
+
subject.config
|
17
|
+
subject.config
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20150706210701) do
|
15
15
|
|
16
16
|
create_table "hubstats_comments", :force => true do |t|
|
17
17
|
t.string "kind"
|
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.4.
|
4
|
+
version: 0.4.4
|
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-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -271,6 +271,7 @@ files:
|
|
271
271
|
- spec/helpers/hubstats/users_helper_spec.rb
|
272
272
|
- spec/lib/hubstats/events_handler_spec.rb
|
273
273
|
- spec/lib/hubstats/github_api_spec.rb
|
274
|
+
- spec/lib/hubstats_spec.rb
|
274
275
|
- spec/models/hubstats/comment_spec.rb
|
275
276
|
- spec/models/hubstats/deploy_spec.rb
|
276
277
|
- spec/models/hubstats/label_spec.rb
|
@@ -354,6 +355,7 @@ test_files:
|
|
354
355
|
- spec/helpers/hubstats/users_helper_spec.rb
|
355
356
|
- spec/lib/hubstats/events_handler_spec.rb
|
356
357
|
- spec/lib/hubstats/github_api_spec.rb
|
358
|
+
- spec/lib/hubstats_spec.rb
|
357
359
|
- spec/models/hubstats/comment_spec.rb
|
358
360
|
- spec/models/hubstats/deploy_spec.rb
|
359
361
|
- spec/models/hubstats/label_spec.rb
|