Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prepare for release

  • Loading branch information...
commit 211cede080772b7ecd7ca7f313cdec75a4ba1149 1 parent 892938c
@maccman authored
View
1  Gemfile
@@ -27,7 +27,6 @@ gem 'dalli'
gem 'juggernaut'
gem 'rdiscount'
gem 'rails_autolink'
-gem 'airbrake'
gem 'macgap'
group :development do
View
4 Gemfile.lock
@@ -38,9 +38,6 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.6)
- airbrake (3.0.9)
- activesupport
- builder
archive-tar-minitar (0.5.2)
arel (3.0.0.rc1)
builder (3.0.0)
@@ -227,7 +224,6 @@ PLATFORMS
ruby
DEPENDENCIES
- airbrake
carrierwave
coffee-rails (~> 3.2.0)
dalli
View
88 README.md
@@ -1,75 +1,41 @@
-## Data
-This is a description of the fields and types of data in the system.
+Server side:
-User:
+* Using Juggernaut to make an app realtime
+* Receiving and parsing email signatures
+* Detecting email sent by a computer
+* Modeling messages and conversations
+* Using the Twitter API
- handle: String, unique in the system
- name: String
- avatar_url: URL string
- description: String
+Client side:
-Message:
+* Spine web app
+* Overlays and CSS transforms
- created_at: Unix timestamp
- sent_at: Unix timestamp
- subject: String
- body: String
- attachments: [Attachment]
- starred: Boolean
- to_users: [User]
- from_user: User
-Attachment:
+##Demo
- message: Message
- name: String, unique among attachments to the message
- type: String, an HTTP content type
- size: Number, bytes encoded
- encoding: String, specifies data encoding (default is base64)
- data: String
+[http://maccman-hermes.herokuapp.com/](http://maccman-hermes.herokuapp.com/)
-Conversation:
+##Installation
- read: Boolean
- from_user: User
- to_users: [User]
- messages: [Message]
+Requires:
-## API
+* Ruby 1.9.2
+* Bundler
-GET /messages?since=:since&limit=:limit
+Installation:
- Since defaults to current server time. Limit defaults to ?.
- Finds messages where from_user is current_user
+1. `bundle install`
+1. `rake db:setup`
+1. Set env variables:
- Returns:
- messages: [Message] sorted by sent_at DESC
- users: [User] who appear in the messages
+ export TWITTER_CONSUMER_KEY=foo
+ export TWITTER_CONSUMER_SECRET=blah
+ export SENDGRID_USERNAME=blah
+ export SENDGRID_PASSWORD=blah
+ export S3_KEY=blah
+ export S3_SECRET=blah
-POST /messages
-
- Creates a new message. If a conversation between the creator of the message
- and any of the recipients does not yet exist, a new conversation is created
- between them.
-
- Sets from_user to current_user
-
- Params:
- sent_at: Unix timestamp
- to: Array of handles/emails
- subject: String
- body: String
- attachments: [Attachment]
-
-PUT /messages/:id
-
- Finds any message the current_user is associated with (i.e. via from_user or to_users)
- Update starred.
-
- Params:
- starred: Boolean
-
-DELETE /messages/:id
-
- Marks a message as deleted.
+1. `rails server thin`
+1. [http://localhost:3000](http://localhost:3000)
View
9 app/controllers/authorize_controller.rb
@@ -1,25 +1,24 @@
class AuthorizeController < ApplicationController
- skip_before_filter :keepsafe
before_filter :require_user, :only => :google
-
+
def google
self.current_user.link_google!(
request.env["omniauth.auth"]
)
redirect_to "/"
end
-
+
def create
self.current_user = User.authorize_twitter!(
request.env["omniauth.auth"]
)
redirect_to "/"
end
-
+
def failure
raise "OAuth failure - #{params[:message]}"
end
-
+
def destroy
reset_session
cookies.delete(:user_id)
View
17 app/controllers/emails_controller.rb
@@ -1,9 +1,8 @@
require 'mail'
class EmailsController < ApplicationController
- skip_before_filter :keepsafe
skip_before_filter :verify_authenticity_token
-
+
def create
mail = params[:headers] && Mail.new(params[:headers])
from = params[:from]
@@ -12,35 +11,35 @@ def create
bcc = params[:bcc]
subject = params[:subject]
body = params[:text] || params["stripped-text"] || params[:plain] || ""
-
+
if forwarded = mail && mail["X-Forwarded-For"]
to += ("," + forwarded.to_s.split(" ").first)
end
-
+
body.encode!("utf-8", "utf-8", :invalid => :replace)
body = subject if body.blank?
body = MailBody.strip(body)
-
+
from_user = User.for(from).first
to_users = User.for([to, cc, bcc].join(","))
-
+
to_users.each do |user|
message = Message.new(
subject: subject,
body: body,
)
-
+
message.headers = mail
message.from_user = from_user
message.to = to_users
message.user = user
message.activity = MailActivity.match?(from, mail, body)
message.save
-
+
publish(:create, message)
publish(:create, message.conversation)
end
-
+
head :ok
end
end
View
7 config/application.yml
@@ -1,18 +1,15 @@
defaults: &defaults
- users:
- dragon: slayer
-
name: Hermes
domain: postmonk.com
url: http://postmonk.com
-
+
juggernaut:
host: maccman-hermes-rt.herokuapp.com
port: 80
development:
<<: *defaults
-
+
juggernaut:
host: localhost
port: 8080
View
6 config/initializers/airbrake.rb
@@ -1,6 +0,0 @@
-Airbrake.configure do |config|
- config.api_key = '0b035490bc419c1eeb45b7245cefd094'
- config.host = 'maccman-errbit.herokuapp.com'
- config.port = 80
- config.secure = config.port == 443
-end
View
75 doc/API.md
@@ -0,0 +1,75 @@
+## Data
+
+This is a description of the fields and types of data in the system.
+
+User:
+
+ handle: String, unique in the system
+ name: String
+ avatar_url: URL string
+ description: String
+
+Message:
+
+ created_at: Unix timestamp
+ sent_at: Unix timestamp
+ subject: String
+ body: String
+ attachments: [Attachment]
+ starred: Boolean
+ to_users: [User]
+ from_user: User
+
+Attachment:
+
+ message: Message
+ name: String, unique among attachments to the message
+ type: String, an HTTP content type
+ size: Number, bytes encoded
+ encoding: String, specifies data encoding (default is base64)
+ data: String
+
+Conversation:
+
+ read: Boolean
+ from_user: User
+ to_users: [User]
+ messages: [Message]
+
+## API
+
+GET /messages?since=:since&limit=:limit
+
+ Since defaults to current server time. Limit defaults to ?.
+ Finds messages where from_user is current_user
+
+ Returns:
+ messages: [Message] sorted by sent_at DESC
+ users: [User] who appear in the messages
+
+POST /messages
+
+ Creates a new message. If a conversation between the creator of the message
+ and any of the recipients does not yet exist, a new conversation is created
+ between them.
+
+ Sets from_user to current_user
+
+ Params:
+ sent_at: Unix timestamp
+ to: Array of handles/emails
+ subject: String
+ body: String
+ attachments: [Attachment]
+
+PUT /messages/:id
+
+ Finds any message the current_user is associated with (i.e. via from_user or to_users)
+ Update starred.
+
+ Params:
+ starred: Boolean
+
+DELETE /messages/:id
+
+ Marks a message as deleted.
View
28 doc/TODO.md
@@ -1,28 +0,0 @@
-Email conversation style, with an integrated workflow.
-
-* solve starred jump bug
-* scroll to right of new message autocomplete
-* Sideways gloss on the avatars
-* autoarchive
-
-Show all unread or received_at > 1.day.ago
-
-* Star conversations not messages
-* Task with name/date?
-
-Later:
-
-* Attachments
-* Navigation shortcuts
-* Receive all DMs
-
-* Search
-* Favorites
-* Activity
-* Contacts
-
-# Types
-
-* Everything - archives after a day
-* Starred - todo list
-* Activity feed - broadcast emails
View
BIN  doc/email2/dc_sm.jpeg
Deleted file not rendered
View
BIN  doc/email2/device_details.jpeg
Deleted file not rendered
View
BIN  doc/email2/devices-list.png
Deleted file not rendered
View
BIN  doc/email2/kept_snip2.jpeg
Deleted file not rendered
View
BIN  doc/email2/kept_view_ddh_004.jpeg
Deleted file not rendered
View
BIN  doc/email2/recording.png
Deleted file not rendered
Please sign in to comment.
Something went wrong with that request. Please try again.