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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmI3ZDhkNmZmMjI0N2U5M2E4OWU5MzI2NmIzMTgwYWZlOWM4Yjc1Mw==
4
+ ZWQ3YTBhNDcwNThjYzIwYTQ4OTdiZjViM2RkYzAzYmZhYzIzNDE1Yg==
5
5
  data.tar.gz: !binary |-
6
- OTBhOTUzNDk5ZTNkYWM3YTAyYWFlYzJhY2U2MDNhYTdhNGFmMzE2Yg==
6
+ NjVlNzNhYjQwNzZlNmJmMjM5Nzk0MTQzOGNkZjQwNTE4NjBiNmE4ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDkxZjM5NWUxMDEwNjYwMGViODUxYjhiOTdhZTE0NWE5MzAwZTYzN2RhYTEy
10
- YjEyMmM2OWUyOGE1NjgzMmI1OWU2OTRmNjA4ZDBhYmU2MTg5ZjdkZTVhODkw
11
- OTViMjFiZDczZDBjYTg5MjhiNzM3YWE0MmZhYTVmMzZlNDA1Mzk=
9
+ ZTdiMjlkOTY2NDdiMjc2ZDY5MTI3Njg5NjU5ZDE0OWI3MmQxMTI2NDVlOGI2
10
+ MGQyYmRmODU5MjY2YTRkZGJhMjRhMDg4NjYwMjlmYmY4ODBmMTQ0ZjNiYTEx
11
+ MjYwNDJhNGRlMWFkOTczZDBmNTNjN2NmZjFiN2QyNjQxOWU0OTU=
12
12
  data.tar.gz: !binary |-
13
- N2ViMmY2MGRjNjNiNGE0MDhkNjUxN2U3ZDFlMjczZWNiMTNmYTBhMjk2ODI2
14
- MDE1MzA0YjNiYTk3NGY1MGI2NDcyNTJiMDNhMzc2N2YwZDg1YTg5M2U4MmZm
15
- YjZhYjBkNzEyMjc3YTUyZGI3NTZiZWI2OGM2OWM4Y2NkOGY1NTM=
13
+ Mzk0NGU2YjZjZmEwMGUzYWQ5NjY4OGY3YWNmNThkNjA5ZmUzZWU3ZDU5MjQ0
14
+ Y2E3NmVmNDNiYTM3MGIwN2E2NWMzYzNmODg5ZWEwZGU4OGZjMTFhM2ZjZWNm
15
+ ZDJiYzk5MDk2OGUwYWM2ZjE5ZGRhMWU4ZjIzODY2MzNhZDA2OWI=
data/.travis.yml CHANGED
@@ -9,7 +9,8 @@ env:
9
9
  - RAILS_VERSION=3.2
10
10
  rvm:
11
11
  - 1.9.3
12
- - 2.0.0
12
+ - 2.1.2
13
+
13
14
  script: bundle exec rspec
14
15
  before_script:
15
16
  - bundle exec rake app:db:create
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
 
@@ -20,7 +20,7 @@ module Hubstats
20
20
  render :nothing => true
21
21
  end
22
22
 
23
- # Pulbic - Will check that the request passed is a valid signature.
23
+ # Public - Will check that the request passed is a valid signature.
24
24
  #
25
25
  # request - the signature to be checked
26
26
  #
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
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -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( nil )
59
- allow(ENV).to receive(:[]).and_return(nil)
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
@@ -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 => 20150625165035) do
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.2
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-02 00:00:00.000000000 Z
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