sugarcube 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoa/sugarcube-foundation/nsstring.rb +8 -4
- data/lib/ios/sugarcube-repl/repl.rb +3 -4
- data/lib/osx/sugarcube-repl/repl.rb +7 -5
- data/lib/version.rb +1 -1
- data/spec/ios/nsstring_spec.rb +7 -0
- metadata +72 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cafb2361552a041c24b9e363c89a977c51d0555
|
4
|
+
data.tar.gz: a5748317cfb7ddca118cd9f95d58e437e63147e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17ee322c4bc4c1d054db7ba41b4382f0de7d992aebe266e0101df4e79c17d8f3be97dcc2952779d96baa5ee1a56e3f0f56c2bc232084eb5f18c059afd7a8943e
|
7
|
+
data.tar.gz: fab4014b589e6399719a14c215c74b3980e19cb69be2c7edcdab7721e6fb6b14bbc73469ec5b2b206dc09378fb34066555b94b911476b19d0f9ad65c7135aebb
|
@@ -1,13 +1,17 @@
|
|
1
1
|
class NSString
|
2
2
|
|
3
3
|
# @return [NSURL]
|
4
|
-
def nsurl
|
5
|
-
@url ||=
|
4
|
+
def nsurl(baseURL=nil)
|
5
|
+
@url ||= begin
|
6
|
+
baseURL.nil? ? NSURL.alloc.initWithString(self) : NSURL.alloc.initWithString(self, relativeToURL: baseURL)
|
7
|
+
end
|
6
8
|
end
|
7
9
|
|
8
10
|
# @return [NSURL]
|
9
|
-
def fileurl
|
10
|
-
@fileurl ||=
|
11
|
+
def fileurl(baseURL=nil)
|
12
|
+
@fileurl ||= begin
|
13
|
+
baseURL.nil? ? NSURL.fileURLWithPath(self) : NSURL.fileURLWithPath(self, relativeToURL: baseURL)
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
def escape_url
|
@@ -4,11 +4,10 @@ module SugarCube
|
|
4
4
|
def window(index=nil)
|
5
5
|
if index
|
6
6
|
UIApplication.sharedApplication.windows[index]
|
7
|
+
elsif UIApplication.sharedApplication.keyWindow
|
8
|
+
UIApplication.sharedApplication.keyWindow
|
7
9
|
else
|
8
|
-
|
9
|
-
UIApplication.sharedApplication.keyWindow ||
|
10
|
-
UIApplication.sharedApplication.windows[0]
|
11
|
-
)
|
10
|
+
UIApplication.sharedApplication.windows.select { |window| window.subviews.count > 0 }.first
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
@@ -4,12 +4,14 @@ module SugarCube
|
|
4
4
|
def window(index=nil)
|
5
5
|
if index
|
6
6
|
NSApplication.sharedApplication.windows[index]
|
7
|
+
elsif NSApplication.sharedApplication.keyWindow
|
8
|
+
NSApplication.sharedApplication.keyWindow
|
9
|
+
elsif NSApplication.sharedApplication.mainWindow
|
10
|
+
NSApplication.sharedApplication.mainWindow
|
7
11
|
else
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
NSApplication.sharedApplication.windows[0]
|
12
|
-
)
|
12
|
+
NSApplication.sharedApplication.windows.select { |window|
|
13
|
+
window.contentView != nil && window.contentView.subviews.count > 0
|
14
|
+
}.first
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
data/lib/version.rb
CHANGED
data/spec/ios/nsstring_spec.rb
CHANGED
@@ -7,6 +7,13 @@ describe "NSString" do
|
|
7
7
|
url.host.should == 'github.com'
|
8
8
|
end
|
9
9
|
|
10
|
+
it "should have a #nsurl method with baseURL parametor" do
|
11
|
+
url = 'status'.nsurl('https://github.com'.nsurl)
|
12
|
+
url.should.be.kind_of(NSURL)
|
13
|
+
url.absoluteString.should == 'https://github.com/status'
|
14
|
+
url.host.should == 'github.com'
|
15
|
+
end
|
16
|
+
|
10
17
|
it "should have a #nsdata method" do
|
11
18
|
data = 'test'.nsdata
|
12
19
|
data.should.be.kind_of(NSData)
|
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: 3.4.
|
4
|
+
version: 3.4.1
|
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: 2017-11-27 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description: |
|
18
18
|
== Description
|
@@ -304,7 +304,7 @@ files:
|
|
304
304
|
- spec/osx/symbol_constants_spec.rb
|
305
305
|
homepage: https://github.com/rubymotion/sugarcube
|
306
306
|
licenses:
|
307
|
-
-
|
307
|
+
- MIT
|
308
308
|
metadata: {}
|
309
309
|
post_install_message:
|
310
310
|
rdoc_options: []
|
@@ -322,88 +322,88 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
322
|
version: '0'
|
323
323
|
requirements: []
|
324
324
|
rubyforge_project:
|
325
|
-
rubygems_version: 2.
|
325
|
+
rubygems_version: 2.5.2
|
326
326
|
signing_key:
|
327
327
|
specification_version: 4
|
328
328
|
summary: Extensions for Ruby to make Rubymotion development more enjoyable, and hopefully
|
329
329
|
more rubyesque!
|
330
330
|
test_files:
|
331
|
-
- spec/
|
331
|
+
- spec/osx/color_other_representations_spec.rb
|
332
|
+
- spec/osx/frameable_spec.rb
|
333
|
+
- spec/osx/symbol_constants_spec.rb
|
334
|
+
- spec/osx/color_spec.rb
|
335
|
+
- spec/osx/color_components_spec.rb
|
336
|
+
- spec/osx/base64_spec.rb
|
337
|
+
- spec/osx/nsview_spec.rb
|
338
|
+
- spec/osx/nsattributedstring_spec.rb
|
339
|
+
- spec/osx/spritekit_spec.rb
|
332
340
|
- spec/all/numeric_spec.rb
|
333
|
-
- spec/
|
334
|
-
- spec/
|
335
|
-
- spec/cocoa/calayer_spec.rb
|
336
|
-
- spec/cocoa/nsarray_files_spec.rb
|
337
|
-
- spec/cocoa/nsattributedstring_spec.rb
|
338
|
-
- spec/cocoa/nscoder_spec.rb
|
339
|
-
- spec/cocoa/nsdata_files_spec.rb
|
340
|
-
- spec/cocoa/nsdictionary_files_spec.rb
|
341
|
-
- spec/cocoa/nsindexpath_spec.rb
|
342
|
-
- spec/cocoa/numeric_time_spec.rb
|
343
|
-
- spec/cocoa/timer_spec.rb
|
344
|
-
- spec/helpers/attributed_string.rb
|
345
|
-
- spec/ios/568_spec.rb
|
346
|
-
- spec/ios/animation_chain_spec.rb
|
347
|
-
- spec/ios/base64_spec.rb
|
348
|
-
- spec/ios/color_components_spec.rb
|
349
|
-
- spec/ios/color_other_representations_spec.rb
|
350
|
-
- spec/ios/color_spec.rb
|
351
|
-
- spec/ios/core_graphics_spec.rb
|
352
|
-
- spec/ios/core_location_spec.rb
|
353
|
-
- spec/ios/date_parser_spec.rb
|
354
|
-
- spec/ios/factories_spec.rb
|
355
|
-
- spec/ios/fixnum_spec.rb
|
356
|
-
- spec/ios/frameable_spec.rb
|
341
|
+
- spec/all/anonymous_spec.rb
|
342
|
+
- spec/ios/notification_spec.rb
|
357
343
|
- spec/ios/gestures_spec.rb
|
358
|
-
- spec/ios/
|
359
|
-
- spec/ios/
|
360
|
-
- spec/ios/image_scale_spec.rb
|
344
|
+
- spec/ios/color_other_representations_spec.rb
|
345
|
+
- spec/ios/nsdate_upto_spec.rb
|
361
346
|
- spec/ios/image_uiimage_filters_spec.rb
|
362
|
-
- spec/ios/
|
363
|
-
- spec/ios/
|
364
|
-
- spec/ios/
|
347
|
+
- spec/ios/uiwebview_spec.rb
|
348
|
+
- spec/ios/nsstring_files_spec.rb
|
349
|
+
- spec/ios/nsorderedset_spec.rb
|
365
350
|
- spec/ios/nsdata_spec.rb
|
366
|
-
- spec/ios/
|
367
|
-
- spec/ios/
|
368
|
-
- spec/ios/
|
351
|
+
- spec/ios/uiview_spec.rb
|
352
|
+
- spec/ios/uibarbuttonitem_spec.rb
|
353
|
+
- spec/ios/uiview_animation_tumble_spec.rb
|
354
|
+
- spec/ios/nsarray_spec.rb
|
355
|
+
- spec/ios/frameable_spec.rb
|
356
|
+
- spec/ios/core_location_spec.rb
|
357
|
+
- spec/ios/image_cifilters_spec.rb
|
358
|
+
- spec/ios/uicolor_spec.rb
|
369
359
|
- spec/ios/nsindexpath_spec.rb
|
370
|
-
- spec/ios/
|
371
|
-
- spec/ios/nsset_spec.rb
|
372
|
-
- spec/ios/nsstring_files_spec.rb
|
373
|
-
- spec/ios/nsstring_spec.rb
|
374
|
-
- spec/ios/nsstring_timezone_spec.rb
|
375
|
-
- spec/ios/nsurl_spec.rb
|
376
|
-
- spec/ios/numeric_spec.rb
|
377
|
-
- spec/ios/pipes_spec.rb
|
378
|
-
- spec/ios/spritekit_spec.rb
|
360
|
+
- spec/ios/uilabel_spec.rb
|
379
361
|
- spec/ios/symbol_constants_spec.rb
|
380
|
-
- spec/ios/
|
381
|
-
- spec/ios/symbol_uifont_spec.rb
|
362
|
+
- spec/ios/nsstring_timezone_spec.rb
|
382
363
|
- spec/ios/uiactionsheet_spec.rb
|
383
|
-
- spec/ios/
|
384
|
-
- spec/ios/
|
385
|
-
- spec/ios/
|
386
|
-
- spec/ios/
|
387
|
-
- spec/ios/
|
364
|
+
- spec/ios/symbol_uicolor_spec.rb
|
365
|
+
- spec/ios/uiview_animation_spec.rb
|
366
|
+
- spec/ios/uiviewcontroller_spec.rb
|
367
|
+
- spec/ios/nsdate_delta_spec.rb
|
368
|
+
- spec/ios/nsset_spec.rb
|
388
369
|
- spec/ios/uicontrol_spec.rb
|
389
|
-
- spec/ios/
|
370
|
+
- spec/ios/uialertview_spec.rb
|
371
|
+
- spec/ios/uitableviewcell_spec.rb
|
372
|
+
- spec/ios/nsstring_spec.rb
|
373
|
+
- spec/ios/image_scale_spec.rb
|
374
|
+
- spec/ios/color_spec.rb
|
390
375
|
- spec/ios/uiimage_spec.rb
|
391
|
-
- spec/ios/
|
376
|
+
- spec/ios/color_components_spec.rb
|
377
|
+
- spec/ios/fixnum_spec.rb
|
378
|
+
- spec/ios/uifont_spec.rb
|
379
|
+
- spec/ios/568_spec.rb
|
380
|
+
- spec/ios/animation_chain_spec.rb
|
381
|
+
- spec/ios/base64_spec.rb
|
382
|
+
- spec/ios/core_graphics_spec.rb
|
383
|
+
- spec/ios/unholy_spec.rb
|
384
|
+
- spec/ios/numeric_spec.rb
|
385
|
+
- spec/ios/uibutton_spec.rb
|
386
|
+
- spec/ios/nsurl_spec.rb
|
392
387
|
- spec/ios/uitabbaritem_spec.rb
|
393
|
-
- spec/ios/
|
394
|
-
- spec/ios/
|
395
|
-
- spec/ios/
|
388
|
+
- spec/ios/factories_spec.rb
|
389
|
+
- spec/ios/symbol_uifont_spec.rb
|
390
|
+
- spec/ios/image_color_at_spec.rb
|
391
|
+
- spec/ios/pipes_spec.rb
|
396
392
|
- spec/ios/uiview_attr_updates_spec.rb
|
397
|
-
- spec/ios/
|
398
|
-
- spec/ios/
|
399
|
-
- spec/ios/
|
400
|
-
- spec/ios/
|
401
|
-
- spec/
|
402
|
-
- spec/
|
403
|
-
- spec/
|
404
|
-
- spec/
|
405
|
-
- spec/
|
406
|
-
- spec/
|
407
|
-
- spec/
|
408
|
-
- spec/
|
409
|
-
- spec/
|
393
|
+
- spec/ios/nsattributedstring_spec.rb
|
394
|
+
- spec/ios/uialertcontroller_spec.rb
|
395
|
+
- spec/ios/date_parser_spec.rb
|
396
|
+
- spec/ios/spritekit_spec.rb
|
397
|
+
- spec/ios/nsdate_spec.rb
|
398
|
+
- spec/cocoa/nscoder_spec.rb
|
399
|
+
- spec/cocoa/numeric_time_spec.rb
|
400
|
+
- spec/cocoa/nsarray_files_spec.rb
|
401
|
+
- spec/cocoa/calayer_spec.rb
|
402
|
+
- spec/cocoa/nsindexpath_spec.rb
|
403
|
+
- spec/cocoa/nsdictionary_files_spec.rb
|
404
|
+
- spec/cocoa/caanimation_spec.rb
|
405
|
+
- spec/cocoa/nsdata_files_spec.rb
|
406
|
+
- spec/cocoa/timer_spec.rb
|
407
|
+
- spec/cocoa/base64_spec.rb
|
408
|
+
- spec/cocoa/nsattributedstring_spec.rb
|
409
|
+
- spec/helpers/attributed_string.rb
|