nanoc 4.7.10 → 4.7.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CONTRIBUTING.md +17 -0
- data/.github/ISSUE_TEMPLATE.md +23 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +18 -0
- data/.gitignore +8 -0
- data/.rspec +3 -0
- data/.rubocop.yml +174 -0
- data/.travis.yml +27 -0
- data/Gemfile +4 -3
- data/NEWS.md +11 -0
- data/Rakefile +5 -2
- data/lib/nanoc/base/entities/dependency.rb +5 -3
- data/lib/nanoc/base/entities/layout.rb +1 -1
- data/lib/nanoc/base/repos/dependency_store.rb +64 -28
- data/lib/nanoc/base/services/dependency_tracker.rb +1 -1
- data/lib/nanoc/base/views/config_view.rb +4 -0
- data/lib/nanoc/checking/checks/external_links.rb +3 -6
- data/lib/nanoc/cli.rb +0 -2
- data/lib/nanoc/cli/commands/shell.rb +2 -3
- data/lib/nanoc/filters/colorize_syntax/colorizers.rb +4 -1
- data/lib/nanoc/telemetry/table.rb +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +1 -5
- data/scripts/release +95 -0
- data/{test → spec/nanoc}/base/core_ext/array_spec.rb +5 -14
- data/{test → spec/nanoc}/base/core_ext/hash_spec.rb +6 -15
- data/{test → spec/nanoc}/base/core_ext/pathname_spec.rb +0 -0
- data/spec/nanoc/base/core_ext/string_spec.rb +23 -0
- data/spec/nanoc/base/directed_graph_spec.rb +291 -0
- data/spec/nanoc/base/entities/identifiable_collection_spec.rb +56 -0
- data/spec/nanoc/base/entities/item_spec.rb +8 -0
- data/spec/nanoc/base/entities/layout_spec.rb +8 -0
- data/spec/nanoc/base/repos/dependency_store_spec.rb +166 -21
- data/spec/nanoc/base/views/config_view_spec.rb +29 -1
- data/spec/nanoc/cli/commands/shell_spec.rb +23 -8
- data/spec/nanoc/filters/less_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1185_spec.rb +22 -0
- data/spec/nanoc/telemetry/table_spec.rb +22 -0
- data/spec/spec_helper.rb +5 -6
- data/test/base/test_item_array.rb +0 -35
- data/test/checking/checks/test_external_links.rb +0 -14
- data/test/filters/test_coffeescript.rb +0 -2
- data/test/filters/test_handlebars.rb +0 -4
- data/test/filters/test_uglify_js.rb +0 -4
- data/test/helper.rb +0 -6
- data/test/helpers/test_blogging.rb +66 -26
- data/test/helpers/test_xml_sitemap.rb +23 -7
- metadata +16 -9
- data/Gemfile.lock +0 -433
- data/test/base/core_ext/string_spec.rb +0 -25
- data/test/base/test_item.rb +0 -40
- data/test/base/test_layout.rb +0 -16
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'helper'
|
4
|
-
|
5
|
-
describe 'String#__nanoc_cleaned_identifier' do
|
6
|
-
it 'should not convert already clean paths' do
|
7
|
-
'/foo/bar/'.__nanoc_cleaned_identifier.must_equal '/foo/bar/'
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'should prepend slash if necessary' do
|
11
|
-
'foo/bar/'.__nanoc_cleaned_identifier.must_equal '/foo/bar/'
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should append slash if necessary' do
|
15
|
-
'/foo/bar'.__nanoc_cleaned_identifier.must_equal '/foo/bar/'
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should remove double slashes at start' do
|
19
|
-
'//foo/bar/'.__nanoc_cleaned_identifier.must_equal '/foo/bar/'
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should remove double slashes at end' do
|
23
|
-
'/foo/bar//'.__nanoc_cleaned_identifier.must_equal '/foo/bar/'
|
24
|
-
end
|
25
|
-
end
|
data/test/base/test_item.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'helper'
|
4
|
-
|
5
|
-
class Nanoc::Int::ItemTest < Nanoc::TestCase
|
6
|
-
def test_initialize_with_attributes_with_string_keys
|
7
|
-
item = Nanoc::Int::Item.new('foo', { 'abc' => 'xyz' }, '/foo/')
|
8
|
-
|
9
|
-
assert_equal nil, item.attributes['abc']
|
10
|
-
assert_equal 'xyz', item.attributes[:abc]
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_reference
|
14
|
-
item = Nanoc::Int::Item.new(
|
15
|
-
'content',
|
16
|
-
{ one: 'one in item' },
|
17
|
-
'/path/',
|
18
|
-
)
|
19
|
-
|
20
|
-
assert_equal([:item, '/path/'], item.reference)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_attributes
|
24
|
-
item = Nanoc::Int::Item.new('content', { 'one' => 'one in item' }, '/path/')
|
25
|
-
assert_equal({ one: 'one in item' }, item.attributes)
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_freeze_should_disallow_changes
|
29
|
-
item = Nanoc::Int::Item.new('foo', { a: { b: 123 } }, '/foo/')
|
30
|
-
item.freeze
|
31
|
-
|
32
|
-
assert_raises_frozen_error do
|
33
|
-
item.attributes[:abc] = '123'
|
34
|
-
end
|
35
|
-
|
36
|
-
assert_raises_frozen_error do
|
37
|
-
item.attributes[:a][:b] = '456'
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
data/test/base/test_layout.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'helper'
|
4
|
-
|
5
|
-
class Nanoc::Int::LayoutTest < Nanoc::TestCase
|
6
|
-
def test_initialize
|
7
|
-
# Make sure attributes are cleaned
|
8
|
-
layout = Nanoc::Int::Layout.new('content', { 'foo' => 'bar' }, '/foo')
|
9
|
-
assert_equal({ foo: 'bar' }, layout.attributes)
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_attributes
|
13
|
-
layout = Nanoc::Int::Layout.new('content', { 'foo' => 'bar' }, '/foo/')
|
14
|
-
assert_equal({ foo: 'bar' }, layout.attributes)
|
15
|
-
end
|
16
|
-
end
|