Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactoring the models into separate files

  • Loading branch information...
commit a0c9061a58408862d55e1eee488d3bd45e223555 1 parent 02a6470
@aaronpowell authored
Showing with 4 additions and 35 deletions.
  1. +4 −35 site.rb
View
39 site.rb
@@ -1,9 +1,7 @@
-require 'sinatra'
-require 'haml'
-require 'couchrest'
-require 'uri'
-require 'net/http'
-require 'maruku'
+['sinatra', 'haml', 'couchrest', 'uri', 'net/http', 'maruku'].each {|gem| require gem}
+
+require './model/Entry.rb'
+require './model/Akismet.rb'
if ENV['CLOUDANT_URL']
set :db, CouchRest.database!( ENV['CLOUDANT_URL'] + '/redback' )
@@ -111,35 +109,6 @@ def logout
end
end
-class Entry
- attr_accessor :Title, :MetaTitle, :PublishDate,
- :Name, :Summary, :IsVisable, :Published, :Revisions, :Comments, :Pingbacks,
- :MetaDescription, :MetaKeywords, :IsDiscussionEnabled, :IsNew,
- :Reason, :Feeds, :Content
-
- def initialize
- @Title = ''
- @Name = ''
- @Summary = ''
- @Content = ''
- @IsVisable = true
- @Published = Time.now.utc
- @Revisions = Array.new
- @Comments = Array.new
- @Pingbacks = Array.new
- @Feeds = Array.new
- @IsDiscussionEnabled = true
- @IsNew = true
- end
-end
-
-class Akismet
- def validateKey
- result = Net::HTTP.post_form(URI.parse('http://rest.akismet.com/1.1/verify-key'), {:key => $akismetApiKey, :blog => $siteUrl})
- return result.body == 'valid'
- end
-end
-
set :haml, :format => :html5
before do
Please sign in to comment.
Something went wrong with that request. Please try again.