xot 0.1.25 → 0.1.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d28e71082099d11ea8291b3b0584625a0f4965f4eac7ddc7e773fdf85c63168d
4
- data.tar.gz: 36695805ada2c39a9d5fbc843192a88c1673d1cdae16726cd258ba35fdee5853
3
+ metadata.gz: b815e9192036d41a7cd1a119bff854dac42bc51f1d0b112d5508279a9341c7b0
4
+ data.tar.gz: 12b61719ad797f1132993f2487e52c2a447a6251e64cbff761c1756b9b600c90
5
5
  SHA512:
6
- metadata.gz: b2fc66704a8acc15b95b9c637ebbc955bb4b8c6c33eb4d873cbd7395c710174a6f02721aa9b7d9a8f80748b6f4f095c01b5eb72b61645f95e2b5e770c71f72f4
7
- data.tar.gz: 7e38df2591560cb874bd9a9f4d1ea8f18dd75d4a434faa1617142dbbed41d2e3f5a6903b67dff4938f96a745ee095e5bc55769e403a2afdd9f6101f5aa02288c
6
+ metadata.gz: 12d3d7845f271f2e7828d4df69cadc1098fcfdad6aa83f4aa3938a2ff64684c914548c3d0f4926fbe3ad20af766d357b3fb3a53ea7e3031f1ec720527ec61413
7
+ data.tar.gz: 0e7d50caa552534ac194781b91d0934fd19ccdd38b2b34c870127f23bd6119c38fa4c27017469ecdc93f0b9332a976effbf7919cc043cd28bb8f4ec49b9bd48c
data/Rakefile CHANGED
@@ -18,4 +18,4 @@ build_ruby_extension dlname: DLNAME
18
18
  test_ruby_extension
19
19
  build_ruby_gem
20
20
 
21
- task :default => :test
21
+ task :default => :ext
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.25
1
+ 0.1.28
data/include/xot/ref.h CHANGED
@@ -185,6 +185,12 @@ namespace Xot
185
185
 
186
186
  bool operator != (const This& obj) const {return !operator==(obj);}
187
187
 
188
+ template <typename X>
189
+ bool operator == (const Ref<X>& obj) const {return ptr == obj.get();}
190
+
191
+ template <typename X>
192
+ bool operator != (const Ref<X>& obj) const {return !operator==(obj);}
193
+
188
194
  bool operator < (const This& obj) const {return ptr < obj.ptr;}
189
195
 
190
196
  operator bool () const {return ptr != NULL;}
@@ -272,6 +278,12 @@ namespace Xot
272
278
 
273
279
  bool operator != (const This& obj) const {return !operator==(obj);}
274
280
 
281
+ template <typename X>
282
+ bool operator == (const Ref<X>& obj) const {return ptr == obj.get();}
283
+
284
+ template <typename X>
285
+ bool operator != (const Ref<X>& obj) const {return !operator==(obj);}
286
+
275
287
  bool operator < (const This& obj) const {return ptr < obj.ptr;}
276
288
 
277
289
  operator bool () const {return ptr != NULL;}
@@ -6,11 +6,11 @@ module Xot
6
6
 
7
7
  module BlockUtil
8
8
 
9
- def instance_eval_or_block_call(recv, *args, &block)
9
+ def instance_eval_or_block_call(recv, *args, **kwargs, &block)
10
10
  if block.arity == 0
11
11
  recv.instance_eval(&block)
12
12
  else
13
- block.call recv, *args
13
+ block.call recv, *args, **kwargs
14
14
  end
15
15
  end
16
16
 
data/lib/xot/hookable.rb CHANGED
@@ -7,8 +7,7 @@ module Xot
7
7
  module Hookable
8
8
 
9
9
  def hook(name, &block)
10
- c = class << self; self; end
11
- c.__send__ :define_method, name, &block
10
+ singleton_class.__send__ :define_method, name, &block
12
11
  self
13
12
  end
14
13
 
data/lib/xot/rake/util.rb CHANGED
@@ -228,8 +228,8 @@ module Xot
228
228
  s = flags.dup
229
229
  s << warning_opts.map {|s| " -W#{s}"}.join
230
230
  s << " -arch arm64" if RUBY_PLATFORM =~ /arm64-darwin/
231
- s << ' -std=c++17' if gcc?
232
- s << ' -std=c++17 -stdlib=libc++ -mmacosx-version-min=10.7' if clang?
231
+ s << ' -std=c++20' if gcc?
232
+ s << ' -std=c++20 -stdlib=libc++ -mmacosx-version-min=10.7' if clang?
233
233
  s << ' ' + RbConfig::CONFIG['debugflags'] if debug?
234
234
  s.gsub!(/-O\d?\w*/, '-O0') if debug?
235
235
  s
@@ -20,8 +20,8 @@ module Xot
20
20
  alias_method :#{set}, options[:writer] || :#{name}=
21
21
  alias_method :#{get}, options[:reader] || :#{name}
22
22
  private :#{set}, :#{get}
23
- def #{name}(*args)
24
- #{set}(*args) unless args.empty?
23
+ def #{name}(*args, **kwargs)
24
+ #{set}(*args, **kwargs) unless args.empty? && args.empty?
25
25
  #{get}
26
26
  end
27
27
  END
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-04 00:00:00.000000000 Z
11
+ date: 2022-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.2.32
104
+ rubygems_version: 3.2.33
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: A Utility library for C++ developemt.