Ruby 如何使用gdatagem/api创建文档?

Ruby 如何使用gdatagem/api创建文档?,ruby,api,gdata,Ruby,Api,Gdata,我能创造。。某物但我无法在我帐户的webview中看到它 require "gdata" require "awesome_print" require "nokogiri" @client = GData::Client::DocList.new @client.clientlogin('me', "mypass") def post_doc # Return documents the authenticated user owns feed = @client.get('ht

我能创造。。某物但我无法在我帐户的webview中看到它

require "gdata"
require "awesome_print"
require "nokogiri"


@client = GData::Client::DocList.new
@client.clientlogin('me', "mypass")

def post_doc
  # Return documents the authenticated user owns
  feed = @client.get('https://docs.google.com/feeds/documents/private/full/-/mine').to_xml
  entry = feed.elements['entry']  # first <atom:entry>

  acl_entry = <<-EOF
  <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl='http://schemas.google.com/acl/2007'>
    <category scheme='http://schemas.google.com/g/2005#kind'
      term='http://schemas.google.com/acl/2007#accessRule'/>
    <title>Testing Ruby GData gem</title>
    <gAcl:role value='writer'/>
    <gAcl:scope type='user' value='idk@example.com'/>
  </entry>
  EOF

  # Regex the document id out from the full <atom:id>.
  # http://docs.google.com/feeds/documents/private/full/document%3Adfrk14g25fdsdwf -> document%3Adfrk14g25fdsdwf
  ap entry.elements['id']
  doc_id = entry.elements['id'].text[/full\/(.*%3[aA].*)$/, 1]
  response = @client.post("https://docs.google.com/feeds/acl/private/full/#{doc_id}", acl_entry)

end
需要“gdata”
需要“绝妙打印”
需要“nokogiri”
@client=GData::client::DocList.new
@client.clientlogin('me','mypass')
def邮局文件
#返回经过身份验证的用户拥有的文档
feed=@client.get('https://docs.google.com/feeds/documents/private/full/-/mine)。以_xml
entry=feed.elements['entry']#first
acl_条目=