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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Configuration#dig() and ConfigView#dig() #1221

Merged
merged 1 commit into from Sep 22, 2017

Conversation

Projects
None yet
2 participants
@gpakosz
Member

gpakosz commented Sep 21, 2017

Getting closer to winning your eternal gratitude 馃槃

# @see Hash#dig
def dig(*keys)
@context.dependency_tracker.bounce(unwrap, attributes: keys)

This comment has been minimized.

@ddfreyne

ddfreyne Sep 22, 2017

Member

attributes is a list of top-level attributes that are touched, so this should be keys.first instead. Nanoc only tracks dependencies of keys one level deep.

(keys will also work, but generate unnecessary dependencies.)

@ddfreyne

ddfreyne Sep 22, 2017

Member

attributes is a list of top-level attributes that are touched, so this should be keys.first instead. Nanoc only tracks dependencies of keys one level deep.

(keys will also work, but generate unnecessary dependencies.)

context 'with non-existing keys' do
let(:keys) { %i[foo baz bar] }
it { is_expected.to eql(nil) }

This comment has been minimized.

@ddfreyne

ddfreyne Sep 22, 2017

Member

Prefer be_nil over eql(nil)

@ddfreyne

ddfreyne Sep 22, 2017

Member

Prefer be_nil over eql(nil)

@ddfreyne ddfreyne merged commit fbb8f96 into nanoc:master Sep 22, 2017

3 checks passed

codecov/patch 100% of diff hit (target 98.71%)
Details
codecov/project 98.72% (+<.01%) compared to e6d5c6e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 22, 2017

Member

I鈥檝e applied the changes and merged it into master! Thanks for the quick contribution!

Member

ddfreyne commented Sep 22, 2017

I鈥檝e applied the changes and merged it into master! Thanks for the quick contribution!

@gpakosz

This comment has been minimized.

Show comment
Hide comment
@gpakosz

gpakosz Sep 22, 2017

Member

Thanks for the merge!

Member

gpakosz commented Sep 22, 2017

Thanks for the merge!

@gpakosz gpakosz deleted the gpakosz:feature/config-dig branch Sep 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment