Skip to content
Browse files

changes

  • Loading branch information...
1 parent de84927 commit 64dc7444c4cfbbc6f4fc4e63c02ea5ac2b9b54df @timothyf timothyf committed Jun 9, 2010
View
5 app/models/ey_module.rb
@@ -0,0 +1,5 @@
+class EyModule < ActiveRecord::Base
+
+ has_many :widgets
+
+end
View
12 app/views/ey_modules/edit.html.erb
@@ -0,0 +1,12 @@
+<h1>Editing ey_module</h1>
+
+<% form_for(@ey_module) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', @ey_module %> |
+<%= link_to 'Back', ey_modules_path %>
View
18 app/views/ey_modules/index.html.erb
@@ -0,0 +1,18 @@
+<h1>Listing ey_modules</h1>
+
+<table>
+ <tr>
+ </tr>
+
+<% @ey_modules.each do |ey_module| %>
+ <tr>
+ <td><%= link_to 'Show', ey_module %></td>
+ <td><%= link_to 'Edit', edit_ey_module_path(ey_module) %></td>
+ <td><%= link_to 'Destroy', ey_module, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New ey_module', new_ey_module_path %>
View
11 app/views/ey_modules/new.html.erb
@@ -0,0 +1,11 @@
+<h1>New ey_module</h1>
+
+<% form_for(@ey_module) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', ey_modules_path %>
View
3 app/views/ey_modules/show.html.erb
@@ -0,0 +1,3 @@
+
+<%= link_to 'Edit', edit_ey_module_path(@ey_module) %> |
+<%= link_to 'Back', ey_modules_path %>
View
7 test/fixtures/ey_modules.yml
@@ -0,0 +1,7 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+# one:
+# column: value
+#
+# two:
+# column: value
View
45 test/functional/ey_modules_controller_test.rb
@@ -0,0 +1,45 @@
+require 'test_helper'
+
+class EyModulesControllerTest < ActionController::TestCase
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:ey_modules)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create ey_module" do
+ assert_difference('EyModule.count') do
+ post :create, :ey_module => { }
+ end
+
+ assert_redirected_to ey_module_path(assigns(:ey_module))
+ end
+
+ test "should show ey_module" do
+ get :show, :id => ey_modules(:one).to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, :id => ey_modules(:one).to_param
+ assert_response :success
+ end
+
+ test "should update ey_module" do
+ put :update, :id => ey_modules(:one).to_param, :ey_module => { }
+ assert_redirected_to ey_module_path(assigns(:ey_module))
+ end
+
+ test "should destroy ey_module" do
+ assert_difference('EyModule.count', -1) do
+ delete :destroy, :id => ey_modules(:one).to_param
+ end
+
+ assert_redirected_to ey_modules_path
+ end
+end
View
8 test/unit/ey_module_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class EyModuleTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
4 test/unit/helpers/ey_modules_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class EyModulesHelperTest < ActionView::TestCase
+end
View
2 vendor/plugins/gmail_smtp/init.rb
@@ -0,0 +1,2 @@
+require 'smtp_tls'
+require 'actionmailer_gmail'
View
8 vendor/plugins/gmail_smtp/lib/actionmailer_gmail.rb
@@ -0,0 +1,8 @@
+ActionMailer::Base.smtp_settings = {
+ :address => "smtp.gmail.com",
+ :port => 587,
+ :authentication => :plain,
+ :domain => ENV['GMAIL_SMTP_USER'],
+ :user_name => ENV['GMAIL_SMTP_USER'],
+ :password => ENV['GMAIL_SMTP_PASSWORD'],
+}
View
65 vendor/plugins/gmail_smtp/lib/smtp_tls.rb
@@ -0,0 +1,65 @@
+require "openssl"
+require "net/smtp"
+
+Net::SMTP.class_eval do
+ private
+ def do_start(helodomain, user, secret, authtype)
+ raise IOError, 'SMTP session already started' if @started
+ check_auth_args user, secret, authtype if user or secret
+
+ sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
+ @socket = Net::InternetMessageIO.new(sock)
+ @socket.read_timeout = 60 #@read_timeout
+ @socket.debug_output = STDERR #@debug_output
+
+ check_response(critical { recv_response() })
+ do_helo(helodomain)
+
+ raise 'openssl library not installed' unless defined?(OpenSSL)
+ starttls
+ ssl = OpenSSL::SSL::SSLSocket.new(sock)
+ ssl.sync_close = true
+ ssl.connect
+ @socket = Net::InternetMessageIO.new(ssl)
+ @socket.read_timeout = 60 #@read_timeout
+ @socket.debug_output = STDERR #@debug_output
+ do_helo(helodomain)
+
+ authenticate user, secret, authtype if user
+ @started = true
+ ensure
+ unless @started
+ # authentication failed, cancel connection.
+ @socket.close if not @started and @socket and not @socket.closed?
+ @socket = nil
+ end
+ end
+
+ def do_helo(helodomain)
+ begin
+ if @esmtp
+ ehlo helodomain
+ else
+ helo helodomain
+ end
+ rescue Net::ProtocolError
+ if @esmtp
+ @esmtp = false
+ @error_occured = false
+ retry
+ end
+ raise
+ end
+ end
+
+ def starttls
+ getok('STARTTLS')
+ end
+
+ def quit
+ begin
+ getok('QUIT')
+ rescue EOFError
+ end
+ end
+end

0 comments on commit 64dc744

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