Skip to content

Instantly share code, notes, and snippets.

View theleoborges's full-sized avatar

Leonardo Borges theleoborges

View GitHub Profile
@theleoborges
theleoborges / gist:790878
Created January 22, 2011 05:11
upgrading-appconstants-to-rails-3#0
class AppConstantsGenerator < Rails::Generator::Base
def manifest
record do |m|
m.directory('config')
m.file('constants.yml', 'config/constants.yml')
m.directory('config/initializers')
m.file('load_app_constants.rb', 'config/initializers/load_app_constants.rb')
end
end
end
@theleoborges
theleoborges / gist:790877
Created January 22, 2011 05:07
small-update-to-appconstants#0
development: &default
max_upload_in_bytes: <%= 1.megabyte %>
@theleoborges
theleoborges / gist:790873
Created January 22, 2011 05:01
are_you_testing_your_javascript_yet#1
Screw.Unit(function() {
describe("Greeter", function() {
it("should say Hi", function() {
greeter = new Greeter();
expect(greeter.greet()).to(equal, "Hi");
});
it("should render the message 'Hi there' inside the container div", function() {
dom_test = $('#dom_test');
dom_test.html("");
@theleoborges
theleoborges / gist:790871
Created January 22, 2011 04:59
are_you_testing_your_javascript_yet#0
function Greeter() {
this.greet = function() {
return "Hi";
}
this.render_hi = function(container) {
$(container).text('Hi there!');
}
}
pairprog@pairprog06:~/jruby$ ant
Buildfile: build.xml
init:
jar:
init:
extract-rdocs: