-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pulling in 5.5.3.2. - adding relevant amends
# By Mehdi Lahmam (11) and others # Via Arthur (3) and others * 'master' of github.com:zurb/foundation-rails: (24 commits) Version up to 5.5.3.2 5.5.3.1 Updating to 5.5.3 ruby version number change for deploy Publishing 5.5.3 explicitly write core foundation first, only append modules Bump to 5.5.2.1 Add a `.ruby-version` file setting Ruby version to 2.2.1 Fix the generator class path by moving it to it's standard path. Because: Rails wasn't picking up the generator when used in an engine as it wasn't namespaced as expected. Add a Travis CI config file Add RSpec based specs. Because: We encountered lately too much 💥 that could be avoided. Add a dummy style guide view, based ons Foundation docs' Kitchen Sink This help us to quickly verify everything is Ok inside a Rails app. We were relying before on `foundation-rails` style guide as a mounted engine, which was causing problems. Run `rails g foundation:install` in the test dummy app Replace test dummy app by a newer one with Rails 4.2 and Foundation 5.5 Correct JavaScript files require order. Bumoing Version & Code Bumping Version Bumping Version Bump to 5.5.1.2 Require 'foundation' before the rest of the JS files ... Conflicts: vendor/assets/stylesheets/foundation/components/_forms.scss vendor/assets/stylesheets/foundation/components/_offcanvas.scss
- Loading branch information
Showing
137 changed files
with
3,838 additions
and
4,838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
language: ruby | ||
rvm: 2.2.1 | ||
cache: bundler | ||
sudo: false | ||
before_install: | ||
- "echo '--colour' > ~/.rspec" | ||
install: bundle install | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
require "bundler/gem_tasks" | ||
require 'bundler/setup' | ||
require 'bundler/gem_tasks' | ||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:rspec) | ||
|
||
desc 'Run the test suite' | ||
task :default => :rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "foundation-rails", | ||
"version": "5.5.1.1", | ||
"version": "5.5.3.2", | ||
"dependencies": { | ||
"foundation": "5.5.1" | ||
"foundation": "5.5.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
require 'foundation/rails/engine' | ||
require 'foundation/rails/version' | ||
require 'foundation/rails/generators/install_generator' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Foundation | ||
module Rails | ||
VERSION = "5.5.1.0" | ||
VERSION = "5.5.3.2" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
require 'rails/generators' | ||
|
||
module Foundation | ||
module Generators | ||
class InstallGenerator < ::Rails::Generators::Base | ||
source_root File.join(File.dirname(__FILE__), 'templates') | ||
argument :layout_name, :type => :string, :default => 'application', :banner => 'layout_name' | ||
|
||
class_option :haml, :desc => 'Generate HAML layout instead of erb', :type => :boolean | ||
class_option :slim, :desc => 'Generate Slim layout instead of erb', :type => :boolean | ||
|
||
def add_assets | ||
# rails_ujs breaks, need to incorporate rails-behavior plugin for this to work seamlessly | ||
# gsub_file "app/assets/javascripts/application#{detect_js_format[0]}", /\/\/= require jquery\n/, "" | ||
insert_into_file File.join(javascripts_base_dir, "application#{detect_js_format[0]}"), "#{detect_js_format[1]} require foundation\n", :after => "jquery_ujs\n" | ||
append_to_file File.join(javascripts_base_dir, "application#{detect_js_format[0]}"), "#{detect_js_format[2]}" | ||
settings_file = File.join(File.dirname(__FILE__),"..", "..", "..", "vendor", "assets", "stylesheets", "foundation", "_settings.scss") | ||
create_file File.join(stylesheets_base_dir, 'foundation_and_overrides.scss'), File.read(settings_file) | ||
append_to_file File.join(stylesheets_base_dir, 'foundation_and_overrides.scss'), "\n@import 'foundation';\n" | ||
insert_into_file File.join(stylesheets_base_dir, "application#{detect_css_format[0]}"), "\n#{detect_css_format[1]} require foundation_and_overrides\n", :after => "require_self" | ||
end | ||
|
||
def detect_js_format | ||
return ['.coffee', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?(File.join(javascripts_base_dir, 'application.coffee')) | ||
return ['.coffee.erb', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?(File.join(javascripts_base_dir, 'application.coffee.erb')) | ||
return ['.js.coffee', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?(File.join(javascripts_base_dir, 'application.js.coffee')) | ||
return ['.js.coffee.erb', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?(File.join(javascripts_base_dir, 'application.js.coffee.erb')) | ||
return ['.js', '//=', "\n$(function(){ $(document).foundation(); });\n"] if File.exist?(File.join(javascripts_base_dir, 'application.js')) | ||
return ['.js.erb', '//=', "\n$(function(){ $(document).foundation(); });\n"] if File.exist?(File.join(javascripts_base_dir, 'application.js.erb')) | ||
end | ||
|
||
def detect_css_format | ||
return ['.css', ' *='] if File.exist?(File.join(stylesheets_base_dir, 'application.css')) | ||
return ['.css.sass', ' //='] if File.exist?(File.join(stylesheets_base_dir, 'application.css.sass')) | ||
return ['.sass', ' //='] if File.exist?(File.join(stylesheets_base_dir, 'application.sass')) | ||
return ['.css.scss', ' //='] if File.exist?(File.join(stylesheets_base_dir, 'application.css.scss')) | ||
return ['.scss', ' //='] if File.exist?(File.join(stylesheets_base_dir, 'application.scss')) | ||
end | ||
|
||
def create_layout | ||
if options.haml?||(defined?(Haml) && options.haml?) | ||
template 'application.html.haml', File.join(layouts_base_dir, "#{file_name}.html.haml") | ||
elsif options.slim?||(defined?(Slim) && options.slim?) | ||
template 'application.html.slim', File.join(layouts_base_dir, "#{file_name}.html.slim") | ||
else | ||
template 'application.html.erb', File.join(layouts_base_dir, "#{file_name}.html.erb") | ||
end | ||
end | ||
|
||
private | ||
|
||
def file_name | ||
layout_name.underscore.downcase | ||
end | ||
|
||
def javascripts_base_dir | ||
File.join('app', 'assets', 'javascripts') | ||
end | ||
|
||
def stylesheets_base_dir | ||
File.join('app', 'assets', 'stylesheets') | ||
end | ||
|
||
def layouts_base_dir | ||
File.join('app', 'views', 'layouts') | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'spec_helper' | ||
|
||
feature 'Foundation install succeeds' do | ||
scenario 'stylesheets assets files are added' do | ||
application_css_file = IO.read("#{dummy_app_path}/app/assets/stylesheets/application.css") | ||
|
||
expect(File).to exist("#{dummy_app_path}/app/assets/stylesheets/foundation_and_overrides.scss") | ||
expect(application_css_file).to match(/require foundation_and_overrides/) | ||
end | ||
|
||
scenario 'javascripts assets files are added' do | ||
application_js_file = IO.read("#{dummy_app_path}/app/assets/javascripts/application.js") | ||
|
||
expect(application_js_file).to match(/require foundation/) | ||
expect(application_js_file).to match(Regexp.new(Regexp.escape('$(function(){ $(document).foundation(); });'))) | ||
end | ||
|
||
scenario 'layout file loads assets' do | ||
layout_file = IO.read("#{dummy_app_path}/app/views/layouts/application.html.erb") | ||
|
||
expect(layout_file).to match(/stylesheet_link_tag "application"/) | ||
expect(layout_file).to match(/javascript_include_tag "vendor\/modernizr"/) | ||
expect(layout_file).to match(/javascript_include_tag "application/) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'capybara/rspec' | ||
require 'bundler/setup' | ||
|
||
Bundler.require(:default, :test) | ||
|
||
Dir['./spec/support/**/*.rb'].each { |file| require file } | ||
|
||
RSpec.configure do |config| | ||
config.include FoundationRailsTestHelpers | ||
|
||
config.before(:all) do | ||
create_dummy_app | ||
install_foundation | ||
end | ||
|
||
config.after(:all) do | ||
remove_dummy_app | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module FoundationRailsTestHelpers | ||
def create_dummy_app | ||
FileUtils.cd(tmp_path) do | ||
%x(rails new dummy --skip-active-record --skip-test-unit --skip-spring) | ||
end | ||
end | ||
|
||
def remove_dummy_app | ||
FileUtils.rm_rf(dummy_app_path) | ||
end | ||
|
||
def install_foundation | ||
FileUtils.cd(dummy_app_path) do | ||
%x(rails g foundation:install -f 2>&1) | ||
end | ||
end | ||
|
||
def dummy_app_path | ||
File.join(tmp_path, 'dummy') | ||
end | ||
|
||
def tmp_path | ||
@tmp_path ||= File.join(File.dirname(__FILE__), '..') | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
test/dummy/app/assets/stylesheets/foundation_and_overrides.scss
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.