diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..23b01e9 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +#Interface to Gmail, connect using IMAP +#https://github.com/dcparker/ruby-gmail +gem 'gmail' +gem 'gmail_xoauth' diff --git a/checkEmail.rb b/checkEmail.rb deleted file mode 100644 index 7e3287c..0000000 --- a/checkEmail.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'gmail' - -#Conecta diff --git a/gmail.rb b/gmail.rb new file mode 100644 index 0000000..547eedc --- /dev/null +++ b/gmail.rb @@ -0,0 +1,15 @@ +require 'gmail' + +email, pass = ARGV #Argumentos recibidos de main.rb + +#Conecta con Gmail +g = Gmail.connect(email, pass) + if g.logged_in? == 'True' + puts "Estas conectado." + else + puts "No estas conectado" + end + + +end +