Commit graph

54 commits

Author SHA1 Message Date
Kevin McCarthy 7608275089 Fix dynamic multi-byte utf-8 files rebuilding.
Thor compares the new contents with the existing file by using
File.binread(destination) == new_content.
File.binread returns a string with ASCII_8BIT encoding, which will not
match the new_content if new_content contains multi-byte utf-8.

This patch simply encodes the new_content to ASCII_8BIT before passing
it to Thor.
2013-03-03 18:13:41 -08:00
Ben Hollis 923697b517 Micro-optimizations around string comparisons 2013-02-09 15:21:52 -08:00
Ben Hollis 7c9c4d03db Make build error message code a bit more compact 2013-01-25 20:22:45 -08:00
Seth Vargo 95fa217cec Say middleman build instead of just middleman 2013-01-25 21:23:24 -05:00
Seth Vargo 12753c5759 add quotes and bundle exec to error message 2013-01-24 12:40:24 -05:00
Steven Sloan 17ad2caf11 also "build" .htpasswd files 2013-01-21 11:21:48 -08:00
Thomas Reynolds 7cd6cd233e Manually copy the file instead of asking Thor to do it 2013-01-02 16:40:42 -08:00
Thomas Reynolds 4eca29866b Copy binary files instead of rendering through MM. Closes #643. Closes #699 2012-12-30 20:37:40 -08:00
Thomas Reynolds 2aec04db69 Merge pull request #558 from bhollis/asset-hash-rack
Asset_hash doesn't play nice with Sprockets
2012-09-23 18:41:11 -07:00
Ben Hollis 6c241603ac Delay recalculating sitemap until absolutely necessary, avoiding redundant recalculations. 2012-09-16 19:36:47 -07:00
Ben Hollis 09ba0049d4 Fix asset_hashing assets affected by Rack middleware or mounted apps (like sprockets). Fixes #558 2012-09-11 00:08:58 -07:00
Thomas Reynolds f7fc041034 Check whether a Pathname exists before calling realpath in build. Closes #569 2012-08-20 19:28:43 -07:00
Thomas Reynolds 446aa6a4ba Clean up whitespace, play with cane for testing style quality and code complexity 2012-08-13 15:41:07 -07:00
Ben Hollis 00b590eedb Support profiling server startup and build via a --profile flag 2012-07-19 21:05:33 -07:00
Ben Hollis 62fa17cf1a Reduce work converting paths from relative to absolute and back again 2012-07-19 01:18:55 -07:00
Ben Hollis 1f22184fc7 Don't request __middleman__ 2012-07-19 01:18:55 -07:00
Thomas Reynolds de6d7980ac Use centralized Logger and add instrument methods 2012-07-18 09:30:39 -07:00
Thomas Reynolds 4b03c5e2df Add Middleman::Util.all_files_under to get a recursive listing of files beneath a path, follows symlinks. Fixes #515 2012-07-06 19:32:05 -07:00
Daniel Zuberbühler e9b996516b Fix option in build failure help message 2012-06-28 14:57:35 +02:00
Thomas Reynolds 8912d3627d Update Padrino to 0.10.7 and Thor to 0.15.3. Closes #495 2012-06-20 17:53:14 -07:00
Thomas Reynolds ddc0712c1b Say :update, not :create on automatic conflict resolution 2012-06-19 19:40:57 -07:00
Thomas Reynolds 5da63cb84f Emit identical message on build as before, removing confusion reported in #475 2012-06-17 12:11:07 -07:00
Thomas Reynolds 286c7352b6 Fix Less load paths, simplify builder error output. Fixes #461 2012-06-05 10:24:00 -07:00
Thomas Reynolds 2e5b0d75a9 Use pathname consistently in file watcher 2012-05-26 17:48:58 -07:00
Thomas Reynolds d79acc7a78 Make i18n a normal extension with options 2012-05-24 16:51:36 -07:00
Thomas Reynolds 94c5f32853 Re-arrange CLI loads for hopefully faster startup time 2012-05-24 11:18:49 -07:00
Ben Hollis 64a2933161 Remove duplicate server methods and solve webrick logging in a platform-independent way 2012-05-16 21:19:03 -07:00
Ben Hollis dddd409336 Support Unicode characters in filenames, both in source filenames and in the names of proxied paths. Fixes #332. 2012-04-29 21:42:45 -07:00
Ben Hollis a4fcb4d939 Fix the file watcher to correctly use relative paths, to ignore files we don't care about, and have a find_new_files method that works like reload_path, but only touches previously-unknown files. This all ends up speeding up the build by a lot. 2012-04-23 01:17:13 -07:00
Thomas Reynolds 9730425caa Missing comma in Thor::Error 2012-04-16 15:08:44 -07:00
Thomas Reynolds d2d40079cc Rename Middleman::Base to Middleman::Application 2012-04-14 14:04:10 -07:00
Thomas Reynolds d935aedd59 Sitemap refactor 2012-04-14 13:17:42 -07:00
Thomas Reynolds b1ba94cf22 Merge pull request #346 from bhollis/master
Provide a stack trace for build errors
2012-04-08 08:39:40 -07:00
Ben Hollis 4c0c638892 Provide a stack trace for build errors 2012-04-07 20:00:56 -07:00
Ben Hollis fc79459e61 Fix the asset_hash extension to operate on the hash of the rendered output rather than just the source file. This prevents generating the same hash for a file when partials it uses change, or if a helper it uses produces different output. As part of this change I removed the caching from Sitemap::Page#destination_path and asset_hash since they were preventing recalculation of path/hash when partials changed, and I rewrote the Sprockets extension to expose the Sprockets environment to other extension, which included consolidating the JS and CSS Sprockets environments into one. 2012-04-04 00:00:33 -07:00
Ben Hollis bacffeea02 Tell Thor to return the right exit code on failure 2012-03-18 17:30:35 -06:00
Ben Hollis 6f4e863091 Expose errors to users during build rather than burying them in output files. 2012-03-18 13:01:04 -06:00
Ben Hollis dc0249b8b9 Remove --relative CLI option in favor of just turning on relative_assets in config.rb 2012-03-04 17:30:09 -08:00
Ben Hollis ac9ae8fcee Rename tilt_template to render_to_file 2012-03-04 17:26:44 -08:00
Ben Hollis fdbd301a32 Get rid of Middleman::Sitemap::Store#all_paths and #each in favor of #pages. Dealing with page objects all over the place instead of paths provides a lot of opportunities for cleaner code. 2012-02-08 23:00:29 -08:00
Thomas Reynolds 8286879f36 sprockets-sass was overwriting image-url and breaking relative assets. Fixes #256 2012-02-05 11:43:19 -08:00
Thomas Reynolds c8c6a1938e Merge pull request #261 from bhollis/page
Callback-based rerouting
2012-02-05 10:33:25 -08:00
Ben Hollis e27e0cdd44 Directory indexes work completely now, in preview and with dotfiles. 2012-02-03 00:29:07 -08:00
Ben Hollis ca1f3ddf83 Directory indexes now work during build, with the exception of .htaccess files. 2012-02-02 21:47:54 -08:00
Ben Hollis 4ce6913baf The beginnings of refactoring page rerouting. Added methods to Sitemap::Store and Sitemap::Page to collect and execute reroute callbacks, and rework builder to use page methods (simplifying it greatly in the process). All tests that don't involve directory indexes pass - next step is to make the directory index extension register its callbacks with Sitemap::Store#reroute. 2012-01-31 23:43:05 -08:00
Thomas Reynolds 251a2e0eb3 add failing tests for compass relative assets 2012-01-31 21:30:45 -08:00
Thomas Reynolds d1f0e6f616 fix errant MM bootup during CLI. Make an autodiscoverable tasks/ directory 2012-01-16 14:55:08 -08:00
Thomas Reynolds e3b15366cb ignore globs, mostly working, except with directory indexes 2012-01-14 14:09:20 -08:00
Thomas Reynolds d0dd60fb4b left some debug messages in 2012-01-07 23:48:22 -08:00
Thomas Reynolds 0ac9c0b662 document sitemap, make ignore accept paths, regexps and blocks 2012-01-07 16:57:50 -08:00