Permalink
Browse files

Raw bones of project set up

  • Loading branch information...
1 parent 55aadd3 commit 592ea4671568298880d95f8a8b61f37484b12f23 @wdenton wdenton committed Apr 3, 2013
Showing with 96 additions and 1 deletion.
  1. +5 −0 .gitignore
  2. +5 −0 Gemfile
  3. +19 −0 Gemfile.lock
  4. +2 −1 README.md
  5. +4 −0 config.json.example
  6. +4 −0 config.ru
  7. +57 −0 my-librarians.rb
View
@@ -0,0 +1,5 @@
+*~
+.bundle/
+gems/
+config.json
+
View
@@ -0,0 +1,5 @@
+source 'https://rubygems.org'
+gem 'sinatra'
+gem 'nokogiri'
+
+
View
@@ -0,0 +1,19 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ nokogiri (1.5.9)
+ rack (1.5.2)
+ rack-protection (1.5.0)
+ rack
+ sinatra (1.4.2)
+ rack (~> 1.5, >= 1.5.2)
+ rack-protection (~> 1.4)
+ tilt (~> 1.3, >= 1.3.4)
+ tilt (1.3.6)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ nokogiri
+ sinatra
View
@@ -1,2 +1,3 @@
my-librarians
-=============
+=============
+
View
@@ -0,0 +1,4 @@
+{
+ "something": "value",
+ "other": "Another value"
+}
View
@@ -0,0 +1,4 @@
+require './my-librarians.rb'
+run Sinatra::Application
+
+
View
@@ -0,0 +1,57 @@
+#!/usr/bin/env ruby
+
+# This file is part of My Librarians.
+#
+# My Librarians is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# My Librarians is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with My Librarians. If not, see <http://www.gnu.org/licenses/>.
+#
+# Copyright 2013 William Denton
+
+# CONFIGURING
+#
+# Configuration details are set in the file config.json.
+# Make a copy of config.json.example and edit it.
+
+require 'json'
+require 'cgi'
+
+require 'rubygems'
+require 'bundler/setup'
+
+require 'sinatra'
+require 'nokogiri'
+require 'open-uri'
+
+before do
+ # Make this the default
+ content_type 'application/json'
+end
+
+configure do
+ begin
+ set(:config) { JSON.parse(File.read("config.json")) }
+ rescue Exception => e
+ puts e
+ exit
+ end
+end
+
+get "/" do
+
+
+end
+
+#
+# Helper methods
+#
+

0 comments on commit 592ea46

Please sign in to comment.