gmail_contatos 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ ---- Simples Gem para Sincronizar com Google Contact ----
2
+
3
+
4
+ ## Instalação
5
+
6
+ adicione no Gemfile:
7
+
8
+ ```ruby
9
+ gem "gmail_contatos"
10
+ ```
11
+
12
+ no controller que deseja usar os contatos do google adicione:
13
+ ```ruby
14
+ before_filter :get_gmail_contatos, :only=>:index
15
+ ```
16
+
17
+
18
+ Obs: Na função que tiver o :only (nesse caso a index) o gmail_contatos retornará uma objetos @gcontatos que você pode usar
19
+ como quiser, essa variável tera uma Array de objetos do tipo Google::Contact que tem os seguintes atributos [nome, email].
20
+
21
+ Uma sugestão de uso para a view é:
22
+ ```ruby
23
+ <table border=1>
24
+ <tr>
25
+ <th>Nome</th>
26
+ <th>email</th>
27
+ </tr>
28
+
29
+ <% @gcontatos.each do |c| %>
30
+ <tr>
31
+ <td><%= c.nome %></td>
32
+ <td><%= c.email %></td>
33
+ </tr>
34
+ <% end %>
35
+ </table>
36
+ ```
37
+
38
+ ## Contribuições e dicas são bem vindas :D
@@ -3,7 +3,7 @@ module GmailContatos
3
3
  class ContactsController < GmailContatos::ApplicationController
4
4
  def new
5
5
  # refatorar para funcionar com qualquer config de rota
6
- redirect_to Google::Authorization.build_auth_url("http://#{request.env["HTTP_HOST"]}/gmail_contatos/gauthorize")
6
+ redirect_to Google::Authorization.build_auth_url("http://#{request.env["HTTP_HOST"]}/g_auth")
7
7
  end
8
8
 
9
9
  def authorize
data/config/routes.rb CHANGED
@@ -1,4 +1,4 @@
1
- GmailContatos::Engine.routes.draw do
2
- get "gauthorize" =>"contacts#authorize"
3
- get "autorizar" => "contacts#new", :as => "autorizar"
1
+ Rails.application.routes.draw do |map|
2
+ get "g_auth" =>"gmail_contatos/contacts#authorize"
3
+ get "g_autorizar" => "gmail_contatos/contacts#new"
4
4
  end
@@ -1,6 +1,6 @@
1
1
  module GmailContatos
2
2
  class Engine < Rails::Engine
3
3
  engine_name "gmail_contatos"
4
- isolate_namespace GmailContatos
4
+ #isolate_namespace GmailContatos
5
5
  end
6
6
  end
@@ -7,7 +7,7 @@ module GmailContatos
7
7
  def get_gmail_contatos
8
8
  unless params.member?(:gtoken) then
9
9
  session[:back_url] = request.url.to_s
10
- redirect_to "/gmail_contatos/autorizar"
10
+ redirect_to "g_autorizar"
11
11
  else
12
12
  puts "chamar".inspect
13
13
  @gcontatos = Google::Contact.all(params["gtoken"])
@@ -1,3 +1,3 @@
1
1
  module GmailContatos
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,24 +1,35 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gmail_contatos
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 2
10
+ version: 0.1.2
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Janderson F. Ferreira
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-03-13 00:00:00.000000000 Z
17
+
18
+ date: 2012-03-13 00:00:00 Z
13
19
  dependencies: []
14
- description: ! ' Simples gem para sincronizar com Gmail Contatos '
15
- email:
20
+
21
+ description: " Simples gem para sincronizar com Gmail Contatos "
22
+ email:
16
23
  - ffjanderson@gmail.com
17
24
  executables: []
25
+
18
26
  extensions: []
27
+
19
28
  extra_rdoc_files: []
20
- files:
29
+
30
+ files:
21
31
  - Gemfile
32
+ - README.md
22
33
  - Rakefile
23
34
  - app/controllers/gmail_contatos/contacts_controller.rb
24
35
  - config/routes.rb
@@ -30,26 +41,36 @@ files:
30
41
  - lib/gmail_contatos/version.rb
31
42
  homepage: https://github.com/Janderson/gmail_contatos
32
43
  licenses: []
44
+
33
45
  post_install_message:
34
46
  rdoc_options: []
35
- require_paths:
47
+
48
+ require_paths:
36
49
  - lib
37
- required_ruby_version: !ruby/object:Gem::Requirement
50
+ required_ruby_version: !ruby/object:Gem::Requirement
38
51
  none: false
39
- requirements:
40
- - - ! '>='
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
- required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
60
  none: false
45
- requirements:
46
- - - ! '>='
47
- - !ruby/object:Gem::Version
48
- version: '0'
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ hash: 3
65
+ segments:
66
+ - 0
67
+ version: "0"
49
68
  requirements: []
69
+
50
70
  rubyforge_project: gmail_contatos
51
71
  rubygems_version: 1.8.15
52
72
  signing_key:
53
73
  specification_version: 3
54
74
  summary: Simples gem para sincronizar com Gmail Contatos
55
75
  test_files: []
76
+