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

Set application name as referrer to make it easier to troubleshoot issues #295

Merged
merged 2 commits into from
Oct 24, 2021
Merged

Set application name as referrer to make it easier to troubleshoot issues #295

merged 2 commits into from
Oct 24, 2021

Conversation

archiloque
Copy link
Contributor

No description provided.

@archiloque
Copy link
Contributor Author

@Mogztter I've worked on the Ruby part and externalised the version in a file to match the usual practice but I can't find a definitive way to do in the JavaScript part and specially how to get the version of Antora, do you have a suggestion about how to do it?

Copy link
Member

@ggrossetie ggrossetie left a comment

Choose a reason for hiding this comment

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

Looking good, thanks 🙌🏻
Left two comments to address before merging.

::OpenURI.open_uri(uri, 'r', &:read)
uri = URI(uri)
request = ::Net::HTTP::Get.new(uri)
request['Content-Type'] = 'text/plain'
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to set the Content-Type since we don't send anything to the server.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@archiloque archiloque marked this pull request as ready for review October 23, 2021 08:50
@archiloque
Copy link
Contributor Author

@Mogztter I've applied your feedbacks, still it only works for the Ruby part of the lib, shall I do something for the JavaScript part or not?

@ggrossetie
Copy link
Member

Thanks, it looks good!

still it only works for the Ruby part of the lib, shall I do something for the JavaScript part or not?

If you want to take a stab at it, then go for it 😄
You can either open a new pull request to implement this feature in JavaScript or do it as part of this pull request. I don't really mind, just let me know so I know if I can merge this pull request now or wait.

Copy link
Member

@ggrossetie ggrossetie left a comment

Choose a reason for hiding this comment

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

Ready to go ✔️

@archiloque
Copy link
Contributor Author

Thanks, it looks good!

still it only works for the Ruby part of the lib, shall I do something for the JavaScript part or not?

If you want to take a stab at it, then go for it 😄 You can either open a new pull request to implement this feature in JavaScript or do it as part of this pull request. I don't really mind, just let me know so I know if I can merge this pull request now or wait.

I'd prefer another PR, but I would need some help because I don't see how to implement it (it's not a JS problem but a "how to retrieve the version?" problem)

@ggrossetie
Copy link
Member

I'd prefer another PR

Perfect, then I will proceed and merge this pull request.

but I would need some help because I don't see how to implement it (it's not a JS problem but a "how to retrieve the version?" problem)

You can require the package.json file and get the version.

const pkg = require('../package.json')
console.log(pkg.version)

@ggrossetie ggrossetie merged commit 42cf9b4 into asciidoctor:master Oct 24, 2021
@ggrossetie
Copy link
Member

@archiloque Let me know if you think you will have time to work on it. I want to publish a new release this week and ideally I would like to include this feature. Thanks 🙌🏻

@archiloque
Copy link
Contributor Author

@Mogztter I should be able to this evening

@ggrossetie
Copy link
Member

Excellent 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants