skellington 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/config/config.yaml +34 -4
  4. data/lib/{jekyll → common}/templates/.ruby-version.eruby +0 -0
  5. data/lib/{jekyll → common}/templates/LICENSE.md.eruby +0 -0
  6. data/lib/common/templates/gitignore +7 -0
  7. data/lib/{sinatra/templates/views/includes/footer.erb.eruby → common/templates/includes/footer} +0 -0
  8. data/lib/common/templates/includes/header +43 -0
  9. data/lib/common/templates/includes/ie-cruft +6 -0
  10. data/lib/common/templates/sass/colours.scss +1 -0
  11. data/lib/common/templates/sass/fonts.scss +1 -0
  12. data/lib/{sinatra/templates/public/sass/_footer.scss.eruby → common/templates/sass/footer.scss} +0 -0
  13. data/lib/{sinatra/templates/public/sass/styles.scss.eruby → common/templates/sass/styles.scss} +5 -2
  14. data/lib/common/templates/sass/variables.scss +1 -0
  15. data/lib/common/templates/views/layout +28 -0
  16. data/lib/jekyll/templates/_config.yml.eruby +2 -0
  17. data/lib/jekyll/templates/_data/libs.yml.eruby +15 -0
  18. data/lib/jekyll/templates/index.md.eruby +1 -1
  19. data/lib/jekyll/templates/post-run.eruby +1 -1
  20. data/lib/sinatra/templates/Gemfile.eruby +1 -1
  21. data/lib/sinatra/templates/lib/app.rb.eruby +1 -1
  22. data/lib/sinatra/templates/views/includes/css-libs.erb.eruby +6 -0
  23. data/lib/sinatra/templates/views/includes/fonts-libs.erb.eruby +8 -0
  24. data/lib/sinatra/templates/views/includes/js-libs.erb.eruby +8 -0
  25. data/lib/skellington/generator.rb +4 -5
  26. data/lib/skellington/template.rb +19 -1
  27. data/lib/skellington/version.rb +1 -1
  28. data/spec/jekyll/bootstrap/css_spec.rb +93 -0
  29. data/spec/jekyll/bootstrap_4/bootstrap_4_spec.rb +45 -0
  30. data/spec/jekyll/cli_spec.rb +1 -1
  31. data/spec/jekyll/data/libs_spec.rb +33 -0
  32. data/spec/jekyll/{cli/git_spec.rb → git_spec.rb} +0 -0
  33. data/spec/jekyll/{cli/index_md.rb → layout/index_md_spec.rb} +2 -3
  34. data/spec/jekyll/layout/layout_spec.rb +104 -0
  35. data/spec/jekyll/{cli → root_files}/config_yml_spec.rb +2 -0
  36. data/spec/jekyll/{cli → root_files}/gemfile_spec.rb +0 -0
  37. data/spec/jekyll/{cli → root_files}/license_spec.rb +0 -0
  38. data/spec/jekyll/{cli → root_files}/rbenv_spec.rb +0 -0
  39. data/spec/non_local_path_spec.rb +1 -1
  40. data/spec/sinatra/{cli → app}/app_spec.rb +1 -1
  41. data/spec/sinatra/{cli → app}/config_yml_spec.rb +0 -0
  42. data/spec/sinatra/{cli → app}/helpers_spec.rb +0 -0
  43. data/spec/sinatra/app/public_spec.rb +14 -0
  44. data/spec/sinatra/{cli → app}/racks_spec.rb +0 -0
  45. data/spec/sinatra/bootstrap/css_spec.rb +42 -0
  46. data/spec/sinatra/{cli → bootstrap_4}/config_rb_bootstrap_4_spec.rb +0 -0
  47. data/spec/sinatra/{cli → bootstrap_4}/gemfile_bootstrap_4_spec.rb +1 -2
  48. data/spec/sinatra/{cli → bootstrap_4}/public_bootstrap_4_spec.rb +0 -0
  49. data/spec/sinatra/{cli/git_spec.rb → git_spec.rb} +0 -0
  50. data/spec/sinatra/{cli → javascript}/javascript_spec.rb +0 -0
  51. data/spec/sinatra/layout/includes_spec.rb +71 -0
  52. data/spec/sinatra/layout/layout_spec.rb +92 -0
  53. data/spec/sinatra/layout/views_spec.rb +17 -0
  54. data/spec/sinatra/{cli → root_files}/config_rb_spec.rb +0 -0
  55. data/spec/sinatra/{cli → root_files}/config_ru_spec.rb +0 -0
  56. data/spec/sinatra/{cli → root_files}/gemfile_spec.rb +0 -1
  57. data/spec/sinatra/{cli → root_files}/guardfile_spec.rb +0 -0
  58. data/spec/sinatra/{cli → root_files}/license_spec.rb +0 -0
  59. data/spec/sinatra/{cli → root_files}/procfile_spec.rb +0 -0
  60. data/spec/sinatra/{cli → root_files}/rakefile_spec.rb +0 -0
  61. data/spec/sinatra/{cli → root_files}/rbenv_spec.rb +0 -0
  62. data/spec/sinatra/{cli → spec}/spec_spec.rb +0 -0
  63. metadata +84 -81
  64. data/lib/jekyll/templates/.gitignore.eruby +0 -2
  65. data/lib/jekyll/templates/_layouts/default.html.eruby +0 -29
  66. data/lib/jekyll/templates/_sass/bootstrap-custom.scss.eruby +0 -1
  67. data/lib/jekyll/templates/_sass/fonts.scss.eruby +0 -4
  68. data/lib/jekyll/templates/assets/application.scss.eruby +0 -6
  69. data/lib/sinatra/templates/.gitignore.eruby +0 -2
  70. data/lib/sinatra/templates/.ruby-version.eruby +0 -1
  71. data/lib/sinatra/templates/LICENSE.md.eruby +0 -27
  72. data/lib/sinatra/templates/public/sass/_fonts.scss.eruby +0 -2
  73. data/lib/sinatra/templates/public/sass/_variables.scss.eruby +0 -2
  74. data/lib/sinatra/templates/views/default.erb.eruby +0 -17
  75. data/lib/sinatra/templates/views/includes/header.erb.eruby +0 -22
  76. data/spec/jekyll/cli/assets_css_spec.rb +0 -23
  77. data/spec/jekyll/cli/bootstrap_4_spec.rb +0 -48
  78. data/spec/jekyll/cli/bootstrap_spec.rb +0 -47
  79. data/spec/jekyll/cli/layout_spec.rb +0 -45
  80. data/spec/sinatra/cli/includes_spec.rb +0 -72
  81. data/spec/sinatra/cli/layout_spec.rb +0 -32
  82. data/spec/sinatra/cli/public_spec.rb +0 -111
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 113e8c6cf5e0914cb28a30647331f69579609a97
4
- data.tar.gz: ea3bd20b869960dd4f9e3362cb1087be2db29ddb
3
+ metadata.gz: 1764412664af82c2ca5b20c67b4e1689b132a68c
4
+ data.tar.gz: f5320be4ba04dce5e77128fd37f0acd55b36ae0a
5
5
  SHA512:
6
- metadata.gz: 2c53c3d061340979780bf3e2d28177199ddca62a775915f41ebfc7d983625e85511af9838026574aeca842800b031d0b31a89af3146d6164daa5d201a817e10b
7
- data.tar.gz: 02f17f219534be565b415fb9166b026423f64786ac8f9b5a8be1da9c98e691cee3f0fa8854e57f57b1732c10f39e1b3de004fae643effd3d5664d8e51966fcc2
6
+ metadata.gz: e1cadd97a522409a2dafb1d5dc937d244e36faf13b2617a8580a4bcb6ca2b0783f4fc127f3ddf4a8bd928877a42267db54c765f3ee526dd2bcc3fe4ef23402a6
7
+ data.tar.gz: 51caf99179a67b5a5265e5cd6bcfcbf8411b1129bdcc44d6ad217e98f9e90404e669e46ab5118146109c956b4388fb5ab7659d75d9d230f91dfc047eced247fb
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.5
3
+ # - 2.2.5
4
4
  - 2.3.0
data/config/config.yaml CHANGED
@@ -14,7 +14,6 @@ sinatra:
14
14
  guard:
15
15
  guard-rspec:
16
16
  guard-jasmine:
17
- capybara:
18
17
  coveralls:
19
18
  jasmine:
20
19
  pry:
@@ -29,6 +28,7 @@ sinatra:
29
28
  .ruby-version:
30
29
  .rspec:
31
30
  .gitignore:
31
+ common: gitignore
32
32
  config.ru:
33
33
  config.rb:
34
34
  config/config.yml:
@@ -41,10 +41,18 @@ sinatra:
41
41
  outpath: app/wormname/racks
42
42
  lib/app/helpers.rb:
43
43
  outpath: app/wormname/helpers
