This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "The predefined global constants" do | |
| it "includes DATA when main script contains __END__" do | |
| ruby_exe(<<-EOF).chomp.should == 'true' | |
| puts Object.const_defined?(:DATA) | |
| __END__ | |
| EOF | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ruby -e 'p File.executable?("fixtures/predefined.rb")' | |
| true | |
| federico@korobushka ~/programacion/rubyspec/1.8/language (master) | |
| $ msr predefined_spec.rb | |
| ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.5.0] | |
| ...............................false | |
| -e:1: syntax error, unexpected '.' | |
| .fixtures/predefined.rb | |
| ^ | |
| ............. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ruby -e 'p File.executable?("fixtures/predefined.rb")' | |
| true | |
| federico@korobushka ~/programacion/rubyspec/1.8/language (master) | |
| $ msr predefined_spec.rb | |
| ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.5.0] | |
| ...............................false | |
| -e:1: syntax error, unexpected '.' | |
| .fixtures/predefined.rb | |
| ^ | |
| ............. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'dm-core' | |
| DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/frankie.sqlite3") | |
| class Recipient | |
| include DataMapper::Resource | |
| property :id, Integer, :serial => true | |
| property :name, Text | |
| property :email, Text, :nullable => false, :unique => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| div.contenedor_marque { | |
| width: 400px; | |
| border: solid 1px black; | |
| padding: 2px; | |
| height: 300px; | |
| } | |
| div.img { | |
| display: inline;/* No modificar */ | |
| height: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @glade = GladeXML.new("main.glade"){|handler| method(handler)} | |
| @tree = GladeXML.new("tree.glade"){|handler| method(handler)} | |
| # Para "attachear" el nuevo nodo a un padre se le puede pasar el root | |
| # node como segundo parametro - en este caso, el widget "mi_padre": | |
| # @tree = GladeXML.new("tree.glade", "mi_padre"){|handler| method(handler)} | |
| # Esto hará que lo que hay definido dentro de "tree.glade" se "pegue" de "mi_padre" | |
| @main_table = @glade.get_widget("main_table") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rails foo | |
| create | |
| create app/controllers | |
| create app/helpers | |
| create app/models | |
| ... | |
| $ cd foo | |
| $ ./script/plugin install git://github.com/febuiles/cute_calendar.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FooController | |
| def destroy | |
| editable_by :admin | |
| puts "OH HAI" | |
| end | |
| end | |
| class ApplicationController < ActionController::Base | |
| private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FooController | |
| def destroy | |
| editable_by :admin | |
| puts "OH HAI" | |
| end | |
| end | |
| class ApplicationController < ActionController::Base | |
| private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def some_filter | |
| redirect_unauthorized unless current_user.authorized?(@judge) | |
| end | |
| def redirect_unauthorized(where = "#{params[:controller]}_path", | |
| message = "You are not authorized to perform this action.") | |
| flash[:error] = message | |
| redirect_to where | |
| end | |