Skip to content
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

Add Windows support #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

allisterb
Copy link
Contributor

No description provided.

@DarthHater
Copy link
Member

@allisterb I think I got this in #6 if you wanna take a gander (took a mildly different approach)

# Conflicts:
#	build.sh
#	lib/auditrb/commands/gems.rb
@sonatypecla
Copy link

sonatypecla bot commented Mar 23, 2020

Thanks for the contribution! Before we can merge this, we need @allisterb to sign the Sonatype Contributor License Agreement.

@allisterb allisterb changed the title Add Gemfile.lock parsing Add Windows support Mar 23, 2020
@@ -0,0 +1,2 @@
@echo off
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need a chelsea.cmd? I'd been Googling around to try and see exactly what you need for a cross platform Ruby CLI app (surprisingly hard to find).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's strictly needed but it's a convenience feature to save some keystrokes plus people may not be sure how to go about launching the CLI . Usually with DevAudit and the ther tools we'd have a .cmd and .sh launcher scripts for Windows and Linux.

@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require ".\\lib\\chelsea.rb"
Copy link
Member

Choose a reason for hiding this comment

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

I think you want to use require_relative here, as once this is deployed out into the ether (RubyGems), it will struggle to find that file, at least from my experience publishing 0.0.1, lol

Also, I wonder if in bin/chelsea you can just do a quick check on Host OS, and switch the require based on that? I don't know for sure if you even need this tho, because I did some quick googling and from what I understand Ruby treats paths identically across platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you're right I think require_relative should be used here and I do believe Ruby treats paths with / correctly according to the platform so a require_relative should work on Linux + Windows and elsewhere.

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.

2 participants