bunto-redirect-from 5.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/spec/spec_helper.rb CHANGED
@@ -1,91 +1,88 @@
1
- require "bunto"
2
- require File.expand_path("lib/bunto-redirect-from.rb")
3
-
4
- RSpec.configure do |config|
5
- config.run_all_when_everything_filtered = true
6
- config.filter_run :focus
7
- config.order = 'random'
8
-
9
- config.expect_with :rspec do |c|
10
- c.syntax = :expect
11
- end
12
-
13
- config.before(:each) do
14
- Bunto.logger.log_level = :error
15
-
16
- @fixtures_path = Pathname.new(__FILE__).parent.join("fixtures")
17
- @dest = @fixtures_path.join("_site")
18
- @posts_src = @fixtures_path.join("_posts")
19
- @layouts_src = @fixtures_path.join("_layouts")
20
- @plugins_src = @fixtures_path.join("_plugins")
21
-
22
- @site = Bunto::Site.new(Bunto.configuration({
23
- "source" => @fixtures_path.to_s,
24
- "destination" => @dest.to_s,
25
- "plugins" => @plugins_src.to_s,
26
- "collections" => {
27
- "articles" => {"output" => true},
28
- "authors" => {}
29
- }
30
- }))
31
-
32
- @dest.rmtree if @dest.exist?
33
- @site.process
34
- end
35
-
36
- config.after(:each) do
37
- @dest.rmtree if @dest.exist?
38
- end
39
-
40
- def dest_dir(*paths)
41
- File.join(@dest.to_s, *paths)
42
- end
43
-
44
- def unpublished_doc
45
- @site.collections["authors"].docs.first
46
- end
47
-
48
- def setup_doc(doc_filename)
49
- @site.collections["articles"].docs.find { |d| d.relative_path.match(doc_filename) }
50
- end
51
-
52
- def setup_post(file)
53
- Bunto::Post.new(@site, @fixtures_path.to_s, '', file)
54
- end
55
-
56
- def setup_page(file)
57
- Bunto::Page.new(@site, @fixtures_path.to_s, File.dirname(file), File.basename(file))
58
- end
59
-
60
- def destination_file_exists?(file)
61
- File.exists?(File.join(@dest.to_s, file))
62
- end
63
-
64
- def destination_file_contents(file)
65
- File.read(File.join(@dest.to_s, file))
66
- end
67
-
68
- def destination_doc_contents(collection, file)
69
- File.read(File.join(@dest.to_s, collection, file))
70
- end
71
-
72
- def new_redirect_page(permalink)
73
- page = BuntoRedirectFrom::RedirectPage.new(@site, @site.source, "", "")
74
- page.data['permalink'] = permalink
75
- page
76
- end
77
-
78
- def destination_sitemap
79
- File.read(File.join(@dest.to_s, 'sitemap.xml'))
80
- end
81
- end
82
-
83
- class TestStringContainer
84
- def initialize(strValue)
85
- @val = strValue
86
- end
87
-
88
- def to_s
89
- @val
90
- end
91
- end
1
+ require "bunto"
2
+ require File.expand_path("lib/bunto-redirect-from.rb")
3
+
4
+ RSpec.configure do |config|
5
+ config.run_all_when_everything_filtered = true
6
+ config.filter_run :focus
7
+ config.order = 'random'
8
+
9
+ config.expect_with :rspec do |c|
10
+ c.syntax = :expect
11
+ end
12
+
13
+ config.before(:each) do
14
+ Bunto.logger.log_level = :error
15
+
16
+ @fixtures_path = Pathname.new(__FILE__).parent.join("fixtures")
17
+ @dest = @fixtures_path.join("_site")
18
+ @posts_src = @fixtures_path.join("_posts")
19
+ @layouts_src = @fixtures_path.join("_layouts")
20
+ @plugins_src = @fixtures_path.join("_plugins")
21
+
22
+ @site = Bunto::Site.new(Bunto.configuration({
23
+ "source" => @fixtures_path.to_s,
24
+ "destination" => @dest.to_s,
25
+ "plugins" => @plugins_src.to_s,
26
+ "collections" => {
27
+ "articles" => {"output" => true},
28
+ "authors" => {}
29
+ },
30
+ "defaults" => [{
31
+ "scope" => { "path" => "" },
32
+ "values" => { "layout" => "layout" }
33
+ }]
34
+ }))
35
+
36
+ @dest.rmtree if @dest.exist?
37
+ @site.process
38
+ end
39
+
40
+ config.after(:each) do
41
+ @dest.rmtree if @dest.exist?
42
+ end
43
+
44
+ def dest_dir(*paths)
45
+ @dest.join(*paths)
46
+ end
47
+
48
+ def unpublished_doc
49
+ @site.collections["authors"].docs.first
50
+ end
51
+
52
+ def setup_doc(doc_filename)
53
+ @site.collections["articles"].docs.find { |d| d.relative_path.match(doc_filename) }
54
+ end
55
+
56
+ def setup_post(file)
57
+ Bunto::Post.new(@site, @fixtures_path.to_s, '', file)
58
+ end
59
+
60
+ def setup_page(file)
61
+ Bunto::Page.new(@site, @fixtures_path.to_s, File.dirname(file), File.basename(file))
62
+ end
63
+
64
+ def new_redirect_page(permalink)
65
+ page = BuntoRedirectFrom::RedirectPage.new(@site, @site.source, "", "index.html")
66
+ page.data['permalink'] = permalink
67
+ page.data['sitemap'] = false
68
+ page
69
+ end
70
+
71
+ def destination_sitemap
72
+ @dest.join("sitemap.xml").read
73
+ end
74
+
75
+ def forced_output_ext
76
+ BuntoRedirectFrom.bunto_3? ? ".html" : ""
77
+ end
78
+ end
79
+
80
+ class TestStringContainer
81
+ def initialize(strValue)
82
+ @val = strValue
83
+ end
84
+
85
+ def to_s
86
+ @val
87
+ end
88
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunto-redirect-from
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-04 00:00:00.000000000 Z
12
+ date: 2016-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bunto
@@ -29,16 +29,16 @@ dependencies:
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '1.3'
34
+ version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '1.3'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -71,16 +71,16 @@ dependencies:
71
71
  name: bunto-sitemap
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 2.0.0
76
+ version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 2.0.0
83
+ version: '0'
84
84
  description: Seamlessly specify multiple redirection URLs for your pages and posts
85
85
  email:
86
86
  - parkrmoore@gmail.com
@@ -105,17 +105,21 @@ files:
105
105
  - script/bootstrap
106
106
  - script/cibuild
107
107
  - script/release
108
+ - script/test
108
109
  - spec/bunto_redirect_from/redirect_page_spec.rb
109
110
  - spec/bunto_redirect_from/redirector_spec.rb
110
111
  - spec/fixtures/_articles/redirect-me-plz.md
112
+ - spec/fixtures/_articles/redirect-somewhere-else-im-a-permalink.html
111
113
  - spec/fixtures/_articles/redirect-somewhere-else-plz.html
112
114
  - spec/fixtures/_authors/kansaichris.md
113
115
  - spec/fixtures/_config.yml
116
+ - spec/fixtures/_layouts/layout.html
114
117
  - spec/fixtures/_posts/2014-01-03-redirect-me-plz.md
115
118
  - spec/fixtures/multiple_redirect_tos.md
116
119
  - spec/fixtures/multiple_redirect_urls.md
117
120
  - spec/fixtures/one_redirect_to.md
118
121
  - spec/fixtures/one_redirect_url.md
122
+ - spec/fixtures/tags/how we work.md
119
123
  - spec/integrations_spec.rb
120
124
  - spec/spec_helper.rb
121
125
  homepage: https://github.com/bunto/bunto-redirect-from
@@ -138,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
142
  version: '0'
139
143
  requirements: []
140
144
  rubyforge_project:
141
- rubygems_version: 2.4.5.1
145
+ rubygems_version: 2.6.6
142
146
  signing_key:
143
147
  specification_version: 4
144
148
  summary: Seamlessly specify multiple redirection URLs for your pages and posts
@@ -146,13 +150,16 @@ test_files:
146
150
  - spec/bunto_redirect_from/redirect_page_spec.rb
147
151
  - spec/bunto_redirect_from/redirector_spec.rb
148
152
  - spec/fixtures/_articles/redirect-me-plz.md
153
+ - spec/fixtures/_articles/redirect-somewhere-else-im-a-permalink.html
149
154
  - spec/fixtures/_articles/redirect-somewhere-else-plz.html
150
155
  - spec/fixtures/_authors/kansaichris.md
151
156
  - spec/fixtures/_config.yml
157
+ - spec/fixtures/_layouts/layout.html
152
158
  - spec/fixtures/_posts/2014-01-03-redirect-me-plz.md
153
159
  - spec/fixtures/multiple_redirect_tos.md
154
160
  - spec/fixtures/multiple_redirect_urls.md
155
161
  - spec/fixtures/one_redirect_to.md
156
162
  - spec/fixtures/one_redirect_url.md
163
+ - spec/fixtures/tags/how we work.md
157
164
  - spec/integrations_spec.rb
158
165
  - spec/spec_helper.rb