sugarcube 3.5.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/cocoa/sugarcube-webkit/wkwebview.rb +10 -0
- data/lib/ios/sugarcube-webkit/wkwebview.rb +3 -0
- data/lib/osx/sugarcube-animations/nsview.rb +2 -2
- data/lib/osx/sugarcube-webkit/wkwebview.rb +3 -0
- data/lib/sugarcube-animations.rb +4 -0
- data/lib/sugarcube-attributedstring.rb +4 -0
- data/lib/sugarcube-webkit.rb +15 -0
- data/lib/version.rb +1 -1
- data/spec/ios/base64_spec.rb +1 -1
- data/spec/ios/wkwebview_spec.rb +37 -0
- metadata +9 -7
- data/lib/ios/sugarcube-ui/uiwebview.rb +0 -7
- data/spec/ios/uiwebview_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 525bee7443997247ce40ef9b565b1e88bbf830968f8dd7159b65b34f2db8ea65
|
4
|
+
data.tar.gz: df06188beb5ed2d875530b912255a7a4cff36eeb6bd6f7f01c64a39097f43c81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1afdfd31581d0bdcf25b932d6abf4fd1d477501021327039bc9431d14e26f60179a31f1a7e384542697352977dfc2c94e68f5fc216c95bd5c995c00531f05328
|
7
|
+
data.tar.gz: ec2fd8153567f360136d11aa001509c0e22497d1a075ca9ed6ceb7be0dcab35330db1a19a430676f63048502c330562a88b74f04a9aa42d30a4f33722937e6f4
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class NSView
|
2
2
|
|
3
3
|
class << self
|
4
4
|
|
@@ -45,7 +45,7 @@ class UIView
|
|
45
45
|
self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay
|
46
46
|
end
|
47
47
|
|
48
|
-
|
48
|
+
NSView.animate(options, &animations)
|
49
49
|
return self
|
50
50
|
end
|
51
51
|
|
data/lib/sugarcube-animations.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
unless defined?(Motion::Project::Config)
|
2
|
+
raise "The sugarcube gem must be required within a RubyMotion project Rakefile."
|
3
|
+
end
|
4
|
+
|
5
|
+
|
6
|
+
require 'sugarcube'
|
7
|
+
SugarCube.cocoa_only!('webkit')
|
8
|
+
|
9
|
+
Motion::Project::App.pre_setup do |app|
|
10
|
+
SugarCube.add_app_files(app, 'sugarcube-webkit')
|
11
|
+
end
|
12
|
+
|
13
|
+
Motion::Project::App.post_setup do |app|
|
14
|
+
app.frameworks += %w{WebKit}
|
15
|
+
end
|
data/lib/version.rb
CHANGED
data/spec/ios/base64_spec.rb
CHANGED
@@ -3,7 +3,7 @@ describe 'Base64' do
|
|
3
3
|
describe 'UIImage' do
|
4
4
|
|
5
5
|
it 'should convert image data (PNG) to base64' do
|
6
|
-
'test'.uiimage.nsdata.to_base64.should == '
|
6
|
+
'test'.uiimage.nsdata.to_base64.should == 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAHgCAIAAADrGJBNAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAAaADAAQAAAABAAAB4AAAAAAnyqA0AAAAHGlET1QAAAACAAAAAAAAAPAAAAAoAAAA8AAAAPAAAABL2vm5UQAAABdJREFUSA1iuGvEwDCKR8NgNA0MyTQAAAAA///pNBr0AAAAFUlEQVRjuGvEwDCKR8NgNA0MyTQAAI2d/DCqzvXsAAAAAElFTkSuQmCC'
|
7
7
|
end
|
8
8
|
|
9
9
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
describe "Sugarcube::WebView" do
|
2
|
+
|
3
|
+
describe WKWebView do
|
4
|
+
tests UIViewController
|
5
|
+
|
6
|
+
before do
|
7
|
+
@view = UIView.alloc.initWithFrame([[1,2],[3,4]])
|
8
|
+
controller.view.addSubview(@view)
|
9
|
+
|
10
|
+
@webview = WKWebView.alloc.init
|
11
|
+
@view << @webview
|
12
|
+
|
13
|
+
@webview.eval_js('') {|id, error| ;; } # NOOP
|
14
|
+
end
|
15
|
+
|
16
|
+
after do
|
17
|
+
@view = @webview = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
[["1 + 1", 2.0],
|
21
|
+
["null", nil],
|
22
|
+
["(function(x) { return x * x; })(4)", 16.0]].each do |str, expected|
|
23
|
+
it "should eval '#{str}'" do
|
24
|
+
@res = ''
|
25
|
+
|
26
|
+
@webview.eval_js(str) do |id, error|
|
27
|
+
@res = id
|
28
|
+
end
|
29
|
+
|
30
|
+
wait 5.0 do
|
31
|
+
@res.should == expected
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin T.A. Gray
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2020-02-25 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description: |
|
18
18
|
== Description
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/cocoa/sugarcube-to_s/nsurl.rb
|
99
99
|
- lib/cocoa/sugarcube-ui/calayer.rb
|
100
100
|
- lib/cocoa/sugarcube-ui/frameable.rb
|
101
|
+
- lib/cocoa/sugarcube-webkit/wkwebview.rb
|
101
102
|
- lib/cocoa/sugarcube/log.rb
|
102
103
|
- lib/ios/sugarcube-568/uiimage.rb
|
103
104
|
- lib/ios/sugarcube-animations/animation_chain.rb
|
@@ -158,7 +159,7 @@ files:
|
|
158
159
|
- lib/ios/sugarcube-ui/uipickerview.rb
|
159
160
|
- lib/ios/sugarcube-ui/uiview.rb
|
160
161
|
- lib/ios/sugarcube-ui/uiviewcontroller.rb
|
161
|
-
- lib/ios/sugarcube-
|
162
|
+
- lib/ios/sugarcube-webkit/wkwebview.rb
|
162
163
|
- lib/osx/sugarcube-animations/nsview.rb
|
163
164
|
- lib/osx/sugarcube-attributedstring/nsattributedstring.rb
|
164
165
|
- lib/osx/sugarcube-color/fixnum.rb
|
@@ -181,6 +182,7 @@ files:
|
|
181
182
|
- lib/osx/sugarcube-ui/nsstring.rb
|
182
183
|
- lib/osx/sugarcube-ui/nsview.rb
|
183
184
|
- lib/osx/sugarcube-ui/symbol.rb
|
185
|
+
- lib/osx/sugarcube-webkit/wkwebview.rb
|
184
186
|
- lib/sugarcube-568.rb
|
185
187
|
- lib/sugarcube-all.rb
|
186
188
|
- lib/sugarcube-animations.rb
|
@@ -220,6 +222,7 @@ files:
|
|
220
222
|
- lib/sugarcube-ui.rb
|
221
223
|
- lib/sugarcube-uikit.rb
|
222
224
|
- lib/sugarcube-unholy.rb
|
225
|
+
- lib/sugarcube-webkit.rb
|
223
226
|
- lib/sugarcube.rb
|
224
227
|
- lib/sugarcube_pre_setup.rb
|
225
228
|
- lib/version.rb
|
@@ -291,8 +294,8 @@ files:
|
|
291
294
|
- spec/ios/uiview_attr_updates_spec.rb
|
292
295
|
- spec/ios/uiview_spec.rb
|
293
296
|
- spec/ios/uiviewcontroller_spec.rb
|
294
|
-
- spec/ios/uiwebview_spec.rb
|
295
297
|
- spec/ios/unholy_spec.rb
|
298
|
+
- spec/ios/wkwebview_spec.rb
|
296
299
|
- spec/osx/base64_spec.rb
|
297
300
|
- spec/osx/color_components_spec.rb
|
298
301
|
- spec/osx/color_other_representations_spec.rb
|
@@ -321,8 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
324
|
- !ruby/object:Gem::Version
|
322
325
|
version: '0'
|
323
326
|
requirements: []
|
324
|
-
|
325
|
-
rubygems_version: 2.5.2.3
|
327
|
+
rubygems_version: 3.0.6
|
326
328
|
signing_key:
|
327
329
|
specification_version: 4
|
328
330
|
summary: Extensions for Ruby to make Rubymotion development more enjoyable, and hopefully
|
@@ -344,7 +346,6 @@ test_files:
|
|
344
346
|
- spec/ios/color_other_representations_spec.rb
|
345
347
|
- spec/ios/nsdate_upto_spec.rb
|
346
348
|
- spec/ios/image_uiimage_filters_spec.rb
|
347
|
-
- spec/ios/uiwebview_spec.rb
|
348
349
|
- spec/ios/nsstring_files_spec.rb
|
349
350
|
- spec/ios/nsorderedset_spec.rb
|
350
351
|
- spec/ios/nsdata_spec.rb
|
@@ -373,6 +374,7 @@ test_files:
|
|
373
374
|
- spec/ios/image_scale_spec.rb
|
374
375
|
- spec/ios/color_spec.rb
|
375
376
|
- spec/ios/uiimage_spec.rb
|
377
|
+
- spec/ios/wkwebview_spec.rb
|
376
378
|
- spec/ios/color_components_spec.rb
|
377
379
|
- spec/ios/fixnum_spec.rb
|
378
380
|
- spec/ios/uifont_spec.rb
|
data/spec/ios/uiwebview_spec.rb
DELETED