Skip to content

"Gemify" #9

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

Merged
merged 4 commits into from
Dec 11, 2019
Merged

"Gemify" #9

merged 4 commits into from
Dec 11, 2019

Conversation

NickLaMuro
Copy link
Collaborator

Converts this project to be distributable on rubygems.

Doesn't change much, and you can still install this as a standalone script, but provides a easier way to support adding features to the project going forward.

Additions:

  • A gemspec
  • Dedicated bin/ file
  • Minor modifications to the lib file to support "gemification"
  • Gemfile (bundler support, though not required)
  • Rake build tasks
  • Dev dependencies for specs:
    • rake (included with most rubies)
    • minitest (included with most rubies)
    • rugged (required for running tests
  • Some simple tests

More info in the specific commits.

@NickLaMuro NickLaMuro force-pushed the gemify branch 2 times, most recently from 5f5b4b9 to 0c46fa8 Compare October 31, 2019 04:31
@NickLaMuro
Copy link
Collaborator Author

@juliancheal I think I have this where I think it makes sense, so feel free to chuck 🍅 as you see fit.

@Fryguy Fryguy self-requested a review November 14, 2019 22:09
Copy link
Collaborator Author

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fryguy

So I was going to put this as "Request Changes"... but apparently I can't do that on my own PR...

Anyway, using this "Review" as a note for a few things that I think might be worth changing here prior to a merge or as a follow up. At a minimum, it might makes sense to at least determine if we handle them here or in a followup.

  • :upstream_branch isn't being properly used in a few places... well, just one, and that is here:

    `git fetch upstream && git rebase upstream/master`

    Where upstream/master has been hardcoded where it shouldn't be. I actually changed that in [WIP] Add reinsert functionality #11 (here at the time of writing), but curious if I should fix that sooner rather then that PR, especially since that one probably is doomed to not see the light of day. I would add a test around that me thinks as well.

Bah... my memory is failing me, but I am pretty sure there was at least one other thing that really got merged into PR #11 that probably should exist prior, but just making a mental note of at least one of them that I can think of currently. Probably follow ups are fine, and I will just push the fix to the bin/ after I use that to test with the code I have in #11 (since that is a good real world use case).

Minimal code changes required to make this a gem with an executable
script included on install.
- Used minitest since it comes with ruby now, and was easy to work with
- Uses `rugged` to help with git validation
- There is a large `TestRepo` test helper class that was added

The `TestRepo` is probably the elephant in the room, since there is a
lot of code being added for it here, but this was intentional to help
facilitate adding new features in the future while allowing some
coverage for what already exists.

As mentioned in the comments, it was lifted from this library in
manageiq:

  https://github.com/NickLaMuro/manageiq/blob/master/spec/support/fake_ansible_repo.rb#L1

Part of this commit:

  NickLaMuro/manageiq@652105e4

I have added some extra DSL methods an functionality not found in the
original, and removed all of the "Ansible bits", so it is a bit of a
departure from that code, but the core interface is the same.  I think
it makes writing tests for this project relatively easy.

In addition, there is a `CodeExtractor::TestCase` class in that same
`test_helper.rb` file which handles creating a sandbox for each test
method.  You can also run the tests with `DEBUG=1 rake` to avoid
deleting the directories after each run, which is nice for debugging
your tests when it isn't doing what you expect.
@juliancheal
Copy link
Owner

@NickLaMuro sorry I have been keeping an eye on this. Are we good to go do you think @Fryguy?

@Fryguy
Copy link
Collaborator

Fryguy commented Dec 11, 2019

Yeah this is good. I think any bug fixes or extra things mentioned in #9 (review) should be a follow up PR, since they don't belong in the Gemify PR.

@Fryguy Fryguy merged commit 5ee26d1 into juliancheal:master Dec 11, 2019
@Fryguy Fryguy self-assigned this Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants