ruby on rails - Read a file from github -


I want to read a file from github repository in my ruby ​​script. Say I want to read the Jifffile URL from my Replay on Geethub, for which ULL Will happen: "".

I tried File.readLink ("http://www.github.com/ Myrepo / blob / master / Gemfile") but this is to me "readlink" 'Error in saying: such a file or directory @ rb_readlink ".

How do I read a file using the Github URL?

You should try to fetch raw content from github files:

  Requires 'net / http' uri = "https://raw.githubusercontent.com/username/myrepo/master/Gemfile" Yuri = URI (Yuri) file = Net :: HTTP.get (Yuri)  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -