Skip to content

Commit

Permalink
Merge pull request #5 from droidlabs/ruby3
Browse files Browse the repository at this point in the history
update to Ruby3
  • Loading branch information
vocrsz authored Aug 26, 2024
2 parents 6fb9dd8 + c83e138 commit 817d377
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7']
ruby-version: ['3.1']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.6
3.1.1
39 changes: 21 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
PATH
remote: .
specs:
smart_ioc (0.3.9)
smart_ioc (0.4.0)

GEM
remote: https://rubygems.org/
specs:
byebug (11.1.3)
coderay (1.1.3)
diff-lcs (1.4.4)
docile (1.3.2)
method_source (1.0.0)
diff-lcs (1.5.1)
docile (1.4.1)
method_source (1.1.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rake (13.0.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
rake (13.2.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
simplecov (0.18.5)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)

PLATFORMS
ruby
x86_64-darwin-23

DEPENDENCIES
bundler
Expand All @@ -47,4 +50,4 @@ DEPENDENCIES
smart_ioc!

BUNDLED WITH
2.3.25
2.5.14
23 changes: 15 additions & 8 deletions lib/smart_ioc.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'smart_ioc/version'
require 'benchmark'
require 'forwardable'

module SmartIoC
autoload :Args, 'smart_ioc/args'
Expand Down Expand Up @@ -74,14 +75,20 @@ def container
Container.get_instance
end

[:register_bean, :get_bean_definition,
:set_extra_context_for_package, :get_bean, :clear_scopes,
:force_clear_scopes, :set_load_proc].each do |name|
define_method name do |*args, &block|
container.send(name, *args, &block)
end
end
extend Forwardable

container_methods = [
:register_bean,
:get_bean_definition,
:set_extra_context_for_package,
:get_bean,
:clear_scopes,
:force_clear_scopes,
:set_load_proc
]

def_delegators :container, *container_methods
end
end

require 'smart_ioc/bean'
require 'smart_ioc/bean'
2 changes: 1 addition & 1 deletion lib/smart_ioc/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SmartIoC
VERSION = "0.3.9"
VERSION = "0.4.0"
end
1 change: 0 additions & 1 deletion spec/smart_ioc/bean_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
locations = SmartIoC::BeanLocations.get_bean_locations(:repository)

expect(locations[:test].size).to eq(3)

expect(locations[:test][0]).to match(/example\/admins\/repository\/admins_repository.rb/)
expect(locations[:test][1]).to match(/example\/admins\/repository\/test\/admins_repository.rb/)
expect(locations[:test][2]).to match(/example\/users\/repository\/users_repository.rb/)
Expand Down

0 comments on commit 817d377

Please sign in to comment.