skellington 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/config/config.yaml +34 -4
- data/lib/{jekyll → common}/templates/.ruby-version.eruby +0 -0
- data/lib/{jekyll → common}/templates/LICENSE.md.eruby +0 -0
- data/lib/common/templates/gitignore +7 -0
- data/lib/{sinatra/templates/views/includes/footer.erb.eruby → common/templates/includes/footer} +0 -0
- data/lib/common/templates/includes/header +43 -0
- data/lib/common/templates/includes/ie-cruft +6 -0
- data/lib/common/templates/sass/colours.scss +1 -0
- data/lib/common/templates/sass/fonts.scss +1 -0
- data/lib/{sinatra/templates/public/sass/_footer.scss.eruby → common/templates/sass/footer.scss} +0 -0
- data/lib/{sinatra/templates/public/sass/styles.scss.eruby → common/templates/sass/styles.scss} +5 -2
- data/lib/common/templates/sass/variables.scss +1 -0
- data/lib/common/templates/views/layout +28 -0
- data/lib/jekyll/templates/_config.yml.eruby +2 -0
- data/lib/jekyll/templates/_data/libs.yml.eruby +15 -0
- data/lib/jekyll/templates/index.md.eruby +1 -1
- data/lib/jekyll/templates/post-run.eruby +1 -1
- data/lib/sinatra/templates/Gemfile.eruby +1 -1
- data/lib/sinatra/templates/lib/app.rb.eruby +1 -1
- data/lib/sinatra/templates/views/includes/css-libs.erb.eruby +6 -0
- data/lib/sinatra/templates/views/includes/fonts-libs.erb.eruby +8 -0
- data/lib/sinatra/templates/views/includes/js-libs.erb.eruby +8 -0
- data/lib/skellington/generator.rb +4 -5
- data/lib/skellington/template.rb +19 -1
- data/lib/skellington/version.rb +1 -1
- data/spec/jekyll/bootstrap/css_spec.rb +93 -0
- data/spec/jekyll/bootstrap_4/bootstrap_4_spec.rb +45 -0
- data/spec/jekyll/cli_spec.rb +1 -1
- data/spec/jekyll/data/libs_spec.rb +33 -0
- data/spec/jekyll/{cli/git_spec.rb → git_spec.rb} +0 -0
- data/spec/jekyll/{cli/index_md.rb → layout/index_md_spec.rb} +2 -3
- data/spec/jekyll/layout/layout_spec.rb +104 -0
- data/spec/jekyll/{cli → root_files}/config_yml_spec.rb +2 -0
- data/spec/jekyll/{cli → root_files}/gemfile_spec.rb +0 -0
- data/spec/jekyll/{cli → root_files}/license_spec.rb +0 -0
- data/spec/jekyll/{cli → root_files}/rbenv_spec.rb +0 -0
- data/spec/non_local_path_spec.rb +1 -1
- data/spec/sinatra/{cli → app}/app_spec.rb +1 -1
- data/spec/sinatra/{cli → app}/config_yml_spec.rb +0 -0
- data/spec/sinatra/{cli → app}/helpers_spec.rb +0 -0
- data/spec/sinatra/app/public_spec.rb +14 -0
- data/spec/sinatra/{cli → app}/racks_spec.rb +0 -0
- data/spec/sinatra/bootstrap/css_spec.rb +42 -0
- data/spec/sinatra/{cli → bootstrap_4}/config_rb_bootstrap_4_spec.rb +0 -0
- data/spec/sinatra/{cli → bootstrap_4}/gemfile_bootstrap_4_spec.rb +1 -2
- data/spec/sinatra/{cli → bootstrap_4}/public_bootstrap_4_spec.rb +0 -0
- data/spec/sinatra/{cli/git_spec.rb → git_spec.rb} +0 -0
- data/spec/sinatra/{cli → javascript}/javascript_spec.rb +0 -0
- data/spec/sinatra/layout/includes_spec.rb +71 -0
- data/spec/sinatra/layout/layout_spec.rb +92 -0
- data/spec/sinatra/layout/views_spec.rb +17 -0
- data/spec/sinatra/{cli → root_files}/config_rb_spec.rb +0 -0
- data/spec/sinatra/{cli → root_files}/config_ru_spec.rb +0 -0
- data/spec/sinatra/{cli → root_files}/gemfile_spec.rb +0 -1
- data/spec/sinatra/{cli → root_files}/guardfile_spec.rb +0 -0
- data/spec/sinatra/{cli → root_files}/license_spec.rb +0 -0
- data/spec/sinatra/{cli → root_files}/procfile_spec.rb +0 -0
- data/spec/sinatra/{cli → root_files}/rakefile_spec.rb +0 -0
- data/spec/sinatra/{cli → root_files}/rbenv_spec.rb +0 -0
- data/spec/sinatra/{cli → spec}/spec_spec.rb +0 -0
- metadata +84 -81
- data/lib/jekyll/templates/.gitignore.eruby +0 -2
- data/lib/jekyll/templates/_layouts/default.html.eruby +0 -29
- data/lib/jekyll/templates/_sass/bootstrap-custom.scss.eruby +0 -1
- data/lib/jekyll/templates/_sass/fonts.scss.eruby +0 -4
- data/lib/jekyll/templates/assets/application.scss.eruby +0 -6
- data/lib/sinatra/templates/.gitignore.eruby +0 -2
- data/lib/sinatra/templates/.ruby-version.eruby +0 -1
- data/lib/sinatra/templates/LICENSE.md.eruby +0 -27
- data/lib/sinatra/templates/public/sass/_fonts.scss.eruby +0 -2
- data/lib/sinatra/templates/public/sass/_variables.scss.eruby +0 -2
- data/lib/sinatra/templates/views/default.erb.eruby +0 -17
- data/lib/sinatra/templates/views/includes/header.erb.eruby +0 -22
- data/spec/jekyll/cli/assets_css_spec.rb +0 -23
- data/spec/jekyll/cli/bootstrap_4_spec.rb +0 -48
- data/spec/jekyll/cli/bootstrap_spec.rb +0 -47
- data/spec/jekyll/cli/layout_spec.rb +0 -45
- data/spec/sinatra/cli/includes_spec.rb +0 -72
- data/spec/sinatra/cli/layout_spec.rb +0 -32
- data/spec/sinatra/cli/public_spec.rb +0 -111
@@ -0,0 +1,104 @@
|
|
1
|
+
module Skellington
|
2
|
+
describe CLI do
|
3
|
+
let :subject do
|
4
|
+
described_class.new
|
5
|
+
end
|
6
|
+
|
7
|
+
context 'layout' do
|
8
|
+
it 'creates a header' do
|
9
|
+
subject.options = { 'framework' => 'jekyll' }
|
10
|
+
subject.generate 'dummy_app'
|
11
|
+
|
12
|
+
expect('dummy_app/_includes/header.html').to have_content (
|
13
|
+
"""
|
14
|
+
<head>
|
15
|
+
<meta charset='utf-8' />
|
16
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
|
17
|
+
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
18
|
+
|
19
|
+
{% include ie-cruft.html %}
|
20
|
+
|
21
|
+
{% for lib in site.data.libs.js %}
|
22
|
+
<!-- {{ lib.name }} -->
|
23
|
+
<script src='{{ lib.url }}'></script>
|
24
|
+
{% endfor %}
|
25
|
+
|
26
|
+
{% for lib in site.data.libs.css %}
|
27
|
+
<!-- {{ lib.name }} -->
|
28
|
+
<link rel='stylesheet' href='{{ lib.url }}'>
|
29
|
+
{% endfor %}
|
30
|
+
|
31
|
+
{% for font in site.data.libs.fonts %}
|
32
|
+
<!-- {{ font.name }} -->
|
33
|
+
<link rel='stylesheet' href='{{ font.url }}'>
|
34
|
+
{% endfor %}
|
35
|
+
|
36
|
+
<link rel='icon' type='image/png' href='{{ site.baseurl }}/assets/favicon.ico' />
|
37
|
+
<link rel='stylesheet' href='{{ site.baseurl }}/css/styles.css' />
|
38
|
+
<script src='{{ site.baseurl }}/js/dummy_app.js'></script>
|
39
|
+
<title>
|
40
|
+
{{ page.title }}
|
41
|
+
</title>
|
42
|
+
</head>
|
43
|
+
"""
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'creates a footer' do
|
48
|
+
subject.options = { 'framework' => 'jekyll' }
|
49
|
+
subject.generate 'dummy_app'
|
50
|
+
|
51
|
+
expect('dummy_app/_includes/footer.html').to have_content (
|
52
|
+
"""
|
53
|
+
<div class='footer'>
|
54
|
+
<div class='row'>
|
55
|
+
<div class='col-md-12 text-center bottom'>
|
56
|
+
Generated with
|
57
|
+
<a href='http://sam.pikesley.org/projects/skellington/' alt='Skellington' title='Skellington'>
|
58
|
+
Skellington
|
59
|
+
</a>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
"""
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'creates a layout' do
|
68
|
+
subject.options = { 'framework' => 'jekyll' }
|
69
|
+
subject.generate 'dummy_app'
|
70
|
+
|
71
|
+
expect('dummy_app/_layouts/default.html').to have_content (
|
72
|
+
"""
|
73
|
+
<!DOCTYPE html>
|
74
|
+
<html lang='en'>
|
75
|
+
{% include header.html %}
|
76
|
+
<body>
|
77
|
+
<div class='container'>
|
78
|
+
{{ content }}
|
79
|
+
</div>
|
80
|
+
{% include footer.html %}
|
81
|
+
</body>
|
82
|
+
</html>
|
83
|
+
"""
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'has the ie shims' do
|
88
|
+
subject.options = { 'framework' => 'jekyll' }
|
89
|
+
subject.generate 'dummy_app'
|
90
|
+
|
91
|
+
expect('dummy_app/_includes/ie-cruft.html').to have_content (
|
92
|
+
"""
|
93
|
+
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
94
|
+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
95
|
+
<!--[if lt IE 9]>
|
96
|
+
<script src='//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js'></script>
|
97
|
+
<script src='//oss.maxcdn.com/respond/1.4.2/respond.min.js'></script>
|
98
|
+
<![endif]-->
|
99
|
+
"""
|
100
|
+
)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
data/spec/non_local_path_spec.rb
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Skellington
|
2
|
+
describe CLI do
|
3
|
+
let :subject do
|
4
|
+
described_class.new
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'generates placeholders for static files' do
|
8
|
+
subject.generate 'dummy_app'
|
9
|
+
|
10
|
+
expect(File).to exist 'dummy_app/public/js/dummy_app.js'
|
11
|
+
expect(File).to exist 'dummy_app/public/assets/favicon.ico'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Skellington
|
2
|
+
describe CLI do
|
3
|
+
let :subject do
|
4
|
+
described_class.new
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'installs bootstrap' do
|
8
|
+
subject.generate 'dummy_app'
|
9
|
+
|
10
|
+
expect('dummy_app/public/sass/_colours.scss').to have_content (
|
11
|
+
"""
|
12
|
+
$brand-primary: rgba(250, 129, 0, 1);
|
13
|
+
"""
|
14
|
+
)
|
15
|
+
expect('dummy_app/public/sass/_fonts.scss').to have_content (
|
16
|
+
"""
|
17
|
+
$font-primary: 'Ubuntu Mono';
|
18
|
+
"""
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'sets up sass' do
|
23
|
+
subject.generate 'dummy_app'
|
24
|
+
|
25
|
+
expect('dummy_app/public/sass/styles.scss').to have_content (
|
26
|
+
"""
|
27
|
+
@import 'bootstrap';
|
28
|
+
@import 'variables';
|
29
|
+
@import 'fonts';
|
30
|
+
@import 'colours';
|
31
|
+
@import 'footer';
|
32
|
+
//@import 'github-corner';
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
color: $brand-primary;
|
36
|
+
font-family: $font-primary;
|
37
|
+
}
|
38
|
+
"""
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
File without changes
|
@@ -20,14 +20,13 @@ module Skellington
|
|
20
20
|
gem 'compass'
|
21
21
|
gem 'erubis'
|
22
22
|
gem 'puma'
|
23
|
-
gem 'bootstrap', '~> 4.0.0.
|
23
|
+
gem 'bootstrap', '~> 4.0.0.alpha5'
|
24
24
|
|
25
25
|
group :test do
|
26
26
|
gem 'rspec'
|
27
27
|
gem 'guard'
|
28
28
|
gem 'guard-rspec'
|
29
29
|
gem 'guard-jasmine'
|
30
|
-
gem 'capybara'
|
31
30
|
gem 'coveralls'
|
32
31
|
gem 'jasmine'
|
33
32
|
gem 'pry'
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Skellington
|
2
|
+
describe CLI do
|
3
|
+
let :subject do
|
4
|
+
described_class.new
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'includes some third-party javascript libs' do
|
8
|
+
subject.generate 'dummy_app'
|
9
|
+
|
10
|
+
expect('dummy_app/views/includes/js-libs.erb').to have_content (
|
11
|
+
"""
|
12
|
+
<%
|
13
|
+
libs = {
|
14
|
+
jquery: '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js',
|
15
|
+
bootstrap: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js'
|
16
|
+
}.each_pair do |name, url| %>
|
17
|
+
<!-- <%= name %> -->
|
18
|
+
<script src='<%= url %>'></script>
|
19
|
+
<% end %>
|
20
|
+
"""
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'includes some third-party css' do
|
25
|
+
subject.generate 'dummy_app'
|
26
|
+
|
27
|
+
expect('dummy_app/views/includes/css-libs.erb').to have_content (
|
28
|
+
"""
|
29
|
+
<%
|
30
|
+
libs = {
|
31
|
+
}.each_pair do |name, url| %>
|
32
|
+
<!-- <%= name %> -->
|
33
|
+
<link rel='stylesheet' href='<%= url %>'>
|
34
|
+
<% end %>
|
35
|
+
"""
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'includes some fonts' do
|
40
|
+
subject.generate 'dummy_app'
|
41
|
+
|
42
|
+
expect('dummy_app/views/includes/fonts-libs.erb').to have_content (
|
43
|
+
"""
|
44
|
+
<%
|
45
|
+
libs = {
|
46
|
+
fontawesome: '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css',
|
47
|
+
ubuntu: '//fonts.googleapis.com/css?family=Ubuntu+Mono'
|
48
|
+
}.each_pair do |name, url| %>
|
49
|
+
<!-- <%= name %> -->
|
50
|
+
<link rel='stylesheet' href='<%= url %>'>
|
51
|
+
<% end %>
|
52
|
+
"""
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'handles some cruft required by IE' do
|
57
|
+
subject.generate 'dummy_app'
|
58
|
+
|
59
|
+
expect('dummy_app/views/includes/ie-cruft.erb').to have_content (
|
60
|
+
"""
|
61
|
+
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
62
|
+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
63
|
+
<!--[if lt IE 9]>
|
64
|
+
<script src='//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js'></script>
|
65
|
+
<script src='//oss.maxcdn.com/respond/1.4.2/respond.min.js'></script>
|
66
|
+
<![endif]-->
|
67
|
+
"""
|
68
|
+
)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
module Skellington
|
2
|
+
describe CLI do
|
3
|
+
let :subject do
|
4
|
+
described_class.new
|
5
|
+
end
|
6
|
+
|
7
|
+
context 'layout' do
|
8
|
+
it 'creates a header' do
|
9
|
+
subject.generate 'dummy_app'
|
10
|
+
|
11
|
+
expect('dummy_app/views/includes/header.erb').to have_content (
|
12
|
+
"""
|
13
|
+
<head>
|
14
|
+
<meta charset='utf-8' />
|
15
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
|
16
|
+
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
17
|
+
|
18
|
+
<%= erb :'includes/ie-cruft' %>
|
19
|
+
<%= erb :'includes/js-libs' %>
|
20
|
+
<%= erb :'includes/css-libs' %>
|
21
|
+
<%= erb :'includes/fonts-libs' %>
|
22
|
+
|
23
|
+
<link rel='icon' type='image/png' href='/assets/favicon.ico' />
|
24
|
+
<link rel='stylesheet' href='/css/styles.css' />
|
25
|
+
<script src='/js/dummy_app.js'></script>
|
26
|
+
<title>
|
27
|
+
<%= @title %>
|
28
|
+
</title>
|
29
|
+
</head>
|
30
|
+
"""
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'creates a footer' do
|
35
|
+
subject.generate 'dummy_app'
|
36
|
+
|
37
|
+
expect('dummy_app/views/includes/footer.erb').to have_content (
|
38
|
+
"""
|
39
|
+
<div class='footer'>
|
40
|
+
<div class='row'>
|
41
|
+
<div class='col-md-12 text-center bottom'>
|
42
|
+
Generated with
|
43
|
+
<a href='http://sam.pikesley.org/projects/skellington/' alt='Skellington' title='Skellington'>
|
44
|
+
Skellington
|
45
|
+
</a>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
"""
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'creates a github corner' do
|
54
|
+
subject.generate 'dummy_app'
|
55
|
+
|
56
|
+
expect('dummy_app/views/includes/github-corner.erb').to have_content (
|
57
|
+
"""
|
58
|
+
<?xml version='1.0' standalone='no'?>
|
59
|
+
<?xml-stylesheet type='text/css' href='styles.css'?>
|
60
|
+
<a href='<%= @github_url %>' class='github-corner' aria-label='Fork me on Github'>
|
61
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 250 250' fill='#151513' style='position: absolute; top: 0; right: 0'>
|
62
|
+
<path class='octo-background' d='M0 0l115 115h15l12 27 108 108V0z' fill='#fff'/>
|
63
|
+
<path class='octo-arm' d='M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16' style='-webkit-transform-origin: 130px 106px; transform-origin: 130px 106px'/>
|
64
|
+
<path class='octo-body' d='M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z'/>
|
65
|
+
</svg>
|
66
|
+
</a>
|
67
|
+
"""
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'creates a layout' do
|
72
|
+
subject.generate 'dummy_app'
|
73
|
+
|
74
|
+
expect('dummy_app/views/layout.erb').to have_content (
|
75
|
+
"""
|
76
|
+
<!DOCTYPE html>
|
77
|
+
<html lang='en'>
|
78
|
+
<%= erb :'includes/header' %>
|
79
|
+
<body>
|
80
|
+
<%= erb :'includes/github-corner' if @github_url %>
|
81
|
+
<div class='container'>
|
82
|
+
<%= yield %>
|
83
|
+
</div>
|
84
|
+
<%= erb :'includes/footer' %>
|
85
|
+
</body>
|
86
|
+
</html>
|
87
|
+
"""
|
88
|
+
)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Skellington
|
2
|
+
describe CLI do
|
3
|
+
let :subject do
|
4
|
+
described_class.new
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'generates a view' do
|
8
|
+
subject.generate 'dummy_app'
|
9
|
+
|
10
|
+
expect('dummy_app/views/index.erb').to have_content (
|
11
|
+
"""
|
12
|
+
<%= @content %>
|
13
|
+
"""
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|