Sha256: c01ae58cf8085c7cece20d436db2c2f38fe45e3c0afdf891d432bd2875f1ad7c

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

require 'rubygems'
require 'sinatra/base'
require 'json'
require 'coffee-script'
require 'slim'
require 'sass'


module Miranda
	class CoffeeEngine < Sinatra::Base
		  set :views,   File.dirname(__FILE__)    + '/public/coffeescript'
		  get "/javascripts/*.js" do
		    filename = params[:splat].first
		    coffee filename.to_sym
		  end
	end
  
  class SassEngine < Sinatra::Base
    set :views,   File.dirname(__FILE__)    + '/public/sass'
    get '/sass/*.css' do
      filename = params[:splat].first
      sass filename.to_sym
    end
  end
  

  class System < Sinatra::Base
  	use CoffeeEngine
    use SassEngine
    
    
    enable :sessions
    set :dump_errors, false
    set :views, Proc.new { File.join(root, "views") }
    
    get '/' do
      slim :index
    end
    
    
    get '/users' do
      @users = Users.new
      $return_users = @users.parse
      content_type :json
      $return_users.to_json
    end
    
    get '/disk' do
      @disk = Disk.new
      content_type :json
      @disk.parse.to_json
    end
    
    get '/applications' do
      @applications = Application.new
      content_type :json
      @applications.parse.to_json
    end
    
    
    get '/ps' do
      @ps = Ps_Aux.new
      content_type :json
      @ps.parse.to_json
    end
    
    get '/cpu' do
      @cpu = Cpu.new
      content_type :json
      @cpu.parse.to_json
    end
    
    get '/os' do
      @os = Os.new
      content_type :json
      @os.parse.to_json
    end
    
  end
end



Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
miranda-0.0.3 app.rb
miranda-0.0.2 app.rb