rays 0.1.30 → 0.1.32

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: 88387a7d63567dd0f87d5c28708d1c666b7bd41df31ae34d676a9fcfeb4b19b5
4
- data.tar.gz: 6a05891d8c4aee2b2ffbdc11fd9d6acc9dee8678f7e98180d399f6a64b04383b
3
+ metadata.gz: 7c6015734476f4a6ac7f5dc3db7201968af2a33c033bfdcae288c04cbd445614
4
+ data.tar.gz: 17c19199c6beb85859b105891e4c6b6d2fb4b3cc770f204314f6637b070bc26e
5
5
  SHA512:
6
- metadata.gz: 14ec81d1d115983f66e39432af1f98d29efe759bf891412fb67e85b09801c89fa6702e4970fd56fcb29cc1d2dfacbeb7d5edc8fb43aaa17accf964bca2b4df30
7
- data.tar.gz: 4d07ba7e7280e7aba01eed8b483978e750a6bfc5201a345e062977cf379c10f12ca1d75b38ef00677bc0bd0798245050cc14c5f0aa33e70fd93dcca5aa58d920
6
+ metadata.gz: 8dfdbd3a485511147eded502b94fc7153442eb61e64460d93b930255813b3261b6ac90996611e4cac636a88b84f88d58eeb479292c2ea574298ce26e8c5ef146
7
+ data.tar.gz: 39a02c3cac4d14fd660b22ea1d7d75d658935622a26e00c730dc238747482d482638707f11e1f41e3ce93761a55441ef07e55a919014ac0e872b2e7f2e0931a0
@@ -0,0 +1,59 @@
1
+ name: Release Gem
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: create gem
27
+ id: gem
28
+ run: |
29
+ rake gem
30
+ echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
31
+
32
+ - name: create github release
33
+ id: release
34
+ uses: actions/create-release@v1
35
+ env:
36
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37
+ with:
38
+ tag_name: ${{ github.ref }}
39
+ release_name: ${{ github.ref }}
40
+
41
+ - name: upload to github release
42
+ uses: actions/upload-release-asset@v1
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
+ with:
46
+ upload_url: ${{ steps.release.outputs.upload_url }}
47
+ asset_path: ./${{ steps.gem.outputs.path }}
48
+ asset_name: ${{ steps.gem.outputs.path }}
49
+ asset_content_type: application/zip
50
+
51
+ - name: upload to rubygems
52
+ env:
53
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
54
+ run: |
55
+ mkdir -p $HOME/.gem
56
+ touch $HOME/.gem/credentials
57
+ chmod 0600 $HOME/.gem/credentials
58
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
59
+ 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,26 @@
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: test
26
+ run: rake test
@@ -0,0 +1,55 @@
1
+ RENAMES = {reflex: 'reflexion'}
2
+
3
+ def sh(cmd)
4
+ puts cmd
5
+ system cmd
6
+ end
7
+
8
+ def setup_dependencies(build: true, only: nil)
9
+ gemspec_path = `git ls-files`.lines(chomp: true).find {|l| l =~ /\.gemspec$/}
10
+ return unless gemspec_path
11
+
12
+ gemspec = File.read gemspec_path
13
+ name = File.basename gemspec_path, '.gemspec'
14
+
15
+ exts = File.readlines('Rakefile')
16
+ .map {|l| l[%r|^\s*require\W+(\w+)/extension\W+$|, 1]}
17
+ .compact
18
+ .reject {|ext| ext == name}
19
+ exts = exts & [only].flatten.map(&:to_s) if only
20
+
21
+ exts.each do |ext|
22
+ gem = RENAMES[ext.to_sym].then {|s| s || ext}
23
+ clone = "git clone --depth 1 https://github.com/xord/#{ext}.git ../#{ext}"
24
+ ver = gemspec[/add_runtime_dependency.*['"]#{gem}['"].*['"]\s*~>\s*([\d\.]+)\s*['"]/, 1]
25
+
26
+ # 'rake subtree:push' pushes all subrepos, so cloning by new tag
27
+ # often fails before tagging each new tag
28
+ sh %( #{clone} --branch v#{ver} || #{clone} )
29
+ sh %( cd ../#{ext} && rake ext )
30
+ end
31
+ end
32
+
33
+ def tag_versions()
34
+ tags = `git tag`.lines chomp: true
35
+ vers = `git log --oneline ./VERSION`
36
+ .lines(chomp: true)
37
+ .map {|line| line.split.first[/^\w+$/]}
38
+ .map {|hash| [`git cat-file -p #{hash}:./VERSION 2>/dev/null`[/[\d\.]+/], hash]}
39
+ .select {|ver, hash| ver && hash}
40
+ .reverse
41
+ .to_h
42
+
43
+ changes = File.read('ChangeLog.md')
44
+ .split(/^\s*##\s*\[\s*v([\d\.]+)\s*\].*$/)
45
+ .slice(1..-1)
46
+ .each_slice(2)
47
+ .to_h
48
+ .transform_values(&:strip!)
49
+
50
+ vers.to_a.reverse.each do |ver, hash|
51
+ tag = "v#{ver}"
52
+ break if tags.include?(tag)
53
+ sh %( git tag -a -m \"#{changes[ver]&.gsub '"', '\\"'}\" #{tag} #{hash} )
54
+ end
55
+ end
data/ChangeLog.md ADDED
@@ -0,0 +1,25 @@
1
+ # rays ChangeLog
2
+
3
+
4
+ ## [v0.1.32] - 2023-03-01
5
+
6
+ - fix bugs
7
+
8
+
9
+ ## [v0.1.31] - 2023-02-27
10
+
11
+ - add ChangeLog.md file
12
+ - add test.yml, tag.yaml, and release.yml
13
+ - requires ruby 2.7.0 or later
14
+
15
+
16
+ ## [v0.1.30] - 2023-02-09
17
+
18
+ - default precision: mediump -> highp
19
+ - do not use buffer object to draw on iOS
20
+ - fix conflicting rays's Init_exception() and others Init_exception()
21
+ - disable non-power-of-two texture by default
22
+ - restore premultiplied rgb values of the font texture on iOS
23
+ - fix buffer leak
24
+ - fix compile errors on building for iOS
25
+ - 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',
@@ -32,10 +32,9 @@ use_external_library 'https://github.com/greenm01/poly2tri',
32
32
  use_external_library 'https://github.com/andrewwillmott/splines-lib.git',
33
33
  excludes: 'Test\.cpp'
34
34
 
35
+ default_tasks :ext
35
36
  build_native_library
36
37
  build_ruby_extension
37
38
  test_ruby_extension
38
39
  generate_documents
39
40
  build_ruby_gem
40
-
41
- task :default => :ext
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.30
1
+ 0.1.32
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.32'
32
+ s.add_runtime_dependency 'rucy', '~> 0.1.32'
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.32
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-03-01 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.32
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.32
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.32
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.32
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-gem.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.