skellington 0.8.3 → 0.8.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 +4 -4
- data/config/config.yaml +30 -12
- data/lib/common/templates/{gitignore → .gitignore} +0 -0
- data/lib/common/templates/{.ruby-version.eruby → .ruby-version} +0 -0
- data/lib/common/templates/{Gemfile.eruby → Gemfile} +0 -0
- data/lib/common/templates/{LICENSE.md.eruby → LICENSE.md} +0 -0
- data/lib/common/templates/includes/header +1 -1
- data/lib/common/templates/sass/colours +10 -0
- data/lib/common/templates/sass/{fonts.scss → fonts} +0 -0
- data/lib/common/templates/sass/{footer.scss → footer} +0 -0
- data/lib/{sinatra/templates/public/sass/_github-corner.scss.eruby → common/templates/sass/github-corner} +0 -0
- data/lib/common/templates/sass/palettes/default +67 -0
- data/lib/common/templates/sass/{styles.scss → styles} +0 -0
- data/lib/common/templates/sass/{variables.scss → variables} +0 -0
- data/lib/jekyll/templates/404.md +6 -0
- data/lib/jekyll/templates/{_config.yml.eruby → _config.yml} +1 -1
- data/lib/jekyll/templates/_data/{libs.yml.eruby → libs.yml} +0 -0
- data/lib/jekyll/templates/{index.md.eruby → index.md} +0 -0
- data/lib/jekyll/templates/{post-run.eruby → post-run} +2 -2
- data/lib/sinatra/templates/{.rspec.eruby → .rspec} +0 -0
- data/lib/sinatra/templates/{Guardfile.eruby → Guardfile} +0 -0
- data/lib/sinatra/templates/{Procfile.eruby → Procfile} +0 -0
- data/lib/sinatra/templates/{Rakefile.eruby → Rakefile} +10 -4
- data/lib/sinatra/templates/config/config.yml +2 -0
- data/lib/sinatra/templates/{config.rb.eruby → config.rb} +0 -0
- data/lib/sinatra/templates/{config.ru.eruby → config.ru} +0 -0
- data/lib/sinatra/templates/lib/app/{helpers.rb.eruby → helpers.rb} +0 -0
- data/lib/sinatra/templates/lib/app/{racks.rb.eruby → racks.rb} +0 -0
- data/lib/sinatra/templates/lib/{app.rb.eruby → app.rb} +6 -0
- data/lib/sinatra/templates/{post-run.eruby → post-run} +3 -2
- data/lib/sinatra/templates/spec/app/{app_spec.rb.eruby → app_spec.rb} +0 -0
- data/lib/sinatra/templates/spec/app/{helpers_spec.rb.eruby → helpers_spec.rb} +0 -0
- data/lib/sinatra/templates/spec/javascripts/{app_spec.js.eruby → app_spec.js} +0 -0
- data/lib/sinatra/templates/spec/javascripts/support/{jasmine.yml.eruby → jasmine.yml} +0 -0
- data/lib/sinatra/templates/spec/javascripts/support/{jasmine_helper.rb.eruby → jasmine_helper.rb} +0 -0
- data/lib/sinatra/templates/spec/{spec_helper.rb.eruby → spec_helper.rb} +0 -0
- data/lib/sinatra/templates/views/includes/{css-libs.erb.eruby → css-libs.erb} +0 -0
- data/lib/sinatra/templates/views/includes/{fonts-libs.erb.eruby → fonts-libs.erb} +0 -0
- data/lib/sinatra/templates/views/includes/{github-corner.erb.eruby → github-corner.erb} +0 -0
- data/lib/sinatra/templates/views/includes/{js-libs.erb.eruby → js-libs.erb} +0 -0
- data/lib/sinatra/templates/views/{index.erb.eruby → index.erb} +0 -0
- data/lib/sinatra/templates/views/oops.erb +5 -0
- data/lib/skellington/cli.rb +1 -4
- data/lib/skellington/generator.rb +10 -6
- data/lib/skellington/template.rb +11 -14
- data/lib/skellington/version.rb +1 -1
- data/spec/hyphens_spec.rb +0 -3
- data/spec/jekyll/404_spec.rb +23 -0
- data/spec/jekyll/assets/static_spec.rb +14 -0
- data/spec/jekyll/bootstrap/css_spec.rb +13 -3
- data/spec/jekyll/bootstrap_4/bootstrap_4_spec.rb +11 -2
- data/spec/jekyll/cli_spec.rb +4 -2
- data/spec/jekyll/data/libs_spec.rb +1 -1
- data/spec/jekyll/git_spec.rb +1 -1
- data/spec/jekyll/{layout/index_md_spec.rb → index_md_spec.rb} +1 -1
- data/spec/jekyll/js/javascript_spec.rb +14 -0
- data/spec/jekyll/layout/layout_spec.rb +4 -4
- data/spec/jekyll/root_files/config_yml_spec.rb +2 -2
- data/spec/jekyll/root_files/gemfile_spec.rb +1 -1
- data/spec/jekyll/root_files/license_spec.rb +2 -2
- data/spec/jekyll/root_files/rbenv_spec.rb +1 -1
- data/spec/non_local_path_spec.rb +0 -13
- data/spec/sinatra/app/app_spec.rb +7 -1
- data/spec/sinatra/app/config_yml_spec.rb +2 -2
- data/spec/sinatra/app/helpers_spec.rb +1 -1
- data/spec/sinatra/app/public_spec.rb +1 -1
- data/spec/sinatra/app/racks_spec.rb +1 -1
- data/spec/sinatra/bootstrap/css_spec.rb +13 -3
- data/spec/sinatra/bootstrap_4/config_rb_bootstrap_4_spec.rb +1 -1
- data/spec/sinatra/bootstrap_4/gemfile_bootstrap_4_spec.rb +1 -1
- data/spec/sinatra/bootstrap_4/public_bootstrap_4_spec.rb +1 -1
- data/spec/sinatra/cli_spec.rb +7 -4
- data/spec/sinatra/git_spec.rb +1 -1
- data/spec/sinatra/javascript/javascript_spec.rb +1 -1
- data/spec/sinatra/layout/includes_spec.rb +4 -4
- data/spec/sinatra/layout/layout_spec.rb +4 -4
- data/spec/sinatra/layout/views_spec.rb +15 -1
- data/spec/sinatra/root_files/config_rb_spec.rb +1 -1
- data/spec/sinatra/root_files/config_ru_spec.rb +1 -1
- data/spec/sinatra/root_files/gemfile_spec.rb +1 -1
- data/spec/sinatra/root_files/guardfile_spec.rb +1 -1
- data/spec/sinatra/root_files/license_spec.rb +2 -2
- data/spec/sinatra/root_files/procfile_spec.rb +1 -1
- data/spec/sinatra/root_files/rakefile_spec.rb +11 -5
- data/spec/sinatra/root_files/rbenv_spec.rb +1 -1
- data/spec/sinatra/spec/spec_spec.rb +1 -1
- metadata +49 -43
- data/lib/common/templates/sass/colours.scss +0 -1
- data/lib/sinatra/templates/config/config.yml.eruby +0 -2
- data/lib/sinatra/templates/public/assets/favicon.ico.eruby +0 -0
- data/lib/sinatra/templates/public/css/styles.css.eruby +0 -0
- data/lib/sinatra/templates/public/js/app.js.eruby +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6aad5990c93118d8b43591b5ebc788a0e747f71e
|
|
4
|
+
data.tar.gz: ec85c14f2c888ddf9e2d7fc78adcb7eeb4532e3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00b595a0fc9a5af1e5366cb5da30909ad2a3750c608cafdc005caa16ec493df87b9b4fc3d3e6c78153ba090730b98619d109bf1169462d0fa2c2614173032630
|
|
7
|
+
data.tar.gz: 0ebb4702c17878374a9fcb6bf9ca18d856621f19c9f735b751c413bd4286fe9a6c4af9353dc2dea466f57743bc0cbcadbc580cef7f0061abfa2858d2b8f2f270
|
data/config/config.yaml
CHANGED
|
@@ -19,6 +19,13 @@ sinatra:
|
|
|
19
19
|
pry:
|
|
20
20
|
actionpack:
|
|
21
21
|
|
|
22
|
+
# for a $file in the list below, skellington looks for templates first in
|
|
23
|
+
# $framework/templates/$file, then in common/templates at the $common path
|
|
24
|
+
# if that's specified for $file, then at common/templates/$file. if it never
|
|
25
|
+
# gets a match, it creates an empty file at $file
|
|
26
|
+
#
|
|
27
|
+
# I will never be able to support a web framework called 'common'
|
|
28
|
+
|
|
22
29
|
files:
|
|
23
30
|
Gemfile:
|
|
24
31
|
LICENSE.md:
|
|
@@ -28,7 +35,6 @@ sinatra:
|
|
|
28
35
|
.ruby-version:
|
|
29
36
|
.rspec:
|
|
30
37
|
.gitignore:
|
|
31
|
-
common: gitignore
|
|
32
38
|
config.ru:
|
|
33
39
|
config.rb:
|
|
34
40
|
config/config.yml:
|
|
@@ -44,6 +50,7 @@ sinatra:
|
|
|
44
50
|
views/layout.erb:
|
|
45
51
|
common: views/layout
|
|
46
52
|
views/index.erb:
|
|
53
|
+
views/oops.erb:
|
|
47
54
|
views/includes/header.erb:
|
|
48
55
|
common: includes/header
|
|
49
56
|
views/includes/footer.erb:
|
|
@@ -65,19 +72,24 @@ sinatra:
|
|
|
65
72
|
outpath: app/wormname
|
|
66
73
|
public/assets/favicon.ico:
|
|
67
74
|
public/css/styles.css:
|
|
75
|
+
common: css/styles
|
|
68
76
|
public/js/app.js:
|
|
69
77
|
outpath: app/wormname
|
|
78
|
+
common: js/app.js
|
|
70
79
|
public/sass/_footer.scss:
|
|
71
|
-
common: sass/footer
|
|
80
|
+
common: sass/footer
|
|
72
81
|
public/sass/_fonts.scss:
|
|
73
|
-
common: sass/fonts
|
|
82
|
+
common: sass/fonts
|
|
74
83
|
public/sass/_github-corner.scss:
|
|
84
|
+
common: sass/github-corner
|
|
75
85
|
public/sass/_variables.scss:
|
|
76
|
-
common: sass/variables
|
|
86
|
+
common: sass/variables
|
|
87
|
+
public/sass/palettes/_default.scss:
|
|
88
|
+
common: sass/palettes/default
|
|
77
89
|
public/sass/_colours.scss:
|
|
78
|
-
common: sass/colours
|
|
90
|
+
common: sass/colours
|
|
79
91
|
public/sass/styles.scss:
|
|
80
|
-
common: sass/styles
|
|
92
|
+
common: sass/styles
|
|
81
93
|
|
|
82
94
|
jekyll:
|
|
83
95
|
gems:
|
|
@@ -89,8 +101,8 @@ jekyll:
|
|
|
89
101
|
Gemfile:
|
|
90
102
|
_config.yml:
|
|
91
103
|
.gitignore:
|
|
92
|
-
common: gitignore
|
|
93
104
|
index.md:
|
|
105
|
+
404.md:
|
|
94
106
|
_layouts/default.html:
|
|
95
107
|
common: views/layout
|
|
96
108
|
_includes/header.html:
|
|
@@ -100,15 +112,21 @@ jekyll:
|
|
|
100
112
|
_includes/ie-cruft.html:
|
|
101
113
|
common: includes/ie-cruft
|
|
102
114
|
css/styles.scss:
|
|
103
|
-
common: sass/styles
|
|
115
|
+
common: sass/styles
|
|
104
116
|
_sass/variables.scss:
|
|
105
|
-
common: sass/variables
|
|
117
|
+
common: sass/variables
|
|
106
118
|
_sass/colours.scss:
|
|
107
|
-
common: sass/colours
|
|
119
|
+
common: sass/colours
|
|
120
|
+
_sass/palettes/default.scss:
|
|
121
|
+
common: sass/palettes/default
|
|
108
122
|
_sass/fonts.scss:
|
|
109
|
-
common: sass/fonts
|
|
123
|
+
common: sass/fonts
|
|
110
124
|
_sass/footer.scss:
|
|
111
|
-
common: sass/footer
|
|
125
|
+
common: sass/footer
|
|
126
|
+
assets/favicon.ico:
|
|
112
127
|
LICENSE.md:
|
|
113
128
|
.ruby-version:
|
|
114
129
|
_data/libs.yml:
|
|
130
|
+
js/app.js:
|
|
131
|
+
outpath: app/wormname
|
|
132
|
+
common: js/app.js
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
<link rel='icon' type='image/png' href='<%= prefix %>/assets/favicon.ico' />
|
|
33
33
|
<link rel='stylesheet' href='<%= prefix %>/css/styles.css' />
|
|
34
|
-
<script src='<%= prefix %>/js
|
|
34
|
+
<script src='<%= prefix %>/js/<%= @gen.wormname %>.js'></script>
|
|
35
35
|
<title>
|
|
36
36
|
<% case @gen.framework %>
|
|
37
37
|
<% when 'sinatra' %>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@import 'palettes/default';
|
|
2
|
+
|
|
3
|
+
$brand-primary: $rgba-primary-0;
|
|
4
|
+
//$brand-complement: $rgba-complement-0;
|
|
5
|
+
//$brand-secondary-1: $rgba-secondary-1-0;
|
|
6
|
+
//$brand-secondary-2: $rgba-secondary-2-0;
|
|
7
|
+
|
|
8
|
+
$grey: rgb(127, 127, 127);
|
|
9
|
+
$light-grey: lighten($grey, 25%);
|
|
10
|
+
$dark-grey: darken($grey, 25%);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// drop a Sass export of a Paletton (http://paletton.com/) palette in here
|
|
2
|
+
|
|
3
|
+
// SASS style sheet */
|
|
4
|
+
// Palette color codes */
|
|
5
|
+
// Palette URL: http://paletton.com/#uid=75b100kw0w0jyC+oRxVy4oIDfjr */
|
|
6
|
+
|
|
7
|
+
// Feel free to copy&paste color codes to your application */
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// As hex codes */
|
|
11
|
+
|
|
12
|
+
$color-primary-0: #CE0071; // Main Primary color */
|
|
13
|
+
$color-primary-1: #DA559E;
|
|
14
|
+
$color-primary-2: #D12F87;
|
|
15
|
+
$color-primary-3: #9F0057;
|
|
16
|
+
$color-primary-4: #7D0044;
|
|
17
|
+
|
|
18
|
+
$color-secondary-1-0: #FF7F00; // Main Secondary color (1) */
|
|
19
|
+
$color-secondary-1-1: #FFB163;
|
|
20
|
+
$color-secondary-1-2: #FF9B39;
|
|
21
|
+
$color-secondary-1-3: #C56200;
|
|
22
|
+
$color-secondary-1-4: #9B4D00;
|
|
23
|
+
|
|
24
|
+
$color-secondary-2-0: #04819E; // Main Secondary color (2) */
|
|
25
|
+
$color-secondary-2-1: #4AA2B6;
|
|
26
|
+
$color-secondary-2-2: #288CA4;
|
|
27
|
+
$color-secondary-2-3: #03637A;
|
|
28
|
+
$color-secondary-2-4: #024E60;
|
|
29
|
+
|
|
30
|
+
$color-complement-0: #9BED00; // Main Complement color */
|
|
31
|
+
$color-complement-1: #BFF25E;
|
|
32
|
+
$color-complement-2: #AFEE35;
|
|
33
|
+
$color-complement-3: #78B700;
|
|
34
|
+
$color-complement-4: #5E9000;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// As RGBa codes */
|
|
39
|
+
|
|
40
|
+
$rgba-primary-0: rgba(206, 0,113,1); // Main Primary color */
|
|
41
|
+
$rgba-primary-1: rgba(218, 85,158,1);
|
|
42
|
+
$rgba-primary-2: rgba(209, 47,135,1);
|
|
43
|
+
$rgba-primary-3: rgba(159, 0, 87,1);
|
|
44
|
+
$rgba-primary-4: rgba(125, 0, 68,1);
|
|
45
|
+
|
|
46
|
+
$rgba-secondary-1-0: rgba(255,127, 0,1); // Main Secondary color (1) */
|
|
47
|
+
$rgba-secondary-1-1: rgba(255,177, 99,1);
|
|
48
|
+
$rgba-secondary-1-2: rgba(255,155, 57,1);
|
|
49
|
+
$rgba-secondary-1-3: rgba(197, 98, 0,1);
|
|
50
|
+
$rgba-secondary-1-4: rgba(155, 77, 0,1);
|
|
51
|
+
|
|
52
|
+
$rgba-secondary-2-0: rgba( 4,129,158,1); // Main Secondary color (2) */
|
|
53
|
+
$rgba-secondary-2-1: rgba( 74,162,182,1);
|
|
54
|
+
$rgba-secondary-2-2: rgba( 40,140,164,1);
|
|
55
|
+
$rgba-secondary-2-3: rgba( 3, 99,122,1);
|
|
56
|
+
$rgba-secondary-2-4: rgba( 2, 78, 96,1);
|
|
57
|
+
|
|
58
|
+
$rgba-complement-0: rgba(155,237, 0,1); // Main Complement color */
|
|
59
|
+
$rgba-complement-1: rgba(191,242, 94,1);
|
|
60
|
+
$rgba-complement-2: rgba(175,238, 53,1);
|
|
61
|
+
$rgba-complement-3: rgba(120,183, 0,1);
|
|
62
|
+
$rgba-complement-4: rgba( 94,144, 0,1);
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
// Generated by Paletton.com © 2002-2014 */
|
|
67
|
+
// http://paletton.com */
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Your new Jekyll site <%= @gen.camelname %> has been created
|
|
3
3
|
|
|
4
4
|
<% if @gen.renamed %>
|
|
5
|
-
(Note that '<%= @gen.
|
|
5
|
+
(Note that '<%= @gen.originalname %>' has been changed to '<%= @gen.wormname %>' because Ruby finds '-'s troubling)
|
|
6
6
|
|
|
7
7
|
<% end %>
|
|
8
8
|
Now do
|
|
@@ -11,7 +11,7 @@ Now do
|
|
|
11
11
|
bundle
|
|
12
12
|
bundle exec jekyll serve
|
|
13
13
|
|
|
14
|
-
which will launch the site (at http://localhost:4000/<%= @gen.
|
|
14
|
+
which will launch the site (at http://localhost:4000/<%= @gen.originalname %>/)
|
|
15
15
|
|
|
16
16
|
And presuming that works OK
|
|
17
17
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,8 +12,14 @@ unless ENV['RACK_ENV'] == 'production'
|
|
|
12
12
|
task :default => [:spec, 'jasmine:ci', 'coveralls:push']
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
namespace :run do
|
|
16
|
+
desc 'start app'
|
|
17
|
+
task :app do
|
|
18
|
+
sh 'rackup -o 0.0.0.0'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
desc 'clean-up and run compass'
|
|
22
|
+
task :sass do
|
|
23
|
+
sh 'compass clean && compass watch'
|
|
24
|
+
end
|
|
19
25
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -16,9 +16,10 @@ And presuming that passes OK
|
|
|
16
16
|
git add .
|
|
17
17
|
git commit -m 'First commit'
|
|
18
18
|
|
|
19
|
-
Then try
|
|
19
|
+
Then try (in 2 different windows)
|
|
20
20
|
|
|
21
|
-
bundle exec rake run
|
|
21
|
+
bundle exec rake run:sass
|
|
22
|
+
bundle exec rake run:app
|
|
22
23
|
|
|
23
24
|
which will launch Compass and then run the app (at http://localhost:9292)
|
|
24
25
|
<% unless @gen.licensor %>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/sinatra/templates/spec/javascripts/support/{jasmine_helper.rb.eruby → jasmine_helper.rb}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/skellington/cli.rb
CHANGED
|
@@ -10,10 +10,7 @@ module Skellington
|
|
|
10
10
|
method_option :framework,
|
|
11
11
|
default: 'sinatra',
|
|
12
12
|
description: 'Framework to generate for',
|
|
13
|
-
enum: [
|
|
14
|
-
'sinatra',
|
|
15
|
-
'jekyll'
|
|
16
|
-
]
|
|
13
|
+
enum: ['sinatra', 'jekyll']
|
|
17
14
|
method_option :bootstrap,
|
|
18
15
|
default: '3',
|
|
19
16
|
description: 'Bootstrap major version to use',
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
module Skellington
|
|
2
2
|
class Generator
|
|
3
|
-
attr_reader :path,
|
|
3
|
+
attr_reader :path,
|
|
4
|
+
:filename,
|
|
5
|
+
:originalname,
|
|
6
|
+
:camelname,
|
|
7
|
+
:files,
|
|
8
|
+
:gems,
|
|
9
|
+
:framework,
|
|
10
|
+
:bootstrap
|
|
4
11
|
attr_accessor :licensor
|
|
5
12
|
|
|
6
13
|
def initialize path, options = {}
|
|
@@ -9,6 +16,7 @@ module Skellington
|
|
|
9
16
|
@full_path = path
|
|
10
17
|
@path = File.dirname @full_path
|
|
11
18
|
@filename = File.basename(@full_path)
|
|
19
|
+
@originalname = @filename
|
|
12
20
|
@camelname = Skellington.camelise(wormname)
|
|
13
21
|
@gems = config[@framework]['gems']
|
|
14
22
|
@files = config[@framework]['files']
|
|
@@ -46,10 +54,6 @@ module Skellington
|
|
|
46
54
|
|
|
47
55
|
root = "#{self.path}/#{self.wormname}"
|
|
48
56
|
|
|
49
|
-
# FileUtils.mkdir_p "#{root}/javascripts"
|
|
50
|
-
# FileUtils.cp_r "#{Bootstrap.assets_path}/javascripts/bootstrap", "#{root}/javascripts"
|
|
51
|
-
# FileUtils.cp "#{Bootstrap.assets_path}/javascripts/bootstrap.min.js", "#{root}/javascripts"
|
|
52
|
-
|
|
53
57
|
FileUtils.mkdir_p "#{root}/_sass"
|
|
54
58
|
FileUtils.cp_r "#{Bootstrap.assets_path}/stylesheets/bootstrap", "#{root}/_sass"
|
|
55
59
|
FileUtils.cp "#{Bootstrap.assets_path}/stylesheets/_bootstrap.scss", "#{root}/_sass/bootstrap.scss"
|
|
@@ -57,7 +61,7 @@ module Skellington
|
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
def wormname
|
|
60
|
-
@filename.gsub('-', '_')
|
|
64
|
+
@wormname ||= @filename.gsub('-', '_')
|
|
61
65
|
end
|
|
62
66
|
|
|
63
67
|
def renamed
|
data/lib/skellington/template.rb
CHANGED
|
@@ -31,23 +31,20 @@ module Skellington
|
|
|
31
31
|
puts 'done'
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
def path
|
|
35
|
+
[
|
|
36
|
+
"#{templates_dir}/#{@name}",
|
|
37
|
+
"#{common_templates}/#{@generator.files.dig(@name, 'common')}",
|
|
38
|
+
"#{common_templates}/#{@name}"
|
|
39
|
+
].each do |maybe_path|
|
|
40
|
+
return File.read(File.open(maybe_path)) if File.file? maybe_path
|
|
38
41
|
end
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
''
|
|
44
|
+
end
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
t = File.read(File.open("#{common_templates}/#{$1}"))
|
|
46
|
-
end
|
|
47
|
-
rescue Errno::ENOENT
|
|
48
|
-
t = File.read(File.open("#{common_templates}/#{@name}.eruby"))
|
|
49
|
-
end
|
|
50
|
-
Erubis::Eruby.new(t).evaluate(gen: @generator)
|
|
46
|
+
def to_s
|
|
47
|
+
Erubis::Eruby.new(path).evaluate(gen: @generator)
|
|
51
48
|
end
|
|
52
49
|
end
|
|
53
50
|
end
|
data/lib/skellington/version.rb
CHANGED
data/spec/hyphens_spec.rb
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Skellington
|
|
2
|
+
describe CLI do
|
|
3
|
+
let :subject do
|
|
4
|
+
described_class.new
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
it 'has a 404 page' do
|
|
8
|
+
subject.options = { 'framework' => 'jekyll' }
|
|
9
|
+
subject.generate 'dummy-app'
|
|
10
|
+
|
|
11
|
+
expect('dummy_app/404.md').to have_content (
|
|
12
|
+
"""
|
|
13
|
+
---
|
|
14
|
+
title: 404
|
|
15
|
+
permalink: /404.html
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Nothing to see here
|
|
19
|
+
"""
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Skellington
|
|
2
|
+
describe CLI do
|
|
3
|
+
let :subject do
|
|
4
|
+
described_class.new
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
it 'creates a favicon' do
|
|
8
|
+
subject.options = { 'framework' => 'jekyll' }
|
|
9
|
+
subject.generate 'dummy-app'
|
|
10
|
+
|
|
11
|
+
expect(File).to exist 'dummy_app/assets/favicon.ico'
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -6,7 +6,7 @@ module Skellington
|
|
|
6
6
|
|
|
7
7
|
it 'installs bootstrap' do
|
|
8
8
|
subject.options = { 'framework' => 'jekyll' }
|
|
9
|
-
subject.generate '
|
|
9
|
+
subject.generate 'dummy-app'
|
|
10
10
|
|
|
11
11
|
expect('dummy_app/_sass/bootstrap.scss').to have_content (
|
|
12
12
|
"""
|
|
@@ -30,9 +30,19 @@ module Skellington
|
|
|
30
30
|
"""
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
+
expect(File).to exist 'dummy_app/_sass/palettes/default.scss'
|
|
33
34
|
expect('dummy_app/_sass/colours.scss').to have_content (
|
|
34
35
|
"""
|
|
35
|
-
|
|
36
|
+
@import 'palettes/default';
|
|
37
|
+
|
|
38
|
+
$brand-primary: $rgba-primary-0;
|
|
39
|
+
//$brand-complement: $rgba-complement-0;
|
|
40
|
+
//$brand-secondary-1: $rgba-secondary-1-0;
|
|
41
|
+
//$brand-secondary-2: $rgba-secondary-2-0;
|
|
42
|
+
|
|
43
|
+
$grey: rgb(127, 127, 127);
|
|
44
|
+
$light-grey: lighten($grey, 25%);
|
|
45
|
+
$dark-grey: darken($grey, 25%);
|
|
36
46
|
"""
|
|
37
47
|
)
|
|
38
48
|
|
|
@@ -69,7 +79,7 @@ module Skellington
|
|
|
69
79
|
|
|
70
80
|
it 'sets up sass' do
|
|
71
81
|
subject.options = { 'framework' => 'jekyll' }
|
|
72
|
-
subject.generate '
|
|
82
|
+
subject.generate 'dummy-app'
|
|
73
83
|
|
|
74
84
|
expect('dummy_app/css/styles.scss').to have_content (
|
|
75
85
|
"""
|
|
@@ -6,7 +6,7 @@ module Skellington
|
|
|
6
6
|
|
|
7
7
|
it 'installs bootstrap 4' do
|
|
8
8
|
subject.options = { 'framework' => 'jekyll', 'bootstrap' => 4 }
|
|
9
|
-
subject.generate '
|
|
9
|
+
subject.generate 'dummy-app'
|
|
10
10
|
|
|
11
11
|
# expect(Dir).to exist 'dummy_app/javascripts/bootstrap'
|
|
12
12
|
# expect('dummy_app/javascripts/bootstrap.min.js').to have_content (
|
|
@@ -32,7 +32,16 @@ module Skellington
|
|
|
32
32
|
)
|
|
33
33
|
expect('dummy_app/_sass/colours.scss').to have_content (
|
|
34
34
|
"""
|
|
35
|
-
|
|
35
|
+
@import 'palettes/default';
|
|
36
|
+
|
|
37
|
+
$brand-primary: $rgba-primary-0;
|
|
38
|
+
//$brand-complement: $rgba-complement-0;
|
|
39
|
+
//$brand-secondary-1: $rgba-secondary-1-0;
|
|
40
|
+
//$brand-secondary-2: $rgba-secondary-2-0;
|
|
41
|
+
|
|
42
|
+
$grey: rgb(127, 127, 127);
|
|
43
|
+
$light-grey: lighten($grey, 25%);
|
|
44
|
+
$dark-grey: darken($grey, 25%);
|
|
36
45
|
"""
|
|
37
46
|
)
|
|
38
47
|
expect('dummy_app/_sass/fonts.scss').to have_content (
|
data/spec/jekyll/cli_spec.rb
CHANGED
|
@@ -6,16 +6,18 @@ module Skellington
|
|
|
6
6
|
|
|
7
7
|
it 'generates correct output' do
|
|
8
8
|
subject.options = { 'framework' => 'jekyll' }
|
|
9
|
-
expect { subject.generate '
|
|
9
|
+
expect { subject.generate 'dummy-app' }.to output(/
|
|
10
10
|
Your new Jekyll site DummyApp has been created
|
|
11
11
|
|
|
12
|
+
\(Note that 'dummy-app' has been changed to 'dummy_app' because Ruby finds '-'s troubling\)
|
|
13
|
+
|
|
12
14
|
Now do
|
|
13
15
|
|
|
14
16
|
cd dummy_app
|
|
15
17
|
bundle
|
|
16
18
|
bundle exec jekyll serve
|
|
17
19
|
|
|
18
|
-
which will launch the site \(at http:\/\/localhost:4000\/
|
|
20
|
+
which will launch the site \(at http:\/\/localhost:4000\/dummy-app\/\)
|
|
19
21
|
|
|
20
22
|
And presuming that works OK
|
|
21
23
|
|
|
@@ -6,7 +6,7 @@ module Skellington
|
|
|
6
6
|
|
|
7
7
|
it 'creates a libs data file' do
|
|
8
8
|
subject.options = { 'framework' => 'jekyll' }
|
|
9
|
-
subject.generate '
|
|
9
|
+
subject.generate 'dummy-app'
|
|
10
10
|
|
|
11
11
|
expect(Dir).to exist 'dummy_app/_data'
|
|
12
12
|
expect('dummy_app/_data/libs.yml').to have_content (
|
data/spec/jekyll/git_spec.rb
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
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.options = { 'framework' => 'jekyll' }
|
|
9
|
+
subject.generate 'dummy-app'
|
|
10
|
+
|
|
11
|
+
expect(File).to exist 'dummy_app/js/dummy_app.js'
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|