added 1.0.1 → 1.0.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
- SHA1:
3
- metadata.gz: 94f1810eec76e187c2b1e5ad9bffb94ec118611c
4
- data.tar.gz: 2fabca3aae2827bab5b9fd81c276effe42503795
2
+ SHA256:
3
+ metadata.gz: ab381ed07d25dd1d54514a8d04f7e4aa73d758c2384f86495d1c45608e1f09b9
4
+ data.tar.gz: 5b0d988cf19a1bd7c675c377d7af18a156fe41b5349bd2e9fe6af8a4c092485c
5
5
  SHA512:
6
- metadata.gz: 70b4871e3e6482b712c632affb45df5aa43e3f8b12c4273f412dfe144f16bdbfcf2a373a6f89c3380126e6ca5f1bf2c33de129250cb7949428a2bf39324b63fe
7
- data.tar.gz: 2a4175a8b52bd35698e5803132ce07389009624b4d96a7779c2ed883ebe960d3f01495e1ee53b7dc1a9f78064729c9c4a1c7b9f5c94868fc0aedaeead064dd9a
6
+ metadata.gz: c2dd727228aae1c26d93b1f4a1bc18146381b8797f483915df537ecce747d68e34d09c912b09b0451f0f174f2f2459baeb0ca7279f427506ad3dab9fc7756a57
7
+ data.tar.gz: '04923996696b01ff112cf654b10638eef4820188877a162f3c932eeb7f03a547770fbdcfc897e31c00c79d495809b0e5a7024888966e84d037e00aae34a35814'
@@ -1,10 +1,13 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.0.2
4
+
5
+ * Relax Ruby version requirement to allow Ruby 3.0
6
+
3
7
  ### 1.0.1
4
8
 
5
9
  * Support Ruby 2.0 (treat prepend as private)
6
10
 
7
-
8
11
  ### 1.0.0
9
12
 
10
13
  * Release
data/Gemfile CHANGED
@@ -4,5 +4,6 @@ gemspec
4
4
 
5
5
  group :development do
6
6
  gem 'minitest'
7
+ gem 'rake'
7
8
  end
8
9
 
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # Added Hook for Ruby [![[version]](https://badge.fury.io/rb/added.svg)](http://badge.fury.io/rb/added) [![[travis]](https://travis-ci.org/janlelis/added.png)](https://travis-ci.org/janlelis/added)
1
+ # Added Hook for Ruby [![[version]](https://badge.fury.io/rb/added.svg)](https://badge.fury.io/rb/added) [![[ci]](https://github.com/janlelis/added/workflows/Test/badge.svg)](https://github.com/janlelis/added/actions?query=workflow%3ATest)
2
2
 
3
3
  Module#added: A unified module hook to run code on all instances when adding the module.
4
4
 
5
5
 
6
6
  ## Warning
7
7
 
8
- This is experimental stuff, using new/advanced language features. You should exactly know what you do, if you want to use it in production.
8
+ This is experimental: You should exactly know what you do, if you want to use it in production.
9
9
 
10
10
  Besides this, I am really curious if you like the approach this gem is taking!
11
11
 
@@ -18,7 +18,7 @@ Ruby allows you to run hooks, when an module is inserted into another object:
18
18
  * Module#included
19
19
  * Module#prepended
20
20
 
21
- This gem unifies all these hooks into a single `Module#added` one, which will be fired for *all* instances that the module has been added to. An example use case might be that you want to set some instance variable for all instances that include the module. There are three different occassions a hook is fired:
21
+ This gem unifies all these hooks into a single `Module#added` one, which will be fired for *all* instances that the module has been added to. An example use case might be that you want to set some instance variable for all instances that include the module. There are three different occasions a hook is fired:
22
22
 
23
23
  * An object extends itself with the module -> The added hook will run for this object
24
24
  * A class has included/prepended the module -> The added hook will run on newly initialized objects of this class
@@ -77,7 +77,7 @@ object.instance_variable_get(:@my) # => "state"
77
77
 
78
78
  ## JRuby Notes
79
79
 
80
- This gem requires a Module#prepend implementation and must have the ObjectSpace available. As JRuby user this means you will need to run JRuby 9000 with the -X+O option to use this gem.
80
+ This gem requires a Module#prepend implementation and must have the ObjectSpace available. As JRuby user this means you will need to run JRuby with the -X+O option to use this gem.
81
81
 
82
82
 
83
83
  # Also See
@@ -87,4 +87,4 @@ This gem requires a Module#prepend implementation and must have the ObjectSpace
87
87
 
88
88
  ## MIT License
89
89
 
90
- Copyright (C) 2015 by [Jan Lelis](http://janlelis.com).
90
+ Copyright (C) 2015 by [Jan Lelis](https://janlelis.com).
@@ -0,0 +1,41 @@
1
+ # # #
2
+ # Get gemspec info
3
+
4
+ gemspec_file = Dir["*.gemspec"].first
5
+ gemspec = eval File.read(gemspec_file), binding, gemspec_file
6
+ info = "#{gemspec.name} | #{gemspec.version} | " \
7
+ "#{gemspec.runtime_dependencies.size} dependencies | " \
8
+ "#{gemspec.files.size} files"
9
+
10
+ # # #
11
+ # Gem build and install task
12
+
13
+ desc info
14
+ task :gem do
15
+ puts info + "\n\n"
16
+ print " "; sh "gem build #{gemspec_file}"
17
+ FileUtils.mkdir_p "pkg"
18
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
19
+ puts; sh %{gem install --no-document pkg/#{gemspec.name}-#{gemspec.version}.gem}
20
+ end
21
+
22
+ # # #
23
+ # Start an IRB session with the gem loaded
24
+
25
+ desc "#{gemspec.name} | IRB"
26
+ task :irb do
27
+ sh "irb -I ./lib -r #{gemspec.name.gsub '-','/'}"
28
+ end
29
+
30
+ # # #
31
+ # Run specs
32
+
33
+ desc "#{gemspec.name} | Spec"
34
+ task :spec do
35
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
36
+ sh "for %f in (spec/\*.rb) do ruby spec/%f"
37
+ else
38
+ sh "for file in spec/*.rb; do ruby $file; done"
39
+ end
40
+ end
41
+ task default: :spec
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
9
9
  gem.description = 'Module#added: A unified module hook to run code on all instances when adding the module.'
10
10
  gem.license = "MIT"
11
11
  gem.authors = ["Jan Lelis"]
12
- gem.email = "mail@janlelis.de"
12
+ gem.email = "hi@ruby.consulting"
13
13
  gem.homepage = "https://github.com/janlelis/added"
14
14
 
15
15
  gem.files = Dir['{**/}{.*,*}'].select { |path| File.file?(path) }
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
19
 
20
- gem.required_ruby_version = '~> 2.0'
20
+ gem.required_ruby_version = '>= 2.0'
21
21
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Added
2
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
3
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: added
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-15 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Module#added: A unified module hook to run code on all instances when
14
14
  adding the module.'
15
- email: mail@janlelis.de
15
+ email: hi@ruby.consulting
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".gitignore"
21
- - ".travis.yml"
22
21
  - CHANGELOG.md
23
22
  - Gemfile
24
23
  - Gemfile.lock
25
24
  - MIT-LICENSE.txt
26
25
  - README.md
26
+ - Rakefile
27
27
  - added.gemspec
28
28
  - lib/added.rb
29
29
  - lib/added/core_ext.rb
@@ -40,7 +40,7 @@ require_paths:
40
40
  - lib
41
41
  required_ruby_version: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - "~>"
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '2.0'
46
46
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -49,11 +49,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubyforge_project:
53
- rubygems_version: 2.4.5
52
+ rubygems_version: 3.2.3
54
53
  signing_key:
55
54
  specification_version: 4
56
55
  summary: Added hook.
57
56
  test_files:
58
57
  - spec/added_spec.rb
59
- has_rdoc:
@@ -1,19 +0,0 @@
1
- language: ruby
2
-
3
- script: bundle exec ruby spec/*
4
-
5
- rvm:
6
- - 2.2.1
7
- - 2.2.0
8
- - 2.1.5
9
- - 2.1.4
10
- - 2.1.3
11
- - 2.1.2
12
- - 2.1.1
13
- - 2.1.0
14
- - 2.0.0
15
- - rbx-2
16
- - jruby-9.0.0.0.pre1
17
-
18
- env:
19
- - JRUBY_OPTS="--2.0 -X+O"