diff --git a/Gemfile b/Gemfile index 59a0f87a..3a355227 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ group :development do gem "rake", "~> 0.9.2" gem "rspec", "~> 2.7" gem "rdoc", "~> 3.9" - gem "yard" + # gem "yard" end group :test do @@ -15,8 +15,9 @@ group :test do gem "slim" gem "coffee-filter", "~> 0.1.1" gem "liquid", "~> 2.2" - gem "jquery-rails" - gem "bootstrap-rails", "0.0.5" + gem "jquery-rails", "~> 2.0.0" + # gem "bootstrap-rails", "0.0.5" + # gem "zurb-foundation" end gem "middleman-core", :path => "middleman-core" diff --git a/Rakefile b/Rakefile index 47e21e80..1435472a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ require 'rubygems' unless defined?(Gem) # require 'fileutils' unless defined?(FileUtils) require 'rake' -require 'yard' +# require 'yard' require File.expand_path("../middleman-core/lib/middleman-core/version.rb", __FILE__) @@ -84,7 +84,7 @@ end desc "Run tests for all middleman gems" task :default => :test -desc "Generate documentation" -task :doc do - YARD::CLI::Yardoc.new.run -end \ No newline at end of file +# desc "Generate documentation" +# task :doc do +# YARD::CLI::Yardoc.new.run +# end \ No newline at end of file diff --git a/gem_rake_helper.rb b/gem_rake_helper.rb index d4fe0f51..fe3ea4b4 100644 --- a/gem_rake_helper.rb +++ b/gem_rake_helper.rb @@ -1,7 +1,7 @@ require 'rubygems' unless defined?(Gem) require 'rake' require 'cucumber/rake/task' -require 'yard' +# require 'yard' require 'bundler' Bundler::GemHelper.install_tasks :name => GEM_NAME @@ -20,6 +20,6 @@ Cucumber::Rake::Task.new(:test, 'Run features that should pass') do |t| t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}" end -YARD::Rake::YardocTask.new +# YARD::Rake::YardocTask.new task :default => :test \ No newline at end of file diff --git a/middleman-core/features/builder.feature b/middleman-core/features/builder.feature index 2bc6dc62..f833b8bc 100644 --- a/middleman-core/features/builder.feature +++ b/middleman-core/features/builder.feature @@ -17,7 +17,6 @@ Feature: Builder Then the following files should not exist: | _partial | | layout | - | other_layout | | layouts/custom | | layouts/content_for | diff --git a/middleman-core/features/extensionless_text_files.feature b/middleman-core/features/extensionless_text_files.feature new file mode 100644 index 00000000..a544f2e0 --- /dev/null +++ b/middleman-core/features/extensionless_text_files.feature @@ -0,0 +1,58 @@ +Feature: Text Files Without Extensions Should Build and Preview + + Scenario: Building Text Files without directory indexes + + Given a fixture app "extensionless-text-files-app" + And a file named "config.rb" with: + """ + """ + And a successfully built app at "extensionless-text-files-app" + When I cd to "build" + Then the following files should exist: + | CNAME | + | LICENSE | + | README | + + Scenario: Building Text Files with directory indexes + + Given a fixture app "extensionless-text-files-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + """ + And a successfully built app at "extensionless-text-files-app" + When I cd to "build" + Then the following files should exist: + | CNAME | + | LICENSE | + | README | + Then the following files should not exist: + | CNAME/index.html | + | LICENSE/index.html | + | README/index.html | + + Scenario: Previewing Text Files without directory indexes + Given "directory_indexes" feature is "disabled" + Given the Server is running at "extensionless-text-files-app" + When I go to "/CNAME" + Then I should see "test.github.com" + When I go to "/LICENSE" + Then I should see "You have the right to remain classy." + When I go to "/README" + Then I should see "Bork bork bork" + + Scenario: Previewing Text Files with directory indexes + Given "directory_indexes" feature is "enabled" + Given the Server is running at "extensionless-text-files-app" + When I go to "/CNAME" + Then I should see "test.github.com" + When I go to "/LICENSE" + Then I should see "You have the right to remain classy." + When I go to "/README" + Then I should see "Bork bork bork" + # When I go to "/CNAME/index.html" + # Then I should see "File Not Found" + # When I go to "/LICENSE/index.html" + # Then I should see "File Not Found" + # When I go to "/README/index.html" + # Then I should see "File Not Found" \ No newline at end of file diff --git a/middleman-core/fixtures/extensionless-text-files-app/config.rb b/middleman-core/fixtures/extensionless-text-files-app/config.rb new file mode 100644 index 00000000..e69de29b diff --git a/middleman-core/fixtures/extensionless-text-files-app/source/CNAME b/middleman-core/fixtures/extensionless-text-files-app/source/CNAME new file mode 100644 index 00000000..c8dc4813 --- /dev/null +++ b/middleman-core/fixtures/extensionless-text-files-app/source/CNAME @@ -0,0 +1 @@ +test.github.com \ No newline at end of file diff --git a/middleman-core/fixtures/extensionless-text-files-app/source/LICENSE b/middleman-core/fixtures/extensionless-text-files-app/source/LICENSE new file mode 100644 index 00000000..8bf82c48 --- /dev/null +++ b/middleman-core/fixtures/extensionless-text-files-app/source/LICENSE @@ -0,0 +1 @@ +You have the right to remain classy. \ No newline at end of file diff --git a/middleman-core/fixtures/extensionless-text-files-app/source/README b/middleman-core/fixtures/extensionless-text-files-app/source/README new file mode 100644 index 00000000..44c2bac0 --- /dev/null +++ b/middleman-core/fixtures/extensionless-text-files-app/source/README @@ -0,0 +1 @@ +Bork bork bork \ No newline at end of file diff --git a/middleman-core/fixtures/extensionless-text-files-app/source/index.html b/middleman-core/fixtures/extensionless-text-files-app/source/index.html new file mode 100644 index 00000000..0b90e2b8 --- /dev/null +++ b/middleman-core/fixtures/extensionless-text-files-app/source/index.html @@ -0,0 +1 @@ +sup \ No newline at end of file diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/alternate.erb b/middleman-core/fixtures/frontmatter-settings-app/source/layouts/alternate.erb similarity index 100% rename from middleman-core/fixtures/frontmatter-settings-app/source/alternate.erb rename to middleman-core/fixtures/frontmatter-settings-app/source/layouts/alternate.erb diff --git a/middleman-core/lib/middleman-core/core_extensions/sitemap.rb b/middleman-core/lib/middleman-core/core_extensions/sitemap.rb index 4366d976..188b26c1 100644 --- a/middleman-core/lib/middleman-core/core_extensions/sitemap.rb +++ b/middleman-core/lib/middleman-core/core_extensions/sitemap.rb @@ -19,8 +19,12 @@ module Middleman::CoreExtensions::Sitemap # Files starting with an underscore, but not a double-underscore :partials => proc { |file, path| (file.match(/\/_/) && !file.match(/\/__/)) }, + :layout => proc { |file, path| + file.match(/^source\/layout\./) || file.match(/^source\/layouts\//) + }, + # Files without any output extension (layouts, partials) - :extensionless => proc { |file, path| !path.match(/\./) }, + # :extensionless => proc { |file, path| !path.match(/\./) }, } # Include instance methods diff --git a/middleman-core/lib/middleman-core/sitemap/store.rb b/middleman-core/lib/middleman-core/sitemap/store.rb index f1c19575..245c74d4 100644 --- a/middleman-core/lib/middleman-core/sitemap/store.rb +++ b/middleman-core/lib/middleman-core/sitemap/store.rb @@ -88,7 +88,10 @@ module Middleman::Sitemap def page_by_destination(destination_path) # TODO: memoize this destination_path = normalize_path(destination_path) - pages.find {|p| p.destination_path == destination_path } + pages.find do |p| + p.destination_path == destination_path || + p.destination_path == destination_path.sub("/#{@app.index_file}", "") + end end # Whether a path is ignored diff --git a/middleman-core/middleman-core.gemspec b/middleman-core/middleman-core.gemspec index 09df535b..9876ce08 100644 --- a/middleman-core/middleman-core.gemspec +++ b/middleman-core/middleman-core.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.require_path = "lib" # Core - s.add_dependency("rack", ["~> 1.3.5"]) + s.add_dependency("rack", ["~> 1.4.0"]) s.add_dependency("tilt", ["~> 1.3.1"]) # Builder @@ -29,7 +29,7 @@ Gem::Specification.new do |s| s.add_dependency("thor", ["~> 0.14.0"]) # Helpers - s.add_dependency("activesupport", ["~> 3.1.0"]) + s.add_dependency("activesupport", ["~> 3.2.0"]) # Watcher s.add_dependency("fssm", ["~> 0.2.8"]) diff --git a/middleman-more/middleman-more.gemspec b/middleman-more/middleman-more.gemspec index b982be44..7c1560b9 100644 --- a/middleman-more/middleman-more.gemspec +++ b/middleman-more/middleman-more.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.add_dependency("sass", ["~> 3.1.7"]) s.add_dependency("compass", ["0.12.rc.1"]) s.add_dependency("coffee-script", ["~> 2.2.0"]) - s.add_dependency("execjs", ["~> 1.2.7"]) + s.add_dependency("execjs", ["~> 1.2"]) s.add_dependency("sprockets", ["~> 2.1.0"]) s.add_dependency("sprockets-sass", ["~> 0.6.0"]) s.add_dependency("redcarpet", ["~> 2.0.0"])