Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

created gem specification

  • Loading branch information...
commit ae0e8ebc94993c47173a1ebf74f9cb746fae27db 1 parent 99ecc6b
@lancejpollard authored
View
0  copyright.txt → LICENSE
File renamed without changes
View
0  manifest.txt → Manifest
File renamed without changes
View
35 Rakefile
@@ -16,23 +16,24 @@ end
APP_ROOT = File.dirname(__FILE__)
spec = Gem::Specification.new do |s|
- s.name = "googletastic"
- s.version = Googletastic::VERSION
- s.date = "Tue Nov 03 20:12:47 -0700 2009"
- s.summary = "Breaking down files"
- s.email = "lancejpollard@gmail.com"
- s.homepage = "http://github.com/viatropos/googletastic"
- s.description = "Googletastic: A Ruby Gem"
- s.has_rdoc = true
- s.authors = ["Lance Pollard"]
- s.files = %w(README.textile Rakefile) +
- Dir["{googletastic,lib,spec}/**/*"] -
- Dir["spec/tmp"]
- s.extra_rdoc_files = %w(README.textile)
- s.require_path = "lib"
-# s.executable = "googletastic"
-# s.add_dependency("extlib")
-# s.add_dependency("rubigen", ">= 1.0")
+ s.name = "googletastic"
+ s.version = Googletastic::VERSION
+ s.date = "Mon Mar 22 20:12:47 -0700 2010"
+ s.summary = "More than Syncing Rails Apps with the Google Data API"
+ s.email = "lancejpollard@gmail.com"
+ s.homepage = "http://github.com/viatropos/googletastic"
+ s.description = "Googletastic: A New Way of Googling"
+ s.has_rdoc = true
+ s.authors = ["Lance Pollard"]
+ s.files = %w(README.textile Rakefile) +
+ Dir["{googletastic,lib,spec}/**/*"] -
+ Dir["spec/tmp"]
+ s.extra_rdoc_files = %w(README.textile)
+ s.require_path = "lib"
+ s.add_dependency("nokogiri")
+ s.add_dependency("activesupport", ">= 2.3.5")
+ s.add_dependency("activerecord", ">= 2.3.5")
+ s.add_dependency("gdata")
end
desc "Create .gemspec file (useful for github)"
View
2  lib/googletastic.rb
@@ -1,7 +1,7 @@
require 'rubygems'
require 'rake'
require 'rake/clean'
-require 'rbconfig'
+#require 'rbconfig'
require 'nokogiri'
require 'active_support'
require 'active_record'
View
16 lib/googletastic/document.rb
@@ -29,6 +29,14 @@ def view_url
"http://docs.google.com/View?docID=#{id}&revision=_latest"
end
+ def update_url
+ if has_attachment?
+ "http://docs.google.com/feeds/media/private/full/#{self.id}"
+ else
+ "http://docs.google.com/feeds/documents/private/full/#{self.id}"
+ end
+ end
+
def download_url(format = "pdf")
"#{FEED_BASE}/download/documents/Export?docID=#{id}&exportFormat=#{format}"
end
@@ -41,6 +49,14 @@ def self.feed_url
"#{FEED}"
end
+ def download(format = "pdf")
+ self.class.first(:url => download_url(format))
+ end
+
+ def has_access?(email)
+ self.class.first(:url => update_url)
+ end
+
attr_reader :body
def body
return @body if @body
View
2  lib/googletastic/event.rb
@@ -148,5 +148,5 @@ def marshall(record)
end
end
-
+
end
View
2  lib/googletastic/helpers.rb
@@ -8,7 +8,7 @@ module ClassMethods
def googletastic(model, options = {})
include ("Googletastic::Helpers::#{model.to_s.camelize}").constantize
end
-
+
end
end
View
2  lib/googletastic/helpers/document.rb
@@ -1,4 +1,4 @@
-module Googletastic::Helpers::DocList
+module Googletastic::Helpers::Document
def self.included(base)
base.extend ClassMethods
View
25 lib/googletastic/helpers/event.rb
@@ -0,0 +1,25 @@
+module Googletastic::Helpers::Event
+
+ def self.included(base, &block)
+ base.extend ClassMethods
+ base.class_eval do
+ include InstanceMethods
+ end
+ end
+
+ module InstanceMethods
+ attr_accessor :google_doc
+
+ def hello
+ end
+
+ def google_doc
+ @google_doc ||= Googletastic::DocList.find(self.remote_id)
+ @google_doc
+ end
+ end
+
+ module ClassMethods
+
+ end
+end
View
2  spec/fixtures/models/document.rb
@@ -1,4 +1,4 @@
class Document < Googletastic::TestModel
- googletastic :doc_list
+# googletastic :doc_list
attr_accessor :something
end
View
3  spec/fixtures/models/event.rb
@@ -0,0 +1,3 @@
+class Event < Googletastic::TestModel
+ googletastic :event, :foreign_key => :g_event
+end
View
2  spec/fixtures/models/form.rb
@@ -1,3 +1,3 @@
class Form < Googletastic::TestModel
- googletastic :form
+ googletastic :form, :form_only => true, :action => /asdf/
end
View
0  waiting/access_rule_spec.rb → spec/googletastic/access_rule_spec.rb
File renamed without changes
View
0  waiting/base_spec.rb → spec/googletastic/base_spec.rb
File renamed without changes
View
0  waiting/document_spec.rb → spec/googletastic/document_spec.rb
File renamed without changes
View
6 spec/googletastic/event_spec.rb
@@ -20,11 +20,15 @@
@event.title = "I CHANGED MY TITLE"
@event.description = "Now I have a description?"
@event.where = "Santa Rosa"
- @event.save
+# @event.save
end
it "should get a 'content not modified' response from google" do
pending
end
+ it "should successfully add to a model via 'googletastic :event'" do
+ Event.new
+ end
+
end
View
0  post_spec.rb → spec/googletastic/post_spec.rb
File renamed without changes
View
0  waiting/youtube_spec.rb → spec/googletastic/youtube_spec.rb
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.