Navigation Menu

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

How can we ensure the User-Agent gets updated with every new version? #11

Closed
todo bot opened this issue Oct 28, 2018 · 2 comments
Closed

How can we ensure the User-Agent gets updated with every new version? #11

todo bot opened this issue Oct 28, 2018 · 2 comments

Comments

@todo
Copy link

todo bot commented Oct 28, 2018

lard/lib/lard.rb

Lines 100 to 112 in 295e5d9

def prepare_request(method, uri)
case method
when 'get'
request = Net::HTTP::Get.new uri
when 'post'
request = Net::HTTP::Post.new uri
request.add_field 'Content-Type', 'application/json'
end
request.add_field 'Authorization', "Token #{@token}"
# TODO: How can we ensure this gets updated with every new version?
request.add_field 'User-Agent', 'Lard/0.0.6'
request
end


This issue was generated by todo based on a TODO comment in 295e5d9 when #10 was merged. cc @hawkins.
@todo todo bot assigned hawkins Oct 28, 2018
@todo todo bot added the todo 🗒️ label Oct 28, 2018
@hawkins hawkins removed their assignment Oct 28, 2018
@hawkins hawkins changed the title How can we ensure this gets updated with every new version? How can we ensure the User-Agent gets updated with every new version? Oct 28, 2018
@hawkins
Copy link
Owner

hawkins commented Oct 28, 2018

I'm thinking a rake task that can fail the continuous deployment from travis might be a good fit for this? Or, maybe gems have an API they can leverage to get the version of lard?

@hawkins
Copy link
Owner

hawkins commented Oct 28, 2018

There's an API for this under Gem, but it only shows gems loaded from installed gems, not with ruby -I like we use for development. So, instead, I'm thinking a Lard::VERSION constant that we require into the Gemspec.

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

No branches or pull requests

1 participant