roger 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 16132ae1857a2fc40e046c297848b5f3683dd249
4
- data.tar.gz: b82228479d276c41069da98f8bf473a0f5478a85
2
+ SHA256:
3
+ metadata.gz: 69986cc9095a927deaa4d0c24ded5939d2ed1ea5373a2e3646af631bf0601c50
4
+ data.tar.gz: e2fa26c7a1aed9f93fa55b236acbbd7ecece390c615978c3bf3cc5867621743a
5
5
  SHA512:
6
- metadata.gz: d5f59c20f09f5cbab909ceaa865c1f6b1d6bdac61c863bf9e3e3df6c549c4d0effd212d379a9e215d09a41d32e5e83f8269ece9f423194b6e95f83c0db57a81c
7
- data.tar.gz: 54ddecc3563773870ee17ae3c0e712e180f0f6b4969a83ff8fa5afd17055e7fd00fb1598f2723317a58291cc1a09ab3b47cde23947d7e797d3e13a479f886769
6
+ metadata.gz: 43991d9924c031c0ffae6f413d4a32186c09ad5e4fd64187ca528b97f227b3fa7db5f47476d4b2667900a83516bb20cbcd973165b3cf98b814f06afeb582753d
7
+ data.tar.gz: 87cb05672e3960e1c8ca8622af06bcf360e0ddebe73d56ce81a6b3122bacf8d7eff4ec9972bec9fdfe35f2e5e1c4cfbbbaf53f902ac20c3fa508d181b404a9e3
data/.rubocop.yml CHANGED
@@ -1,3 +1,7 @@
1
+ Style/PercentLiteralDelimiters:
2
+ PreferredDelimiters:
3
+ "%w": "()"
4
+
1
5
  LineLength:
2
6
  Description: 'Limit lines to 100 characters.'
3
7
  Max: 100
@@ -18,10 +22,16 @@ Metrics/MethodLength:
18
22
  Metrics/AbcSize:
19
23
  Max: 20
20
24
 
25
+ Metrics/BlockLength:
26
+ Max: 35
27
+
21
28
  Style/ClassAndModuleChildren:
22
29
  EnforcedStyle: compact
23
30
  Enabled: false
24
31
 
32
+ Style/SymbolArray:
33
+ Enabled: false
34
+
25
35
  # By default, the rails cops are not run. Override in project or home
26
36
  # directory .rubocop.yml files, or by giving the -R/--rails option.
27
37
  Rails:
data/.travis.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
4
- - 2.3.3
3
+ - 2.3.7
4
+ - 2.5.1
5
+ - ruby-head
5
6
  before_script:
6
7
  - git config --global user.email "travis-ci@digitpaint.nl"
7
8
  - git config --global user.name "Travis-CI"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 1.9.0
4
+ * Render all *.erb files by default
5
+ * Update dependencies
6
+ * Rsync finalizer now uses `--delete`
7
+ * Removed hpricot dependency and URL relativizer (now lives in roger_url)relativizer gem)
8
+
3
9
  ## Version 1.8.0
4
10
  * Roger Rack application now adheres to match/skip options. Pass them in the rogerfile as follows:
5
11
  ```
@@ -12,10 +12,12 @@ module Roger
12
12
  def self.register(name, klass = nil)
13
13
  name, klass = generator_name(name, klass)
14
14
 
15
- raise(
16
- ArgumentError,
17
- "Generator name '#{name.inspect}' already in use"
18
- ) if Cli::Generate.tasks.key?(name)
15
+ if Cli::Generate.tasks.key?(name)
16
+ raise(
17
+ ArgumentError,
18
+ "Generator name '#{name.inspect}' already in use"
19
+ )
20
+ end
19
21
 
20
22
  usage = "#{name} #{klass.arguments.map(&:banner).join(' ')}"
21
23
  long_desc = klass.desc || "Run #{name} generator"
@@ -14,7 +14,7 @@ module Roger
14
14
 
15
15
  def default_options
16
16
  {
17
- match: ["**/*.{html,md,html.erb}"],
17
+ match: ["**/*.{html,md,erb}"],
18
18
  skip: []
19
19
  }
20
20
  end
data/lib/roger/release.rb CHANGED
@@ -235,33 +235,43 @@ module Roger
235
235
  # Checks if build path exists (and cleans it up)
236
236
  # Checks if target path exists (if not, creates it)
237
237
  def validate_paths!
238
- if build_path.exist?
239
- log self, "Cleaning up previous build \"#{build_path}\""
240
- rm_rf(build_path)
241
- end
238
+ ensure_clean_build_path!
239
+ ensure_existing_target_path!
240
+ end
242
241
 
243
- unless target_path.exist?
244
- log self, "Creating target path \"#{target_path}\""
245
- mkdir target_path
246
- end
242
+ def ensure_clean_build_path!
243
+ return unless build_path.exist?
244
+
245
+ log self, "Cleaning up previous build \"#{build_path}\""
246
+ rm_rf(build_path)
247
+ end
248
+
249
+ def ensure_existing_target_path!
250
+ return if target_path.exist?
251
+
252
+ log self, "Creating target path \"#{target_path}\""
253
+ mkdir target_path
247
254
  end
248
255
 
249
256
  # Checks if the project will be runned
250
- # If config[:blank] is true it will automatically add UrlRelativizer or Mockup processor
257
+ # If config[:blank] is true it will automatically add Mockup processor
251
258
  def validate_stack!
252
259
  return if config[:blank]
253
260
 
254
- unless find_in_stack(Roger::Release::Processors::Mockup)
255
- @stack.unshift([Roger::Release::Processors::Mockup.new, {}])
256
- end
261
+ ensure_mockup_processor_in_stack!
262
+ ensure_dir_finalizer_in_stack!
263
+ end
257
264
 
258
- unless find_in_stack(Roger::Release::Processors::UrlRelativizer)
259
- @stack.push([Roger::Release::Processors::UrlRelativizer.new, {}])
260
- end
265
+ def ensure_mockup_processor_in_stack!
266
+ return if find_in_stack(Roger::Release::Processors::Mockup)
261
267
 
262
- unless find_in_stack(Roger::Release::Finalizers::Dir)
263
- @stack.push([Roger::Release::Finalizers::Dir.new, {}])
264
- end
268
+ @stack.unshift([Roger::Release::Processors::Mockup.new, {}])
269
+ end
270
+
271
+ def ensure_dir_finalizer_in_stack!
272
+ return if find_in_stack(Roger::Release::Finalizers::Dir)
273
+
274
+ @stack.push([Roger::Release::Finalizers::Dir.new, {}])
265
275
  end
266
276
 
267
277
  # Find a processor in the stack
@@ -58,7 +58,7 @@ module Roger::Release::Finalizers
58
58
  FileUtils.cp_r @release.build_path.to_s + "/.", clone_dir.to_s
59
59
 
60
60
  commands = [
61
- %w(git add . ), # 4. Add all files
61
+ %w(git add .), # 4. Add all files
62
62
  %w(git commit -q -a -m) << "Release #{@release.scm.version}" # 5. Commit
63
63
  ]
64
64
 
@@ -60,6 +60,7 @@ module Roger::Release::Finalizers
60
60
  command = [
61
61
  options[:rsync],
62
62
  "-az",
63
+ "--delete",
63
64
  Shellwords.escape(local_path),
64
65
  Shellwords.escape(target_path)
65
66
  ]
@@ -80,11 +80,10 @@ module Roger
80
80
  raise ArgumentError, "No :content or :file specified" unless content
81
81
 
82
82
  if injection[:processor]
83
- if tmpl = Tilt[injection[:processor]]
84
- (tmpl.new { content }).render
85
- else
86
- raise ArgumentError, "Unknown processor #{injection[:processor]}"
87
- end
83
+ tmpl = Tilt[injection[:processor]]
84
+ raise(ArgumentError, "Unknown processor #{injection[:processor]}") unless tmpl
85
+
86
+ (tmpl.new { content }).render
88
87
  else
89
88
  content
90
89
  end
@@ -55,4 +55,3 @@ module Roger::Release::Processors
55
55
  end
56
56
 
57
57
  require File.dirname(__FILE__) + "/processors/mockup"
58
- require File.dirname(__FILE__) + "/processors/url_relativizer"
@@ -15,7 +15,7 @@ module Roger
15
15
  # @deprecated Please use roger method instead.
16
16
  def mockup
17
17
  warn("The use of mockup has been deprecated; please use roger instead")
18
- warn(" on #{caller.first}")
18
+ warn(" on #{caller(0..0).first}")
19
19
  roger
20
20
  end
21
21
 
@@ -95,7 +95,7 @@ module Roger
95
95
  source = source.sub(fm_regex, "")
96
96
 
97
97
  begin
98
- data = (YAML.load(match[1]) || {}).inject({}) do |memo, (k, v)|
98
+ data = (YAML.safe_load(match[1]) || {}).inject({}) do |memo, (k, v)|
99
99
  memo[k.to_sym] = v
100
100
  memo
101
101
  end
data/lib/roger/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Roger main namespace
2
2
  module Roger
3
- VERSION = "1.8.0".freeze
3
+ VERSION = "1.9.0".freeze
4
4
  end
data/roger.gemspec CHANGED
@@ -31,16 +31,15 @@ Gem::Specification.new do |s|
31
31
  end
32
32
 
33
33
  s.add_dependency("thor", ["~> 0.19.0"])
34
- s.add_dependency("rack", [">= 1.0.0"])
34
+ s.add_dependency("rack", [">= 2.0.0"])
35
35
  s.add_dependency("tilt", ["~> 2.0.1"])
36
- s.add_dependency("mime-types", ["~> 2.2"])
37
- s.add_dependency("hpricot", ["= 0.8.4"])
36
+ s.add_dependency("mime-types", ["~> 3.1"])
38
37
  s.add_dependency("redcarpet", [">= 3.1.1"])
39
38
  s.add_dependency("test_construct", "~> 2.0")
40
39
 
41
40
  s.add_development_dependency("test-unit", "~> 3.0.0")
42
41
  s.add_development_dependency("mocha", "~> 1.1.0")
43
42
  s.add_development_dependency("simplecov", "~> 0.10.0")
44
- s.add_development_dependency("puma", "~> 3.6.0")
45
- s.add_development_dependency("rubocop", "~> 0.38.0")
43
+ s.add_development_dependency("puma", "~> 3.12.0")
44
+ s.add_development_dependency("rubocop", "~> 0.49.0")
46
45
  end
data/test/project/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ gem "pry"
4
+ gem "redcarpet"
3
5
  gem "roger", path: File.dirname(__FILE__) + "/../../"
4
6
  gem "sass"
5
7
  gem "yui-compressor"
6
- gem "redcarpet"
7
- gem "pry"
@@ -17,5 +17,4 @@ end
17
17
 
18
18
  mockup.release do |r|
19
19
  r.use :mockup
20
- r.use :url_relativizer, :skip => [/non-relative.*/]
21
- end
20
+ end
@@ -2,7 +2,6 @@ module RogerNoopTest
2
2
  # A CLI command for the Noop test. Doesn't do anything
3
3
  class Cli < Roger::Test::Cli
4
4
  desc "init", "init noop tests"
5
- def init
6
- end
5
+ def init; end
7
6
  end
8
7
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "test_construct"
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "test_construct"
@@ -41,8 +41,7 @@ module Roger
41
41
  assert_includes Cli::Generate.tasks, "mockery"
42
42
  end
43
43
 
44
- def test_cli_help_shows_all_available_generators
45
- end
44
+ def test_cli_help_shows_all_available_generators; end
46
45
 
47
46
  def test_invoke_mocked_generator
48
47
  Roger::Generators.register ::Generators::MockedGenerator
@@ -19,9 +19,9 @@ module Roger
19
19
 
20
20
  # Running a blank release
21
21
  @rogerfile.release(blank: true) do |r|
22
- r.use proc{|release|
22
+ r.use(proc { |release|
23
23
  assert_equal release.project.mode, :release
24
- }
24
+ })
25
25
  end
26
26
 
27
27
  @project.release.run!
@@ -43,14 +43,6 @@ module Roger
43
43
  assert_equal Roger::Release::Processors::Mockup, release.stack.first.first.class
44
44
  end
45
45
 
46
- def test_release_should_add_url_relativizer_by_default
47
- release = @rogerfile.release
48
- release.run!
49
-
50
- assert !release.stack.empty?
51
- assert_equal Roger::Release::Processors::UrlRelativizer, release.stack[-2].first.class
52
- end
53
-
54
46
  def test_release_should_add_dir_finalizer_by_default
55
47
  release = @rogerfile.release
56
48
  release.run!
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "./lib/roger/renderer.rb"
@@ -120,7 +121,7 @@ module Roger
120
121
  # "md.erb" => "html",
121
122
  "css.erb" => "css",
122
123
  "json.erb" => "json",
123
- "js.erb" => "js"
124
+ "js.erb" => "ecma"
124
125
  }
125
126
 
126
127
  mime_types.each do |ext, ext_out|
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "./lib/roger/renderer.rb"
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "./lib/roger/renderer.rb"
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "./lib/roger/renderer.rb"
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "./lib/roger/template.rb"
@@ -36,7 +36,6 @@ module Roger
36
36
 
37
37
  next_port = @server.send(:free_port_for_host_above, @host, port)
38
38
  assert next_port > port
39
-
40
39
  ensure
41
40
  s.close
42
41
  end
@@ -44,8 +43,7 @@ module Roger
44
43
  # Test to see if env["roger.project"] is set
45
44
  def test_env_roger_project_is_set
46
45
  test = Class.new do
47
- def initialize(_app)
48
- end
46
+ def initialize(_app); end
49
47
 
50
48
  def call(env)
51
49
  [200, {}, [env["roger.project"].object_id.to_s]]
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # Generators register themself on the CLI module
3
4
  require "test_helper"
4
5
  require "./lib/roger/template.rb"
@@ -23,7 +24,7 @@ module Roger
23
24
 
24
25
  def test_render_with_block
25
26
  template = Template.new("<%= yield %>", {}, source_path: "test.erb")
26
- assert_equal "inner", template.render { "inner" }
27
+ assert_equal "inner", (template.render { "inner" })
27
28
  end
28
29
 
29
30
  def test_data
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  require "test_helper"
3
4
  require "./lib/roger/test.rb"
4
5
  require "roger/testing/mock_project"
@@ -27,9 +28,9 @@ module Roger
27
28
  assert_equal @project.mode, nil
28
29
 
29
30
  @rogerfile.test do |t|
30
- t.use proc{|test|
31
+ t.use(proc { |test|
31
32
  assert_equal test.project.mode, :test
32
- }
33
+ })
33
34
  end
34
35
 
35
36
  @project.test.run!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-10-18 00:00:00.000000000 Z
13
+ date: 2018-09-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: 1.0.0
35
+ version: 2.0.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.0.0
42
+ version: 2.0.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: tilt
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -60,28 +60,14 @@ dependencies:
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '2.2'
63
+ version: '3.1'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '2.2'
71
- - !ruby/object:Gem::Dependency
72
- name: hpricot
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - '='
76
- - !ruby/object:Gem::Version
77
- version: 0.8.4
78
- type: :runtime
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - '='
83
- - !ruby/object:Gem::Version
84
- version: 0.8.4
70
+ version: '3.1'
85
71
  - !ruby/object:Gem::Dependency
86
72
  name: redcarpet
87
73
  requirement: !ruby/object:Gem::Requirement
@@ -158,28 +144,28 @@ dependencies:
158
144
  requirements:
159
145
  - - "~>"
160
146
  - !ruby/object:Gem::Version
161
- version: 3.6.0
147
+ version: 3.12.0
162
148
  type: :development
163
149
  prerelease: false
164
150
  version_requirements: !ruby/object:Gem::Requirement
165
151
  requirements:
166
152
  - - "~>"
167
153
  - !ruby/object:Gem::Version
168
- version: 3.6.0
154
+ version: 3.12.0
169
155
  - !ruby/object:Gem::Dependency
170
156
  name: rubocop
171
157
  requirement: !ruby/object:Gem::Requirement
172
158
  requirements:
173
159
  - - "~>"
174
160
  - !ruby/object:Gem::Version
175
- version: 0.38.0
161
+ version: 0.49.0
176
162
  type: :development
177
163
  prerelease: false
178
164
  version_requirements: !ruby/object:Gem::Requirement
179
165
  requirements:
180
166
  - - "~>"
181
167
  - !ruby/object:Gem::Version
182
- version: 0.38.0
168
+ version: 0.49.0
183
169
  description: See homepage for more information.
184
170
  email:
185
171
  - info@digitpaint.nl
@@ -241,7 +227,6 @@ files:
241
227
  - lib/roger/release/injector.rb
242
228
  - lib/roger/release/processors.rb
243
229
  - lib/roger/release/processors/mockup.rb
244
- - lib/roger/release/processors/url_relativizer.rb
245
230
  - lib/roger/release/scm.rb
246
231
  - lib/roger/release/scm/fixed.rb
247
232
  - lib/roger/release/scm/git.rb
@@ -335,7 +320,6 @@ files:
335
320
  - test/unit/release/finalizers/zip_test.rb
336
321
  - test/unit/release/injector_test.rb
337
322
  - test/unit/release/processors/mockup_test.rb
338
- - test/unit/release/processors/url_relativizer_test.rb
339
323
  - test/unit/release/processors_test.rb
340
324
  - test/unit/release/scm/base_test.rb
341
325
  - test/unit/release/scm/fixed_test.rb
@@ -372,7 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
356
  version: '0'
373
357
  requirements: []
374
358
  rubyforge_project:
375
- rubygems_version: 2.6.10
359
+ rubygems_version: 2.7.7
376
360
  signing_key:
377
361
  specification_version: 4
378
362
  summary: Roger is a set of tools to create self-containing HTML mockups.
@@ -452,7 +436,6 @@ test_files:
452
436
  - test/unit/release/finalizers/zip_test.rb
453
437
  - test/unit/release/injector_test.rb
454
438
  - test/unit/release/processors/mockup_test.rb
455
- - test/unit/release/processors/url_relativizer_test.rb
456
439
  - test/unit/release/processors_test.rb
457
440
  - test/unit/release/scm/base_test.rb
458
441
  - test/unit/release/scm/fixed_test.rb
@@ -1,74 +0,0 @@
1
- require "hpricot"
2
- require File.dirname(__FILE__) + "../../../resolver"
3
-
4
- module Roger::Release::Processors
5
- # URL relativizer processor
6
- # The relativizer can be used to rewrite absolute paths in attributes to relative paths
7
- # during release.
8
- class UrlRelativizer < Base
9
- self.name = :url_relativizer
10
-
11
- def default_options
12
- {
13
- url_attributes: %w(src href action),
14
- match: ["**/*.html"],
15
- skip: []
16
- }
17
- end
18
-
19
- def perform
20
- log_call
21
-
22
- @resolver = Roger::Resolver.new(release.build_path)
23
-
24
- relativize_attributes_in_files(
25
- release,
26
- options[:url_attributes],
27
- release.get_files(options[:match], options[:skip])
28
- )
29
- end
30
-
31
- protected
32
-
33
- def log_call
34
- log_message = "Relativizing all URLS in #{@options[:match].inspect}"
35
- log_message << "files in attributes #{@options[:url_attributes].inspect},"
36
- log_message << "skipping #{@options[:skip].any? ? @options[:skip].inspect : 'none'}"
37
- release.log(self, log_message)
38
- end
39
-
40
- def relativize_attributes_in_files(release, attributes, files)
41
- files.each do |file_path|
42
- release.debug(self, "Relativizing URLS in #{file_path}") do
43
- relativize_attributes_in_file(release, attributes, file_path)
44
- end
45
- end
46
- end
47
-
48
- def relativize_attributes_in_file(release, attributes, file_path)
49
- orig_source = File.read(file_path)
50
- File.open(file_path, "w") do |f|
51
- f.write(relativize_attributes_in_source(release, attributes, orig_source, file_path))
52
- end
53
- end
54
-
55
- def relativize_attributes_in_source(release, attributes, source, file_path)
56
- doc = Hpricot(source)
57
- attributes.each do |attribute|
58
- (doc / "*[@#{attribute}]").each do |tag|
59
- converted_url = @resolver.url_to_relative_url(tag[attribute], file_path)
60
- release.debug(self, "Converting '#{tag[attribute]}' to '#{converted_url}'")
61
- case converted_url
62
- when String
63
- tag[attribute] = converted_url
64
- when nil
65
- release.log(self, "Could not resolve link #{tag[attribute]} in #{file_path}")
66
- end
67
- end
68
- end
69
- doc.to_original_html
70
- end
71
- end
72
- end
73
-
74
- Roger::Release::Processors.register(Roger::Release::Processors::UrlRelativizer)
@@ -1,35 +0,0 @@
1
- require "test_helper"
2
- require "roger/testing/mock_release"
3
-
4
- module Roger
5
- # Test UrlRelativizer
6
- class UrlRelativizerTest < ::Test::Unit::TestCase
7
- def setup
8
- @release = Testing::MockRelease.new
9
- @processor = Roger::Release::Processors::UrlRelativizer.new
10
- end
11
-
12
- def teardown
13
- @release.destroy
14
- @release = nil
15
- end
16
-
17
- def test_empty_release_runs
18
- files = @processor.call(@release)
19
- assert_equal 0, files.length
20
- end
21
-
22
- def test_basic_relativization
23
- @release.project.construct.directory "build/sub" do |dir|
24
- dir.file "test.html", "<a href='/test.html'>link</a>"
25
- end
26
- @release.project.construct.file "build/test.html"
27
-
28
- files = @processor.call(@release)
29
- assert_equal 2, files.length
30
-
31
- contents = File.read((@release.build_path + "sub/test.html").to_s)
32
- assert contents.include?("../test.html")
33
- end
34
- end
35
- end