rays 0.1.30 → 0.1.31

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: 88387a7d63567dd0f87d5c28708d1c666b7bd41df31ae34d676a9fcfeb4b19b5
4
- data.tar.gz: 6a05891d8c4aee2b2ffbdc11fd9d6acc9dee8678f7e98180d399f6a64b04383b
3
+ metadata.gz: 958a334c5a26f773a1b99706103f104d1196d5e808721b89f8aa887641f65f00
4
+ data.tar.gz: 4f63633edea9768657373a2b59323b11f2b3ab07632bf192a60ab83db42fd480
5
5
  SHA512:
6
- metadata.gz: 14ec81d1d115983f66e39432af1f98d29efe759bf891412fb67e85b09801c89fa6702e4970fd56fcb29cc1d2dfacbeb7d5edc8fb43aaa17accf964bca2b4df30
7
- data.tar.gz: 4d07ba7e7280e7aba01eed8b483978e750a6bfc5201a345e062977cf379c10f12ca1d75b38ef00677bc0bd0798245050cc14c5f0aa33e70fd93dcca5aa58d920
6
+ metadata.gz: 749bf2ccb3d4b142e2ac4ef2531716f63632680cc44014b4e880abad0ed93ce6b9ce764bce040b53f10b4957927777ed009d9d2043e7d92b5d91bd939df975bf
7
+ data.tar.gz: 150864fbee3311eec9c0c023cb1b6054af1cbadaabd5a5ffc6b867d72c5b628f4803dee02bbbd9e61e1f5df8e9785c0cb5d090e967b24f5e66405b53452a6ad1
@@ -0,0 +1,34 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ['v[0-9]*']
6
+
7
+ jobs:
8
+ release:
9
+ runs-on: macos-latest
10
+
11
+ steps:
12
+ - name: ruby 3.2
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: 3.2
16
+
17
+ - name: checkout
18
+ uses: actions/checkout@v2
19
+
20
+ - name: setup dependencies
21
+ run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
22
+
23
+ - name: test
24
+ run: rake test
25
+
26
+ - name: upload to rubygems
27
+ env:
28
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
29
+ run: |
30
+ mkdir -p $HOME/.gem
31
+ touch $HOME/.gem/credentials
32
+ chmod 0600 $HOME/.gem/credentials
33
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
34
+ rake upload
@@ -0,0 +1,35 @@
1
+ name: Tag
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+
7
+ jobs:
8
+ tag:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: ruby 3.2
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: 3.2
16
+
17
+ - name: checkout
18
+ uses: actions/checkout@v2
19
+ with:
20
+ fetch-depth: 0
21
+ token: ${{ secrets.PAT }}
22
+
23
+ - name: setup dependencies
24
+ run: "ruby -I.github/workflows -rutils -e 'setup_dependencies only: :xot'"
25
+
26
+ - name: setup user name and email
27
+ run: |
28
+ git config --global user.email "xordog@gmail.com"
29
+ git config --global user.name "xord"
30
+
31
+ - name: tag versions
32
+ run: "ruby -I.github/workflows -rutils -e 'tag_versions'"
33
+
34
+ - name: push tags
35
+ run: git push origin --tags
@@ -0,0 +1,32 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: macos-latest
12
+
13
+ steps:
14
+ - name: ruby 3.2
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 3.2
18
+
19
+ - name: checkout
20
+ uses: actions/checkout@v2
21
+
22
+ - name: setup dependencies
23
+ run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
24
+
25
+ - name: lib
26
+ run: rake lib
27
+
28
+ - name: ext
29
+ run: rake ext
30
+
31
+ - name: test
32
+ run: rake test
@@ -0,0 +1,47 @@
1
+ def sh(cmd)
2
+ puts cmd
3
+ system cmd
4
+ end
5
+
6
+ def setup_dependencies(build: true, only: nil)
7
+ gemspec_path = `git ls-files`.lines(chomp: true).find {|l| l =~ /\.gemspec$/}
8
+ gemspec = File.read gemspec_path
9
+ name = File.basename gemspec_path, '.gemspec'
10
+
11
+ exts = File.readlines('Rakefile')
12
+ .map {|l| l[%r|^\s*require\W+(\w+)/extension\W+$|, 1]}
13
+ .compact
14
+ .reject {|ext| ext == name}
15
+ exts = exts & [only].flatten.map(&:to_s) if only
16
+
17
+ exts.each do |ext|
18
+ ver = gemspec[/add_runtime_dependency.*'#{ext}'.*'\s*~>\s*([\d\.]+)\s*'/, 1]
19
+ url = "https://github.com/xord/#{ext}.git"
20
+ sh %( git clone --depth 1 --branch v#{ver} #{url} ../#{ext} )
21
+ sh %( cd ../#{ext} && rake ext )
22
+ end
23
+ end
24
+
25
+ def tag_versions()
26
+ tags = `git tag`.lines chomp: true
27
+ vers = `git log --oneline ./VERSION`
28
+ .lines(chomp: true)
29
+ .map {|line| line.split.first[/^\w+$/]}
30
+ .map {|hash| [`git cat-file -p #{hash}:./VERSION 2>/dev/null`[/[\d\.]+/], hash]}
31
+ .select {|ver, hash| ver && hash}
32
+ .reverse
33
+ .to_h
34
+
35
+ changes = File.read('ChangeLog.md')
36
+ .split(/^\s*##\s*\[\s*v([\d\.]+)\s*\].*$/)
37
+ .slice(1..-1)
38
+ .each_slice(2)
39
+ .to_h
40
+ .transform_values(&:strip!)
41
+
42
+ vers.to_a.reverse.each do |ver, hash|
43
+ tag = "v#{ver}"
44
+ break if tags.include?(tag)
45
+ sh %( git tag -a -m \"#{changes[ver]&.gsub '"', '\\"'}\" #{tag} #{hash} )
46
+ end
47
+ end
data/ChangeLog.md ADDED
@@ -0,0 +1,20 @@
1
+ # rays ChangeLog
2
+
3
+
4
+ ## [v0.1.31] - 2023-02-27
5
+
6
+ - add ChangeLog.md file
7
+ - add test.yml, tag.yaml, and release.yml
8
+ - requires ruby 2.7.0 or later
9
+
10
+
11
+ ## [v0.1.30] - 2023-02-09
12
+
13
+ - default precision: mediump -> highp
14
+ - do not use buffer object to draw on iOS
15
+ - fix conflicting rays's Init_exception() and others Init_exception()
16
+ - disable non-power-of-two texture by default
17
+ - restore premultiplied rgb values of the font texture on iOS
18
+ - fix buffer leak
19
+ - fix compile errors on building for iOS
20
+ - refactoring
data/Rakefile CHANGED
@@ -7,12 +7,12 @@
7
7
 
8
8
  require 'rucy/rake'
9
9
 
10
- require 'xot/module'
11
- require 'rucy/module'
12
- require 'rays/module'
10
+ require 'xot/extension'
11
+ require 'rucy/extension'
12
+ require 'rays/extension'
13
13
 
14
14
 
15
- MODULES = [Xot, Rucy, Rays]
15
+ EXTENSIONS = [Xot, Rucy, Rays]
16
16
  TESTS_ALONE = ['test/test_rays.rb']
17
17
 
18
18
  use_external_library 'https://github.com/g-truc/glm',
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.30
1
+ 0.1.31
data/ext/rays/extconf.rb CHANGED
@@ -7,9 +7,9 @@
7
7
 
8
8
  require 'mkmf'
9
9
  require 'xot/extconf'
10
- require 'xot/module'
11
- require 'rucy/module'
12
- require 'rays/module'
10
+ require 'xot/extension'
11
+ require 'rucy/extension'
12
+ require 'rays/extension'
13
13
 
14
14
 
15
15
  Xot::ExtConf.new Xot, Rucy, Rays do
@@ -4,7 +4,7 @@
4
4
  module Rays
5
5
 
6
6
 
7
- module Module
7
+ module Extension
8
8
 
9
9
  module_function
10
10
 
@@ -13,7 +13,7 @@ module Rays
13
13
  end
14
14
 
15
15
  def version()
16
- open(root_dir 'VERSION') {|f| f.readline.chomp}
16
+ File.read(root_dir 'VERSION')[/[\d\.]+/]
17
17
  end
18
18
 
19
19
  def root_dir(path = '')
@@ -28,7 +28,7 @@ module Rays
28
28
  root_dir 'lib'
29
29
  end
30
30
 
31
- end# Module
31
+ end# Extension
32
32
 
33
33
 
34
34
  end# Rays
data/lib/rays.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  require 'rays/autoinit'
5
- require 'rays/module'
5
+ require 'rays/extension'
6
6
 
7
7
  require 'rays/point'
8
8
  require 'rays/bounds'
data/rays.gemspec CHANGED
@@ -4,7 +4,7 @@
4
4
  File.expand_path('lib', __dir__)
5
5
  .tap {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
6
6
 
7
- require 'rays/module'
7
+ require 'rays/extension'
8
8
 
9
9
 
10
10
  Gem::Specification.new do |s|
@@ -12,24 +12,27 @@ Gem::Specification.new do |s|
12
12
  patterns.map {|pat| Dir.glob(pat).to_a}.flatten
13
13
  end
14
14
 
15
- mod = Rays::Module
16
- name = mod.name.downcase
15
+ ext = Rays::Extension
16
+ name = ext.name.downcase
17
17
  rdocs = glob.call *%w[README .doc/ext/**/*.cpp]
18
18
 
19
19
  s.name = name
20
20
  s.summary = 'A Drawing Engine using OpenGL.'
21
21
  s.description = 'This library helps you to develop graphics application with OpenGL.'
22
- s.version = mod.version
22
+ s.version = ext.version
23
23
 
24
24
  s.authors = %w[xordog]
25
25
  s.email = 'xordog@gmail.com'
26
26
  s.homepage = "https://github.com/xord/rays"
27
27
 
28
28
  s.platform = Gem::Platform::RUBY
29
- s.required_ruby_version = '>= 2.6.0'
29
+ s.required_ruby_version = '>= 2.7.0'
30
30
 
31
- s.add_runtime_dependency 'xot', '~> 0.1.30'
32
- s.add_runtime_dependency 'rucy', '~> 0.1.30'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.31'
32
+ s.add_runtime_dependency 'rucy', '~> 0.1.31'
33
+
34
+ s.add_development_dependency 'rake'
35
+ s.add_development_dependency 'test-unit'
33
36
 
34
37
  s.files = `git ls-files`.split $/
35
38
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-08 00:00:00.000000000 Z
11
+ date: 2023-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,28 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.30
19
+ version: 0.1.31
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.30
26
+ version: 0.1.31
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.30
33
+ version: 0.1.31
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.30
40
+ version: 0.1.31
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  description: This library helps you to develop graphics application with OpenGL.
42
70
  email: xordog@gmail.com
43
71
  executables: []
@@ -83,6 +111,11 @@ files:
83
111
  - ".doc/ext/rays/polyline.cpp"
84
112
  - ".doc/ext/rays/rays.cpp"
85
113
  - ".doc/ext/rays/shader.cpp"
114
+ - ".github/workflows/release.yml"
115
+ - ".github/workflows/tag.yml"
116
+ - ".github/workflows/test.yml"
117
+ - ".github/workflows/utils.rb"
118
+ - ChangeLog.md
86
119
  - LICENSE
87
120
  - README.md
88
121
  - Rakefile
@@ -154,10 +187,10 @@ files:
154
187
  - lib/rays/color.rb
155
188
  - lib/rays/color_space.rb
156
189
  - lib/rays/ext.rb
190
+ - lib/rays/extension.rb
157
191
  - lib/rays/font.rb
158
192
  - lib/rays/image.rb
159
193
  - lib/rays/matrix.rb
160
- - lib/rays/module.rb
161
194
  - lib/rays/painter.rb
162
195
  - lib/rays/point.rb
163
196
  - lib/rays/polygon.rb
@@ -250,14 +283,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
283
  requirements:
251
284
  - - ">="
252
285
  - !ruby/object:Gem::Version
253
- version: 2.6.0
286
+ version: 2.7.0
254
287
  required_rubygems_version: !ruby/object:Gem::Requirement
255
288
  requirements:
256
289
  - - ">="
257
290
  - !ruby/object:Gem::Version
258
291
  version: '0'
259
292
  requirements: []
260
- rubygems_version: 3.4.1
293
+ rubygems_version: 3.4.6
261
294
  signing_key:
262
295
  specification_version: 4
263
296
  summary: A Drawing Engine using OpenGL.