xot 0.2.1 → 0.3.1

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: 3699d7ae604c3bc0d96a0ebacf3c3a22115e1ba338c9178ebaaf064ad93ca282
4
- data.tar.gz: 810dc619b0d9bf7c0bae8ab97118a3f6170bd864b9872c0efbbce0973a4ea8e1
3
+ metadata.gz: 7ebe7556be35dc2f7ae7d8eb1143845db27027a947e66dc782cc8b1d2fc9ce20
4
+ data.tar.gz: 7599cff806e863128eeab7426810dbedd4b5472e29fa15c9d50d4eebff9fee7f
5
5
  SHA512:
6
- metadata.gz: 6fc79411d29fe6a9a26c08e6aeb0979db6a8806c4c1a1361028f0aa402a30612ffa3ca1483bb7b78ae007e9b4d6f7a92139d95dcc57b9e5e290df1a93762c34e
7
- data.tar.gz: 261e370e9c80c9606c44bfd621677381f3c528d9387419c418a18a54ec5dbb53ecf43ce16f3b5f027010ea6e4f39974abf42ddd535d13a40ffc7d4a1e8f8653d
6
+ metadata.gz: 8fc03885e3503cfd761408e4b4cf17a9b46f903c9dcb65251d18a8125b03e6cae6a25fe2ed8c56c9ed43b46c53640c01797b836e408d2e8657d2efaea5990783
7
+ data.tar.gz: 48847d41602008727fbd66bf990f9c2b81e21e46239ab19352bb47decc8040a910d5f961b5cd462f46f2ea4fdadd5de74493671dd26696f65dbec298260299c0
@@ -24,7 +24,7 @@ jobs:
24
24
  run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
25
25
 
26
26
  - name: test
27
- run: bundle exec rake quiet test
27
+ run: bundle exec rake quiet packages test
28
28
 
29
29
  - name: create gem
30
30
  id: gem
@@ -24,6 +24,9 @@ jobs:
24
24
  - name: setup dependencies
25
25
  run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
26
26
 
27
+ - name: packages
28
+ run: bundle exec rake packages
29
+
27
30
  - name: lib
28
31
  run: bundle exec rake lib
29
32
 
data/ChangeLog.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # xot ChangeLog
2
2
 
3
3
 
4
+ ## [v0.3.1] - 2025-01-13
5
+
6
+ - Update LICENSE
7
+
8
+
9
+ ## [v0.3] - 2024-07-06
10
+
11
+ - Support Windows
12
+
13
+
4
14
  ## [v0.2.1] - 2024-07-05
5
15
 
6
16
  - Add xot/util.rb
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GEM
9
9
 
10
10
  PLATFORMS
11
11
  arm64-darwin-21
12
- arm64-darwin-22
12
+ arm64-darwin-23
13
13
 
14
14
  DEPENDENCIES
15
15
  rake
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 xord.org
3
+ Copyright (c) 2011 xord.org
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  # -*- mode: ruby -*-
2
2
 
3
-
4
3
  %w[.]
5
4
  .map {|s| File.expand_path "#{s}/lib", __dir__}
6
5
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.1
@@ -0,0 +1,15 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __XOT_WINDOWS_H__
4
+ #define __XOT_WINDOWS_H__
5
+
6
+
7
+ #ifdef WIN32
8
+ #undef _WIN32_WINNT
9
+ #define _WIN32_WINNT _WIN32_WINNT_WIN7
10
+ #include <windows.h>
11
+ #include <windowsx.h>
12
+ #endif
13
+
14
+
15
+ #endif//EOH
data/include/xot.h CHANGED
@@ -15,5 +15,7 @@
15
15
  #include <xot/noncopyable.h>
16
16
  #include <xot/util.h>
17
17
 
18
+ //#include <xot/windows.h>
19
+
18
20
 
19
21
  #endif//EOH
data/lib/xot/extconf.rb CHANGED
@@ -29,8 +29,8 @@ module Xot
29
29
 
30
30
  extensions.each do |ext|
31
31
  name = ext.name.downcase
32
- headers << "#{name}.h"
33
- libs << name
32
+ headers << "#{name}.h"
33
+ local_libs << name
34
34
  end
35
35
 
36
36
  ldflags = $LDFLAGS.dup
@@ -45,7 +45,7 @@ module Xot
45
45
  $CFLAGS = make_cflags $CFLAGS + ' -x c++'
46
46
  $CXXFLAGS = make_cflags $CXXFLAGS + ' -x c++' if $CXXFLAGS
47
47
  $LDFLAGS = make_ldflags ldflags, lib_dirs, frameworks
48
- $LOCAL_LIBS << local_libs.map {|s| " -l#{s}"}.join
48
+ $LOCAL_LIBS << local_libs.reverse.map {|s| " -l#{s}"}.join
49
49
  end
50
50
 
51
51
  def create_makefile(*args)
data/lib/xot/rake/util.rb CHANGED
@@ -55,7 +55,10 @@ module Xot
55
55
  end
56
56
 
57
57
  def inc_dirs()
58
- env_array(:INCDIRS, []) + extensions.reverse.map {|m| m.inc_dir}.flatten
58
+ dirs = env_array :INCDIRS, []
59
+ dirs += extensions.reverse.map {|m| m.inc_dir}.flatten
60
+ dirs << "#{env :MINGW_PREFIX}/include" if mingw?
61
+ dirs
59
62
  end
60
63
 
61
64
  def src_dirs()
@@ -170,11 +173,15 @@ module Xot
170
173
 
171
174
  def make_cppflags_defs(defs = [])
172
175
  a = defs.dup
173
- a << $~[0].upcase if RUBY_PLATFORM =~ /mswin|ming|cygwin|darwin/i
174
176
  a << (debug? ? '_DEBUG' : 'NDEBUG')
175
- a << 'WIN32' if win32?
176
- a << 'OSX' if osx?
177
- a << 'IOS' if ios?
177
+ a << target.name.upcase
178
+ a << $~[0].upcase if RUBY_PLATFORM =~ /mswin|mingw|cygwin|darwin/i
179
+ a << 'WIN32' if win32?
180
+ a << 'OSX' if osx?
181
+ a << 'IOS' if ios?
182
+ a << 'GCC' if gcc?
183
+ a << 'CLANG' if clang?
184
+ a << '_USE_MATH_DEFINES' if gcc?
178
185
  a
179
186
  end
180
187
 
@@ -192,11 +199,11 @@ module Xot
192
199
  end
193
200
 
194
201
  def make_cflags(flags = '')
195
- warning_opts = %w[
196
- no-unknown-pragmas
202
+ warning_opts = %w[no-unknown-pragmas]
203
+ warning_opts += %w[
197
204
  no-deprecated-register
198
205
  no-reserved-user-defined-literal
199
- ]
206
+ ] if clang?
200
207
  s = flags.dup
201
208
  s << warning_opts.map {|s| " -W#{s}"}.join
202
209
  s << " -arch arm64" if RUBY_PLATFORM =~ /arm64-darwin/
data/lib/xot/rake.rb CHANGED
@@ -276,7 +276,7 @@ module Xot
276
276
  desc "install packages"
277
277
  task :packages do
278
278
  case
279
- when osx? && osx.size > 0
279
+ when osx? && osx.size > 0
280
280
  sh %( brew install #{osx.join ' '} )
281
281
  when win32? && win32.size > 0
282
282
  prefix = 'MINGW_PACKAGE_PREFIX'
@@ -359,6 +359,9 @@ module Xot
359
359
  end
360
360
 
361
361
  def define_placeholder_tasks()
362
+ desc "install all external packages"
363
+ alias_task :packages
364
+
362
365
  desc "setup all external libraries"
363
366
  alias_task :vendor
364
367
 
data/src/exception.cpp CHANGED
@@ -1,9 +1,7 @@
1
1
  #include "xot/exception.h"
2
2
 
3
3
 
4
- #ifdef WIN32
5
- #include <windows.h>
6
- #endif
4
+ #include "xot/windows.h"
7
5
 
8
6
 
9
7
  namespace Xot
data/src/string.cpp CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  #include <stdio.h>
5
+ #include <string.h>
5
6
  #include <algorithm>
6
7
  #include <memory>
7
8
  #include "xot/exception.h"
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.2.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2025-01-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This library include some useful utility classes and functions for development
14
14
  with C++.
@@ -41,6 +41,7 @@ files:
41
41
  - include/xot/string.h
42
42
  - include/xot/time.h
43
43
  - include/xot/util.h
44
+ - include/xot/windows.h
44
45
  - lib/xot.rb
45
46
  - lib/xot/bit_flag.rb
46
47
  - lib/xot/bit_flag_accessor.rb