diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..136c91c --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +source :rubygems + +gem 'rake', '~> 10.0' + +gem 'sinatra', '~> 1.3' + +gem 'json', '~> 1.7' +gem 'sass', '~> 3.2' + +group :test do + gem 'rspec', '~> 2.12' + gem 'mocha', '~> 0.13' + gem 'rack-test', '~> 0.6', require: 'rack/test' +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..5254d19 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,40 @@ +GEM + remote: http://rubygems.org/ + specs: + diff-lcs (1.1.3) + json (1.7.5) + metaclass (0.0.1) + mocha (0.13.0) + metaclass (~> 0.0.1) + rack (1.4.1) + rack-protection (1.2.0) + rack + rack-test (0.6.2) + rack (>= 1.0) + rake (10.0.2) + rspec (2.12.0) + rspec-core (~> 2.12.0) + rspec-expectations (~> 2.12.0) + rspec-mocks (~> 2.12.0) + rspec-core (2.12.1) + rspec-expectations (2.12.0) + diff-lcs (~> 1.1.3) + rspec-mocks (2.12.0) + sass (3.2.3) + sinatra (1.3.3) + rack (~> 1.3, >= 1.3.6) + rack-protection (~> 1.2) + tilt (~> 1.3, >= 1.3.3) + tilt (1.3.3) + +PLATFORMS + ruby + +DEPENDENCIES + json (~> 1.7) + mocha (~> 0.13) + rack-test (~> 0.6) + rake (~> 10.0) + rspec (~> 2.12) + sass (~> 3.2) + sinatra (~> 1.3) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..63d0abc --- /dev/null +++ b/Rakefile @@ -0,0 +1,5 @@ +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new + +task default: :spec +task test: :spec diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..c5f2547 --- /dev/null +++ b/config.ru @@ -0,0 +1,2 @@ +require File.expand_path('lib/travis/lite/application') +run Travis::Lite::Application diff --git a/lib/travis/lite/application.rb b/lib/travis/lite/application.rb new file mode 100644 index 0000000..95b0e71 --- /dev/null +++ b/lib/travis/lite/application.rb @@ -0,0 +1,28 @@ +require 'bundler' +Bundler.require + +module Travis + module Lite + class Application < Sinatra::Base + configure :production do + disable :raise_exceptions + disable :show_exceptions + + set :sass, style: :compressed + end + + get '/style.css' do + sass :style + end + + get '/' do + erb :index + end + + error do + @error = env['sinatra.error'] + erb :error + end + end + end +end diff --git a/spec/application_spec.rb b/spec/application_spec.rb new file mode 100644 index 0000000..071f3bd --- /dev/null +++ b/spec/application_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +ENV['RACK_ENV'] = 'test' +require File.expand_path('../../lib/travis/lite/application', __FILE__) + +describe Travis::Lite::Application do + include Rack::Test::Methods + + def app + Travis::Lite::Application + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..55d0b55 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,2 @@ +require 'bundler' +Bundler.require(:default, :test)