weakref 0.1.0 → 0.1.2

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: b3dcc36ac8d61a70a118eb1adbfe9667347be766be52ec6096d6295e08e00769
4
- data.tar.gz: fae5525d82ebf453b7154dac191738d726848d063705ac307784bea63e4d9a4a
3
+ metadata.gz: 32c5ff61d8b29ce0a0389fe2dbbc2b358c0747e1aef6526c5561bd929add5261
4
+ data.tar.gz: ad7ed5b81f8a9387338b6e76e068c666d74b136046eb5cffe248c551b5219133
5
5
  SHA512:
6
- metadata.gz: a50aec393b92017ab61248c8ac7cce139c10fc68eaae4d8d83ce87537b75d0f5de3e152f5e6e45597f00b74c0adaf72858e1f04092d98093fcaade8b2d92c13f
7
- data.tar.gz: 85b9bc74278df76106589f3e7bf7185e728cea31bad944e4aba5e838a512a4583583cfc5eec1cfec1f2fbc61b835998cec1ef273868d5bbbf7be87a87d5c825b
6
+ metadata.gz: 9e9e4a2f7d7344377629aa2d1143dac85379b673643aef04976dcd90fef65f35ffb340f96e14730adfd8236f1ac3ccf0d30400eb5fa39d2d55e7a8b5a5c2375a
7
+ data.tar.gz: 46eb30d43965f63fede62634b719d4dd833e00d548ded79872561b212d9c765307cdb1580f2aff7177739dbf6ebdb22ef94040f5fcd1f1480499421948e590fc
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'weekly'
@@ -11,14 +11,12 @@ jobs:
11
11
  os: [ ubuntu-latest, macos-latest ]
12
12
  runs-on: ${{ matrix.os }}
13
13
  steps:
14
- - uses: actions/checkout@master
14
+ - uses: actions/checkout@v3
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: ${{ matrix.ruby }}
19
19
  - name: Install dependencies
20
- run: |
21
- gem install bundler --no-document
22
- bundle install
20
+ run: bundle install
23
21
  - name: Run test
24
22
  run: rake test
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ Gemfile.lock
data/Gemfile CHANGED
@@ -1,4 +1,7 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in weakref.gemspec
4
3
  gemspec
4
+
5
+ gem "bundler"
6
+ gem "rake"
7
+ gem "test-unit"
data/Rakefile CHANGED
@@ -7,4 +7,11 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList["test/**/test_*.rb"]
8
8
  end
9
9
 
10
+ task :sync_tool do
11
+ require 'fileutils'
12
+ FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
13
+ FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
14
+ FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
15
+ end
16
+
10
17
  task :default => :test
data/lib/weakref.rb CHANGED
@@ -17,6 +17,7 @@ require "delegate"
17
17
  #
18
18
 
19
19
  class WeakRef < Delegator
20
+ VERSION = "0.1.2"
20
21
 
21
22
  ##
22
23
  # RefError is raised when a referenced object has been recycled by the
@@ -29,9 +30,6 @@ class WeakRef < Delegator
29
30
 
30
31
  ##
31
32
  # Creates a weak reference to +orig+
32
- #
33
- # Raises an ArgumentError if the given +orig+ is immutable, such as Symbol,
34
- # Integer, or Float.
35
33
 
36
34
  def initialize(orig)
37
35
  case orig
data/weakref.gemspec CHANGED
@@ -1,10 +1,15 @@
1
- lib = File.expand_path("lib", __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "weakref/version"
1
+ # frozen_string_literal: true
2
+
3
+ name = File.basename(__FILE__, ".gemspec")
4
+ version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir|
5
+ break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
6
+ /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
7
+ end rescue nil
8
+ end
4
9
 
5
10
  Gem::Specification.new do |spec|
6
- spec.name = "weakref"
7
- spec.version = Weakref::VERSION
11
+ spec.name = name
12
+ spec.version = version
8
13
  spec.authors = ["Yukihiro Matsumoto"]
9
14
  spec.email = ["matz@ruby-lang.org"]
10
15
 
@@ -14,18 +19,16 @@ Gem::Specification.new do |spec|
14
19
 
15
20
  spec.metadata["homepage_uri"] = spec.homepage
16
21
  spec.metadata["source_code_uri"] = "https://github.com/ruby/weakref"
17
- spec.license = "BSD-2-Clause"
22
+ spec.licenses = ["Ruby", "BSD-2-Clause"]
18
23
 
19
24
  # Specify which files should be added to the gem when it is released.
20
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
26
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
28
  end
24
29
  spec.bindir = "exe"
25
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
31
  spec.require_paths = ["lib"]
27
32
 
28
- spec.add_development_dependency "bundler", "~> 2.0"
29
- spec.add_development_dependency "rake", "~> 10.0"
30
- spec.add_development_dependency "minitest", "~> 5.0"
33
+ spec.add_dependency "delegate"
31
34
  end
metadata CHANGED
@@ -1,57 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weakref
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: delegate
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :development
19
+ version: '0'
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: '2.0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '5.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '5.0'
26
+ version: '0'
55
27
  description: Allows a referenced object to be garbage-collected.
56
28
  email:
57
29
  - matz@ruby-lang.org
@@ -59,6 +31,7 @@ executables: []
59
31
  extensions: []
60
32
  extra_rdoc_files: []
61
33
  files:
34
+ - ".github/dependabot.yml"
62
35
  - ".github/workflows/test.yml"
63
36
  - ".gitignore"
64
37
  - Gemfile
@@ -68,15 +41,15 @@ files:
68
41
  - bin/console
69
42
  - bin/setup
70
43
  - lib/weakref.rb
71
- - lib/weakref/version.rb
72
44
  - weakref.gemspec
73
45
  homepage: https://github.com/ruby/weakref
74
46
  licenses:
47
+ - Ruby
75
48
  - BSD-2-Clause
76
49
  metadata:
77
50
  homepage_uri: https://github.com/ruby/weakref
78
51
  source_code_uri: https://github.com/ruby/weakref
79
- post_install_message:
52
+ post_install_message:
80
53
  rdoc_options: []
81
54
  require_paths:
82
55
  - lib
@@ -91,8 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
64
  - !ruby/object:Gem::Version
92
65
  version: '0'
93
66
  requirements: []
94
- rubygems_version: 3.2.0.pre1
95
- signing_key:
67
+ rubygems_version: 3.4.0.dev
68
+ signing_key:
96
69
  specification_version: 4
97
70
  summary: Allows a referenced object to be garbage-collected.
98
71
  test_files: []
@@ -1,3 +0,0 @@
1
- module Weakref
2
- VERSION = "0.1.0"
3
- end