overlay 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e7cf4853cb51c3c998a8b0d89691dd7fe769b71
4
- data.tar.gz: a3a51bcfb29b2d56ebd16b25547c609476506afd
3
+ metadata.gz: 2a704612722dcf4b32bb66d84615f9df4e7951ef
4
+ data.tar.gz: 773ab3695e26dd21937e859c4e3aeb372d77fa52
5
5
  SHA512:
6
- metadata.gz: 5dae53b5bd7073acba446d4a605341b473139bef5e763582946bf9173251474e29ce523cd65bb9e6e6cc074c6a58b0e966c8bc093ee44d4892b8717172ca43e6
7
- data.tar.gz: 4e7f06ee20f890721b59bd548b1e1ffee3d9b75da166206518314ac52563157d94750878e1b1f8e0f043f7202129f711da8a86591c6a1dcb3e68a63cf5a6e0de
6
+ metadata.gz: 18adabde873278e10f7eb9deeec5fd705455b00bf5e97202f9b0689d09ade0dbe8f82b190917a09f7a423b82a7384e8d8210c30f4725b960a7ae951c233e0841
7
+ data.tar.gz: 375b3de0283dc25d3452ba91d157bd043c7272386bae37ec4289af4bc10b17191b5afad666a7b5c2338210e5ae023745bc6f05f1b84e737a21688ba7d0069e64
@@ -57,14 +57,19 @@ module Overlay
57
57
  REQUIRED_PARAMS = [:org, :repo, :auth, :root_source_path]
58
58
  REQUIRED_PUBLISHER_PARAMS = [:redis_server, :redis_port, :registration_server]
59
59
 
60
- def initialize(org, repo, auth, root_source_path, root_dest_path)
61
- @org = org
62
- @repo = repo
63
- @auth = auth
64
- @root_source_path = root_source_path
65
- @root_dest_path = root_dest_path
66
- @branch = 'master'
67
- @use_publisher = false
60
+ def initialize(options={})
61
+ @org = options[:org]
62
+ @repo = options[:repo]
63
+ @auth = options[:auth]
64
+ @root_source_path = options[:root_source_path]
65
+ @root_dest_path = options[:root_dest_path]
66
+ @redis_server = options[:redis_server]
67
+ @redis_port = options[:redis_port]
68
+ @registration_server = options[:registration_server]
69
+ @endpoint = options[:endpoint]
70
+ @site = options[:site]
71
+ @branch = options[:branch] || 'master'
72
+ @use_publisher = options[:use_publisher] || false
68
73
 
69
74
  # Quick sanity check
70
75
  validate
@@ -1,3 +1,3 @@
1
1
  module Overlay
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -4,52 +4,107 @@ require 'spec_helper'
4
4
  describe Overlay::GithubRepo do
5
5
 
6
6
  let(:repo_config) do
7
- Overlay::GithubRepo.new('org', 'repo', 'auth', 'test', '/')
7
+ Overlay::GithubRepo.new({
8
+ org: 'test_org',
9
+ repo: 'test_repo',
10
+ auth: 'test_user:test_pass',
11
+ root_source_path: 'test',
12
+ root_dest_path: '/'
13
+ })
8
14
  end
9
15
 
10
16
  it "should allow basic creation" do
11
17
  expect {
12
- test = Overlay::GithubRepo.new('org', 'repo', 'auth', 'test', '/')
18
+ Overlay::GithubRepo.new({
19
+ org: 'test_org',
20
+ repo: 'test_repo',
21
+ auth: 'test_user:test_pass',
22
+ root_source_path: 'test',
23
+ root_dest_path: '/'
24
+ })
13
25
  }.to_not raise_error
14
26
  end
15
27
 
16
28
  it 'should throw error for missing org' do
