xot 0.1.13 → 0.1.20

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: 88efd5d3701a109d4d84b73ca708534afd4b241b65e346a7713b7432c4448375
4
- data.tar.gz: 7e34ffbf480f514bd89288861adfe607250c370bb6f39a9a6f269ffec1a9fadf
3
+ metadata.gz: a0941e0c70c8185dbf66fe9c1d40215a942ae42353182246a093bef2644cbcab
4
+ data.tar.gz: 0f41c5285cc9717f5a48445c0e42e8599d8b2cfe2912576b36224870047d51ad
5
5
  SHA512:
6
- metadata.gz: 0c966eca380aa4d048f3f97a522e6b26b4b7bcf26b63f35f1a68ed3fa1e6d9fc075360004bbdfe338c7d2f57cf5b6b35be0ac76b7ed27d8beb20c38b6143b9ab
7
- data.tar.gz: 2626967aa53d9f1493a132bba2bdb18ae0b7ea67a4991351941c60116e6a27460ad07e8b4be560f32063c546a44ee004e3552ab2a740c6e0e358558951fc3abf
6
+ metadata.gz: a6866ea9aaea4c6a4daef98bd4841af32fea6c8a8cd7f4a18ac93800e5ac2f2eb7681f34888b53c05eff52091ef3655e5bd11b21ab293a4a589415b0eb91430d
7
+ data.tar.gz: 41377d969ee09f0b68a12de2203cdc57b7b788a56dc0a44697bcc1288e80a9a9c49768e97258b77f97c8d022fe34fd0ef9a9d28c66865630feb2ddd7093831f9
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 xord.org
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/Rakefile CHANGED
@@ -6,6 +6,7 @@
6
6
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
7
7
 
8
8
  require 'xot/rake'
9
+
9
10
  require 'xot/module'
10
11
 
11
12
 
@@ -13,7 +14,7 @@ MODULES = [Xot]
13
14
  DLNAME = 'tester'
14
15
 
15
16
  build_native_library
16
- build_ruby_extension dlname: :tester
17
+ build_ruby_extension dlname: DLNAME
17
18
  test_ruby_extension
18
19
  build_ruby_gem
19
20
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.13
1
+ 0.1.20
@@ -54,9 +54,6 @@ namespace Xot
54
54
  }// Types
55
55
 
56
56
 
57
- enum {UNKNOWN = 0};
58
-
59
-
60
57
  using namespace Types;
61
58
 
62
59
 
@@ -46,17 +46,29 @@ namespace Xot
46
46
  namespace ErrorFunctions
47
47
  {
48
48
 
49
- void xot_error (const char* file, int line, const char* format = NULL, ...);
49
+ [[noreturn]]
50
+ void xot_error (
51
+ const char* file, int line, const char* format = NULL, ...);
50
52
 
51
- void argument_error (const char* file, int line, const char* format = NULL, ...);
53
+ [[noreturn]]
54
+ void argument_error (
55
+ const char* file, int line, const char* format = NULL, ...);
52
56
 
53
- void index_error (const char* file, int line, const char* format = NULL, ...);
57
+ [[noreturn]]
58
+ void index_error (
59
+ const char* file, int line, const char* format = NULL, ...);
54
60
 
55
- void invalid_state_error (const char* file, int line, const char* format = NULL, ...);
61
+ [[noreturn]]
62
+ void invalid_state_error (
63
+ const char* file, int line, const char* format = NULL, ...);
56
64
 
57
- void system_error (const char* file, int line, const char* format = NULL, ...);
65
+ [[noreturn]]
66
+ void system_error (
67
+ const char* file, int line, const char* format = NULL, ...);
58
68
 
59
- void not_implemented_error (const char* file, int line, const char* format = NULL, ...);
69
+ [[noreturn]]
70
+ void not_implemented_error (
71
+ const char* file, int line, const char* format = NULL, ...);
60
72
 
61
73
  }// ErrorFunctions
62
74
 
@@ -6,7 +6,7 @@ require 'rake/loaders/makefile'
6
6
  require 'rake/testtask'
7
7
  require 'xot/rake/alias_task'
8
8
  require 'xot/rake/util'
9
- require 'xot/rake/escalation'
9
+ #require 'xot/rake/escalation'
10
10
 
11
11
 
12
12
  module Xot
@@ -127,7 +127,7 @@ module Xot
127
127
  libout = File.join ext_lib_dir, outname
128
128
 
129
129
  srcs = FileList["#{ext_dir}/**/*.cpp"]
