Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

created gem specification

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

0 notes on commit ae0e8eb

Please sign in to comment.
Something went wrong with that request. Please try again.