17
29
  expect {
18
- test = Overlay::GithubRepo.new('', 'repo', 'auth', 'test', '/')
30
+ Overlay::GithubRepo.new({
31
+ org: '',
32
+ repo: 'test_repo',
33
+ auth: 'test_user:test_pass',
34
+ root_source_path: 'test',
35
+ root_dest_path: '/'
36
+ })
19
37
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: org")
20
38
 
21
39
  expect {
22
- test = Overlay::GithubRepo.new(nil, 'repo', 'auth', 'test', '/')
40
+ Overlay::GithubRepo.new({ repo: 'test_repo',
41
+ auth: 'test_user:test_pass',
42
+ root_source_path: 'test',
43
+ root_dest_path: '/'
44
+ })
23
45
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: org")
24
46
  end
25
47
 
26
48
  it 'should throw error for missing repo' do
27
49
  expect {
28
- test = Overlay::GithubRepo.new('org', '', 'auth', 'test', '/')
50
+ Overlay::GithubRepo.new({
51
+ org: 'test_org',
52
+ repo: '',
53
+ auth: 'test_user:test_pass',
54
+ root_source_path: 'test',
55
+ root_dest_path: '/'
56
+ })
29
57
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: repo")
30
58
 
31
59
  expect {
32
- test = Overlay::GithubRepo.new('org', nil, 'auth', 'test', '/')
60
+ Overlay::GithubRepo.new({
61
+ org: 'test_org',
62
+ auth: 'test_user:test_pass',
63
+ root_source_path: 'test',
64
+ root_dest_path: '/'
65
+ })
33
66
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: repo")
34
67
  end
35
68
 
36
69
  it 'should throw error for missing auth' do
37
70
  expect {
38
- test = Overlay::GithubRepo.new('org', 'repo', '', 'test', '/')
71
+ Overlay::GithubRepo.new({
72
+ org: 'test_org',
73
+ repo: 'test_repo',
74
+ auth: '',
75
+ root_source_path: 'test',
76
+ root_dest_path: '/'
77
+ })
39
78
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: auth")
40
79
 
41
80
  expect {
42
- test = Overlay::GithubRepo.new('org', 'repo', nil, 'test', '/')
81
+ Overlay::GithubRepo.new({
82
+ org: 'test_org',
83
+ repo: 'test_repo',
84
+ root_source_path: 'test',
85
+ root_dest_path: '/'
86
+ })
43
87
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: auth")
44
88
  end
45
89
 
46
90
  it 'should throw error for missing source root_source_path' do
47
91
  expect {
48
- test = Overlay::GithubRepo.new('org', 'repo', 'auth', '', '/')
92
+ Overlay::GithubRepo.new({
93
+ org: 'test_org',
94
+ repo: 'test_repo',
95
+ auth: 'test_user:test_pass',
96
+ root_source_path: '',
97
+ root_dest_path: '/'
98
+ })
49
99
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: root_source_path")
50
100
 
51
101
  expect {
52
- test = Overlay::GithubRepo.new('org', 'repo', 'auth', nil, '/')
102
+ Overlay::GithubRepo.new({
103
+ org: 'test_org',
104
+ repo: 'test_repo',
105
+ auth: 'test_user:test_pass',
106
+ root_dest_path: '/'
107
+ })
53
108
  }.to raise_error(Overlay::RequiredParameterError, "Overlay GithubRepo missing required paramater: root_source_path")
54
109
  end
55
110
 
@@ -94,9 +149,10 @@ describe Overlay::GithubRepo do
94
149
  it 'should initialize the API with correct settings' do
95
150
  github_api = repo_config.github_api
96
151
 
97
- expect(github_api.current_options[:org]) .to eq('org')
98
- expect(github_api.current_options[:repo]) .to eq('repo')
99
- expect(github_api.current_options[:login]) .to eq('auth')
152
+ expect(github_api.current_options[:org]) .to eq('test_org')
153
+ expect(github_api.current_options[:repo]) .to eq('test_repo')
154
+ expect(github_api.current_options[:login]) .to eq('test_user')
155
+ expect(github_api.current_options[:password]) .to eq('test_pass')
100
156
  end
101
157
 
102
158
  it 'should reinitialize api when endpoint is changed' do
@@ -6,20 +6,20 @@ module Overlay
6
6
  Overlay.configuration.reset if Overlay.configuration
7
7
 
8
8
  Overlay.configure do |config|
9
- config.repositories << Overlay::GithubRepo.new(
10
- 'test',
11
- 'test',
12
- 'test_user:test_pass',
13
- 'spec',
14
- 'spec'
15
- )
9
+ config.repositories << Overlay::GithubRepo.new({
10
+ org: 'test_org',
11
+ repo: 'test_repo',
12
+ auth: 'test_user:test_pass',
13
+ root_source_path: 'spec',
14
+ root_dest_path: 'spec'
15
+ })
16
16
  end
17
17
  end
18
18
 
19
19
  describe "POST 'update'" do
20
20
  it "returns http success" do
21
21
  expect(Overlay::Github.instance).to receive(:process_hook).once.and_return
22
- post 'update', {:use_route => :overlay, :ref => "refs/heads/master", :repository => {:name => 'test'}}
22
+ post 'update', {:use_route => :overlay, :ref => "refs/heads/master", :repository => {:name => 'test_repo'}}
23
23
  end
24
24
  end
25
25
  end
@@ -1660,3 +1660,119 @@ Overlay found deleted file in hook: lib/test/test.rb
1660
1660
  Overlay found added file in hook: lib/test/test.rb
1661
1661
  Overlay found modified file in hook: lib/test/test.rb
1662
1662
  Overlay found deleted file in hook: lib/test/test.rb
1663
+ Processing by Overlay::GithubController#update as HTML
1664
+ Completed 200 OK in 7ms (Views: 6.5ms)
1665
+ Processing by Overlay::GithubController#update as HTML
1666
+ Completed 200 OK in 3ms (Views: 3.1ms)
1667
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1668
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1669
+ Overlay subscribing to redis channel: test_key
1670
+ Overlay subscribing to redis channel: test_key
1671
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1672
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1673
+ Processing by Overlay::GithubController#update as HTML
1674
+ Rendered text template (0.0ms)
1675
+ Completed 200 OK in 4ms (Views: 3.8ms)
1676
+ Overlay subscribing to redis channel: test_key
1677
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1678
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1679
+ Processing by Overlay::GithubController#update as HTML
1680
+ Completed 200 OK in 3ms (Views: 3.2ms)
1681
+ Overlay subscribing to redis channel: test_key
1682
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1683
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1684
+ Processing by Overlay::GithubController#update as HTML
1685
+ Completed 200 OK in 4ms (Views: 3.3ms)
1686
+ Processing by Overlay::GithubController#update as HTML
1687
+ Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
1688
+ Rendered text template (0.0ms)
1689
+ Completed 200 OK in 3ms (Views: 3.0ms)
1690
+ Processing by Overlay::GithubController#update as HTML
1691
+ Completed 200 OK in 0ms (Views: 0.1ms)
1692
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1693
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1694
+ Overlay subscribing to redis channel: test_key
1695
+ Processing by Overlay::GithubController#update as HTML
1696
+ Rendered text template (0.0ms)
1697
+ Completed 200 OK in 4ms (Views: 3.4ms)
1698
+ Processing by Overlay::GithubController#update as HTML
1699
+ Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
1700
+ Completed 200 OK in 0ms (Views: 0.2ms)
1701
+ Overlay found added file in hook: lib/test/test.rb
1702
+ Overlay found modified file in hook: lib/test/test.rb
1703
+ Overlay found deleted file in hook: lib/test/test.rb
1704
+ Overlay found added file in hook: lib/test/test.rb
1705
+ Overlay found modified file in hook: lib/test/test.rb
1706
+ Overlay found deleted file in hook: lib/test/test.rb
1707
+ Overlay found added file in hook: lib/test/test.rb
1708
+ Overlay found modified file in hook: lib/test/test.rb
1709
+ Overlay found deleted file in hook: lib/test/test.rb
1710
+ Overlay found added file in hook: lib/test/test.rb
1711
+ Overlay found modified file in hook: lib/test/test.rb
1712
+ Overlay found deleted file in hook: lib/test/test.rb
1713
+ Overlay subscribing to redis channel: test_key
1714
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1715
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1716
+ Processing by Overlay::GithubController#update as HTML
1717
+ Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
1718
+ Rendered text template (0.0ms)
1719
+ Completed 200 OK in 4ms (Views: 3.2ms)
1720
+ Processing by Overlay::GithubController#update as HTML
1721
+ Completed 200 OK in 0ms (Views: 0.1ms)
1722
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1723
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1724
+ Overlay subscribing to redis channel: test_key
1725
+ Overlay found added file in hook: lib/test/test.rb
1726
+ Overlay found modified file in hook: lib/test/test.rb
1727
+ Overlay found deleted file in hook: lib/test/test.rb
1728
+ Overlay found added file in hook: lib/test/test.rb
1729
+ Overlay found modified file in hook: lib/test/test.rb
1730
+ Overlay found deleted file in hook: lib/test/test.rb
1731
+ Overlay found added file in hook: lib/test/test.rb
1732
+ Overlay found modified file in hook: lib/test/test.rb
1733
+ Overlay found deleted file in hook: lib/test/test.rb
1734
+ Overlay found added file in hook: lib/test/test.rb
1735
+ Overlay found modified file in hook: lib/test/test.rb
1736
+ Overlay found deleted file in hook: lib/test/test.rb
1737
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1738
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1739
+ Overlay subscribing to redis channel: test_key
1740
+ Overlay found added file in hook: lib/test/test.rb
1741
+ Overlay found modified file in hook: lib/test/test.rb
1742
+ Overlay found deleted file in hook: lib/test/test.rb
1743
+ Overlay found added file in hook: lib/test/test.rb
1744
+ Overlay found modified file in hook: lib/test/test.rb
1745
+ Overlay found deleted file in hook: lib/test/test.rb
1746
+ Overlay found added file in hook: lib/test/test.rb
1747
+ Overlay found modified file in hook: lib/test/test.rb
1748
+ Overlay found deleted file in hook: lib/test/test.rb
1749
+ Overlay found added file in hook: lib/test/test.rb
1750
+ Overlay found modified file in hook: lib/test/test.rb
1751
+ Overlay found deleted file in hook: lib/test/test.rb
1752
+ Processing by Overlay::GithubController#update as HTML
1753
+ Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test_repo"}}
1754
+ Rendered text template (0.0ms)
1755
+ Completed 200 OK in 3ms (Views: 3.1ms)
1756
+ Processing by Overlay::GithubController#update as HTML
1757
+ Completed 200 OK in 0ms (Views: 0.1ms)
1758
+ Overlay found added file in hook: lib/test/test.rb
1759
+ Overlay found modified file in hook: lib/test/test.rb
1760
+ Overlay found deleted file in hook: lib/test/test.rb
1761
+ Overlay found added file in hook: lib/test/test.rb
1762
+ Overlay found modified file in hook: lib/test/test.rb
1763
+ Overlay found deleted file in hook: lib/test/test.rb
1764
+ Overlay found added file in hook: lib/test/test.rb
1765
+ Overlay found modified file in hook: lib/test/test.rb
1766
+ Overlay found deleted file in hook: lib/test/test.rb
1767
+ Overlay found added file in hook: lib/test/test.rb
1768
+ Overlay found modified file in hook: lib/test/test.rb
1769
+ Overlay found deleted file in hook: lib/test/test.rb
1770
+ Overlay subscribing to redis channel: test_key
1771
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1772
+ Overlay register webhook for repo: org => test_org, repo => test_repo
1773
+ Processing by Overlay::GithubController#update as HTML
1774
+ Rendered text template (0.0ms)
1775
+ Completed 200 OK in 7ms (Views: 6.3ms)
1776
+ Processing by Overlay::GithubController#update as HTML
1777
+ Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test_repo"}}
1778
+ Completed 200 OK in 0ms (Views: 0.2ms)
data/spec/github_spec.rb CHANGED
@@ -4,13 +4,13 @@ require 'socket'
4
4
  describe Overlay::Github do
5
5
 
6
6
  let(:repo_config) do
7
- Overlay::GithubRepo.new(
8
- 'test_org',
9
- 'test_repo',
10
- 'test_user:test_pass',
11
- 'spec',
12
- 'spec'
13
- )
7
+ Overlay::GithubRepo.new({
8
+ org: 'test_org',
9
+ repo: 'test_repo',
10
+ auth: 'test_user:test_pass',
11
+ root_source_path: 'spec',
12
+ root_dest_path: 'spec'
13
+ })
14
14
  end
15
15
 
16
16
  describe "Register Github webhook" do
@@ -111,13 +111,13 @@ describe Overlay::Github do
111
111
 
112
112
  describe 'process webhook payload' do
113
113
  let(:repo_config) do
114
- Overlay::GithubRepo.new(
115
- 'test_org',
116
- 'test_repo',
117
- 'test_user:test_pass',
118
- 'lib',
119
- 'lib'
120
- )
114
+ Overlay::GithubRepo.new({
115
+ org: 'test_org',
116
+ repo: 'test_repo',
117
+ auth: 'test_user:test_pass',
118
+ root_source_path: 'lib',
119
+ root_dest_path: 'lib'
120
+ })
121
121
  end
122
122
 
123
123
  let(:payload) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overlay
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Saarinen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -93,7 +93,6 @@ files:
93
93
  - lib/overlay/configuration.rb
94
94
  - lib/overlay/engine.rb
95
95
  - lib/overlay/github.rb
96
- - lib/overlay/subscriber.rb
97
96
  - lib/overlay/version.rb
98
97
  - lib/overlay.rb
99
98
  - lib/tasks/overlay_tasks.rake
@@ -1 +0,0 @@
1
- subscriber.rb