xot 0.1.34 → 0.1.35

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: e9b5197cb38389ca854063207be401c6f07760fca67dadae435addcf6e1d3ea1
4
- data.tar.gz: fb6537b39bd5bfa38fb2fd7386bedcc6f67bf0c3b5acaabc580bca047da0a5f6
3
+ metadata.gz: af347a8f52c2017aab855762db2627f351f142c49d8427e4a1102cf9e8add4e1
4
+ data.tar.gz: 401f915e2a34ec211998007e7b0ee439b5b73e02a479628aee758b072dafe167
5
5
  SHA512:
6
- metadata.gz: 03e7a551c41ba1ce1f40301362fcef7da04618dfff0f2be912ecef8efe6307107283eba58ac1027036404689ffe178b98e32a27a833d9ec034bb07dd6562fbc1
7
- data.tar.gz: 831b5f8c7ffdf155134850f160e20606f2969b535fcad9b6da649ca1c60fa2e67b27052a319b0714b53b95d57dfbdf0d239aa9023c8e941eab8baf90ef5b41c6
6
+ metadata.gz: e4c25971fc88c51e61abc93d414801dbd4c0a1d7f05c1b35dbfd28982517256e8c5251d54dc034326a96155245c8edd78d91a89e130c395525324903a4c6077b
7
+ data.tar.gz: 34c3349e5a192ac6333d27a217356f425f93324dbf26ec5d24dd4f3d5061a2e8233c1a01a2c98e732d68b20c7405fcb04c9d15e3e59c6b0758c774fe6d05bc2b
data/ChangeLog.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # xot ChangeLog
2
2
 
3
3
 
4
+ ## [v0.1.35] - 2023-05-08
5
+
6
+ - add xot/inspectable.rb
7
+
8
+
4
9
  ## [v0.1.34] - 2023-04-30
5
10
 
6
11
  - Fix bugs
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
1
+ # -*- mode: ruby -*-
2
2
 
3
3
 
4
4
  %w[.]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.34
1
+ 0.1.35
data/ext/xot/extconf.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[.]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/lib/xot/bit_flag.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/bit_util'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/bit_flag'
5
2
  require 'xot/block_util'
6
3
 
data/lib/xot/bit_util.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
data/lib/xot/extconf.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/rake/util'
5
2
  require 'xot/block_util'
6
3
 
data/lib/xot/extension.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
data/lib/xot/hookable.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
@@ -0,0 +1,17 @@
1
+ module Xot
2
+
3
+
4
+ module Inspectable
5
+
6
+ # Returns a string containing a human-readable representation of object.
7
+ #
8
+ # @return [String] inspected text
9
+ #
10
+ def inspect()
11
+ "#<#{self.class.name}:0x#{(object_id << 1).to_s(16).rjust(16, '0')}>"
12
+ end
13
+
14
+ end# Inspectable
15
+
16
+
17
+ end# Xot
data/lib/xot/invoker.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'ostruct'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rake/task'
5
2
  require 'rake/dsl_definition'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rake'
5
2
 
6
3
 
data/lib/xot/rake/util.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'erb'
5
2
  require 'rbconfig'
6
3
 
@@ -10,8 +7,6 @@ module Xot
10
7
 
11
8
  module Rake
12
9
 
13
- VERSION_NAME = 'VERSION'
14
-
15
10
  def extensions()
16
11
  env(:EXTENSIONS, []).map {|m| m::Extension}
17
12
  end
@@ -107,49 +102,6 @@ module Xot
107
102
  end
108
103
  end
109
104
 
