webview 0.1.1 → 0.1.3

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: 71067f7cf653b0246423225eedfcf954ca345d14b3d180698cdea616d7f237ae
4
- data.tar.gz: 135bed20ebfc2cbd0710d01a0198918c68d01bdf51b630dc5415ef651569647e
3
+ metadata.gz: 1358c823e6ab0054271f98c44f79c14b1044ac734c1236db84385068e806583e
4
+ data.tar.gz: 6168d576afdb5ed4dadf25e3570215d54558e6f460b403b07ba43b8b626b232e
5
5
  SHA512:
6
- metadata.gz: 20da9dcdd1a136e08b493407fb4311b300a1fc167c3f32b1b936385c9459e1542953a8c7487e85e65158a097d2e7f962dadfd7a287e2d134889e0a1e611beedc
7
- data.tar.gz: 906ae1b839bb19dc1421e7f5b9b66f77ad79232a3d291373c605a6b76e3ce05b60068a8c46f54e44940e8431f9680a07585501472bdb0e13c1e49a742be1e06e
6
+ metadata.gz: cbb2e2692d2d0783e56775a727236ba6112002b4543df5ca792f7059dff2370e46cb6936dfe247924aece81910c3039bffe092cb8caf40d4d85eab8bf437b498
7
+ data.tar.gz: effe7f13a840a1cd5cf0aa1a8a2d9344c421b527849ad7c36d9cc24c6f78d6e6b10e22675a392c118cdc42f062ae543879797807a2fb7c4721091011a1de5057
data/.travis.yml CHANGED
@@ -13,10 +13,7 @@ before_install:
13
13
  - sudo apt-get update
14
14
  - sudo apt-get install libwebkit2gtk-4.0-dev -y
15
15
 
16
- - cd ext
17
- - ruby extconf.rb
18
- - make && make install
19
- - cd ..
16
+ - bin/build_ext
20
17
 
21
18
  script:
22
19
  - bundle exec rspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webview (0.1.0)
4
+ webview (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -104,6 +104,11 @@ Some ways:
104
104
 
105
105
  When I finish my application, I will make a gem of the framework.
106
106
 
107
+
108
+ ## TODO
109
+
110
+ Test golang code by golang
111
+
107
112
  ## Development
108
113
 
109
114
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
@@ -3,4 +3,7 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task :test do
7
+ system("cd ext && ruby extconf.rb && make clean && make && make install")
8
+ Rake::Task[:spec].invoke
9
+ end
data/bin/build_ext ADDED
@@ -0,0 +1,10 @@
1
+ #! /bin/bash
2
+
3
+ set -ex
4
+
5
+ cd ext
6
+ ruby extconf.rb
7
+ make clean
8
+ make
9
+ make install
10
+
data/ext/Makefile CHANGED
@@ -10,5 +10,5 @@ install:
10
10
  mv webview/webview ./webview_app
11
11
 
12
12
  clean:
13
- rm webview_app
14
- rm ext_package
13
+ rm -f webview_app
14
+ rm -f ext_package
data/lib/webview/app.rb CHANGED
@@ -21,10 +21,7 @@ module Webview
21
21
 
22
22
  def open(url)
23
23
  return true if @app_process
24
- cmd = [
25
- File.expand_path('ext/webview_app', ROOT_PATH),
26
- "-url '#{url}'"
27
- ]
24
+ cmd = [executable, "-url '#{url}'"]
28
25
  @options.each do |k, v|
29
26
  case v
30
27
  when true, false then cmd << "-#{k}" if v
@@ -42,7 +39,10 @@ module Webview
42
39
  pid = app_process.pid
43
40
  signal('QUIT')
44
41
  begin
45
- Timeout.timeout(3) { Process.wait(pid) }
42
+ Timeout.timeout(3) do
43
+ Process.wait(pid)
44
+ rescue Errno::ECHILD, Errno::ESRCH
45
+ end
46
46
  rescue Timeout::Error
47
47
  kill
48
48
  end
@@ -53,7 +53,7 @@ module Webview
53
53
  def join
54
54
  return unless app_process && app_process.alive?
55
55
  Process.wait(app_process.pid)
56
- rescue Errno::ECHILD
56
+ rescue Errno::ECHILD, Errno::ESRCH
57
57
  end
58
58
 
59
59
  def kill
@@ -70,6 +70,10 @@ module Webview
70
70
 
71
71
  private
72
72
 
73
+ def executable
74
+ File.expand_path('ext/webview_app', ROOT_PATH)
75
+ end
76
+
73
77
  def exec_cmd(cmd)
74
78
  app_in, @app_out, @app_err, @app_process = Open3.popen3(cmd)
75
79
  app_in.close
@@ -1,3 +1,3 @@
1
1
  module Webview
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiangzhi.xie
@@ -68,6 +68,7 @@ files:
68
68
  - LICENSE.txt
69
69
  - README.md
70
70
  - Rakefile
71
+ - bin/build_ext
71
72
  - bin/console
72
73
  - bin/setup
73
74
  - ext/Makefile