Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ source 'http://rubygems.org'
gem 'rake'
gem 'rspec'
gem 'superfight', github: "RubyoffRails/superfight"
gem 'about-meltar', "~>0.1", github: "meltar/about-meltar"

gem 'sinatra'
gem 'sinatra-contrib'
30 changes: 30 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@ GIT
specs:
superfight (0.0.1)

GIT
remote: git://github.com/meltar/about-meltar.git
revision: f5e5126d2f475c756ac755ab2e09144c781a1cb3
specs:
about-meltar (0.1.0)

GEM
remote: http://rubygems.org/
specs:
backports (2.5.3)
diff-lcs (1.1.3)
eventmachine (1.0.3)
eventmachine (1.0.3-x86-mingw32)
rack (1.4.5)
rack-protection (1.2.0)
rack
rack-test (0.6.2)
rack (>= 1.0)
rake (0.9.2.2)
rspec (2.10.0)
rspec-core (~> 2.10.0)
Expand All @@ -17,11 +31,27 @@ GEM
rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
rspec-mocks (2.10.1)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
sinatra-contrib (1.3.1)
backports (>= 2.0)
eventmachine
rack-protection
rack-test
sinatra (~> 1.3.0)
tilt (~> 1.3)
tilt (1.3.3)

PLATFORMS
ruby
x86-mingw32

DEPENDENCIES
about-meltar (~> 0.1)!
rake
rspec
sinatra
sinatra-contrib
superfight!
2 changes: 2 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require "./niner"
run Sinatra::Application
27 changes: 13 additions & 14 deletions niner.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
require 'rubygems'
require 'bundler/setup'

require 'sinatra'
require 'sinatra/reloader'
Bundler.require

puts "--------------------------------"
puts "welcome to the superfight"
puts "--------------------------------"
puts ""
puts ""
puts ""

puts "What is your first fighter's name?"
fighter_a = $stdin.gets
puts "What is your second fighter's name?"
fighter_b = $stdin.gets
enable :sessions

match = Match.new(Fighter.new(fighter_a), Fighter.new(fighter_b))
get '/' do
session[:about] = About::Meltar::AboutMe.new
@random_text = session[:about].random_fact
erb :about
end

puts "The winner of match is ....... #{match.winner.name}"
get '/about' do
session[:about] = About::Meltar::AboutMe.new
@random_text = session[:about].random_fact
erb :about
end
Loading