isomorfeus-puppetmaster 0.6.1 → 0.6.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fe1ac013c902f9119e5be6dcb20513155e76b8dec0900453ba0b5337a36aeb4
4
- data.tar.gz: 1f122d99fa89df0dca58878a5a90e6dce7363d3592f6cedcfb9ceba9d4a750f5
3
+ metadata.gz: 4080f1a27758c6b60a17ee8b2c7979dddfd5bc1467c06092152b3da62ffdb80a
4
+ data.tar.gz: 2617266b139434cdeb3b0abb4eaf06ce9a642ccfe9afb14e662fb2bd4e38e4b5
5
5
  SHA512:
6
- metadata.gz: b0eac78e29a2e3031427761cd8aa5ab1ddfb813e2f0f7bd67f9f7dbce7bd339708bd137eee98f500cdfec84aefbe4713fe75dc404dbf097ea1e5f46a96c0c8c9
7
- data.tar.gz: fb825b194042ef57993fdc9cdfe07b3ca4c72d6bd5a7337a79607d33f52fbf3063bd1b46f7fa3e76d69d9790e0b7a073eaf4c3b9b94ae385d188c71a28fafa47
6
+ metadata.gz: e18012b7ff457a3124282ad3818065f1aa171003de3cee74977b31a1b71cf98c70e061cd8014cbbb92d101f90eccaac4bfe14b59f458fa22d858c18cbd25f128
7
+ data.tar.gz: 24767df77157b6414355f94e8f2be863f0fd82582971f4da608bf5b8415969f365e0537ad5fe87b92d6b4ae4b279c35f87767efabce6fe9ffd89d95bc8cc87aa
data/README.md CHANGED
@@ -8,7 +8,7 @@ Allows for writing javascript browser tests in pure ruby.
8
8
  It is tailored for Isomorfeus and using [puppeteer-ruby](https://github.com/YusukeIwaki/puppeteer-ruby).
9
9
 
10
10
  ### Community and Support
11
- At the [Isomorfeus Framework Project](http://isomorfeus.com)
11
+ At the [Isomorfeus Framework Project](https://isomorfeus.com)
12
12
 
13
13
  ## Installation
14
14
 
@@ -3,11 +3,12 @@ module Isomorfeus
3
3
  module DSL
4
4
  @@launch_options = nil
5
5
 
6
- def set_launch_options(args: nil, channel: nil, default_viewport: nil, devtools: nil, dumpio: nil,
6
+ def set_launch_options(app: nil, args: nil, channel: nil, default_viewport: nil, devtools: nil, dumpio: nil,
7
7
  env: nil, executable_path: nil, handle_SIGINT: nil, handle_SIGTERM: nil, handle_SIGHUP: nil,
8
8
  headless: true, ignore_default_args: nil, ignore_https_errors: nil, pipe: nil,
9
9
  product: :chrome, slow_mo: nil, timeout: nil, user_data_dir: nil)
10
10
  @@launch_options = {
11
+ app: app,
11
12
  args: args,
12
13
  channel: channel&.to_s,
13
14
  devtools: devtools,
@@ -55,7 +56,7 @@ module Isomorfeus
55
56
  Isomorfeus::Puppetmaster.served_app.on_server(ruby_source, &block)
56
57
  end
57
58
 
58
- def new_session(app:, args: nil, channel: nil, default_viewport: nil, devtools: nil, dumpio: nil,
59
+ def new_session(app: nil, args: nil, channel: nil, default_viewport: nil, devtools: nil, dumpio: nil,
59
60
  env: nil, executable_path: nil, handle_SIGINT: nil, handle_SIGTERM: nil, handle_SIGHUP: nil,
60
61
  headless: true, ignore_default_args: nil, ignore_https_errors: nil, pipe: nil,
61
62
  product: :chrome, slow_mo: nil, timeout: nil, user_data_dir: nil)
@@ -24,6 +24,10 @@ module Isomorfeus
24
24
  ObjectSpace.define_finalizer(self, self.class.close_browser(self))
25
25
  end
26
26
 
27
+ def close
28
+ @browser.close
29
+ end
30
+
27
31
  def devices
28
32
  ::Puppeteer::DEVICES
29
33
  end
@@ -39,7 +43,7 @@ module Isomorfeus
39
43
  def goto(uri, referer: nil, timeout: nil, wait_until: 'networkidle0')
40
44
  parsed_uri = parse_uri(uri)
41
45
  @response = @default_page.goto(parsed_uri.to_s, referer: referer, timeout: timeout, wait_until: wait_until)
42
- self
46
+ @default_page
43
47
  end
44
48
  alias_method :visit, :goto
45
49
 
@@ -89,7 +93,7 @@ module Isomorfeus
89
93
 
90
94
  def eval_ruby(ruby_source = '', &block)
91
95
  ruby_source = Isomorfeus::Puppetmaster.block_source_code(&block) if block_given?
92
- compiled_ruby = compile_ruby_source(ruby_source)
96
+ compiled_ruby = Isomorfeus::Puppetmaster.compile_ruby_source(ruby_source)
93
97
  res = self.evaluate "function(){ try { return #{compiled_ruby} } catch (e) { return { error: e.name, message: e.message, stack: e.stack }; }}"
94
98
  if res.is_a?(Hash) && res.key?('error') && res.key?('message') && res.key?('stack')
95
99
  e = RuntimeError.new("#{res['error']}: #{res['message']}")
@@ -101,7 +105,7 @@ module Isomorfeus
101
105
 
102
106
  def eval_with_opal(ruby_source = '', &block)
103
107
  ruby_source = Isomorfeus::Puppetmaster.block_source_code(&block) if block_given?
104
- compiled_ruby = compile_ruby_source(ruby_source)
108
+ compiled_ruby = Isomorfeus::Puppetmaster.compile_ruby_source(ruby_source)
105
109
  res = self.evaluate <<~JAVASCRIPT
106
110
  function(){
107
111
  if (typeof Opal === "undefined") {
@@ -1,3 +1,3 @@
1
1
  module Isomorfeus
2
- PUPPETMASTER_VERSION = '0.6.1'
2
+ PUPPETMASTER_VERSION = '0.6.5'
3
3
  end
@@ -9,8 +9,11 @@ module Isomorfeus
9
9
  end
10
10
 
11
11
  def block_source_code(&block)
12
- source_block = Parser::CurrentRuby.parse(block.source).children.last
13
- source_block = source_block.children.last if source_block.type == :block
12
+ source_block = Parser::CurrentRuby.parse(block.source.strip)
13
+ unless source_block.type == :block
14
+ source_block = source_block.children[source_block.children.index { |c| c.respond_to?(:type) && c.type == :block }]
15
+ end
16
+ source_block = source_block.children[2]
14
17
  Unparser.unparse(source_block)
15
18
  end
16
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-puppetmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-25 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.40.1
89
+ version: 0.40.3
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.40.1
96
+ version: 0.40.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: tty-which
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -178,34 +178,20 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: launchy
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: 2.5.0
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: 2.5.0
195
181
  - !ruby/object:Gem::Dependency
196
182
  name: nokogiri
197
183
  requirement: !ruby/object:Gem::Requirement
198
184
  requirements:
199
185
  - - "~>"
200
186
  - !ruby/object:Gem::Version
201
- version: 1.12.5
187
+ version: 1.13.1
202
188
  type: :development
203
189
  prerelease: false
204
190
  version_requirements: !ruby/object:Gem::Requirement
205
191
  requirements:
206
192
  - - "~>"
207
193
  - !ruby/object:Gem::Version
208
- version: 1.12.5
194
+ version: 1.13.1
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: opal-browser
211
197
  requirement: !ruby/object:Gem::Requirement
@@ -282,14 +268,14 @@ dependencies:
282
268
  requirements:
283
269
  - - "~>"
284
270
  - !ruby/object:Gem::Version
285
- version: 3.51.0
271
+ version: 3.52.0
286
272
  type: :development
287
273
  prerelease: false
288
274
  version_requirements: !ruby/object:Gem::Requirement
289
275
  requirements:
290
276
  - - "~>"
291
277
  - !ruby/object:Gem::Version
292
- version: 3.51.0
278
+ version: 3.52.0
293
279
  - !ruby/object:Gem::Dependency
294
280
  name: tilt
295
281
  requirement: !ruby/object:Gem::Requirement
@@ -327,11 +313,12 @@ files:
327
313
  - lib/isomorfeus/puppetmaster/server/middleware.rb
328
314
  - lib/isomorfeus/puppetmaster/session.rb
329
315
  - lib/isomorfeus/puppetmaster/version.rb
330
- homepage: http://isomorfeus.com
316
+ homepage: https://isomorfeus.com
331
317
  licenses:
332
318
  - MIT
333
319
  metadata:
334
320
  github_repo: ssh://github.com/isomorfeus/gems
321
+ source_code_uri: https://github.com/isomorfeus/isomorfeus-puppetmaster
335
322
  post_install_message:
336
323
  rdoc_options: []
337
324
  require_paths: