rundoc 4.1.2 → 4.1.3

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
2
  SHA256:
3
- metadata.gz: 175e8af5e0beeb7acca8d32740f3379d68771ba207d723a1f51495848645249c
4
- data.tar.gz: ac404b2c8337948628d7f18b90b20c57668f8a059d6e10c9c64354d21e04ac58
3
+ metadata.gz: b65a04eca7d7099223b2a626c47eb78e14a8e102266cf880cddc747a0d9fc4a5
4
+ data.tar.gz: 840585e8f0c6b3cddbb1d15354f4fdf862d2440b20054cd1b5344c026adb23d9
5
5
  SHA512:
6
- metadata.gz: 758367c980b07a1d57f63fd0272e16f4ac4a93c42e747b9da200891438e661cede3edde72bb23f25ceb3e8c35074c53a59cb0a7e141edcb78684569163134deb
7
- data.tar.gz: 6250e519af65a9800d4bb41926adb1713ef8e12d22e4503bb8eb8369514ce82db1036e289b80d0bd0fa8fb5cdb5d2f92fc2dc6e9ce029f5fb4a873f872e8f310
6
+ metadata.gz: 99661d14543918c21a988bd1c4cffc1d5c9d73a852a95c16b0905b5ddde312dc986d970b4082921752cd2eac4d786a0ae37f42f3577fdea2df54c6de50376810
7
+ data.tar.gz: 6819d3babc4cb2a7ad1f76386e3d7e7f28886a989e6a31ef052ea87b3b226a6979cc1c2092653fa7aadadd34d3f8af9b268464c2a14c70f385b559ee8a13ca9a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## HEAD
2
2
 
3
+ ## 4.1.3
4
+
5
+ - Fix: Internal error in `background.wait` introduced in 4.1.2 (https://github.com/zombocom/rundoc/pull/97)
6
+ - Fix: Website commands such as `:::>> website.visit(...)` now use lazy lookup (like Background tasks since 4.1.2). This allows `pre.erb` to be used with these commands (https://github.com/zombocom/rundoc/pull/98)
7
+
3
8
  ## 4.1.2
4
9
 
5
10
  - Fix: Background task name lookup is now lazy, this fixes a bug when using `:::>- pre.erb background.start(...)` (https://github.com/zombocom/rundoc/pull/95)
@@ -8,7 +8,7 @@ class Rundoc::CodeCommand::Background
8
8
  end
9
9
 
10
10
  def background
11
- @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(name)
11
+ @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name)
12
12
  end
13
13
 
14
14
  def to_md(env = {})
@@ -2,7 +2,11 @@ class Rundoc::CodeCommand::Website
2
2
  class Navigate < Rundoc::CodeCommand
3
3
  def initialize(name:)
4
4
  @name = name
5
- @driver = Rundoc::CodeCommand::Website::Driver.find(name)
5
+ @driver = nil
6
+ end
7
+
8
+ def driver
9
+ @driver ||= Rundoc::CodeCommand::Website::Driver.find(@name)
6
10
  end
7
11
 
8
12
  def to_md(env = {})
@@ -11,7 +15,7 @@ class Rundoc::CodeCommand::Website
11
15
 
12
16
  def call(env = {})
13
17
  puts "website.navigate [#{@name}]: #{contents}"
14
- @driver.safe_eval(contents, env)
18
+ driver.safe_eval(contents, env)
15
19
  ""
16
20
  end
17
21
 
@@ -1,8 +1,13 @@
1
1
  class Rundoc::CodeCommand::Website
2
2
  class Screenshot < Rundoc::CodeCommand
3
3
  def initialize(name:, upload: false)
4
- @driver = Rundoc::CodeCommand::Website::Driver.find(name)
4
+ @name = name
5
5
  @upload = upload
6
+ @driver = nil
7
+ end
8
+
9
+ def driver
10
+ @driver ||= Rundoc::CodeCommand::Website::Driver.find(@name)
6
11
  end
7
12
 
8
13
  def to_md(env = {})
@@ -10,14 +15,14 @@ class Rundoc::CodeCommand::Website
10
15
  end
11
16
 
12
17
  def call(env = {})
13
- puts "Taking screenshot: #{@driver.current_url}"
14
- filename = @driver.screenshot(
18
+ puts "Taking screenshot: #{driver.current_url}"
19
+ filename = driver.screenshot(
15
20
  upload: @upload,
16
21
  screenshots_dir: env[:context].screenshots_dir
17
22
  )
18
23
 
19
24
  relative_filename = filename.relative_path_from(env[:context].output_dir)
20
- env[:before] << "![Screenshot of #{@driver.current_url}](#{relative_filename})"
25
+ env[:before] << "![Screenshot of #{driver.current_url}](#{relative_filename})"
21
26
  ""
22
27
  end
23
28
 
@@ -6,14 +6,21 @@ class Rundoc::CodeCommand::Website
6
6
  @name = name
7
7
  @url = url
8
8
  @scroll = scroll
9
- @driver = Driver.new(
10
- name: name,
11
- url: url,
12
- height: height,
13
- width: width,
14
- visible: visible
15
- )
16
- Driver.add(@name, @driver)
9
+ @height = height
10
+ @width = width
11
+ @visible = visible
12
+ end
13
+
14
+ def driver
15
+ @driver ||= Driver.new(
16
+ name: @name,
17
+ url: @url,
18
+ height: @height,
19
+ width: @width,
20
+ visible: @visible
21
+ ).tap do |driver|
22
+ Driver.add(@name, driver)
23
+ end
17
24
  end
18
25
 
19
26
  def to_md(env = {})
@@ -26,11 +33,11 @@ class Rundoc::CodeCommand::Website
26
33
 
27
34
  puts message
28
35
 
29
- @driver.visit(@url) if @url
30
- @driver.scroll(@scroll) if @scroll
36
+ driver.visit(@url) if @url
37
+ driver.scroll(@scroll) if @scroll
31
38
 
32
39
  return "" if contents.nil? || contents.empty?
33
- @driver.safe_eval(contents, env)
40
+ driver.safe_eval(contents, env)
34
41
 
35
42
  ""
36
43
  end
@@ -1,3 +1,3 @@
1
1
  module Rundoc
2
- VERSION = "4.1.2"
2
+ VERSION = "4.1.3"
3
3
  end
@@ -6,6 +6,8 @@ class IntegrationWebsiteTest < Minitest::Test
6
6
  ```
7
7
  :::>> website.visit(name: "example", url: "http://example.com")
8
8
  :::>> website.screenshot(name: "example")
9
+ :::>> website.navigate(name: "example")
10
+ session.execute_script "window.scrollBy(0,10)"
9
11
  ```
10
12
  RUBY
11
13
 
@@ -19,6 +19,11 @@ class BackgroundTest < Minitest::Test
19
19
  output = stdin_write.call
20
20
  assert_equal("hello there" + $/, output)
21
21
 
22
+ Rundoc::CodeCommand::Background::Wait.new(
23
+ name: "cat",
24
+ wait: "hello"
25
+ ).call
26
+
22
27
  Rundoc::CodeCommand::Background::Log::Clear.new(
23
28
  name: "cat"
24
29
  ).call
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rundoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman