In nanoc, using File.read
directly is a bad idea, because it bypasses the dependency tracking and causes site recompilation to yield erroneous results.
This file contains hidden or 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
Checking sizeof(short): 2 bytes | |
Checking sizeof(int): 4 bytes | |
Checking sizeof(void*): 8 bytes | |
Checking sizeof(size_t): 8 bytes | |
Checking sizeof(long): 8 bytes | |
Checking sizeof(long long): 8 bytes | |
Checking sizeof(float): 4 bytes | |
Checking sizeof(double): 8 bytes | |
Checking sizeof(off_t): 8 bytes | |
Checking sizeof(time_t): 8 bytes |
This file contains hidden or 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
require 'minitest' | |
require 'minitest/autorun' | |
require 'tmpdir' | |
require 'fileutils' | |
class SymlinksNotResolvedTest < Minitest::Test | |
def test_symlinks_not_resolved | |
Dir.mktmpdir do |dirname| | |
FileUtils.cd(dirname) do |
This file contains hidden or 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
# encoding: utf-8 | |
module Nanoc | |
############################################################################# | |
class ItemChange | |
attr_reader :identifier |
This file contains hidden or 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
require 'set' | |
class FullSubset | |
def +(other) | |
self | |
end | |
def inspect | |
"<FullSubset>" |
This file contains hidden or 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
\defaultfontfeatures{Mapping=tex-text} | |
\setromanfont[Mapping=tex-text]{GentiumBasic} | |
\setsansfont{ITC Franklin Gothic LT Medium} | |
\setmonofont{Consolas} | |
%%%%%%%%%% | |
\clubpenalty=10000 | |
\widowpenalty=10000 |
This file contains hidden or 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
func pointsAtDistance(a, b, c s5t.Point, d float64) (s5t.Point, s5t.Point) { | |
// Slope of A-B | |
slope := (b.Y - a.Y) / (b.X - a.X) | |
// Slope of line perpendicular to A-B | |
perpSlope := -1 / slope | |
// X components of intersection of circle with radius d with line perpendicular to A-B through C | |
xd := d / math.Sqrt(1+math.Pow(perpSlope, 2.0)) | |
newX1 := c.X + xd |
This file contains hidden or 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
# encoding: utf-8 | |
class FilesystemWithRelocatedContent < Nanoc::DataSources::FilesystemUnified | |
identifier :filesystem_with_relocated_content | |
def items | |
load_objects('../content', 'item', Nanoc::Item) | |
end |