130
- libs = modules.map {|m| m.name.downcase}.map {|s| "../#{s}/lib/lib#{s}.a"}
130
+ libs = modules.map {|m| "#{m.lib_dir}/lib#{m.name.downcase}.a"}
131
131
 
132
132
  alias_task :ext => libout
133
133
  alias_task :clean => 'ext:clean'
@@ -175,7 +175,7 @@ module Xot
175
175
  namespace :test do
176
176
  ::Rake::TestTask.new :full do |t|
177
177
  t.libs << lib_dir
178
- t.test_files = FileList["#{test_dir}/test_*.rb"] - test_alones - test_excludes
178
+ t.test_files = FileList["#{test_dir}/**/test_*.rb"] - test_alones - test_excludes
179
179
  t.verbose = true
180
180
  end
181
181
 
@@ -10,6 +10,7 @@ module Xot
10
10
 
11
11
  module Rake
12
12
 
13
+ VERSION_NAME = 'VERSION'
13
14
 
14
15
  def modules ()
15
16
  env(:MODULES, []).map {|m| m::Module}
@@ -83,6 +84,60 @@ module Xot
83
84
  paths
84
85
  end
85
86
 
87
+ def filter_file (path, &block)
88
+ File.write path, block.call(File.read path)
89
+ end
90
+
91
+ def cd_sh (dir, cmd)
92
+ Dir.chdir dir do
93
+ $stderr.puts "(in #{Dir.pwd})"
94
+ sh cmd
95
+ end
96
+ end
97
+
98
+ def modified_files (dir: '.', hash: '@')
99
+ `git diff --name-only #{hash} -- #{dir}`.lines.map &:chomp
100
+ end
101
+
102
+ def version_path (dir = nil)
103
+ dir ? "#{dir}/#{VERSION_NAME}" : VERSION_NAME
104
+ end
105
+
106
+ def get_version (dir = nil)
107
+ File.readlines(version_path dir).first.chomp
108
+ end
109
+
110
+ def bump_version (index, version = get_version)
111
+ nums = version.split('.').map &:to_i
112
+ nums << 0 until nums.size > index
113
+ nums[index] += 1
114
+ nums.map!.with_index {|num, i| i > index ? 0 : num}
115
+ nums.pop while nums.last == 0 && nums.size >= 3
116
+ nums.join '.'
117
+ end
118
+
119
+ def bump_version_file (index, dir: nil)
120
+ newver = bump_version index, get_version(dir)
121
+ File.write version_path(dir), newver
122
+ newver
123
+ end
124
+
125
+ def update_and_tag_version (index, dir: nil, &block)
126
+ raise 'modified files exist' unless modified_files.empty?
127
+
128
+ message = ENV['message']
129
+ raise 'no message' unless message
130
+
131
+ newver = bump_version_file index, dir: dir
132
+ raise 'version is not updated' unless modified_files == [version_path(dir)]
133
+
134
+ block.call if block
135
+
136
+ sh %( git add -u )
137
+ sh %( git commit -m "#{message}" )
138
+ sh %( git tag -a -m "#{message}" v#{newver} )
139
+ end
140
+
86
141
  def compile_erb (path, out)
87
142
  open(path) do |input|
88
143
  open(out, 'w') do |output|
@@ -165,8 +220,13 @@ module Xot
165
220
  end
166
221
 
167
222
  def make_cflags (flags = '')
223
+ warning_opts = %w[
224
+ no-unknown-pragmas
225
+ no-deprecated-register
226
+ no-reserved-user-defined-literal
227
+ ]
168
228
  s = flags.dup
169
- s << ' -Wno-unknown-pragmas -Wno-reserved-user-defined-literal'
229
+ s << warning_opts.map {|s| " -W#{s}"}.join
170
230
  s << ' -std=c++11' if gcc?
171
231
  s << ' -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7' if clang?
172
232
  s << ' ' + RbConfig::CONFIG['debugflags'] if debug?
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.13
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-23 00:00:00.000000000 Z
11
+ date: 2020-12-10 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++.
@@ -18,6 +18,7 @@ extensions:
18
18
  - Rakefile
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - LICENSE
21
22
  - README.md
22
23
  - Rakefile
23
24
  - VERSION
@@ -71,7 +72,7 @@ files:
71
72
  homepage: https://github.com/xord/xot
72
73
  licenses: []
73
74
  metadata: {}
74
- post_install_message:
75
+ post_install_message:
75
76
  rdoc_options: []
76
77
  require_paths:
77
78
  - lib
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  requirements: []
89
90
  rubygems_version: 3.0.3
90
- signing_key:
91
+ signing_key:
91
92
  specification_version: 4
92
93
  summary: A Utility library for C++ developemt.
93
94
  test_files: