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 +4 -4
- data/.travis.yml +1 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/Rakefile +4 -1
- data/bin/build_ext +10 -0
- data/ext/Makefile +2 -2
- data/lib/webview/app.rb +10 -6
- data/lib/webview/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1358c823e6ab0054271f98c44f79c14b1044ac734c1236db84385068e806583e
|
4
|
+
data.tar.gz: 6168d576afdb5ed4dadf25e3570215d54558e6f460b403b07ba43b8b626b232e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb2e2692d2d0783e56775a727236ba6112002b4543df5ca792f7059dff2370e46cb6936dfe247924aece81910c3039bffe092cb8caf40d4d85eab8bf437b498
|
7
|
+
data.tar.gz: effe7f13a840a1cd5cf0aa1a8a2d9344c421b527849ad7c36d9cc24c6f78d6e6b10e22675a392c118cdc42f062ae543879797807a2fb7c4721091011a1de5057
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
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
data/bin/build_ext
ADDED
data/ext/Makefile
CHANGED
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)
|
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
|
data/lib/webview/version.rb
CHANGED
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.
|
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
|