diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..437459c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.5.0 diff --git a/README.md b/README.md index 2ae4edc..eabab5d 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@ Extremely opinionated generator for your [Sinatra](http://www.sinatrarb.com/) a * Sinatra * [Rspec](http://rspec.info/) * [Jasmine](http://jasmine.github.io/2.0/introduction.html) - * [Bootstrap](http://getbootstrap.com/) - * [Compass](http://compass-style.org/) + * [Bootstrap 4](http://getbootstrap.com/) + * [Sass](https://sass-lang.com/) * An MIT License file * A Code-of-Conduct file * Jekyll * [Jekyll](https://jekyllrb.com/) - * [Bootstrap](http://getbootstrap.com/) + * [Bootstrap 4](http://getbootstrap.com/) * Reasonable default things * An MIT License file * A Code-of-Conduct file @@ -104,12 +104,6 @@ or just * Default: sinatra * Possible values: sinatra, jekyll -* --bootstrap - * Bootstrap major version to include - * Default: 3 - * Possible values: 3, 4 - * VERY EXPERIMENTAL - * --licensor * Name to include in the license file diff --git a/Rakefile b/Rakefile index bd8fa43..4d5373b 100644 --- a/Rakefile +++ b/Rakefile @@ -3,36 +3,6 @@ require 'rspec/core/rake_task' require 'coveralls/rake/task' Coveralls::RakeTask.new +RSpec::Core::RakeTask.new -namespace :specs do - desc 'run the trustworthy specs' - task :safe do - RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = "--tag ~troublesome" - end - Rake::Task['spec'].execute - end - - desc 'run the shonky specs' - task :shaky do - RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = "--tag troublesome" - end - Rake::Task['spec'].execute - end - - desc 'run all the specs' - task :all do - RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = "--tag troublesome" - end - - RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = "--tag ~troublesome" - end - - Rake::Task['spec'].execute - end -end - -task :default => ['specs:all', 'coveralls:push'] +task :default => [:spec, 'coveralls:push'] diff --git a/config/config.yaml b/config/config.yaml index 3afa5ed..2c73a4c 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -15,7 +15,7 @@ sinatra: rack-tracker: rake: compass: - bootstrap-sass: + bootstrap: erubis: puma: test: @@ -41,7 +41,6 @@ sinatra: Procfile: .rspec: config.ru: - config.rb: config/config.yml: # the template has this name lib/app.rb: @@ -98,12 +97,10 @@ sinatra: public/sass/_colours.scss: common: sass/colours public/sass/styles.scss: - common: sass/styles jekyll: gems: github-pages: - # bootstrap: '4.0.0.alpha4' rake: files: @@ -118,16 +115,15 @@ jekyll: common: includes/nav _includes/footer.html: common: includes/footer + _includes/libs.html: + common: includes/libs _includes/ie-cruft.html: common: includes/ie-cruft css/styles.scss: - common: sass/styles _sass/variables.scss: common: sass/variables _sass/colours.scss: common: sass/colours - _sass/nav.scss: - common: sass/nav _sass/palettes/default.scss: common: sass/palettes/default _sass/fonts.scss: @@ -139,3 +135,21 @@ jekyll: js/app.js: outpath: app/wormname common: js/app.js + +bootstrap: + js: + - name: jquery + url: //code.jquery.com/jquery-VERSION.slim.min.js + version: 3.2.1 + hash: sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN + - name: popper + url: //cdnjs.cloudflare.com/ajax/libs/popper.js/VERSION/umd/popper.min.js + version: 1.12.9 + hash: sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q + - name: bootstrap + url: //maxcdn.bootstrapcdn.com/bootstrap/VERSION/js/bootstrap.min.js + version: 4.0.0 + hash: sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl + - name: fontawesome + url: //use.fontawesome.com/releases/vVERSION/js/all.js + version: 5.0.4 diff --git a/lib/skellington.rb b/lib/skellington.rb index c5b246d..06ab604 100644 --- a/lib/skellington.rb +++ b/lib/skellington.rb @@ -3,7 +3,7 @@ require 'fileutils' require 'erubis' require 'git' -require 'bootstrap-sass' +require 'bootstrap' require 'skellington/version' require 'skellington/generator' diff --git a/lib/skellington/cli.rb b/lib/skellington/cli.rb index 8726aa2..1338df0 100644 --- a/lib/skellington/cli.rb +++ b/lib/skellington/cli.rb @@ -11,10 +11,6 @@ def version default: 'sinatra', description: 'Framework to generate for', enum: ['sinatra', 'jekyll'] - method_option :bootstrap, - default: '3', - description: 'Bootstrap major version to use *VERY EXPERIMENTAL*', - enum: ['3', '4'] method_option :licensor, aliases: '-l', description: 'Name to insert into the license file' diff --git a/lib/skellington/generator.rb b/lib/skellington/generator.rb index 2f70d8d..7e2d554 100644 --- a/lib/skellington/generator.rb +++ b/lib/skellington/generator.rb @@ -6,13 +6,11 @@ class Generator :camelname, :files, :gems, - :framework, - :bootstrap + :framework attr_accessor :licensor def initialize path, options = {} @framework = options.fetch('framework', 'sinatra') - @bootstrap = options.fetch('bootstrap', 3).to_s @full_path = path @path = File.dirname @full_path @filename = File.basename(@full_path) @@ -46,18 +44,11 @@ def generate end def strap_boots - if @framework == 'jekyll' - if @bootstrap == '4' - Object.send(:remove_const, :Bootstrap) - require 'bootstrap' - end + root = "#{self.path}/#{self.wormname}" - root = "#{self.path}/#{self.wormname}" - - FileUtils.mkdir_p "#{root}/_sass" - FileUtils.cp_r "#{Bootstrap.assets_path}/stylesheets/bootstrap", "#{root}/_sass" - FileUtils.cp "#{Bootstrap.assets_path}/stylesheets/_bootstrap.scss", "#{root}/_sass/bootstrap.scss" - end + FileUtils.mkdir_p "#{root}/_sass" + FileUtils.cp_r "#{Bootstrap.assets_path}/stylesheets/bootstrap", "#{root}/_sass" + FileUtils.cp "#{Bootstrap.assets_path}/stylesheets/_bootstrap.scss", "#{root}/_sass/bootstrap.scss" end def wormname diff --git a/lib/skellington/helpers.rb b/lib/skellington/helpers.rb index cfac30e..c2c7c0a 100644 --- a/lib/skellington/helpers.rb +++ b/lib/skellington/helpers.rb @@ -7,4 +7,21 @@ def self.unslash word return word[2..-1] if word[0..1] == './' word end + + def self.js_for_sinatra data + s = [' %s: {' % data['name']] + s.push " url: '%s'," % (data['url'].sub 'VERSION', data['version']) + s.push " hash: '%s'" % data['hash'] + s.push ' }' + + s.join "\n" + end + + def self.js_for_jekyll data + s = [' - name: %s' % data['name']] + s.push " url: %s" % (data['url'].sub 'VERSION', data['version']) + s.push " hash: %s" % data['hash'] if data['hash'] + + s.join "\n" + end end diff --git a/lib/skellington/version.rb b/lib/skellington/version.rb index 96bd605..0b12ca0 100644 --- a/lib/skellington/version.rb +++ b/lib/skellington/version.rb @@ -1,3 +1,3 @@ module Skellington - VERSION = '0.8.9' + VERSION = '0.9.0' end diff --git a/lib/templates/common/Gemfile b/lib/templates/common/Gemfile index 4499ec3..2036499 100644 --- a/lib/templates/common/Gemfile +++ b/lib/templates/common/Gemfile @@ -1,9 +1,3 @@ -<% if @gen.framework == 'sinatra' %> - <% if @gen.bootstrap == '4' %> - <% @gen.gems['production'].delete 'bootstrap-sass' %> - <% @gen.gems['production']['bootstrap'] = '4.0.0.alpha5' %> - <% end %> -<% end %> source 'https://rubygems.org' ruby '<%= RUBY_VERSION %>' diff --git a/lib/templates/common/includes/footer b/lib/templates/common/includes/footer index 58bfc0c..6217a95 100644 --- a/lib/templates/common/includes/footer +++ b/lib/templates/common/includes/footer @@ -1,4 +1,4 @@ -