44
- views/default.erb:
44
+ views/layout.erb:
45
+ common: views/layout
45
46
  views/index.erb:
46
47
  views/includes/header.erb:
48
+ common: includes/header
47
49
  views/includes/footer.erb:
50
+ common: includes/footer
51
+ views/includes/ie-cruft.erb:
52
+ common: includes/ie-cruft
53
+ views/includes/js-libs.erb:
54
+ views/includes/css-libs.erb:
55
+ views/includes/fonts-libs.erb:
48
56
  views/includes/github-corner.erb:
49
57
  spec/spec_helper.rb:
50
58
  spec/app/helpers_spec.rb:
@@ -60,10 +68,16 @@ sinatra:
60
68
  public/js/app.js:
61
69
  outpath: app/wormname
62
70
  public/sass/_footer.scss:
71
+ common: sass/footer.scss
63
72
  public/sass/_fonts.scss:
73
+ common: sass/fonts.scss
64
74
  public/sass/_github-corner.scss:
65
75
  public/sass/_variables.scss:
76
+ common: sass/variables.scss
77
+ public/sass/_colours.scss:
78
+ common: sass/colours.scss
66
79
  public/sass/styles.scss:
80
+ common: sass/styles.scss
67
81
 
68
82
  jekyll:
69
83
  gems:
@@ -75,10 +89,26 @@ jekyll:
75
89
  Gemfile:
76
90
  _config.yml:
77
91
  .gitignore:
92
+ common: gitignore
78
93
  index.md:
79
94
  _layouts/default.html:
80
- assets/application.scss:
81
- _sass/bootstrap-custom.scss:
95
+ common: views/layout
96
+ _includes/header.html:
97
+ common: includes/header
98
+ _includes/footer.html:
99
+ common: includes/footer
100
+ _includes/ie-cruft.html:
101
+ common: includes/ie-cruft
102
+ css/styles.scss:
103
+ common: sass/styles.scss
104
+ _sass/variables.scss:
105
+ common: sass/variables.scss
106
+ _sass/colours.scss:
107
+ common: sass/colours.scss
82
108
  _sass/fonts.scss:
109
+ common: sass/fonts.scss
110
+ _sass/footer.scss:
111
+ common: sass/footer.scss
83
112
  LICENSE.md:
84
113
  .ruby-version:
114
+ _data/libs.yml:
File without changes
@@ -0,0 +1,7 @@
1
+ <% case @gen.framework %>
2
+ <% when 'sinatra' %>
3
+ coverage/
4
+ <% when 'jekyll' %>
5
+ _site/
6
+ <% end %>
7
+ .sass-cache
@@ -0,0 +1,43 @@
1
+ <head>
2
+ <meta charset='utf-8' />
3
+ <meta http-equiv='X-UA-Compatible' content='IE=edge' />
4
+ <meta name='viewport' content='width=device-width, initial-scale=1' />
5
+
6
+ <% case @gen.framework %>
7
+ <% when 'sinatra' %>
8
+ <%%= erb :'includes/ie-cruft' %>
9
+ <%%= erb :'includes/js-libs' %>
10
+ <%%= erb :'includes/css-libs' %>
11
+ <%%= erb :'includes/fonts-libs' %>
12
+ <% when 'jekyll' %>
13
+ {% include ie-cruft.html %}
14
+
15
+ {% for lib in site.data.libs.js %}
16
+ <!-- {{ lib.name }} -->
17
+ <script src='{{ lib.url }}'></script>
18
+ {% endfor %}
19
+
20
+ {% for lib in site.data.libs.css %}
21
+ <!-- {{ lib.name }} -->
22
+ <link rel='stylesheet' href='{{ lib.url }}'>
23
+ {% endfor %}
24
+
25
+ {% for font in site.data.libs.fonts %}
26
+ <!-- {{ font.name }} -->
27
+ <link rel='stylesheet' href='{{ font.url }}'>
28
+ {% endfor %}
29
+ <% end %>
30
+ <% prefix = '{{ site.baseurl }}' if @gen.framework == 'jekyll' %>
31
+
32
+ <link rel='icon' type='image/png' href='<%= prefix %>/assets/favicon.ico' />
33
+ <link rel='stylesheet' href='<%= prefix %>/css/styles.css' />
34
+ <script src='<%= prefix %>/js/dummy_app.js'></script>
35
+ <title>
36
+ <% case @gen.framework %>
37
+ <% when 'sinatra' %>
38
+ <%%= @title %>
39
+ <% when 'jekyll' %>
40
+ {{ page.title }}
41
+ <% end %>
42
+ </title>
43
+ </head>
@@ -0,0 +1,6 @@
1
+ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
2
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
3
+ <!--[if lt IE 9]>
4
+ <script src='//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js'></script>
5
+ <script src='//oss.maxcdn.com/respond/1.4.2/respond.min.js'></script>
6
+ <![endif]-->
@@ -0,0 +1 @@
1
+ $brand-primary: rgba(250, 129, 0, 1);
@@ -0,0 +1 @@
1
+ $font-primary: 'Ubuntu Mono';
@@ -1,8 +1,11 @@
1
+ <% if @gen.framework == 'jekyll' %>---
2
+ ---<% end %>
1
3
  @import 'bootstrap';
2
- @import 'fonts';
3
4
  @import 'variables';
5
+ @import 'fonts';
6
+ @import 'colours';
4
7
  @import 'footer';
5
- @import 'github-corner';
8
+ //@import 'github-corner';
6
9
 
7
10
  h1 {
8
11
  color: $brand-primary;
@@ -0,0 +1 @@
1
+ $footer-height: 40px;
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html lang='en'>
3
+ <% case @gen.framework %>
4
+ <% when 'sinatra' %>
5
+ <%%= erb :'includes/header' %>
6
+ <% when 'jekyll' %>
7
+ {% include header.html %}
8
+ <% end %>
9
+ <body>
10
+ <% if @gen.framework == 'sinatra' %>
11
+ <%%= erb :'includes/github-corner' if @github_url %>
12
+ <% end %>
13
+ <div class='container'>
14
+ <% case @gen.framework %>
15
+ <% when 'sinatra' %>
16
+ <%%= yield %>
17
+ <% when 'jekyll' %>
18
+ {{ content }}
19
+ <% end %>
20
+ </div>
21
+ <% case @gen.framework %>
22
+ <% when 'sinatra' %>
23
+ <%%= erb :'includes/footer' %>
24
+ <% when 'jekyll' %>
25
+ {% include footer.html %}
26
+ <% end %>
27
+ </body>
28
+ </html>
@@ -5,3 +5,5 @@ defaults:
5
5
  values:
6
6
  layout: default
7
7
  permalink: pretty
8
+
9
+ baseurl: /<%= @gen.wormname %>
@@ -0,0 +1,15 @@
1
+ js:
2
+ - name: jquery
3
+ url: //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
4
+ - name: bootstrap
5
+ url: //maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js
6
+
7
+ css:
8
+ - name: foo
9
+ bar: //bar.com/baz.css
10
+
11
+ fonts:
12
+ - name: fontawesome
13
+ url: //maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css
14
+ - name: ubuntu
15
+ url: //fonts.googleapis.com/css?family=Ubuntu+Mono
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  ---
3
3
 
4
- Hold tight <%= @gen.wormname %>
4
+ # Hello from <%= @gen.camelname %>
@@ -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)
14
+ which will launch the site (at http://localhost:4000/<%= @gen.wormname %>/)
15
15
 
16
16
  And presuming that works OK
17
17
 
@@ -1,6 +1,6 @@
1
1
  <% if @gen.bootstrap == '4' %>
2
2
  <% @gen.gems['production'].delete 'bootstrap-sass' %>
3
- <% @gen.gems['production']['bootstrap'] = '4.0.0.alpha4' %>
3
+ <% @gen.gems['production']['bootstrap'] = '4.0.0.alpha5' %>
4
4
  <% end %>
5
5
  source 'https://rubygems.org'
6
6
 
@@ -20,7 +20,7 @@ module <%= @gen.camelname %>
20
20
  @content = '<h1>Hello from <%= @gen.camelname %></h1>'
21
21
  @title = '<%= @gen.camelname %>'
22
22
  @github_url = CONFIG['github_url']
23
- erb :index, layout: :default
23
+ erb :index
24
24
  end
25
25
 
26
26
  wants.json do
@@ -0,0 +1,6 @@
1
+ <%%
2
+ libs = {
3
+ }.each_pair do |name, url| %>
4
+ <!-- <%%= name %> -->
5
+ <link rel='stylesheet' href='<%%= url %>'>
6
+ <%% end %>
@@ -0,0 +1,8 @@
1
+ <%%
2
+ libs = {
3
+ fontawesome: '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css',
4
+ ubuntu: '//fonts.googleapis.com/css?family=Ubuntu+Mono'
5
+ }.each_pair do |name, url| %>
6
+ <!-- <%%= name %> -->
7
+ <link rel='stylesheet' href='<%%= url %>'>
8
+ <%% end %>
@@ -0,0 +1,8 @@
1
+ <%%
2
+ libs = {
3
+ jquery: '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js',
4
+ bootstrap: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js'
5
+ }.each_pair do |name, url| %>
6
+ <!-- <%%= name %> -->
7
+ <script src='<%%= url %>'></script>
8
+ <%% end %>
@@ -4,7 +4,6 @@ module Skellington
4
4
  attr_accessor :licensor
5
5
 
6
6
  def initialize path, options = {}
7
- # @framework = options[:framework] ? options[:framework] : 'sinatra'
8
7
  @framework = options.fetch('framework', 'sinatra')
9
8
  @bootstrap = options.fetch('bootstrap', 3).to_s
10
9
  @full_path = path
@@ -44,12 +43,12 @@ module Skellington
44
43
  Object.send(:remove_const, :Bootstrap)
45
44
  require 'bootstrap'
46
45
  end
47
-
46
+
48
47
  root = "#{self.path}/#{self.wormname}"
49
48
 
50
- FileUtils.mkdir_p "#{root}/javascripts"
51
- FileUtils.cp_r "#{Bootstrap.assets_path}/javascripts/bootstrap", "#{root}/javascripts"
52
- FileUtils.cp "#{Bootstrap.assets_path}/javascripts/bootstrap.min.js", "#{root}/javascripts"
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"
53
52
 
54
53
  FileUtils.mkdir_p "#{root}/_sass"
55
54
  FileUtils.cp_r "#{Bootstrap.assets_path}/stylesheets/bootstrap", "#{root}/_sass"
@@ -14,6 +14,10 @@ module Skellington
14
14
  end
15
15
  end
16
16
 
17
+ def common_templates
18
+ File.join File.dirname(__FILE__), '..', 'common', 'templates'
19
+ end
20
+
17
21
  def templates_dir
18
22
  File.join File.dirname(__FILE__), '..', @generator.framework, 'templates'
19
23
  end
@@ -28,7 +32,21 @@ module Skellington
28
32
  end
29
33
 
30
34
  def to_s
31
- t = File.read(File.open("#{templates_dir}/#{@name}.eruby"))
35
+ path = "#{templates_dir}/#{@name}.eruby"
36
+ if @generator.files.dig(@name, 'common')
37
+ path = "#{common_templates}/#{@generator.files[@name]['common']}"
38
+ end
39
+
40
+ begin
41
+ t = File.read(File.open(path))
42
+
43
+ # this can go away soon
44
+ if t =~ /^common: (.*)$/
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
32
50
  Erubis::Eruby.new(t).evaluate(gen: @generator)
33
51
  end
34
52
  end
@@ -1,3 +1,3 @@
1
1
  module Skellington
2
- VERSION = '0.8.1'
2
+ VERSION = '0.8.2'
3
3
  end
@@ -0,0 +1,93 @@
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('dummy_app/_sass/bootstrap.scss').to have_content (
12
+ """
13
+ /*!
14
+ * Bootstrap v3.3.7 (http://getbootstrap.com)
15
+ * Copyright 2011-2016 Twitter, Inc.
16
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
17
+ */
18
+ """
19
+ )
20
+
21
+ expect('dummy_app/_sass/variables.scss').to have_content (
22
+ """
23
+ $footer-height: 40px;
24
+ """
25
+ )
26
+
27
+ expect('dummy_app/_sass/fonts.scss').to have_content (
28
+ """
29
+ $font-primary: 'Ubuntu Mono';
30
+ """
31
+ )
32
+
33
+ expect('dummy_app/_sass/colours.scss').to have_content (
34
+ """
35
+ $brand-primary: rgba(250, 129, 0, 1);
36
+ """
37
+ )
38
+
39
+ expect('dummy_app/_sass/footer.scss').to have_content (
40
+ """
41
+ html {
42
+ position: relative;
43
+ min-height: 100%;
44
+ }
45
+
46
+ body {
47
+ margin-bottom: $footer-height;
48
+ }
49
+
50
+ .footer {
51
+ position: absolute;
52
+ bottom: 0;
53
+ width: 100%;
54
+
55
+ margin-top: $padding-large-vertical;
56
+ background: $brand-primary;
57
+ color: white;
58
+ height: $footer-height;
59
+
60
+ padding: $padding-large-vertical $padding-large-horizontal;
61
+
62
+ a {
63
+ color: white;
64
+ }
65
+ }
66
+ """
67
+ )
68
+ end
69
+
70
+ it 'sets up sass' do
71
+ subject.options = { 'framework' => 'jekyll' }
72
+ subject.generate 'dummy_app'
73
+
74
+ expect('dummy_app/css/styles.scss').to have_content (
75
+ """
76
+ ---
77
+ ---
78
+ @import 'bootstrap';
79
+ @import 'variables';
80
+ @import 'fonts';
81
+ @import 'colours';
82
+ @import 'footer';
83
+ //@import 'github-corner';
84
+
85
+ h1 {
86
+ color: $brand-primary;
87
+ font-family: $font-primary;
88
+ }
89
+ """
90
+ )
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,45 @@
1
+ module Skellington
2
+ describe CLI, troublesome: true do
3
+ let :subject do
4
+ described_class.new
5
+ end
6
+
7
+ it 'installs bootstrap 4' do
8
+ subject.options = { 'framework' => 'jekyll', 'bootstrap' => 4 }
9
+ subject.generate 'dummy_app'
10
+
11
+ # expect(Dir).to exist 'dummy_app/javascripts/bootstrap'
12
+ # expect('dummy_app/javascripts/bootstrap.min.js').to have_content (
13
+ # """
14
+ # /*!
15
+ # * Bootstrap v4.0.0-alpha.5 (https://getbootstrap.com)
16
+ # * Copyright 2011-2016 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
17
+ # * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
+ # */
19
+ # """
20
+ # )
21
+
22
+ expect(Dir).to exist 'dummy_app/_sass/bootstrap'
23
+ expect('dummy_app/_sass/bootstrap.scss').to have_content (
24
+ """
25
+ /*!
26
+ * Bootstrap v4.0.0-alpha.5 (https://getbootstrap.com)
27
+ * Copyright 2011-2016 The Bootstrap Authors
28
+ * Copyright 2011-2016 Twitter, Inc.
29
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
30
+ */
31
+ """
32
+ )
33
+ expect('dummy_app/_sass/colours.scss').to have_content (
34
+ """
35
+ $brand-primary: rgba(250, 129, 0, 1);
36
+ """
37
+ )
38
+ expect('dummy_app/_sass/fonts.scss').to have_content (
39
+ """
40
+ $font-primary: 'Ubuntu Mono';
41
+ """
42
+ )
43
+ end
44
+ end
45
+ end
@@ -15,7 +15,7 @@ Now do
15
15
  bundle
16
16
  bundle exec jekyll serve
17
17
 
18
- which will launch the site \(at http:\/\/localhost:4000\)
18
+ which will launch the site \(at http:\/\/localhost:4000\/dummy_app\/\)
19
19
 
20
20
  And presuming that works OK
21
21
 
@@ -0,0 +1,33 @@
1
+ module Skellington
2
+ describe CLI do
3
+ let :subject do
4
+ described_class.new
5
+ end
6
+
7
+ it 'creates a libs data file' do
8
+ subject.options = { 'framework' => 'jekyll' }
9
+ subject.generate 'dummy_app'
10
+
11
+ expect(Dir).to exist 'dummy_app/_data'
12
+ expect('dummy_app/_data/libs.yml').to have_content (
13
+ """
14
+ js:
15
+ - name: jquery
16
+ url: //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
17
+ - name: bootstrap
18
+ url: //maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js
19
+
20
+ css:
21
+ - name: foo
22
+ bar: //bar.com/baz.css
23
+
24
+ fonts:
25
+ - name: fontawesome
26
+ url: //maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css
27
+ - name: ubuntu
28
+ url: //fonts.googleapis.com/css?family=Ubuntu+Mono
29
+ """
30
+ )
31
+ end
32
+ end
33
+ end
File without changes
@@ -7,14 +7,13 @@ module Skellington
7
7
  it 'creates a default index page' do
8
8
  subject.options = { 'framework' => 'jekyll' }
9
9
  subject.generate 'dummy_app'
10
- expect(Dir).to exist 'dummy_app/index.md'
11
10
 
12
- expect('dummy_app/.gitignore').to have_content (
11
+ expect('dummy_app/index.md').to have_content (
13
12
  """
14
13
  ---
15
14
  ---
16
15
 
17
- # Hold tight DummyApp
16
+ # Hello from DummyApp
18
17
  """
19
18
  )
20
19
  end