Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store temp data per output dir #1071

Merged
merged 12 commits into from Jan 19, 2017

Write temp data to dir with hashed name

  • Loading branch information...
ddfreyne committed Jan 17, 2017
commit 12d7586b9aa1ad1cbfa1d76fdde9f405b1fbabd8
Copy path View file
@@ -41,7 +41,8 @@ def initialize(filename, version)
contract C::KeywordArgs[site: C::Maybe[Nanoc::Int::Site], store_name: String] => String
def self.tmp_path_for(store_name:, site:)
env_name = site ? site.config.env_name : nil
File.join('tmp', env_name.to_s, store_name)
dir = env_name ? Digest::SHA1.hexdigest(env_name)[0..20] : ''
File.join('tmp', dir, store_name)
end

# @group Loading and storing data
@@ -18,7 +18,7 @@

context 'env specified' do
let(:config) { Nanoc::Int::Configuration.new(env_name: 'staging', hash: { 'foo' => 'bar' }) }
it { is_expected.to eql('tmp/staging/giraffes') }
it { is_expected.to eql('tmp/d9390b2c40115621a7949/giraffes') }
end
end
end
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.