singleton 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/test.yml +10 -6
- data/lib/singleton.rb +2 -7
- data/singleton.gemspec +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9dfa8197e311e8c51f00bf57763bb8b50310208e6a99a7baa3a60c874620956
|
4
|
+
data.tar.gz: 68f60f4bcdcd68a06c39f72a1960a29a7c378a1e14ec419fcbcfa9c51e811399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0160a2ea66e1a2a8f05a0f49bf03be28a0b5bb05999014006855078dfc2143cab53f33ac686fb39dbe4de1318b60873526239d0cc802f6700064d206dffdfe0
|
7
|
+
data.tar.gz: 489e9e5984d81dc8e7bc848d308c5bfd82774ea88e13cc26ef2e8daa8ac23d7928ab562adcad1b0d92e74e2b1ae8613f94d86a7f9ffe1fa73c0fba9e64cf3619
|
data/.github/workflows/test.yml
CHANGED
@@ -3,22 +3,26 @@ name: test
|
|
3
3
|
on: [push, pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
|
6
|
+
ruby-versions:
|
7
|
+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
|
8
|
+
with:
|
9
|
+
engine: cruby
|
10
|
+
min_version: 2.4
|
11
|
+
test:
|
12
|
+
needs: ruby-versions
|
7
13
|
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
14
|
strategy:
|
9
15
|
matrix:
|
10
|
-
ruby:
|
16
|
+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
11
17
|
os: [ ubuntu-latest, macos-latest ]
|
12
18
|
runs-on: ${{ matrix.os }}
|
13
19
|
steps:
|
14
|
-
- uses: actions/checkout@
|
20
|
+
- uses: actions/checkout@v4
|
15
21
|
- name: Set up Ruby
|
16
22
|
uses: ruby/setup-ruby@v1
|
17
23
|
with:
|
18
24
|
ruby-version: ${{ matrix.ruby }}
|
19
25
|
- name: Install dependencies
|
20
|
-
run:
|
21
|
-
gem install bundler --no-document
|
22
|
-
bundle install
|
26
|
+
run: bundle install
|
23
27
|
- name: Run test
|
24
28
|
run: rake test
|
data/lib/singleton.rb
CHANGED
@@ -92,7 +92,7 @@
|
|
92
92
|
# p a.strip # => nil
|
93
93
|
#
|
94
94
|
module Singleton
|
95
|
-
VERSION = "0.
|
95
|
+
VERSION = "0.2.0"
|
96
96
|
|
97
97
|
# Raises a TypeError to prevent cloning.
|
98
98
|
def clone
|
@@ -121,12 +121,7 @@ module Singleton
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def instance # :nodoc:
|
124
|
-
|
125
|
-
@singleton__mutex__.synchronize {
|
126
|
-
return @singleton__instance__ if @singleton__instance__
|
127
|
-
@singleton__instance__ = new()
|
128
|
-
}
|
129
|
-
@singleton__instance__
|
124
|
+
@singleton__instance__ || @singleton__mutex__.synchronize { @singleton__instance__ ||= new }
|
130
125
|
end
|
131
126
|
|
132
127
|
private
|
data/singleton.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
name = File.basename(__FILE__, ".gemspec")
|
4
|
-
version = ["lib", Array.new(name.count("-")+1, "
|
4
|
+
version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir|
|
5
5
|
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
|
6
6
|
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
|
7
7
|
end rescue nil
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.metadata["source_code_uri"] = spec.homepage
|
23
23
|
|
24
24
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
25
|
-
`git ls-files -z 2
|
25
|
+
`git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
26
|
end
|
27
27
|
spec.bindir = "exe"
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The Singleton module implements the Singleton pattern.
|
14
14
|
email:
|
@@ -17,6 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".github/dependabot.yml"
|
20
21
|
- ".github/workflows/test.yml"
|
21
22
|
- ".gitignore"
|
22
23
|
- Gemfile
|
@@ -49,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
50
|
- !ruby/object:Gem::Version
|
50
51
|
version: '0'
|
51
52
|
requirements: []
|
52
|
-
rubygems_version: 3.
|
53
|
+
rubygems_version: 3.5.0.dev
|
53
54
|
signing_key:
|
54
55
|
specification_version: 4
|
55
56
|
summary: The Singleton module implements the Singleton pattern.
|