Permalink
Browse files

Dailyhi shifting to labnotes.org

  • Loading branch information...
1 parent 036edb3 commit 05e65791397b7ca2fe6a0613af16bcfda5d78466 @assaf committed Mar 13, 2012
Showing with 32 additions and 27 deletions.
  1. +10 −10 Gemfile
  2. +16 −12 Gemfile.lock
  3. +2 −1 dailyhi.rb
  4. +4 −4 subscription.rb
  5. BIN vendor/cache/unicorn-1.1.0.gem
View
20 Gemfile
@@ -1,11 +1,11 @@
source :rubygems
-gem "activerecord", "~>3.1.0"
-gem "flickr_fu", "0.3.0"
-gem "mail", "~>2.2.5"
-gem "mime-types", "~>1.16"
-gem "sinatra", "~>1.2"
-gem "sqlite3-ruby", "1.2.5"
-gem "mysql2", "~> 0.3.7"
-gem "multi_json", "~> 1.0.3"
-gem "unicorn", "1.1.0"
-gem "tzinfo", "~>0.3.29"
+gem "activerecord"
+gem "flickr_fu"
+gem "mail"
+gem "mime-types"
+gem "sinatra"
+gem "sqlite3-ruby"
+gem "mysql2"
+gem "multi_json"
+gem "thin"
+gem "tzinfo"
View
@@ -16,6 +16,8 @@ GEM
arel (2.2.1)
bcrypt-ruby (3.0.0)
builder (3.0.0)
+ daemons (1.1.4)
+ eventmachine (0.12.10)
flickr_fu (0.3.0)
mime-types (> 0.0.0)
xml-magic (> 0.0.0)
@@ -34,26 +36,28 @@ GEM
rack (~> 1.1)
tilt (< 2.0, >= 1.2.2)
sqlite3-ruby (1.2.5)
+ thin (1.2.11)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
- unicorn (1.1.0)
- rack
xml-magic (0.1.1)
PLATFORMS
ruby
DEPENDENCIES
- activerecord (~> 3.1.0)
- flickr_fu (= 0.3.0)
- mail (~> 2.2.5)
- mime-types (~> 1.16)
- multi_json (~> 1.0.3)
- mysql2 (~> 0.3.7)
- sinatra (~> 1.2)
- sqlite3-ruby (= 1.2.5)
- tzinfo (~> 0.3.29)
- unicorn (= 1.1.0)
+ activerecord
+ flickr_fu
+ mail
+ mime-types
+ multi_json
+ mysql2
+ sinatra
+ sqlite3-ruby
+ thin
+ tzinfo
View
@@ -1,5 +1,5 @@
require "sinatra"
-require File.expand_path("../subscription", __FILE__)
+#require File.expand_path("../subscription", __FILE__)
require "time"
ZONES = [[-11, "Midway Island", "Samoa" ],
@@ -34,6 +34,7 @@
erb :index
end
+
get '/today/:year/:month/:day' do
@hi = Hi.fetch(Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i))
erb :today, layout: false
View
@@ -13,7 +13,7 @@
end
env = ENV["RACK_ENV"] || "development"
-HOSTNAME = env == "development" ? "localhost:3000" : "dailyhi.com"
+HOSTNAME = env == "development" ? "localhost:3000" : "dailyhi.labnotes.org"
config = YAML.load_file("#{File.dirname(__FILE__)}/config/database.yml")
ActiveRecord::Base.establish_connection config[env]
@@ -122,7 +122,7 @@ class Subscription < ActiveRecord::Base
after_create do |record|
Mail.deliver do
- from "The Daily Hi <hi@dailyhi.com>"
+ from "The Daily Hi <hi@dailyhi.labnotes.org>"
to record.email
subject "Please verify your email address"
url = "http://#{HOSTNAME}/verify/#{record.code}"
@@ -158,7 +158,7 @@ def deliver(utc = Time.now.utc)
find_each conditions: { verified: true, timezone: timezone } do |subscription|
html = email(subscription, time, hi)
Mail.deliver do
- from "The Daily Hi <hi@dailyhi.com>"
+ from "The Daily Hi <hi@dailyhi.labnotes.org>"
to subscription.email
subject subject
html_part do
@@ -182,7 +182,7 @@ def email(subscription, time, hi)
Subscription.deliver
rescue
Mail.deliver do
- from "The Daily Hi <hi@dailyhi.com>"
+ from "The Daily Hi <hi@dailyhi.labnotes.org>"
to "assaf@labnotes.org"
subject $!.message
text_part do
Binary file not shown.

0 comments on commit 05e6579

Please sign in to comment.