cocoawebview 0.3.6 → 0.3.7

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: 565509cd7519af65bf75223ae7b73a9df121d660f8f7b1ee6801d9d99aaa1941
4
- data.tar.gz: e9d81c5b9c308c21a3df5ea8d3f51cc5c2a88999ec25611e2007ff2f085f72eb
3
+ metadata.gz: b23a062232a47f6e4b07c88a26ade032888a45d98d095793a66c0352dd86a8cc
4
+ data.tar.gz: 1e770d12e1a76131845986ea1d787b509918d01c51ca50fcd652e95a4cbd4e1a
5
5
  SHA512:
6
- metadata.gz: e1a655389f33ae83b4007007bd8b63f549f55b0705a6a6b7671ec769c5f6a174107f00c130c78079ba50924bfc19d843b56f02a2d7ff3b32f1b10ec517c35211
7
- data.tar.gz: 833fe660daa5fc18de836d4224b0a194c93e118018d0e3d9e013f027316fbc2e27d4bcaaebabdb4fdc6a2ea7a9eb5fd5514f76c87eb052c72f2b9426e8594fee
6
+ metadata.gz: 640892f28816916318df53680cbfe10bb8e41fa562a41c846266f7e07a66c2acc014dd53527c377cd35d555495a4773c31f664d4bb50c6f78e50a09c63defc1b
7
+ data.tar.gz: ab214136f80bd4a5e9ba210ebfa8d7482a4b51e7bbab6091b167f4b96fe216a59d8b36d819285e9186ae857bd14420060edabaca66311bf1410f8f540802e221
@@ -56,10 +56,15 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
56
56
  NSArray<NSURL *> *fileURLs = [pasteboard readObjectsForClasses:@[[NSURL class]]
57
57
  options:@{NSPasteboardURLReadingFileURLsOnlyKey: @YES}];
58
58
 
59
- if (fileURLs.count > 0) {
60
- NSString *filePath = fileURLs[0].path;
59
+ VALUE files = rb_ary_new();
60
+ for (int i = 0; i < fileURLs.count; i++) {
61
+ NSString *filePath = fileURLs[i].path;
61
62
  VALUE ruby_file_path = rb_str_new_cstr([filePath UTF8String]);
62
- rb_funcall(rb_cocoawebview, rb_intern("file_did_drop"), 1, ruby_file_path);
63
+ rb_ary_push(files, ruby_file_path);
64
+ }
65
+
66
+ if (fileURLs.count > 0) {
67
+ rb_funcall(rb_cocoawebview, rb_intern("file_did_drop"), 1, files);
63
68
  return YES;
64
69
  }
65
70
  return NO;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocoawebview
4
- VERSION = "0.3.6"
4
+ VERSION = "0.3.7"
5
5
  end
data/lib/cocoawebview.rb CHANGED
@@ -46,8 +46,9 @@ module CocoaWebview
46
46
  puts "CocoaWebview did loaded"
47
47
  end
48
48
 
49
- def file_did_drop(file_path)
50
- puts "#{file_path} dropped"
49
+ def file_did_drop(files)
50
+ puts "Dropped below files:"
51
+ puts "#{files}"
51
52
  end
52
53
 
53
54
  def bind(name, &block)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoawebview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Jeff
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-07-04 00:00:00.000000000 Z
10
+ date: 2025-07-05 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Webview ruby binding for macOS
13
13
  email: