overlay 1.0.7 → 1.1.0
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/app/controllers/overlay/github_controller.rb +1 -1
- data/lib/overlay/github.rb +22 -33
- data/lib/overlay/version.rb +1 -1
- data/spec/controllers/overlay/github_controller_spec.rb +0 -1
- data/spec/dummy/log/test.log +58 -0
- data/spec/github_spec.rb +2 -1
- data/spec/spec_helper.rb +0 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4c5cc9e0f3df5433871de6e021c072fc3e5122
|
4
|
+
data.tar.gz: 5a769dbe4d754ec40db970a19bd2b536299d30c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9566bcd6762c5035425aa5467fc1e5151366793335ad31c2de3668c5893f93f3e85d10b5a8a08d2924688c9e6c6660a8b4b38da490b338706ef1703bef328aab
|
7
|
+
data.tar.gz: b1981b111c43b6bab9b650ce86a07fab40fc77d83dc669982fda21f6be5ddecbd1ae67f79d1f8b25002a0d3a144cdf060194a468a36014eda30fa33facdade74
|
@@ -12,7 +12,7 @@ module Overlay
|
|
12
12
|
if (params[:repository] && params[:ref])
|
13
13
|
if (params[:repository][:name] == repo_config[:repo]) && (params[:ref] == "refs/heads/#{branch}")
|
14
14
|
logger.info "Enqueueing GithubJob for repo: #{repo_config[:repo]} and branch: #{repo_config[:branch] || 'master'}"
|
15
|
-
|
15
|
+
Overlay::Github.overlay_repo repo_config
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/overlay/github.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'github_api'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'socket'
|
4
|
-
require 'sucker_punch'
|
5
4
|
|
6
5
|
module Overlay
|
7
6
|
class Github
|
@@ -29,7 +28,7 @@ module Overlay
|
|
29
28
|
|
30
29
|
register_web_hook(repo_config)
|
31
30
|
|
32
|
-
|
31
|
+
overlay_repo repo_config
|
33
32
|
end
|
34
33
|
end
|
35
34
|
|
@@ -54,25 +53,28 @@ module Overlay
|
|
54
53
|
end
|
55
54
|
|
56
55
|
def self.overlay_repo repo_config
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
56
|
+
Thread.new do
|
57
|
+
Rails.logger.info "Start processing repo with config #{repo_config.inspect}"
|
58
|
+
# Get our root entries
|
59
|
+
#
|
60
|
+
root = repo_config[:root_source_path] || '/'
|
61
|
+
|
62
|
+
# If we have a root defined, jump right into it
|
63
|
+
#
|
64
|
+
if (root != '/')
|
65
|
+
overlay_directory(root, repo_config)
|
66
|
+
else
|
67
|
+
root_entries = github_repo.contents.get(repo_config[:user], repo_config[:repo], root, ref: repo_config[:branch]).response.body
|
68
|
+
|
69
|
+
# We aren't pulling anything out of root. Cycle through directories and overlay
|
70
|
+
#
|
71
|
+
root_entries.each do |entry|
|
72
|
+
if entry.type == 'dir'
|
73
|
+
overlay_directory(entry.path, repo_config)
|
74
|
+
end
|
75
|
+
end
|
75
76
|
end
|
77
|
+
Rails.logger.info "Finished processing repo with config #{repo_config.inspect}"
|
76
78
|
end
|
77
79
|
end
|
78
80
|
|
@@ -124,17 +126,4 @@ module Overlay
|
|
124
126
|
end
|
125
127
|
end
|
126
128
|
end
|
127
|
-
|
128
|
-
class GithubJob
|
129
|
-
include SuckerPunch::Job
|
130
|
-
|
131
|
-
def perform(repo_config)
|
132
|
-
Rails.logger.info "SuckerPunch processing job for #{repo_config[:repo]}"
|
133
|
-
|
134
|
-
# Configure github api
|
135
|
-
Github.configure
|
136
|
-
|
137
|
-
Github.overlay_repo repo_config
|
138
|
-
end
|
139
|
-
end
|
140
129
|
end
|
data/lib/overlay/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -327,3 +327,61 @@ SuckerPunch processing job for overlay
|
|
327
327
|
SuckerPunch processing job for overlay
|
328
328
|
Terminating 3 actors...
|
329
329
|
Shutdown completed cleanly
|
330
|
+
Processing by Overlay::GithubController#update as HTML
|
331
|
+
Rendered text template (0.0ms)
|
332
|
+
Completed 200 OK in 5ms (Views: 4.4ms)
|
333
|
+
Processing by Overlay::GithubController#update as HTML
|
334
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
335
|
+
Enqueueing GithubJob for repo: test and branch: master
|
336
|
+
Completed 200 OK in 0ms (Views: 0.2ms)
|
337
|
+
Processing by Overlay::GithubController#update as HTML
|
338
|
+
Rendered text template (0.0ms)
|
339
|
+
Completed 200 OK in 4ms (Views: 3.4ms)
|
340
|
+
Processing by Overlay::GithubController#update as HTML
|
341
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
342
|
+
Enqueueing GithubJob for repo: test and branch: master
|
343
|
+
Completed 200 OK in 0ms (Views: 0.1ms)
|
344
|
+
Processing by Overlay::GithubController#update as HTML
|
345
|
+
Rendered text template (0.0ms)
|
346
|
+
Completed 200 OK in 4ms (Views: 4.1ms)
|
347
|
+
Processing by Overlay::GithubController#update as HTML
|
348
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
349
|
+
Enqueueing GithubJob for repo: test and branch: master
|
350
|
+
Completed 200 OK in 0ms (Views: 0.2ms)
|
351
|
+
Processing by Overlay::GithubController#update as HTML
|
352
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
353
|
+
Rendered text template (0.0ms)
|
354
|
+
Enqueueing GithubJob for repo: test and branch: master
|
355
|
+
Completed 200 OK in 4ms (Views: 4.1ms)
|
356
|
+
Processing by Overlay::GithubController#update as HTML
|
357
|
+
Completed 200 OK in 0ms (Views: 0.1ms)
|
358
|
+
Processing by Overlay::GithubController#update as HTML
|
359
|
+
Rendered text template (0.0ms)
|
360
|
+
Completed 200 OK in 4ms (Views: 4.2ms)
|
361
|
+
Processing by Overlay::GithubController#update as HTML
|
362
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
363
|
+
Enqueueing GithubJob for repo: test and branch: master
|
364
|
+
Completed 200 OK in 0ms (Views: 0.2ms)
|
365
|
+
Processing by Overlay::GithubController#update as HTML
|
366
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
367
|
+
Rendered text template (0.0ms)
|
368
|
+
Enqueueing GithubJob for repo: test and branch: master
|
369
|
+
Completed 200 OK in 5ms (Views: 4.3ms)
|
370
|
+
Processing by Overlay::GithubController#update as HTML
|
371
|
+
Completed 200 OK in 0ms (Views: 0.2ms)
|
372
|
+
Processing by Overlay::GithubController#update as HTML
|
373
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
374
|
+
Rendered text template (0.0ms)
|
375
|
+
Enqueueing GithubJob for repo: test and branch: master
|
376
|
+
Completed 200 OK in 5ms (Views: 4.3ms)
|
377
|
+
Processing by Overlay::GithubController#update as HTML
|
378
|
+
Completed 200 OK in 0ms (Views: 0.2ms)
|
379
|
+
Processing by Overlay::GithubController#update as HTML
|
380
|
+
Parameters: {"ref"=>"refs/heads/master", "repository"=>{"name"=>"test"}}
|
381
|
+
Rendered text template (0.0ms)
|
382
|
+
Enqueueing GithubJob for repo: test and branch: master
|
383
|
+
Completed 200 OK in 6ms (Views: 5.3ms)
|
384
|
+
Start processing repo with config #<struct Overlay::GithubRepo user="saarinen", repo="overlay", branch="master", root_source_path="spec", root_dest_path="spec">
|
385
|
+
Finished processing repo with config #<struct Overlay::GithubRepo user="saarinen", repo="overlay", branch="master", root_source_path="spec", root_dest_path="spec">
|
386
|
+
Processing by Overlay::GithubController#update as HTML
|
387
|
+
Completed 200 OK in 0ms (Views: 0.2ms)
|
data/spec/github_spec.rb
CHANGED
@@ -81,7 +81,8 @@ describe Overlay::Github do
|
|
81
81
|
it "should jump directly to overlay_directory if root set" do
|
82
82
|
repo_config = Overlay::GithubRepo.new('saarinen', 'overlay', 'master', 'spec', 'spec')
|
83
83
|
Overlay::Github.should_receive(:overlay_directory).once.with('spec', repo_config).and_return
|
84
|
-
Overlay::Github.overlay_repo repo_config
|
84
|
+
overlay_thread = Overlay::Github.overlay_repo repo_config
|
85
|
+
overlay_thread.join
|
85
86
|
end
|
86
87
|
|
87
88
|
it "should ignore any files in repo root"
|
data/spec/spec_helper.rb
CHANGED
@@ -3,7 +3,6 @@ ENV["RAILS_ENV"] ||= 'test'
|
|
3
3
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
4
4
|
require 'rspec/rails'
|
5
5
|
require 'rspec/autorun'
|
6
|
-
require 'sucker_punch/testing/inline'
|
7
6
|
|
8
7
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
8
|
# in spec/support/ and its subdirectories.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overlay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Saarinen
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.10'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: sucker_punch
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec-rails
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|