Skip to content

Commit

Permalink
one of a lot of updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophrinix committed Mar 21, 2011
1 parent b930b7f commit 0fcd9f1
Show file tree
Hide file tree
Showing 110 changed files with 14,549 additions and 505 deletions.
4 changes: 4 additions & 0 deletions TryRuby/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.bundle
db/*.sqlite3
log/*.log
tmp/
1 change: 1 addition & 0 deletions TryRuby/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--colour
1 change: 1 addition & 0 deletions TryRuby/.rvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rvm use 1.9.2@tryruby
2 changes: 2 additions & 0 deletions TryRuby/app/controllers/classic_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class ClassicController < ApplicationController
end
85 changes: 85 additions & 0 deletions TryRuby/app/controllers/irb_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
class IrbController < ApplicationController
# GET /irb
# GET /irb.xml
def index

@irb = []

respond_to do |format|
format.html # index.html.erb
format.to_json
format.xml { render :xml => @irb }
end
end

# GET /irb/1
# GET /irb/1.xml
def show
@irb = Irb.find(params[:id])

respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @irb }
end
end

# GET /irb/new
# GET /irb/new.xml
def new
@irb = Irb.new

respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @irb }
end
end

# GET /irb/1/edit
def edit
@irb = Irb.find(params[:id])
end

# POST /irb
# POST /irb.xml
def create
@irb = Irb.new(params[:irb])

respond_to do |format|
if @irb.save
format.html { redirect_to(@irb, :notice => 'Irb was successfully created.') }
format.xml { render :xml => @irb, :status => :created, :location => @irb }
else
format.html { render :action => "new" }
format.xml { render :xml => @irb.errors, :status => :unprocessable_entity }
end
end
end

# PUT /irb/1
# PUT /irb/1.xml
def update
@irb = Irb.find(params[:id])

respond_to do |format|
if @irb.update_attributes(params[:irb])
format.html { redirect_to(@irb, :notice => 'Irb was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @irb.errors, :status => :unprocessable_entity }
end
end
end

# DELETE /irb/1
# DELETE /irb/1.xml
def destroy
@irb = Irb.find(params[:id])
@irb.destroy

respond_to do |format|
format.html { redirect_to(irb_url) }
format.xml { head :ok }
end
end
end
2 changes: 2 additions & 0 deletions TryRuby/app/controllers/public_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class PublicController < ApplicationController
end
2 changes: 2 additions & 0 deletions TryRuby/app/helpers/classic_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module ClassicHelper
end
2 changes: 2 additions & 0 deletions TryRuby/app/helpers/irb_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module IrbHelper
end
2 changes: 2 additions & 0 deletions TryRuby/app/helpers/public_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PublicHelper
end
17 changes: 17 additions & 0 deletions TryRuby/app/views/irb/_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<%= form_for(@irb) do |f| %>
<% if @irb.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@irb.errors.count, "error") %> prohibited this irb from being saved:</h2>

<ul>
<% @irb.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>

<div class="actions">
<%= f.submit %>
</div>
<% end %>
6 changes: 6 additions & 0 deletions TryRuby/app/views/irb/edit.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h1>Editing irb</h1>

<%= render 'form' %>

<%= link_to 'Show', @irb %> |
<%= link_to 'Back', irb_path %>
21 changes: 21 additions & 0 deletions TryRuby/app/views/irb/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<h1>Listing irb</h1>

<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>

<% @irb.each do |irb| %>
<tr>
<td><%= link_to 'Show', irb %></td>
<td><%= link_to 'Edit', edit_irb_path(irb) %></td>
<td><%= link_to 'Destroy', irb, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>

<br />

<%= link_to 'New Irb', new_irb_path %>
5 changes: 5 additions & 0 deletions TryRuby/app/views/irb/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h1>New irb</h1>

<%= render 'form' %>

<%= link_to 'Back', irb_path %>
5 changes: 5 additions & 0 deletions TryRuby/app/views/irb/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p id="notice"><%= notice %></p>


<%= link_to 'Edit', edit_irb_path(@irb) %> |
<%= link_to 'Back', irb_path %>
96 changes: 96 additions & 0 deletions TryRuby/app/views/layouts/tryruby_es.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>try ruby! (en tu navegador)</title>
<script type="text/javascript" src="/javascripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/javascripts/mouseapp_2.js"></script>
<script type="text/javascript" src="/javascripts/mouseirb_2.js"></script>

<script type="text/javascript" src="/javascripts/irb.js"></script>
<style type="text/css">
@import '/stylesheets/site.css';
</style>
</head>
<body>

<div id="container">
<div id="header"><img src="/images/header.png" /></div>
<div id="content">
<div id="lilBrowser">
<div id="lbTitlebar">

<h3 id="lbTitle">A Popup Browser</h3>
<p id="lbClose">[<a href="javascript:void(window.irb.options.popup_close());">x</a>]</p>
</div>
<iframe width="500" height="400" src="about:blank" id="lbIframe"></iframe>
</div>
<div id="shellwin">

<div id="terminal">
<div id="irb"></div>
</div>
</div>
<div id="helpstone">
<div class="stretcher chapmark">
<h3>¿Tienes 15 minutos? ¡Prueba Ruby ahora mismo!</h3>
<p>Ruby es un lenguaje de programación de Japón
(disponible en <a href="http://ruby-lang.org" target="_new">ruby-lang.org</a>)
que está revolucionando la web.
La belleza de Ruby se encuentra en su balance entre la simplicidad y el poder.</p>

<p>Prueba código Ruby en el prompt de arriba. Además de los métodos
originales de Ruby, los siguientes comandos están disponibles:</p>
<ul class="commands">
<li><strong>help</strong>
Empieza el tutorial interactivo de 15 minutos. ¡Creeme, es muy básico!</li>
<li><strong>help 2</strong>
Salta al capítulo 2.</li>

<li><strong>clear</strong>
Limpia la pantalla. Útil si tu navegador empieza a alerdarce.
Tu historial de comandos será recordado.</dd>
<li><strong>back</strong>
Retrocede una pantalla en el tutorial.</li>
<li><strong>reset</strong>
Resetea el interprete. (o <b>Ctrl-D</b>!)</li>
<li><strong>next</strong>
Te permite saltear la siguiente lección</li>

<li><strong>time</strong>
Detiene el reloj. Imprime cuanto tiempo tu sesión estuvo abierta.</li>
</ul>
<p>Si te pasa de dejar o refrescar la página, tu sesión seguirá aquí a menos que
se deje inactiva por diez minutos.</p>
<br />
<div class="answer"></div>
</div>

</div>
<div class="note">¿Atrapado en los dos puntos? Unas comillas o algo fue dejado abierto. Escribe: <strong>reset</strong> o aprieta <strong>Ctrl-D</strong>.</div>
</div>
<div id="footer"><img src="/images/footer.png" /></div>
<p>This place <del>was sired by <a href="http://whytheluckystiff.net">why the lucky stiff</a>.
Please contact me using the email address at that link.</del><add>is maintained by Andrew McElroy and David Miani. For support issues, please post a ticket or contact Sophrinix on <a href="http://github.com/Sophrinix/TryRuby">github</a>.<br /> Por asuntos de traducción, mandar un ticket o contactarse con Cristian Re (leizzer) en <a href="http://github.com/leizzer/TryRuby_es">Github</a>.</add>
</p>

</div>
<input class="keyboard-selector-input" type="text" id="irb_input" autocomplete="off" />

<!-- Putting the Google Analytics Code Here. Google Likes this to be in the header, but I can't bare
putting my code though that. Expect This to become it's own .js file in the future.
Replace the UA code if your hosting your own copy -->

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-2365371-3");
pageTracker._trackPageview();
} catch(err) {}</script>

<!-- end of GA code -->
</body>
</html>
41 changes: 41 additions & 0 deletions TryRuby/app/views/tryruby/_donate.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div id="donation" style="display: none">
<h2 style="margin-left:150px">Please Support Try Ruby!</h2>
<div style="float:left; width:50px;margin-left:150px">
<a class="FlattrButton" style="display:none;"
href="http://tryruby.org"></a>
</div>
<div style="float:right;margin-right:130px;margin-top:10px">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="BCJ27GDQ6PRM4">
<input type="image" src="https://www.paypalobjects.com/WEBSCR-640-20110306-1/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/WEBSCR-640-20110306-1/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
<div style="clear:both"></div>
<p>First, I'd like to thank the over 365,345 (three hundred sixty five thousand three hundred fourty five) people who have used Try Ruby (globally) over 508,600 (five hundred eight thousand six hundred) times in the last two years! </p>
<p> It has been an honor and a privlege to help restore such a fantastic resource.</p>
<p> Because of the fun nature of Try Ruby, it only makes sense to allow it to reach its full potential. </p>
<p>Specifically, Try Ruby must have lessons for the full language.</p>
<p>A partial list includes</p>
<ul>
<li>Blocks, Lambdas, Closures, and Procs</li>
<li>Object Model <small>(DrX with a live svg front end)</small></li>
<li> Metaprogramming </li>
<li>Sandboxing</li>
<li>Standard lib</li>
<li>Unit Testing & Outside in Behavior Driven Development</li>
<li>The Ruby VM <small>(Garbage Collection, Tuning, etc)</small></li>
<li>Try Ruby Offline & Mobile versions.</li>
</ul>

<p> I have gladly covered the hosting expense (currently amazon ec2 small instance, and before that a dedicated box) for the last two years.
<br> The smile people have when experiencing the beauty of Ruby has been more than worth it. :-)</p>
<p> However, in order allow Try Ruby's potential to flourish- muchless stay online- I am currently raising funds. I have never placed ads or sold any information collected by Try Ruby. Please donate to help this site reach its full potential.</p>
<p> If all goes well, I will have weekly lessons, much in the spirit of Railscasts. <br>Obviously these would be interative lessons.</p>
<p>Last, I'd like to thank David Miani for helping me reassemble Try Ruby when _why disappeared*. Also, a thanks goes out to Adrian aka "Orangea" for his eairly work in finding security holes and helping with other misc issues. A deep thanks also goes out to everyone who has ever reported a bug or issue with Try Ruby.</p>
<p><b>Thank You.</b>
<br>Respectfully,<br><br>
Andrew McElroy</p>
<div class="footnote-facebox"><small>* _why the lucky stiff was the origional creator of Try Ruby. However he vanished from the Internet over two years ago. He took his copy of Try Ruby with him. We had to completely reimplement Try Ruby.</small></div>
</div>
4 changes: 4 additions & 0 deletions TryRuby/config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
run TryRuby::Application
42 changes: 42 additions & 0 deletions TryRuby/config/application.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)

module TryRuby
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.

# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)

# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]

# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer

# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de

# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
end
end
8 changes: 8 additions & 0 deletions TryRuby/config/cucumber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
7 changes: 7 additions & 0 deletions TryRuby/config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.

# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
TryRuby::Application.config.secret_token = 'f256893c2715b8fab149294c7f3b79fbc7a725534be51332c220c2e19965e631cc72c360acfec77dcc0469f58b81b5023e7c93a800626520f9420816639948d5'
12 changes: 12 additions & 0 deletions TryRuby/db/migrate/20110314191710_create_irb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateIrb < ActiveRecord::Migration
def self.up
create_table :irb do |t|

t.timestamps
end
end

def self.down
drop_table :irb
end
end
Loading

0 comments on commit 0fcd9f1

Please sign in to comment.