beeps 0.1.30 → 0.1.31

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: e2519640c698ff53ac158dd770e4cc65842eac2927dfb13520a6c85a9457371d
4
- data.tar.gz: aa6853c12b4154b9d304ed7f9c7e5b1ab572a59bd91fcee9492b271f4238f2e3
3
+ metadata.gz: 9e709310c7554defe3986e27506ad58db7a4bac6ca804cf6d01ed84d25dcac15
4
+ data.tar.gz: 6324f51401883f0c2659ec239e9629182a21cbbaf8a05ed5b5c15ad91bb28ae9
5
5
  SHA512:
6
- metadata.gz: 9507f87c4293f6d89eb130bdadb55a61985cd18e7738fb9e32e6a3210a486f4671091457a24f950ab76ac2234f4773c939e0117932f44874de853845e2a13e33
7
- data.tar.gz: 7571ee307b4ff3a1723b07fa749ea6930d011707eecc65b38dcdf915e0167cc14a6f987e8f5f20c81e506d755d8789cbb1b95bf26460cb0e4754a6283e3e0ba7
6
+ metadata.gz: f10c60f3e75cf76eb4dcc6cae1d0a20187d720e8f74af33cfa140588d846343e41579bfac299c2e72ba39da10d27ee3e396d4b38ddc22bf7c7a497a45e70abf2
7
+ data.tar.gz: 7b9e64b60fc04046e761e4a03d9645bf54d7fc946f9be06a4e797da73c63ecadce7fe99f9df8663e21eb05294262c226be0409fe5d01afab8be567e3c48ead4c
@@ -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,14 @@
1
+ # beeps 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
+ - fix conflicting beeps's Init_exception() and others Init_exception()
14
+ - 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 'beeps/module'
10
+ require 'xot/extension'
11
+ require 'rucy/extension'
12
+ require 'beeps/extension'
13
13
 
14
14
 
15
- MODULES = [Xot, Rucy, Beeps]
15
+ EXTENSIONS = [Xot, Rucy, Beeps]
16
16
  TESTS_ALONE = ['test/test_beeps.rb']
17
17
 
18
18
  use_external_library 'https://github.com/thestk/stk',
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.30
1
+ 0.1.31
data/beeps.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 'beeps/module'
7
+ require 'beeps/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 = Beeps::Module
16
- name = mod.name.downcase
15
+ ext = Beeps::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 = 'Plays beep sound.'
21
21
  s.description = 'Synthesize and play beep sounds.'
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/beeps"
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}
data/ext/beeps/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 'beeps/module'
10
+ require 'xot/extension'
11
+ require 'rucy/extension'
12
+ require 'beeps/extension'
13
13
 
14
14
 
15
15
  Xot::ExtConf.new Xot, Rucy, Beeps do
@@ -4,7 +4,7 @@
4
4
  module Beeps
5
5
 
6
6
 
7
- module Module
7
+ module Extension
8
8
 
9
9
  module_function
10
10
 
@@ -13,7 +13,7 @@ module Beeps
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 Beeps
28
28
  root_dir 'lib'
29
29
  end
30
30
 
31
- end# Module
31
+ end# Extension
32
32
 
33
33
 
34
34
  end# Beeps
data/lib/beeps.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  require 'beeps/autoinit'
5
- require 'beeps/module'
5
+ require 'beeps/extension'
6
6
 
7
7
  require 'beeps/beeps'
8
8
  require 'beeps/processor'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beeps
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: Synthesize and play beep sounds.
42
70
  email: xordog@gmail.com
43
71
  executables: []
@@ -63,6 +91,11 @@ files:
63
91
  - ".doc/ext/beeps/sine_wave.cpp"
64
92
  - ".doc/ext/beeps/sound.cpp"
65
93
  - ".doc/ext/beeps/square_wave.cpp"
94
+ - ".github/workflows/release.yml"
95
+ - ".github/workflows/tag.yml"
96
+ - ".github/workflows/test.yml"
97
+ - ".github/workflows/utils.rb"
98
+ - ChangeLog.md
66
99
  - README.md
67
100
  - Rakefile
68
101
  - VERSION
@@ -96,7 +129,7 @@ files:
96
129
  - lib/beeps/autoinit.rb
97
130
  - lib/beeps/beeps.rb
98
131
  - lib/beeps/ext.rb
99
- - lib/beeps/module.rb
132
+ - lib/beeps/extension.rb
100
133
  - lib/beeps/processor.rb
101
134
  - lib/beeps/sound.rb
102
135
  - src/beeps.cpp
@@ -122,14 +155,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
155
  requirements:
123
156
  - - ">="
124
157
  - !ruby/object:Gem::Version
125
- version: 2.6.0
158
+ version: 2.7.0
126
159
  required_rubygems_version: !ruby/object:Gem::Requirement
127
160
  requirements:
128
161
  - - ">="
129
162
  - !ruby/object:Gem::Version
130
163
  version: '0'
131
164
  requirements: []
132
- rubygems_version: 3.4.1
165
+ rubygems_version: 3.4.6
133
166
  signing_key:
134
167
  specification_version: 4
135
168
  summary: Plays beep sound.