diff --git a/lib/earthquake/commands.rb b/lib/earthquake/commands.rb index acc4084..a6b0243 100644 --- a/lib/earthquake/commands.rb +++ b/lib/earthquake/commands.rb @@ -480,7 +480,7 @@ def self._eval_as_ruby_string(text) puts "the host must be gist.github.com".c(41) else puts "..." - gist_id = uri.path[/\d+/] + gist_id = uri.path[%r|/(\d+)/?$|,1] meta = JSON.parse(open("https://api.github.com/gists/#{gist_id}").read) filename = meta["files"].keys[0] raw = meta['files'][filename]['content']