Skip to content

Commit

Permalink
Refactor: Rename #attributes2_checksum_for
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Mar 27, 2017
1 parent e7a97a3 commit 52ea0c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/nanoc/base/repos/checksum_store.rb
Expand Up @@ -28,7 +28,7 @@ def [](obj)
def add(obj)
if obj.is_a?(Nanoc::Int::Document)
@checksums[[obj.reference, :content]] = Nanoc::Int::Checksummer.calc_for_content_of(obj)
@checksums[[obj.reference, :attributes2]] = Nanoc::Int::Checksummer.calc_for_each_attribute_of(obj)
@checksums[[obj.reference, :each_attribute]] = Nanoc::Int::Checksummer.calc_for_each_attribute_of(obj)
end

@checksums[obj.reference] = Nanoc::Int::Checksummer.calc(obj)
Expand All @@ -42,8 +42,8 @@ def content_checksum_for(obj)
end

contract c_obj => C::Maybe[C::HashOf[Symbol, String]]
def attributes2_checksum_for(obj)
@checksums[[obj.reference, :attributes2]]
def attributes_checksum_for(obj)
@checksums[[obj.reference, :each_attribute]]
end

protected
Expand Down
2 changes: 1 addition & 1 deletion lib/nanoc/base/services/outdatedness_rules.rb
Expand Up @@ -85,7 +85,7 @@ def apply(obj, outdatedness_checker)
when Nanoc::Int::ItemRep
apply(obj.item, outdatedness_checker)
when Nanoc::Int::Item, Nanoc::Int::Layout
old_checksums = outdatedness_checker.checksum_store.attributes2_checksum_for(obj)
old_checksums = outdatedness_checker.checksum_store.attributes_checksum_for(obj)
unless old_checksums
return Nanoc::Int::OutdatednessReasons::AttributesModified.new(true)
end
Expand Down
10 changes: 5 additions & 5 deletions spec/nanoc/base/repos/checksum_store_spec.rb
Expand Up @@ -19,7 +19,7 @@
end

it 'has no attributes checksum' do
expect(store.attributes2_checksum_for(item)).to be_nil
expect(store.attributes_checksum_for(item)).to be_nil
end
end

Expand All @@ -35,7 +35,7 @@
end

it 'has no attributes checksum' do
expect(store.attributes2_checksum_for(code_snippet)).to be_nil
expect(store.attributes_checksum_for(code_snippet)).to be_nil
end

context 'after storing and loading' do
Expand All @@ -62,7 +62,7 @@
end

it 'has no attributes checksum' do
expect(store.attributes2_checksum_for(other_code_snippet)).to be_nil
expect(store.attributes_checksum_for(other_code_snippet)).to be_nil
end

context 'after storing and loading' do
Expand All @@ -89,7 +89,7 @@
end

it 'has attributes checksum' do
expect(store.attributes2_checksum_for(item)).not_to be_nil
expect(store.attributes_checksum_for(item)).not_to be_nil
end

context 'after storing and loading' do
Expand All @@ -116,7 +116,7 @@
end

it 'has attributes checksum' do
expect(store.attributes2_checksum_for(other_item)).not_to be_nil
expect(store.attributes_checksum_for(other_item)).not_to be_nil
end

context 'after storing and loading' do
Expand Down

0 comments on commit 52ea0c1

Please sign in to comment.