110
- def modified_files(dir: '.', hash: '@')
111
- `git diff --name-only #{hash} -- #{dir}`.lines.map &:chomp
112
- end
113
-
114
- def version_path(dir = nil)
115
- dir ? "#{dir}/#{VERSION_NAME}" : VERSION_NAME
116
- end
117
-
118
- def get_version(dir = nil)
119
- File.readlines(version_path dir).first.chomp
120
- end
121
-
122
- def bump_version(index, version = get_version, min_digits: 3)
123
- nums = version.split('.').map &:to_i
124
- nums << 0 until nums.size > index
125
- nums[index] += 1
126
- nums.map!.with_index {|num, i| i > index ? 0 : num}
127
- nums.pop while nums.last == 0 && nums.size > min_digits
128
- nums.join '.'
129
- end
130
-
131
- def bump_version_file(index, dir: nil)
132
- newver = bump_version index, get_version(dir)
133
- File.write version_path(dir), newver
134
- newver
135
- end
136
-
137
- def update_and_tag_version(index, dir: nil, &block)
138
- raise 'modified files exist' unless modified_files.empty?
139
-
140
- message = ENV['message']
141
- raise 'no message' unless message
142
-
143
- newver = bump_version_file index, dir: dir
144
- raise 'version is not updated' unless modified_files == [version_path(dir)]
145
-
146
- block.call if block
147
-
148
- sh %( git add -u )
149
- sh %( git commit -m "#{message}" )
150
- sh %( git tag -a -m "#{message}" v#{newver} )
151
- end
152
-
153
105
  def compile_erb(path, out)
154
106
  open(path) do |input|
155
107
  open(out, 'w') do |output|
data/lib/xot/rake.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rbconfig'
5
2
  require 'rake'
6
3
  require 'rake/loaders/makefile'
data/lib/xot/setter.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
data/lib/xot/test.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
@@ -14,6 +11,12 @@ module Xot
14
11
  assert !collection.include?(obj), *args
15
12
  end
16
13
 
14
+ def assert_each_in_epsilon(expected, actual, *args)
15
+ expected.zip(actual) do |e, a|
16
+ assert_in_epsilon e, a, *args
17
+ end
18
+ end
19
+
17
20
  end# Test
18
21
 
19
22
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  module Xot
5
2
 
6
3
 
data/lib/xot.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/extension'
5
2
 
6
3
  require 'xot/bit_flag'
@@ -9,6 +6,7 @@ require 'xot/bit_util'
9
6
  require 'xot/block_util'
10
7
  require 'xot/const_symbol_accessor'
11
8
  require 'xot/hookable'
9
+ require 'xot/inspectable'
12
10
  require 'xot/invoker'
13
11
  require 'xot/setter'
14
12
  require 'xot/universal_accessor'
data/test/helper.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[.]
5
2
  .map {|s| File.expand_path "../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -0,0 +1,24 @@
1
+ require_relative 'helper'
2
+
3
+
4
+ class TestInspectable < Test::Unit::TestCase
5
+
6
+ class Temp
7
+
8
+ include Xot::Inspectable
9
+
10
+ end# Temp
11
+
12
+ def temp(*args)
13
+ Temp.new
14
+ end
15
+
16
+ def test_inspect()
17
+ o = temp
18
+ assert_match %r"#<(?:\w|\:\:)+:0x\w{16}+>", o.inspect
19
+
20
+ assert_equal o.inspect, o.inspect
21
+ assert_not_equal temp.inspect, o.inspect
22
+ end
23
+
24
+ end# TestInspectable
data/test/test_invoker.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
data/test/test_rake.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
  require 'xot/rake'
6
3
 
data/test/test_setter.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -33,7 +30,7 @@ class TestSetter < Test::Unit::TestCase
33
30
 
34
31
  def test_set_by_kwargs()
35
32
  o = temp
36
- o.set **{x: 1, y: 2}
33
+ o.set(**{x: 1, y: 2})
37
34
  assert_equal [1, 2], [o.x, o.y]
38
35
  end
39
36
 
data/test/test_tester.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require_relative 'helper'
5
2
 
6
3
 
data/xot.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
1
+ # -*- mode: ruby -*-
2
2
 
3
3
 
4
4
  File.expand_path('lib', __dir__)
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.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-30 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -76,6 +76,7 @@ files:
76
76
  - lib/xot/extconf.rb
77
77
  - lib/xot/extension.rb
78
78
  - lib/xot/hookable.rb
79
+ - lib/xot/inspectable.rb
79
80
  - lib/xot/invoker.rb
80
81
  - lib/xot/rake.rb
81
82
  - lib/xot/rake/alias_task.rb
@@ -96,6 +97,7 @@ files:
96
97
  - test/test_block_util.rb
97
98
  - test/test_const_symbol_accessor.rb
98
99
  - test/test_hookable.rb
100
+ - test/test_inspectable.rb
99
101
  - test/test_invoker.rb
100
102
  - test/test_rake.rb
101
103
  - test/test_setter.rb
@@ -132,6 +134,7 @@ test_files:
132
134
  - test/test_block_util.rb
133
135
  - test/test_const_symbol_accessor.rb
134
136
  - test/test_hookable.rb
137
+ - test/test_inspectable.rb
135
138
  - test/test_invoker.rb
136
139
  - test/test_rake.rb
137
140
  - test/test_setter.rb