nanoc 4.7.10 → 4.7.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CONTRIBUTING.md +17 -0
  3. data/.github/ISSUE_TEMPLATE.md +23 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  5. data/.gitignore +8 -0
  6. data/.rspec +3 -0
  7. data/.rubocop.yml +174 -0
  8. data/.travis.yml +27 -0
  9. data/Gemfile +4 -3
  10. data/NEWS.md +11 -0
  11. data/Rakefile +5 -2
  12. data/lib/nanoc/base/entities/dependency.rb +5 -3
  13. data/lib/nanoc/base/entities/layout.rb +1 -1
  14. data/lib/nanoc/base/repos/dependency_store.rb +64 -28
  15. data/lib/nanoc/base/services/dependency_tracker.rb +1 -1
  16. data/lib/nanoc/base/views/config_view.rb +4 -0
  17. data/lib/nanoc/checking/checks/external_links.rb +3 -6
  18. data/lib/nanoc/cli.rb +0 -2
  19. data/lib/nanoc/cli/commands/shell.rb +2 -3
  20. data/lib/nanoc/filters/colorize_syntax/colorizers.rb +4 -1
  21. data/lib/nanoc/telemetry/table.rb +1 -1
  22. data/lib/nanoc/version.rb +1 -1
  23. data/nanoc.gemspec +1 -5
  24. data/scripts/release +95 -0
  25. data/{test → spec/nanoc}/base/core_ext/array_spec.rb +5 -14
  26. data/{test → spec/nanoc}/base/core_ext/hash_spec.rb +6 -15
  27. data/{test → spec/nanoc}/base/core_ext/pathname_spec.rb +0 -0
  28. data/spec/nanoc/base/core_ext/string_spec.rb +23 -0
  29. data/spec/nanoc/base/directed_graph_spec.rb +291 -0
  30. data/spec/nanoc/base/entities/identifiable_collection_spec.rb +56 -0
  31. data/spec/nanoc/base/entities/item_spec.rb +8 -0
  32. data/spec/nanoc/base/entities/layout_spec.rb +8 -0
  33. data/spec/nanoc/base/repos/dependency_store_spec.rb +166 -21
  34. data/spec/nanoc/base/views/config_view_spec.rb +29 -1
  35. data/spec/nanoc/cli/commands/shell_spec.rb +23 -8
  36. data/spec/nanoc/filters/less_spec.rb +1 -1
  37. data/spec/nanoc/regressions/gh_1185_spec.rb +22 -0
  38. data/spec/nanoc/telemetry/table_spec.rb +22 -0
  39. data/spec/spec_helper.rb +5 -6
  40. data/test/base/test_item_array.rb +0 -35
  41. data/test/checking/checks/test_external_links.rb +0 -14
  42. data/test/filters/test_coffeescript.rb +0 -2
  43. data/test/filters/test_handlebars.rb +0 -4
  44. data/test/filters/test_uglify_js.rb +0 -4
  45. data/test/helper.rb +0 -6
  46. data/test/helpers/test_blogging.rb +66 -26
  47. data/test/helpers/test_xml_sitemap.rb +23 -7
  48. metadata +16 -9
  49. data/Gemfile.lock +0 -433
  50. data/test/base/core_ext/string_spec.rb +0 -25
  51. data/test/base/test_item.rb +0 -40
  52. 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
@@ -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
@@ -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