owl-cms 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +4 -2
- data/Rakefile +38 -1
- data/core/classes/cached.rb +1 -1
- data/core/classes/commit.rb +63 -0
- data/core/helpers/base.rb +1 -1
- data/core/routes/base.rb +5 -1
- data/core/routes/bootstrap.rb +3 -0
- data/core/routes/cache.rb +20 -11
- data/core/routes/deploy.rb +16 -0
- data/owl-cms.gemspec +1 -1
- data/sample/data/page/about/index.haml +1 -3
- data/sample/data/page/error/index.haml +8 -0
- data/sample/data/page/not-found/index.haml +5 -4
- data/sample/themes/base/assets/scss/modules/_all.scss +1 -1
- data/sample/themes/base/assets/scss/modules/_extensions.scss +2 -0
- data/sample/themes/base/assets/scss/modules/_mixins.scss +10 -1
- data/sample/themes/base/assets/scss/modules/_susy.scss +5 -4
- data/sample/themes/base/assets/scss/partials/_base.scss +8 -1
- data/sample/themes/base/assets/scss/partials/_main.scss +7 -4
- data/sample/themes/base/assets/stylesheets/main.css +15 -23
- data/sample/themes/base/partials/_footer.haml +2 -2
- data/test/data/post-receive-hook.json +146 -0
- data/test/test_deploy.rb +23 -0
- metadata +21 -3
- data/core/classes/other.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9629808f019274ece905b0f54cfa53746751110
|
4
|
+
data.tar.gz: 53a878e5b45b35efd082e0eea3f9dbd66d968aa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eed8020f5f1d5f0a3761146e350108ee26eef38cbf0c3c67fc3eadb06f02641578fde4201eee34727294b151852c49cfc7ec0e9cbc1ee46c54da152e0b172d6f
|
7
|
+
data.tar.gz: eea0eae38eae58557e40428f51b6fe5a403eb4be37f7a02ef0ed37b7a38a8593380711e7b7f4286fc4d829a18cba41a2f3bb4fedea33c9a82ead6d2885cf971e
|
data/Gemfile
CHANGED
@@ -18,6 +18,8 @@ gem 'susy', '1.0.9', :require => 'susy'
|
|
18
18
|
gem 'maruku', '0.6.1', :require => 'maruku'
|
19
19
|
gem 'html_truncator', '0.3.1', :require => 'html_truncator'
|
20
20
|
|
21
|
-
|
22
21
|
# Datastore
|
23
22
|
gem 'cabi', '>=0.1.6', :require => 'cabi'
|
23
|
+
|
24
|
+
# Misc.
|
25
|
+
gem "netaddr", '1.5.0', :require => 'netaddr'
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
4
|
backports (3.3.4)
|
5
|
-
cabi (0.1.
|
5
|
+
cabi (0.1.6)
|
6
6
|
thor (~> 0.18, >= 0.18.1)
|
7
7
|
chunky_png (1.2.8)
|
8
8
|
compass (0.12.2)
|
@@ -25,6 +25,7 @@ GEM
|
|
25
25
|
syntax (>= 1.0.0)
|
26
26
|
mini_portile (0.5.1)
|
27
27
|
multi_json (1.8.0)
|
28
|
+
netaddr (1.5.0)
|
28
29
|
nokogiri (1.6.0)
|
29
30
|
mini_portile (~> 0.5.0)
|
30
31
|
rack (1.5.2)
|
@@ -71,11 +72,12 @@ PLATFORMS
|
|
71
72
|
ruby
|
72
73
|
|
73
74
|
DEPENDENCIES
|
74
|
-
cabi (
|
75
|
+
cabi (>= 0.1.6)
|
75
76
|
compass (= 0.12.2)
|
76
77
|
haml (= 4.0.3)
|
77
78
|
html_truncator (= 0.3.1)
|
78
79
|
maruku (= 0.6.1)
|
80
|
+
netaddr (= 1.5.0)
|
79
81
|
rack-cache (= 1.2)
|
80
82
|
rack-funky-cache (= 0.0.6)
|
81
83
|
rack-session-file (= 0.5.0)
|
data/Rakefile
CHANGED
@@ -5,4 +5,41 @@ Rake::TestTask.new do |t|
|
|
5
5
|
end
|
6
6
|
|
7
7
|
desc "Run tests"
|
8
|
-
task :
|
8
|
+
task :test => :test
|
9
|
+
|
10
|
+
namespace :gem do
|
11
|
+
|
12
|
+
desc "build"
|
13
|
+
task :build do
|
14
|
+
puts %x[rm -rf *.gem]
|
15
|
+
puts %x[gem build *.gemspec]
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "install"
|
19
|
+
task :install do
|
20
|
+
puts %x[gem install *.gem]
|
21
|
+
puts %x[rm -rf *.gem]
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "release"
|
25
|
+
task :release do
|
26
|
+
gems = Dir.glob("*.gem").length
|
27
|
+
puts gems
|
28
|
+
raise "0 or > 1 gem in directory; aborting!" if gems != 1
|
29
|
+
puts %x[gem push *.gem]
|
30
|
+
puts %x[rm -rf *.gem]
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "build & install"
|
34
|
+
task :build_and_install do
|
35
|
+
Rake::Task["gem:build"].invoke
|
36
|
+
Rake::Task["gem:install"].invoke
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "build & release"
|
40
|
+
task :build_and_release do
|
41
|
+
Rake::Task["gem:build"].invoke
|
42
|
+
Rake::Task["gem:release"].invoke
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
data/core/classes/cached.rb
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
module Owl
|
2
|
+
module Lib
|
3
|
+
class Commit
|
4
|
+
|
5
|
+
DEPLOY_TRIGGER = '#deploy'
|
6
|
+
GITHUB_IP_1 = NetAddr::CIDR.create('204.232.175.64/27').enumerate
|
7
|
+
GITHUB_IP_2 = NetAddr::CIDR.create('192.30.252.0/22').enumerate
|
8
|
+
BITBUCKET_IPS = ['207.223.240.187', '207.223.240.188']
|
9
|
+
AUTHORIZED_IPS = BITBUCKET_IPS + GITHUB_IP_1 + GITHUB_IP_2
|
10
|
+
|
11
|
+
attr_accessor :data
|
12
|
+
attr_accessor :message
|
13
|
+
attr_accessor :id
|
14
|
+
attr_accessor :ip
|
15
|
+
|
16
|
+
def initialize(payload, ip)
|
17
|
+
@payload = payload.is_a?(String) ? JSON.parse(payload) : payload["payload"]
|
18
|
+
@data = @payload["commits"].first
|
19
|
+
@ip = ip
|
20
|
+
|
21
|
+
parse_message
|
22
|
+
parse_id
|
23
|
+
end
|
24
|
+
|
25
|
+
def parse_message
|
26
|
+
@message = @data['message'].downcase
|
27
|
+
end
|
28
|
+
|
29
|
+
def parse_id
|
30
|
+
# github # # bitbucket #
|
31
|
+
@id = @data['id'] || @data['node']
|
32
|
+
end
|
33
|
+
|
34
|
+
def deploy_if_necessary
|
35
|
+
if deploy?
|
36
|
+
|
37
|
+
Owl::Lib::CachedFile.clear_all!
|
38
|
+
|
39
|
+
cmd = [
|
40
|
+
'git reset --hard HEAD',
|
41
|
+
'git pull'
|
42
|
+
]
|
43
|
+
|
44
|
+
system cmd.join(" && ")
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def triggers_deploy?
|
50
|
+
@message.include? DEPLOY_TRIGGER
|
51
|
+
end
|
52
|
+
|
53
|
+
def authorized?
|
54
|
+
AUTHORIZED_IPS.include?(@ip)
|
55
|
+
end
|
56
|
+
|
57
|
+
def deploy?
|
58
|
+
triggers_deploy? and authorized?
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/core/helpers/base.rb
CHANGED
data/core/routes/base.rb
CHANGED
@@ -5,9 +5,13 @@ module Owl
|
|
5
5
|
extend Sinatra::Extension
|
6
6
|
|
7
7
|
not_found do
|
8
|
-
|
8
|
+
render_page('/not-found')
|
9
9
|
end
|
10
10
|
|
11
|
+
error do
|
12
|
+
render_page('/error')
|
13
|
+
end
|
14
|
+
|
11
15
|
get '*' do |path|
|
12
16
|
path = "/home" if path == '/'
|
13
17
|
render_page(path)
|
data/core/routes/bootstrap.rb
CHANGED
@@ -12,6 +12,7 @@ module Owl
|
|
12
12
|
|
13
13
|
register Owl::CMS::Admin
|
14
14
|
register Owl::CMS::Cache
|
15
|
+
register Owl::CMS::Deploy
|
15
16
|
register Owl::CMS::Base
|
16
17
|
|
17
18
|
helpers Owl::CMS::Helpers::Base
|
@@ -23,6 +24,8 @@ module Owl
|
|
23
24
|
set :public_folder, Owl::Lib::Theme.instance.theme_path
|
24
25
|
set :site_settings, Owl::Lib::Settings.instance.settings
|
25
26
|
set :theme_settings, Owl::Lib::Theme.instance.settings
|
27
|
+
set :show_exceptions, development?
|
28
|
+
set :raise_errors, false
|
26
29
|
end
|
27
30
|
|
28
31
|
end
|
data/core/routes/cache.rb
CHANGED
@@ -7,28 +7,37 @@ module Owl
|
|
7
7
|
|
8
8
|
CACHE_ROOT = "#{Dir.pwd}"
|
9
9
|
CACHE_PATH = ".cache"
|
10
|
-
CACHE_STORE = File.join(CACHE_ROOT, CACHE_PATH)
|
10
|
+
CACHE_STORE = File.expand_path File.join(CACHE_ROOT, CACHE_PATH)
|
11
11
|
METASTORE_URI = "file:#{CACHE_STORE}"
|
12
12
|
ENTITYSTORE_URI = "file:#{CACHE_STORE}"
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
CACHE_BLACKLIST = [ /^\/cache/, /^\/admin/ ]
|
15
|
+
|
16
|
+
use Rack::Cache,
|
17
|
+
verbose: false,
|
18
|
+
metastore: METASTORE_URI,
|
19
|
+
entitystore: ENTITYSTORE_URI
|
19
20
|
|
20
|
-
use Rack::FunkyCache,
|
21
|
+
use Rack::FunkyCache,
|
22
|
+
root: CACHE_ROOT,
|
23
|
+
path: CACHE_PATH
|
21
24
|
|
22
25
|
before do
|
26
|
+
file = Owl::Lib::CachedFile.find(request)
|
23
27
|
|
24
|
-
if
|
25
|
-
|
26
|
-
|
28
|
+
if file
|
29
|
+
if (env['HTTP_PRAGMA'] == 'no-cache') or request.path.match Regexp.new(CACHE_BLACKLIST.join("|"))
|
30
|
+
# don't send cached file.
|
31
|
+
else
|
27
32
|
last_modified File.mtime(file)
|
28
33
|
send_file(file)
|
29
34
|
end
|
30
35
|
end
|
31
|
-
|
36
|
+
end
|
37
|
+
|
38
|
+
get '/cache/clear' do
|
39
|
+
Owl::Lib::CachedFile.clear_all!
|
40
|
+
"You have cleared the cache."
|
32
41
|
end
|
33
42
|
|
34
43
|
end
|
data/owl-cms.gemspec
CHANGED
@@ -9,6 +9,4 @@ layout: foo # this layout is missing (by design), will use default.
|
|
9
9
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ullamcorper justo sem. Fusce ac sem est. Aenean dignissim feugiat auctor. Vestibulum in ante sem. Ut sit amet erat arcu, eget fringilla odio. Aenean a nibh est. Cras metus urna, vulputate non feugiat vel, condimentum sit amet purus.
|
10
10
|
|
11
11
|
%p
|
12
|
-
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec dictum egestas lorem. Vestibulum tempus, ante a adipiscing tempus, eros lectus mollis tellus, id viverra arcu purus vitae sapien. Suspendisse sed quam leo. Suspendisse volutpat nunc sit amet nulla venenatis ultrices. Quisque bibendum, purus pulvinar lacinia euismod, dolor tortor cursus enim, tempus porttitor magna neque in nibh. Quisque vel turpis sit amet mi semper venenatis in et arcu. Mauris mattis hendrerit turpis, tristique bibendum felis dictum et. Mauris elit turpis, suscipit eget sollicitudin id, congue sed erat. Mauris fringilla semper magna eget vulputate. Fusce ut ligula a velit ultricies condimentum at hendrerit lectus.
|
13
|
-
|
14
|
-
- puts "Test"
|
12
|
+
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec dictum egestas lorem. Vestibulum tempus, ante a adipiscing tempus, eros lectus mollis tellus, id viverra arcu purus vitae sapien. Suspendisse sed quam leo. Suspendisse volutpat nunc sit amet nulla venenatis ultrices. Quisque bibendum, purus pulvinar lacinia euismod, dolor tortor cursus enim, tempus porttitor magna neque in nibh. Quisque vel turpis sit amet mi semper venenatis in et arcu. Mauris mattis hendrerit turpis, tristique bibendum felis dictum et. Mauris elit turpis, suscipit eget sollicitudin id, congue sed erat. Mauris fringilla semper magna eget vulputate. Fusce ut ligula a velit ultricies condimentum at hendrerit lectus.
|
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
---
|
2
|
+
title: Page Not Found
|
3
|
+
---
|
2
4
|
|
3
|
-
%
|
4
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ullamcorper justo sem. Fusce ac sem est. Aenean dignissim feugiat auctor. Vestibulum in ante sem. Ut sit amet erat arcu, eget fringilla odio. Aenean a nibh est. Cras metus urna, vulputate non feugiat vel, condimentum sit amet purus.
|
5
|
+
%h1= @page.setting('title')
|
5
6
|
|
6
7
|
%p
|
7
|
-
|
8
|
+
We're sorry, but this page could not be found.
|
@@ -1,2 +1,11 @@
|
|
1
1
|
|
2
|
-
// All mixins here.
|
2
|
+
// All mixins here.
|
3
|
+
|
4
|
+
@mixin respond-to($breakpoint) {
|
5
|
+
@media only screen and (min-width: $breakpoint) { @content; }
|
6
|
+
}
|
7
|
+
|
8
|
+
@mixin super-rhythm( $leader, $padding-leader, $padding-trailer, $trailer, $font-size ){
|
9
|
+
@include adjust-font-size-to( $font-size );
|
10
|
+
@include rhythm( $leader, $padding-leader, $padding-trailer, $trailer, $font-size );
|
11
|
+
}
|
@@ -23,4 +23,11 @@ $h3: 18px;
|
|
23
23
|
$h4: 16px;
|
24
24
|
$h5: 13px;
|
25
25
|
$h6: 12px;
|
26
|
-
$headings: $h1, $h2, $h3, $h4, $h5, $h6;
|
26
|
+
$headings: $h1, $h2, $h3, $h4, $h5, $h6;
|
27
|
+
|
28
|
+
// Breakpoints
|
29
|
+
$breakpoint-1: 480px;
|
30
|
+
$breakpoint-2: 600px;
|
31
|
+
$breakpoint-3: 768px;
|
32
|
+
$breakpoint-4: 992px;
|
33
|
+
$breakpoint-5: 1382px;
|
@@ -8,15 +8,18 @@ body{
|
|
8
8
|
font-family: $base-font-family;
|
9
9
|
color: $base-font-color;
|
10
10
|
background: $super-lightgrey;
|
11
|
-
padding:
|
12
|
-
@include adjust-leading-to($base-line-mult); // $base-line-height * $base-line-mult = 24px
|
11
|
+
padding: 0;
|
13
12
|
|
13
|
+
@include adjust-leading-to($base-line-mult); // $base-line-height * $base-line-mult = 24px
|
14
14
|
@include border-box-sizing;
|
15
|
+
|
16
|
+
@include respond-to( $breakpoint-3 ) {
|
17
|
+
padding: rhythm(10) 0;
|
18
|
+
}
|
19
|
+
|
15
20
|
}
|
16
21
|
|
17
22
|
.container{
|
18
|
-
// already in extensions.scss
|
19
|
-
@include susy-grid-background;
|
20
23
|
max-width: 40em;
|
21
24
|
|
22
25
|
&.main{
|
@@ -379,12 +379,14 @@ table {
|
|
379
379
|
/* line 3, ../scss/modules/_extensions.scss */
|
380
380
|
.container {
|
381
381
|
*zoom: 1;
|
382
|
-
max-width:
|
383
|
-
_width:
|
384
|
-
padding-left:
|
385
|
-
padding-right:
|
382
|
+
max-width: 35em;
|
383
|
+
_width: 35em;
|
384
|
+
padding-left: 3em;
|
385
|
+
padding-right: 3em;
|
386
386
|
margin-left: auto;
|
387
387
|
margin-right: auto;
|
388
|
+
padding-left: 3em;
|
389
|
+
padding-right: 3em;
|
388
390
|
width: 100%;
|
389
391
|
max-width: 100%; }
|
390
392
|
/* line 38, ../../../../../../../../../../../Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
|
@@ -393,7 +395,7 @@ table {
|
|
393
395
|
display: table;
|
394
396
|
clear: both; }
|
395
397
|
|
396
|
-
/* line
|
398
|
+
/* line 11, ../scss/modules/_extensions.scss */
|
397
399
|
.clearfix, footer {
|
398
400
|
overflow: hidden;
|
399
401
|
*zoom: 1; }
|
@@ -412,32 +414,22 @@ body {
|
|
412
414
|
font-family: "PT Sans", sans;
|
413
415
|
color: #333333;
|
414
416
|
background: #f9f9f9;
|
415
|
-
padding:
|
417
|
+
padding: 0;
|
416
418
|
line-height: 1.5em; }
|
417
419
|
/* line 14, ../../../../../../../../../../../Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/susy/sass/susy/_grid.scss */
|
418
420
|
body * {
|
419
421
|
-webkit-box-sizing: border-box;
|
420
422
|
-moz-box-sizing: border-box;
|
421
423
|
box-sizing: border-box; }
|
424
|
+
@media only screen and (min-width: 768px) {
|
425
|
+
/* line 7, ../scss/partials/_main.scss */
|
426
|
+
body {
|
427
|
+
padding: 3.75em 0; } }
|
422
428
|
|
423
|
-
/* line
|
429
|
+
/* line 22, ../scss/partials/_main.scss */
|
424
430
|
.container {
|
425
|
-
background-image: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(0%, rgba(100, 100, 225, 0.25)), color-stop(6.77966%, rgba(100, 100, 225, 0.25)), color-stop(6.77966%, rgba(0, 0, 0, 0)), color-stop(8.47458%, rgba(0, 0, 0, 0)), color-stop(8.47458%, rgba(100, 100, 225, 0.25)), color-stop(15.25424%, rgba(100, 100, 225, 0.25)), color-stop(15.25424%, rgba(0, 0, 0, 0)), color-stop(16.94915%, rgba(0, 0, 0, 0)), color-stop(16.94915%, rgba(100, 100, 225, 0.25)), color-stop(23.72881%, rgba(100, 100, 225, 0.25)), color-stop(23.72881%, rgba(0, 0, 0, 0)), color-stop(25.42373%, rgba(0, 0, 0, 0)), color-stop(25.42373%, rgba(100, 100, 225, 0.25)), color-stop(32.20339%, rgba(100, 100, 225, 0.25)), color-stop(32.20339%, rgba(0, 0, 0, 0)), color-stop(33.89831%, rgba(0, 0, 0, 0)), color-stop(33.89831%, rgba(100, 100, 225, 0.25)), color-stop(40.67797%, rgba(100, 100, 225, 0.25)), color-stop(40.67797%, rgba(0, 0, 0, 0)), color-stop(42.37288%, rgba(0, 0, 0, 0)), color-stop(42.37288%, rgba(100, 100, 225, 0.25)), color-stop(49.15254%, rgba(100, 100, 225, 0.25)), color-stop(49.15254%, rgba(0, 0, 0, 0)), color-stop(50.84746%, rgba(0, 0, 0, 0)), color-stop(50.84746%, rgba(100, 100, 225, 0.25)), color-stop(57.62712%, rgba(100, 100, 225, 0.25)), color-stop(57.62712%, rgba(0, 0, 0, 0)), color-stop(59.32203%, rgba(0, 0, 0, 0)), color-stop(59.32203%, rgba(100, 100, 225, 0.25)), color-stop(66.10169%, rgba(100, 100, 225, 0.25)), color-stop(66.10169%, rgba(0, 0, 0, 0)), color-stop(67.79661%, rgba(0, 0, 0, 0)), color-stop(67.79661%, rgba(100, 100, 225, 0.25)), color-stop(74.57627%, rgba(100, 100, 225, 0.25)), color-stop(74.57627%, rgba(0, 0, 0, 0)), color-stop(76.27119%, rgba(0, 0, 0, 0)), color-stop(76.27119%, rgba(100, 100, 225, 0.25)), color-stop(83.05085%, rgba(100, 100, 225, 0.25)), color-stop(83.05085%, rgba(0, 0, 0, 0)), color-stop(84.74576%, rgba(0, 0, 0, 0)), color-stop(84.74576%, rgba(100, 100, 225, 0.25)), color-stop(91.52542%, rgba(100, 100, 225, 0.25)), color-stop(91.52542%, rgba(0, 0, 0, 0)), color-stop(93.22034%, rgba(0, 0, 0, 0)), color-stop(93.22034%, rgba(100, 100, 225, 0.25)), color-stop(100.0%, rgba(100, 100, 225, 0.25)), color-stop(100.0%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0)));
|
426
|
-
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(100, 100, 225, 0.25) 0%, rgba(100, 100, 225, 0.25) 6.77966%, rgba(0, 0, 0, 0) 6.77966%, rgba(0, 0, 0, 0) 8.47458%, rgba(100, 100, 225, 0.25) 8.47458%, rgba(100, 100, 225, 0.25) 15.25424%, rgba(0, 0, 0, 0) 15.25424%, rgba(0, 0, 0, 0) 16.94915%, rgba(100, 100, 225, 0.25) 16.94915%, rgba(100, 100, 225, 0.25) 23.72881%, rgba(0, 0, 0, 0) 23.72881%, rgba(0, 0, 0, 0) 25.42373%, rgba(100, 100, 225, 0.25) 25.42373%, rgba(100, 100, 225, 0.25) 32.20339%, rgba(0, 0, 0, 0) 32.20339%, rgba(0, 0, 0, 0) 33.89831%, rgba(100, 100, 225, 0.25) 33.89831%, rgba(100, 100, 225, 0.25) 40.67797%, rgba(0, 0, 0, 0) 40.67797%, rgba(0, 0, 0, 0) 42.37288%, rgba(100, 100, 225, 0.25) 42.37288%, rgba(100, 100, 225, 0.25) 49.15254%, rgba(0, 0, 0, 0) 49.15254%, rgba(0, 0, 0, 0) 50.84746%, rgba(100, 100, 225, 0.25) 50.84746%, rgba(100, 100, 225, 0.25) 57.62712%, rgba(0, 0, 0, 0) 57.62712%, rgba(0, 0, 0, 0) 59.32203%, rgba(100, 100, 225, 0.25) 59.32203%, rgba(100, 100, 225, 0.25) 66.10169%, rgba(0, 0, 0, 0) 66.10169%, rgba(0, 0, 0, 0) 67.79661%, rgba(100, 100, 225, 0.25) 67.79661%, rgba(100, 100, 225, 0.25) 74.57627%, rgba(0, 0, 0, 0) 74.57627%, rgba(0, 0, 0, 0) 76.27119%, rgba(100, 100, 225, 0.25) 76.27119%, rgba(100, 100, 225, 0.25) 83.05085%, rgba(0, 0, 0, 0) 83.05085%, rgba(0, 0, 0, 0) 84.74576%, rgba(100, 100, 225, 0.25) 84.74576%, rgba(100, 100, 225, 0.25) 91.52542%, rgba(0, 0, 0, 0) 91.52542%, rgba(0, 0, 0, 0) 93.22034%, rgba(100, 100, 225, 0.25) 93.22034%, rgba(100, 100, 225, 0.25) 100.0%, rgba(0, 0, 0, 0) 100.0%, rgba(0, 0, 0, 0) 100%);
|
427
|
-
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(100, 100, 225, 0.25) 0%, rgba(100, 100, 225, 0.25) 6.77966%, rgba(0, 0, 0, 0) 6.77966%, rgba(0, 0, 0, 0) 8.47458%, rgba(100, 100, 225, 0.25) 8.47458%, rgba(100, 100, 225, 0.25) 15.25424%, rgba(0, 0, 0, 0) 15.25424%, rgba(0, 0, 0, 0) 16.94915%, rgba(100, 100, 225, 0.25) 16.94915%, rgba(100, 100, 225, 0.25) 23.72881%, rgba(0, 0, 0, 0) 23.72881%, rgba(0, 0, 0, 0) 25.42373%, rgba(100, 100, 225, 0.25) 25.42373%, rgba(100, 100, 225, 0.25) 32.20339%, rgba(0, 0, 0, 0) 32.20339%, rgba(0, 0, 0, 0) 33.89831%, rgba(100, 100, 225, 0.25) 33.89831%, rgba(100, 100, 225, 0.25) 40.67797%, rgba(0, 0, 0, 0) 40.67797%, rgba(0, 0, 0, 0) 42.37288%, rgba(100, 100, 225, 0.25) 42.37288%, rgba(100, 100, 225, 0.25) 49.15254%, rgba(0, 0, 0, 0) 49.15254%, rgba(0, 0, 0, 0) 50.84746%, rgba(100, 100, 225, 0.25) 50.84746%, rgba(100, 100, 225, 0.25) 57.62712%, rgba(0, 0, 0, 0) 57.62712%, rgba(0, 0, 0, 0) 59.32203%, rgba(100, 100, 225, 0.25) 59.32203%, rgba(100, 100, 225, 0.25) 66.10169%, rgba(0, 0, 0, 0) 66.10169%, rgba(0, 0, 0, 0) 67.79661%, rgba(100, 100, 225, 0.25) 67.79661%, rgba(100, 100, 225, 0.25) 74.57627%, rgba(0, 0, 0, 0) 74.57627%, rgba(0, 0, 0, 0) 76.27119%, rgba(100, 100, 225, 0.25) 76.27119%, rgba(100, 100, 225, 0.25) 83.05085%, rgba(0, 0, 0, 0) 83.05085%, rgba(0, 0, 0, 0) 84.74576%, rgba(100, 100, 225, 0.25) 84.74576%, rgba(100, 100, 225, 0.25) 91.52542%, rgba(0, 0, 0, 0) 91.52542%, rgba(0, 0, 0, 0) 93.22034%, rgba(100, 100, 225, 0.25) 93.22034%, rgba(100, 100, 225, 0.25) 100.0%, rgba(0, 0, 0, 0) 100.0%, rgba(0, 0, 0, 0) 100%);
|
428
|
-
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(100, 100, 225, 0.25) 0%, rgba(100, 100, 225, 0.25) 6.77966%, rgba(0, 0, 0, 0) 6.77966%, rgba(0, 0, 0, 0) 8.47458%, rgba(100, 100, 225, 0.25) 8.47458%, rgba(100, 100, 225, 0.25) 15.25424%, rgba(0, 0, 0, 0) 15.25424%, rgba(0, 0, 0, 0) 16.94915%, rgba(100, 100, 225, 0.25) 16.94915%, rgba(100, 100, 225, 0.25) 23.72881%, rgba(0, 0, 0, 0) 23.72881%, rgba(0, 0, 0, 0) 25.42373%, rgba(100, 100, 225, 0.25) 25.42373%, rgba(100, 100, 225, 0.25) 32.20339%, rgba(0, 0, 0, 0) 32.20339%, rgba(0, 0, 0, 0) 33.89831%, rgba(100, 100, 225, 0.25) 33.89831%, rgba(100, 100, 225, 0.25) 40.67797%, rgba(0, 0, 0, 0) 40.67797%, rgba(0, 0, 0, 0) 42.37288%, rgba(100, 100, 225, 0.25) 42.37288%, rgba(100, 100, 225, 0.25) 49.15254%, rgba(0, 0, 0, 0) 49.15254%, rgba(0, 0, 0, 0) 50.84746%, rgba(100, 100, 225, 0.25) 50.84746%, rgba(100, 100, 225, 0.25) 57.62712%, rgba(0, 0, 0, 0) 57.62712%, rgba(0, 0, 0, 0) 59.32203%, rgba(100, 100, 225, 0.25) 59.32203%, rgba(100, 100, 225, 0.25) 66.10169%, rgba(0, 0, 0, 0) 66.10169%, rgba(0, 0, 0, 0) 67.79661%, rgba(100, 100, 225, 0.25) 67.79661%, rgba(100, 100, 225, 0.25) 74.57627%, rgba(0, 0, 0, 0) 74.57627%, rgba(0, 0, 0, 0) 76.27119%, rgba(100, 100, 225, 0.25) 76.27119%, rgba(100, 100, 225, 0.25) 83.05085%, rgba(0, 0, 0, 0) 83.05085%, rgba(0, 0, 0, 0) 84.74576%, rgba(100, 100, 225, 0.25) 84.74576%, rgba(100, 100, 225, 0.25) 91.52542%, rgba(0, 0, 0, 0) 91.52542%, rgba(0, 0, 0, 0) 93.22034%, rgba(100, 100, 225, 0.25) 93.22034%, rgba(100, 100, 225, 0.25) 100.0%, rgba(0, 0, 0, 0) 100.0%, rgba(0, 0, 0, 0) 100%);
|
429
|
-
background-image: linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(100, 100, 225, 0.25) 0%, rgba(100, 100, 225, 0.25) 6.77966%, rgba(0, 0, 0, 0) 6.77966%, rgba(0, 0, 0, 0) 8.47458%, rgba(100, 100, 225, 0.25) 8.47458%, rgba(100, 100, 225, 0.25) 15.25424%, rgba(0, 0, 0, 0) 15.25424%, rgba(0, 0, 0, 0) 16.94915%, rgba(100, 100, 225, 0.25) 16.94915%, rgba(100, 100, 225, 0.25) 23.72881%, rgba(0, 0, 0, 0) 23.72881%, rgba(0, 0, 0, 0) 25.42373%, rgba(100, 100, 225, 0.25) 25.42373%, rgba(100, 100, 225, 0.25) 32.20339%, rgba(0, 0, 0, 0) 32.20339%, rgba(0, 0, 0, 0) 33.89831%, rgba(100, 100, 225, 0.25) 33.89831%, rgba(100, 100, 225, 0.25) 40.67797%, rgba(0, 0, 0, 0) 40.67797%, rgba(0, 0, 0, 0) 42.37288%, rgba(100, 100, 225, 0.25) 42.37288%, rgba(100, 100, 225, 0.25) 49.15254%, rgba(0, 0, 0, 0) 49.15254%, rgba(0, 0, 0, 0) 50.84746%, rgba(100, 100, 225, 0.25) 50.84746%, rgba(100, 100, 225, 0.25) 57.62712%, rgba(0, 0, 0, 0) 57.62712%, rgba(0, 0, 0, 0) 59.32203%, rgba(100, 100, 225, 0.25) 59.32203%, rgba(100, 100, 225, 0.25) 66.10169%, rgba(0, 0, 0, 0) 66.10169%, rgba(0, 0, 0, 0) 67.79661%, rgba(100, 100, 225, 0.25) 67.79661%, rgba(100, 100, 225, 0.25) 74.57627%, rgba(0, 0, 0, 0) 74.57627%, rgba(0, 0, 0, 0) 76.27119%, rgba(100, 100, 225, 0.25) 76.27119%, rgba(100, 100, 225, 0.25) 83.05085%, rgba(0, 0, 0, 0) 83.05085%, rgba(0, 0, 0, 0) 84.74576%, rgba(100, 100, 225, 0.25) 84.74576%, rgba(100, 100, 225, 0.25) 91.52542%, rgba(0, 0, 0, 0) 91.52542%, rgba(0, 0, 0, 0) 93.22034%, rgba(100, 100, 225, 0.25) 93.22034%, rgba(100, 100, 225, 0.25) 100.0%, rgba(0, 0, 0, 0) 100.0%, rgba(0, 0, 0, 0) 100%);
|
430
|
-
background-position: left top;
|
431
|
-
-webkit-background-origin: content;
|
432
|
-
-moz-background-origin: content;
|
433
|
-
-ms-background-origin: content-box;
|
434
|
-
-o-background-origin: content-box;
|
435
|
-
background-origin: content-box;
|
436
|
-
-webkit-background-clip: content-box;
|
437
|
-
-moz-background-clip: content-box;
|
438
|
-
background-clip: content-box;
|
439
431
|
max-width: 40em; }
|
440
|
-
/* line
|
432
|
+
/* line 25, ../scss/partials/_main.scss */
|
441
433
|
.container.main {
|
442
434
|
padding-top: 1.5em;
|
443
435
|
padding-bottom: 1.5em;
|
@@ -451,7 +443,7 @@ body {
|
|
451
443
|
-moz-box-shadow: 1px 1px 2px rgba(51, 51, 51, 0.05);
|
452
444
|
box-shadow: 1px 1px 2px rgba(51, 51, 51, 0.05); }
|
453
445
|
|
454
|
-
/* line
|
446
|
+
/* line 35, ../scss/partials/_main.scss */
|
455
447
|
hr {
|
456
448
|
height: 1px;
|
457
449
|
border-width: 0;
|
@@ -0,0 +1,146 @@
|
|
1
|
+
|
2
|
+
{"payload":{
|
3
|
+
"after":"1481a2de7b2a7d02428ad93446ab166be7793fbb",
|
4
|
+
"before":"17c497ccc7cca9c2f735aa07e9e3813060ce9a6a",
|
5
|
+
"commits":[
|
6
|
+
{
|
7
|
+
"added":[
|
8
|
+
|
9
|
+
],
|
10
|
+
"author":{
|
11
|
+
"email":"lolwut@noway.biz",
|
12
|
+
"name":"Garen Torikian",
|
13
|
+
"username":"octokitty"
|
14
|
+
},
|
15
|
+
"committer":{
|
16
|
+
"email":"lolwut@noway.biz",
|
17
|
+
"name":"Garen Torikian",
|
18
|
+
"username":"octokitty"
|
19
|
+
},
|
20
|
+
"distinct":true,
|
21
|
+
"id":"c441029cf673f84c8b7db52d0a5944ee5c52ff89",
|
22
|
+
"message":"This should trigger a #deploy",
|
23
|
+
"modified":[
|
24
|
+
"README.md"
|
25
|
+
],
|
26
|
+
"removed":[
|
27
|
+
|
28
|
+
],
|
29
|
+
"timestamp":"2013-02-22T13:50:07-08:00",
|
30
|
+
"url":"https://github.com/octokitty/testing/commit/c441029cf673f84c8b7db52d0a5944ee5c52ff89"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"added":[
|
34
|
+
|
35
|
+
],
|
36
|
+
"author":{
|
37
|
+
"email":"lolwut@noway.biz",
|
38
|
+
"name":"Garen Torikian",
|
39
|
+
"username":"octokitty"
|
40
|
+
},
|
41
|
+
"committer":{
|
42
|
+
"email":"lolwut@noway.biz",
|
43
|
+
"name":"Garen Torikian",
|
44
|
+
"username":"octokitty"
|
45
|
+
},
|
46
|
+
"distinct":true,
|
47
|
+
"id":"36c5f2243ed24de58284a96f2a643bed8c028658",
|
48
|
+
"message":"This is me testing the windows client.",
|
49
|
+
"modified":[
|
50
|
+
"README.md"
|
51
|
+
],
|
52
|
+
"removed":[
|
53
|
+
|
54
|
+
],
|
55
|
+
"timestamp":"2013-02-22T14:07:13-08:00",
|
56
|
+
"url":"https://github.com/octokitty/testing/commit/36c5f2243ed24de58284a96f2a643bed8c028658"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"added":[
|
60
|
+
"words/madame-bovary.txt"
|
61
|
+
],
|
62
|
+
"author":{
|
63
|
+
"email":"lolwut@noway.biz",
|
64
|
+
"name":"Garen Torikian",
|
65
|
+
"username":"octokitty"
|
66
|
+
},
|
67
|
+
"committer":{
|
68
|
+
"email":"lolwut@noway.biz",
|
69
|
+
"name":"Garen Torikian",
|
70
|
+
"username":"octokitty"
|
71
|
+
},
|
72
|
+
"distinct":true,
|
73
|
+
"id":"1481a2de7b2a7d02428ad93446ab166be7793fbb",
|
74
|
+
"message":"Rename madame-bovary.txt to words/madame-bovary.txt",
|
75
|
+
"modified":[
|
76
|
+
|
77
|
+
],
|
78
|
+
"removed":[
|
79
|
+
"madame-bovary.txt"
|
80
|
+
],
|
81
|
+
"timestamp":"2013-03-12T08:14:29-07:00",
|
82
|
+
"url":"https://github.com/octokitty/testing/commit/1481a2de7b2a7d02428ad93446ab166be7793fbb"
|
83
|
+
}
|
84
|
+
],
|
85
|
+
"compare":"https://github.com/octokitty/testing/compare/17c497ccc7cc...1481a2de7b2a",
|
86
|
+
"created":false,
|
87
|
+
"deleted":false,
|
88
|
+
"forced":false,
|
89
|
+
"head_commit":{
|
90
|
+
"added":[
|
91
|
+
"words/madame-bovary.txt"
|
92
|
+
],
|
93
|
+
"author":{
|
94
|
+
"email":"lolwut@noway.biz",
|
95
|
+
"name":"Garen Torikian",
|
96
|
+
"username":"octokitty"
|
97
|
+
},
|
98
|
+
"committer":{
|
99
|
+
"email":"lolwut@noway.biz",
|
100
|
+
"name":"Garen Torikian",
|
101
|
+
"username":"octokitty"
|
102
|
+
},
|
103
|
+
"distinct":true,
|
104
|
+
"id":"1481a2de7b2a7d02428ad93446ab166be7793fbb",
|
105
|
+
"message":"Rename madame-bovary.txt to words/madame-bovary.txt",
|
106
|
+
"modified":[
|
107
|
+
|
108
|
+
],
|
109
|
+
"removed":[
|
110
|
+
"madame-bovary.txt"
|
111
|
+
],
|
112
|
+
"timestamp":"2013-03-12T08:14:29-07:00",
|
113
|
+
"url":"https://github.com/octokitty/testing/commit/1481a2de7b2a7d02428ad93446ab166be7793fbb"
|
114
|
+
},
|
115
|
+
"pusher":{
|
116
|
+
"email":"lolwut@noway.biz",
|
117
|
+
"name":"Garen Torikian"
|
118
|
+
},
|
119
|
+
"ref":"refs/heads/master",
|
120
|
+
"repository":{
|
121
|
+
"created_at":1332977768,
|
122
|
+
"description":"",
|
123
|
+
"fork":false,
|
124
|
+
"forks":0,
|
125
|
+
"has_downloads":true,
|
126
|
+
"has_issues":true,
|
127
|
+
"has_wiki":true,
|
128
|
+
"homepage":"",
|
129
|
+
"id":3860742,
|
130
|
+
"language":"Ruby",
|
131
|
+
"master_branch":"master",
|
132
|
+
"name":"testing",
|
133
|
+
"open_issues":2,
|
134
|
+
"owner":{
|
135
|
+
"email":"lolwut@noway.biz",
|
136
|
+
"name":"octokitty"
|
137
|
+
},
|
138
|
+
"private":false,
|
139
|
+
"pushed_at":1363295520,
|
140
|
+
"size":2156,
|
141
|
+
"stargazers":1,
|
142
|
+
"url":"https://github.com/octokitty/testing",
|
143
|
+
"watchers":1
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
data/test/test_deploy.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
require 'json'
|
3
|
+
require './test/test_includes'
|
4
|
+
|
5
|
+
class OwlTestDeploy < Test::Unit::TestCase
|
6
|
+
|
7
|
+
include OwlTestIncludes
|
8
|
+
|
9
|
+
GITHUB_PR_HOOK_PAYLOAD = File.read('./test/data/post-receive-hook.json')
|
10
|
+
|
11
|
+
def test_deploy
|
12
|
+
commit = Owl::Lib::Commit.new( GITHUB_PR_HOOK_PAYLOAD )
|
13
|
+
assert commit.triggers_deploy?
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_no_deploy
|
17
|
+
data = GITHUB_PR_HOOK_PAYLOAD.gsub "#deploy", "#nope"
|
18
|
+
commit = Owl::Lib::Commit.new( data )
|
19
|
+
|
20
|
+
assert !commit.triggers_deploy?, "Should not deploy!"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: owl-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Gonzalez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -332,6 +332,20 @@ dependencies:
|
|
332
332
|
- - '='
|
333
333
|
- !ruby/object:Gem::Version
|
334
334
|
version: 1.8.0
|
335
|
+
- !ruby/object:Gem::Dependency
|
336
|
+
name: netaddr
|
337
|
+
requirement: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - '='
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: 1.5.0
|
342
|
+
type: :runtime
|
343
|
+
prerelease: false
|
344
|
+
version_requirements: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - '='
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: 1.5.0
|
335
349
|
- !ruby/object:Gem::Dependency
|
336
350
|
name: rack
|
337
351
|
requirement: !ruby/object:Gem::Requirement
|
@@ -518,8 +532,8 @@ files:
|
|
518
532
|
- core/assets/stylesheets/style.css
|
519
533
|
- core/classes/cached.rb
|
520
534
|
- core/classes/checker.rb
|
535
|
+
- core/classes/commit.rb
|
521
536
|
- core/classes/error.rb
|
522
|
-
- core/classes/other.rb
|
523
537
|
- core/classes/page.rb
|
524
538
|
- core/classes/partial.rb
|
525
539
|
- core/classes/path.rb
|
@@ -532,6 +546,7 @@ files:
|
|
532
546
|
- core/routes/base.rb
|
533
547
|
- core/routes/bootstrap.rb
|
534
548
|
- core/routes/cache.rb
|
549
|
+
- core/routes/deploy.rb
|
535
550
|
- owl-cms.gemspec
|
536
551
|
- sample/.cabi-data
|
537
552
|
- sample/data/home/index.haml
|
@@ -539,6 +554,7 @@ files:
|
|
539
554
|
- sample/data/page/about/index.haml
|
540
555
|
- sample/data/page/contact-us/index.haml
|
541
556
|
- sample/data/page/dynamic-page/index.haml
|
557
|
+
- sample/data/page/error/index.haml
|
542
558
|
- sample/data/page/no-front-matter/index.haml
|
543
559
|
- sample/data/page/not-found/index.haml
|
544
560
|
- sample/data/page/static-page/index.haml
|
@@ -581,8 +597,10 @@ files:
|
|
581
597
|
- sample/themes/base/partials/_head.haml
|
582
598
|
- sample/themes/base/partials/_header.haml
|
583
599
|
- sample/themes/base/settings.yml
|
600
|
+
- test/data/post-receive-hook.json
|
584
601
|
- test/test_basics.rb
|
585
602
|
- test/test_data.rb
|
603
|
+
- test/test_deploy.rb
|
586
604
|
- test/test_includes.rb
|
587
605
|
- test/test_page.rb
|
588
606
|
homepage: http://github.com/briangonzalez/owl-cms-gem
|