-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifying multiple groups within the Gemfile fails to produce a graph. #7
Comments
Do you mind posting your original Gemfile component statement?
Is it this one? https://github.com/shageman/component-based-rails-applications-book/blob/master/c2s01/sportsball/Gemfile
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Friday, February 14, 2020 4:32 AM, Dave Shah ***@***.***> wrote:
When attempting to generate a dependency graph at the end of 2.1 in the CBRA book, running cobradeps -g component_diagram . succeeded (in that no errors were shown) but the resulting graph was empty.
I decided to re-run with the text option to determine if this was a problem with graphviz, but this produced the following (also, an empty dependency list):
➜ sportsball git:(master): cobradeps -t component_diagram .
APP
DEPENDENCIES
ALL PARTS
After visiting this repo and combing through the README, I decided to modify my Gemfile to see if changing the way this dependency is specified would produce different results.
If I modify my Gemfile so that I specify the component dependency this way:
gem 'app_component', path: 'components/app_component', group: :direct
cobradeps succeeds in producing a graph (and the text output works as well).
This works independently of me adding Bundler.require(:direct, *Rails.groups) to my application.rb (I opted to remove this since this seemed to be the case).
If I modify my Gemfile so that I specify the component dependency this way:
gem 'app_component', path: 'components/app_component', group: [:default, :direct]
cobradeps silently fails (as outlined initially).
I'm currently seeing this issue on Bundler version 2.0.2 (cobradeps -v produces no version information)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](#7?email_source=notifications&email_token=AABNTTIU2HC7GDMRCFZR5PLRCZ6NBA5CNFSM4KVGJUK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INRLZDQ), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AABNTTLQLMWEKKWT456L5XTRCZ6NBANCNFSM4KVGJUKQ).
|
Here's the Gemfile in it's entirety (with the component statement @ the very bottom):
|
Ah, ok... So Rails 6 adds the :default group to plugins it generates. I hadn't run into this before. I will put it on my list to take a look at this, but would be happy to accept a pull request if you see a solution.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Saturday, February 15, 2020 4:13 AM, Dave Shah ***@***.***> wrote:
Here's the Gemfile in it's entirety (with the component statement @ the very bottom):
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'app_component', path: 'components/app_component', group: [:default, :direct]
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#7?email_source=notifications&email_token=AABNTTIFFRV7SAN2WWNSZKLRC7E47A5CNFSM4KVGJUK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL3H5OQ#issuecomment-586579642), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AABNTTLE7UBHYMOLBHNWKSTRC7E47ANCNFSM4KVGJUKQ).
|
Glad to hear! I ended up forking this earlier today to see where the problem was. I started down the path of a small refactor to get a unit test around this. (Then the kiddos woke up so I probably won't get back to this until later this evening 🤣 ) I'll post what I have a bit later on 👍 |
@daveshah I'm running into this as well. Any chance you're able to post what you've got so far? |
When attempting to generate a dependency graph at the end of 2.1 in the CBRA book, running
cobradeps -g component_diagram .
succeeded (in that no errors were shown) but the resulting graph was empty.I decided to re-run with the text option to determine if this was a problem with graphviz, but this produced the following (also, an empty dependency list):
After visiting this repo and combing through the README, I decided to modify my
Gemfile
to see if changing the way this dependency is specified would produce different results.If I modify my Gemfile so that I specify the component dependency this way:
gem 'app_component', path: 'components/app_component', group: :direct
cobradeps succeeds in producing a graph (and the text output works as well).
This works independently of me adding
Bundler.require(:direct, *Rails.groups)
to myapplication.rb
(I opted to remove this since this seemed to be the case).If I modify my Gemfile so that I specify the component dependency this way:
gem 'app_component', path: 'components/app_component', group: [:default, :direct]
cobradeps silently fails (as outlined initially).
I'm currently seeing this issue on Bundler version 2.0.2 and cobradeps version 0.4.1.
The text was updated successfully, but these errors were encountered: