From 60ac6e69bb28ca8fdbabb7e5eaea37480b22163a Mon Sep 17 00:00:00 2001 From: jason perez Date: Fri, 14 Feb 2014 14:02:53 -0800 Subject: [PATCH 1/4] update to include about jason gem, output about jason info in the niner.rb file --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- niner.rb | 16 +--------------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/Gemfile b/Gemfile index f0764fc..244aef7 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,4 @@ source 'http://rubygems.org' gem 'rake' gem 'rspec' -gem 'superfight', github: "RubyoffRails/superfight" +gem 'about_jason', github: "jperezish/about_jason" diff --git a/Gemfile.lock b/Gemfile.lock index b1daa75..dbf9f76 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT - remote: git://github.com/RubyoffRails/superfight.git - revision: 75a5c4f724284ade4132f0a84acf3b2a8e126fcd + remote: git://github.com/jperezish/about_jason.git + revision: 8dc2d461e3b2318b7ab26b4f30598e11ffa14f40 specs: - superfight (0.0.1) + about_jason (0.0.1) GEM remote: http://rubygems.org/ @@ -22,6 +22,6 @@ PLATFORMS ruby DEPENDENCIES + about_jason! rake rspec - superfight! diff --git a/niner.rb b/niner.rb index 801bf2a..4c30388 100644 --- a/niner.rb +++ b/niner.rb @@ -3,18 +3,4 @@ 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 - -match = Match.new(Fighter.new(fighter_a), Fighter.new(fighter_b)) - -puts "The winner of match is ....... #{match.winner.name}" +puts Jason.about From 38950a17a879771ce34fb3d543bdd2b32f6d5a14 Mon Sep 17 00:00:00 2001 From: jason perez Date: Tue, 18 Feb 2014 21:12:02 -0800 Subject: [PATCH 2/4] update for new about gem --- Gemfile.lock | 2 +- niner.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index dbf9f76..52f3d6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/jperezish/about_jason.git - revision: 8dc2d461e3b2318b7ab26b4f30598e11ffa14f40 + revision: 52ccf2f81a96ab47c81ec646f37349e048f26959 specs: about_jason (0.0.1) diff --git a/niner.rb b/niner.rb index 4c30388..dd6b630 100644 --- a/niner.rb +++ b/niner.rb @@ -3,4 +3,5 @@ Bundler.require -puts Jason.about +puts Jason.title +puts Jason.subject From a4983f111e266a3559517a0ccd4bca560bc4076f Mon Sep 17 00:00:00 2001 From: jason perez Date: Tue, 18 Feb 2014 22:50:52 -0800 Subject: [PATCH 3/4] replace cli with sinatra --- Gemfile | 2 ++ Gemfile.lock | 12 ++++++++++++ config.ru | 2 ++ niner.rb | 9 +++++++-- views/jason.erb | 2 ++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 config.ru create mode 100644 views/jason.erb diff --git a/Gemfile b/Gemfile index 244aef7..398f1ea 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,6 @@ source 'http://rubygems.org' gem 'rake' gem 'rspec' +gem 'sinatra' +gem 'shotgun' gem 'about_jason', github: "jperezish/about_jason" diff --git a/Gemfile.lock b/Gemfile.lock index 52f3d6a..2f52498 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,9 @@ GEM remote: http://rubygems.org/ specs: diff-lcs (1.1.3) + rack (1.5.2) + rack-protection (1.5.1) + rack rake (0.9.2.2) rspec (2.10.0) rspec-core (~> 2.10.0) @@ -17,6 +20,13 @@ GEM rspec-expectations (2.10.0) diff-lcs (~> 1.1.3) rspec-mocks (2.10.1) + shotgun (0.9) + rack (>= 1.0) + sinatra (1.4.4) + rack (~> 1.4) + rack-protection (~> 1.4) + tilt (~> 1.3, >= 1.3.4) + tilt (1.4.1) PLATFORMS ruby @@ -25,3 +35,5 @@ DEPENDENCIES about_jason! rake rspec + shotgun + sinatra diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..4bef1cb --- /dev/null +++ b/config.ru @@ -0,0 +1,2 @@ +require "./niner" +run Sinatra::Application \ No newline at end of file diff --git a/niner.rb b/niner.rb index dd6b630..afcff2e 100644 --- a/niner.rb +++ b/niner.rb @@ -1,7 +1,12 @@ require 'rubygems' require 'bundler/setup' +require 'sinatra' Bundler.require -puts Jason.title -puts Jason.subject + +get '/' do + @title = Jason.title + @subject = Jason.subject + erb :jason +end \ No newline at end of file diff --git a/views/jason.erb b/views/jason.erb new file mode 100644 index 0000000..ec6bca0 --- /dev/null +++ b/views/jason.erb @@ -0,0 +1,2 @@ +

<%= @title %>

+

<%= @subject %>

\ No newline at end of file From 789157d50848d87b1ba1a26c6ec8347168ae954c Mon Sep 17 00:00:00 2001 From: jason perez Date: Tue, 18 Feb 2014 23:23:36 -0800 Subject: [PATCH 4/4] update about to /about, update gem version --- Gemfile | 2 +- Gemfile.lock | 6 +++--- niner.rb | 4 ++-- views/about.erb | 2 ++ views/jason.erb | 2 -- 5 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 views/about.erb delete mode 100644 views/jason.erb diff --git a/Gemfile b/Gemfile index 398f1ea..efb9b4b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,4 @@ gem 'rake' gem 'rspec' gem 'sinatra' gem 'shotgun' -gem 'about_jason', github: "jperezish/about_jason" +gem 'about_jason', '~> 0.1.0', github: "jperezish/about_jason" diff --git a/Gemfile.lock b/Gemfile.lock index 2f52498..147dc05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: git://github.com/jperezish/about_jason.git - revision: 52ccf2f81a96ab47c81ec646f37349e048f26959 + revision: 2680921f5cce8a9ecd3b27260051a1ca1768098f specs: - about_jason (0.0.1) + about_jason (0.1.0) GEM remote: http://rubygems.org/ @@ -32,7 +32,7 @@ PLATFORMS ruby DEPENDENCIES - about_jason! + about_jason (~> 0.1.0)! rake rspec shotgun diff --git a/niner.rb b/niner.rb index afcff2e..a75c951 100644 --- a/niner.rb +++ b/niner.rb @@ -5,8 +5,8 @@ Bundler.require -get '/' do +get '/about' do @title = Jason.title @subject = Jason.subject - erb :jason + erb :about end \ No newline at end of file diff --git a/views/about.erb b/views/about.erb new file mode 100644 index 0000000..9cb7be3 --- /dev/null +++ b/views/about.erb @@ -0,0 +1,2 @@ +

<%= @title %>

+

<%= @subject %>

\ No newline at end of file diff --git a/views/jason.erb b/views/jason.erb deleted file mode 100644 index ec6bca0..0000000 --- a/views/jason.erb +++ /dev/null @@ -1,2 +0,0 @@ -

<%= @title %>

-

<%= @subject %>

\ No newline at end of file