Remove_other_supported_gems('ActiveModelSerializers', 'FastJsonapi')Īfter: "gem 'dry_serialization', source: ''") # Add blueprinter gem to gemfile after my_gem declaration and bundles the newly declared gem Source_root File.expand_path("./././templates", _FILE_) So for right now I have this as my install generator require 'generators/base_generator' So I tried to take what suggested and created an install for the gems. I wasn't able to really figure out the dependency injection for now. Here is the code relevant to the current configuration attempt: # lib/my_gem Aborting.Īnd in my gemspec spec.add_dependency || 'blueprinter' Remote: Invalid gemspec in : cannot load such file - blueprinter My test passes, and I am able to bundle install locally without any issue and my gem seems to be working as intended, but when I try to push to gemfury I am now getting an error: remote: Initializing build: done. I updated with an install generator that creates an initializer with a default gem listed, along with what I thought would work for dynamically adding the dependency. I'm going to write it without this functionality for now, but in the future, I'd like to make it more robust with the support for multiple gems. Is there a way, using an initializer, to set the preferred gem that a user might want to use and only install that one and not any of the others? The only downside I see is that it would require adding them to the dependancy list and installing them into the project that uses the gem I am writing. I'm using one gem at the moment and don't foresee any issues with it, but I'd like to be able to add support for multiple serialization gems. I'm trying to write my first gem, and want to create one that provides functionality to dry-up serialization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |