{"action":"created","issue":{"url":"https://api.github.com/repos/msaspence/cobragems/issues/1","labels_url":"https://api.github.com/repos/msaspence/cobragems/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/msaspence/cobragems/issues/1/comments","events_url":"https://api.github.com/repos/msaspence/cobragems/issues/1/events","html_url":"https://github.com/msaspence/cobragems/issues/1","id":114103785,"number":1,"title":"Two more ways of solving the problem","user":{"login":"shageman","id":186829,"avatar_url":"https://avatars.githubusercontent.com/u/186829?v=3","gravatar_id":"","url":"https://api.github.com/users/shageman","html_url":"https://github.com/shageman","followers_url":"https://api.github.com/users/shageman/followers","following_url":"https://api.github.com/users/shageman/following{/other_user}","gists_url":"https://api.github.com/users/shageman/gists{/gist_id}","starred_url":"https://api.github.com/users/shageman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shageman/subscriptions","organizations_url":"https://api.github.com/users/shageman/orgs","repos_url":"https://api.github.com/users/shageman/repos","events_url":"https://api.github.com/users/shageman/events{/privacy}","received_events_url":"https://api.github.com/users/shageman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-29T17:29:43Z","updated_at":"2015-11-04T19:58:07Z","closed_at":null,"body":"Hi Matthew,\r\n\r\nThanks for putting this together!\r\n\r\nFirst off, I think a lot more people should weigh in on this, like @agenteo, @bleonard, @jetaggart, and all those I just forgot.\r\n\r\nI agree with you that the managing of dependencies with a CBRA is pretty tedious and deserves a better solution. I think your suggestion is a valid approach and may be a nice solution for many projects out there.\r\n\r\nI would like to propose two alternative ways of tackling the dependency problem:\r\n\r\n### Aggregate Gemfiles and Gemspecs\r\nWith [maven](https://maven.apache.org) the java world knows about [project aggregation](https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Aggregation). That effectively allows developers to maintain an application as a set of hierarchically structured projects. At my work, when we build java apps, that's how we do component-based Java. \"pom\" files are used to specify dependencies. \"pom\" files can reference \"pom\" files and inherit all their specifications.\r\n\r\nI am quite certain that something like this would mean a huge change to the way bundler and rubygems work. It is very likely not something that we could push into those projects very easily (read \"at all\") since we would be breaking a lot of stuff.\r\n\r\n### Gemfile, Gemspec generator\r\nThe one thing I don't like about your proposal is that it requires us to monkey patch Gemfile and Gemspec implementations. Instead of doing that, what if we build a system where you configure the contents of gemfile and gemspec in a separate file, say gem_config.yml (in each component). \r\n\r\n~~~~~~~~\r\n---\r\nname: my_cbra_component\r\n... #other gem config stuff\r\nbase_gem_config: ../../gem_config.yml #points to root app's gem config\r\ndependencies:\r\n  common:\r\n    - rails\r\n    - devise\r\n    - cancancan\r\n    - users\r\ndevelopment dependencies:\r\n  common:\r\n    - rspec-rails\r\n    - capybara\r\n  versioned:\r\n    - pry, 'x.x.x'\r\n~~~~~~~~\r\n\r\nThe idea is that any dependencies in dependencies -> common would get resolved through the config found in base_gem_config. The rest of the needed gem configuration (in a CBRA we don't need most of the Gemspec anyways...) would be in here as well.\r\n\r\nThen there would be a generator script that ran through all the components in the CBRA which would generate valid `Gemfile` and `gemspec` files for every component and the main app.\r\n\r\nThe advantage of this approach is that it is invisible to bundler and rubygems. Of course, we would have to keep this up to date with changes in both of those projects to make sure we always generate valid definitions.\r\n"},"comment":{"url":"https://api.github.com/repos/msaspence/cobragems/issues/comments/153846092","html_url":"https://github.com/msaspence/cobragems/issues/1#issuecomment-153846092","issue_url":"https://api.github.com/repos/msaspence/cobragems/issues/1","id":153846092,"user":{"login":"bleonard","id":36106,"avatar_url":"https://avatars.githubusercontent.com/u/36106?v=3","gravatar_id":"","url":"https://api.github.com/users/bleonard","html_url":"https://github.com/bleonard","followers_url":"https://api.github.com/users/bleonard/followers","following_url":"https://api.github.com/users/bleonard/following{/other_user}","gists_url":"https://api.github.com/users/bleonard/gists{/gist_id}","starred_url":"https://api.github.com/users/bleonard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleonard/subscriptions","organizations_url":"https://api.github.com/users/bleonard/orgs","repos_url":"https://api.github.com/users/bleonard/repos","events_url":"https://api.github.com/users/bleonard/events{/privacy}","received_events_url":"https://api.github.com/users/bleonard/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T19:58:07Z","updated_at":"2015-11-04T19:58:07Z","body":"I see. sounds like it's fixed if gemspecs could point to paths or remote things.\r\n\r\nWe put those in our root Gemfile and declare the dependency in the child gemspecs. It seems to work out ok.\r\n\r\nI'm not saying this isn't a huge issue for some use case, but we've never really run across any trouble in this area. Maybe it's because we run the tests globally as well and not each one. It's probably not best to get into which way is right (test each in isolation or not), but that's probably the reason why we've never seen this issue.\r\n\r\nI assume you have Gemfile in each of those gem directories under test. Maybe add them in there. You could do something fancy to DRY it up since that's ruby code in there anyway.\r\n"}}