Ruby on Rails
Wednesday, June 6, 2018
Would this code work or am i way off?
On Wednesday, June 6, 2018 at 5:56:43 AM UTC-5, Jason McMahan wrote:
-- setcode do
if File.exist? '/etc/udev/rules.d/66-azure-storage.rules'
#do something
else
download = open('https://github.com/Azure/WALinuxAgent/blob/master/config/66-azure-storage.rules')
IO.copy_stream(download, '/etc/udev/rules.d/66-azure-storage.rules')
#do something
end
end
On Wednesday, June 6, 2018 at 5:56:43 AM UTC-5, Jason McMahan wrote:
The url is https://github.com/Azure/WALinuxAgent/blob/master/ config/66-azure-storage.rules I thought something along the lines ofif File.exist? '/etc/udev/rules.d/66-azure-storage.rules' setcode do#*something*endelse#Copy file from url to /etc/udev/rules.d/66-azure-storage.rules #then do something.endThank you all the quick replies and help thus far it is appreciated.
On Tuesday, June 5, 2018 at 4:15:08 PM UTC-5, Hassan Schroeder wrote:On Tue, Jun 5, 2018 at 1:14 PM, Jason McMahan <jason.m...@gmail.com> wrote:
> I am new to rails and would like suggestions/help to copy a file from github
> to a local directory.
Not a Rails question at all, but assuming you know the URL of the
file you want to retrieve:
https://ruby-doc.org/stdlib-2.5.1/libdoc/open-uri/rdoc/ OpenURI.html
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/87e0ac94-1633-4066-94f1-a62d339281ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment