Skip to content

Commit

Permalink
Update stimpack dependency to packs-rails (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
gap777 authored Jan 29, 2023
1 parent 0838b6f commit 71dc795
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
14 changes: 9 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATH
remote: .
specs:
automatic_namespaces (0.1.2)
automatic_namespaces (0.2.0)
activesupport
stimpack
packs-rails

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -112,6 +112,12 @@ GEM
racc (~> 1.4)
nokogiri (1.13.9-x86_64-linux)
racc (~> 1.4)
packs (0.0.6)
sorbet-runtime
packs-rails (0.0.1)
activesupport
packs
railties
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
Expand Down Expand Up @@ -177,9 +183,7 @@ GEM
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
stimpack (0.7.1)
activesupport
railties
sorbet-runtime (0.5.10626)
thor (1.2.1)
timeout (0.3.0)
tzinfo (2.0.5)
Expand Down
2 changes: 1 addition & 1 deletion automatic_namespaces.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
# guide at: https://bundler.io/guides/creating_gem.html

spec.add_dependency "activesupport"
spec.add_dependency "stimpack"
spec.add_dependency "packs-rails"

spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
Expand Down
8 changes: 4 additions & 4 deletions lib/automatic_namespaces/autoloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def non_namspaced_directory(dir)
end

def define_namespace(pack, metadata)
namespace = metadata['namespace_override'] || pack.name.camelize
namespace = metadata['namespace_override'] || pack.last_name.camelize
Object.const_set(namespace, Module.new)
namespace.constantize
end

def namespaced_packages
Stimpack::Packs.all
.map {|pack| [pack, package_metadata(pack)] }
.select {|pack, metadata| metadata && metadata["automatic_pack_namespace"] }
Packs.all
.map {|pack| [pack, package_metadata(pack)] }
.select {|_pack, metadata| metadata && metadata["automatic_pack_namespace"] }
end

def package_metadata(pack)
Expand Down
2 changes: 1 addition & 1 deletion lib/automatic_namespaces/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module AutomaticNamespaces
VERSION = "0.1.2"
VERSION = "0.2.0"
end
2 changes: 1 addition & 1 deletion spec/fixtures/rails-7.0/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ruby "3.0.1"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.4", ">= 7.0.3.1"

gem "stimpack"
gem "packs-rails"

gem "automatic_namespaces", path: File.expand_path("../../..", __dir__)

Expand Down
16 changes: 10 additions & 6 deletions spec/fixtures/rails-7.0/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATH
remote: /Users/gap/Projects/flytedesk/automatic_namespaces
specs:
automatic_namespaces (0.1.0)
automatic_namespaces (0.1.3)
activesupport
stimpack
packs-rails

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -107,6 +107,12 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.9-arm64-darwin)
racc (~> 1.4)
packs (0.0.6)
sorbet-runtime
packs-rails (0.0.1)
activesupport
packs
railties
puma (5.6.5)
nio4r (~> 2.0)
racc (1.6.0)
Expand Down Expand Up @@ -142,6 +148,7 @@ GEM
rake (13.0.6)
reline (0.3.1)
io-console (~> 0.5)
sorbet-runtime (0.5.10626)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -150,9 +157,6 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.5.3-arm64-darwin)
stimpack (0.7.1)
activesupport
railties
thor (1.2.1)
timeout (0.3.0)
tzinfo (2.0.5)
Expand All @@ -168,11 +172,11 @@ PLATFORMS
DEPENDENCIES
automatic_namespaces!
debug
packs-rails
puma (~> 5.0)
rails (~> 7.0.4, >= 7.0.3.1)
sprockets-rails
sqlite3 (~> 1.4)
stimpack
tzinfo-data

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "bundler/setup"
require "stimpack"
require "packs-rails"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
Expand Down

0 comments on commit 71dc795

Please sign in to comment.