The essential bits from [https://github.com/jonathanpenn/ui-screen-shooter](ui-screen shooter).
- To install, clone this Gist into your project's root:
git clone git@gist.github.com:/962170d4b533e5c5e3d5.git Scripts
" Tab -> , EOL -> | |
set list | |
set listchars=tab:💩💩,eol:¬ |
The essential bits from [https://github.com/jonathanpenn/ui-screen-shooter](ui-screen shooter).
git clone git@gist.github.com:/962170d4b533e5c5e3d5.git Scripts
#!/usr/bin/env ruby | |
Dir['**/*.rb'].each do |path| | |
lines = File.readlines(path) | |
new_lines = lines.dup | |
lines.each do |line| | |
if line =~ /^# encoding: utf-8/i || line !~ /\S/ | |
new_lines.delete_at(new_lines.index(line)) | |
else |
gemspec |
module Concerns::Token | |
def self.included(base) | |
base.after_initialize(:set_token) | |
end | |
def set_token | |
self.token = SecureRandom.hex if new_record? | |
end | |
end |
<html> | |
<head> | |
<style> | |
a{ | |
display: block; | |
margin: 2em 1em; | |
} | |
</style> | |
</head> | |
<body> |
# Option 1 | |
info = if publication | |
"Title: #{ publication.title } (ID: #{ publication.id })" | |
else | |
'N/A' | |
end | |
# Option 2 | |
info = case publication | |
when Publication then puts "Title: #{ publication.title } (ID: #{ publication.id })" |
puts "♫ If I could turn, turn back the hands of time ♫" | |
puts "♫ Then my darlin' you'd still be mine ♫" | |
class Time | |
def self.now | |
Time.new(2015, 1, 23) | |
end | |
end |
# index.html.erb | |
<ul id="projects"> | |
<% @projects.each_with_index do |project, index| %> | |
<% content_tag_for :li, project do %> | |
<%= project.name %> | |
<%= button_to('up', :action => 'sort', :projects => @projects.swap(index, index -1)) if index > 0 %> | |
<%= button_to('down', :action => 'sort', :projects => @projects.swap(index, index +1)) if index < @projects.length - 1 %> | |
<% end %> | |
<% end %> |
** Invoke test (first_time) | |
** Execute test | |
** Invoke test_inner (first_time) | |
** Execute test_inner | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:ext:bin:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test_helper.rb" "test/test_nifty_authentication_generator.rb" "test/test_nifty_config_generator.rb" "test/test_nifty_layout_generator.rb" "test/test_nifty_scaffold_generator.rb" | |
/Library/Ruby/Gems/1.8/gems/rubigen-1.4.0/lib/rubigen/lookup.rb:9:in `const_missing_before_generators': stack level too deep (SystemStackError) | |
from /Library/Ruby/Gems/1.8/gems/rubigen-1.4.0/lib/rubigen/lookup.rb:13:in `const_missing_before_generators' | |
from /Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/rails_generator/lookup.rb:13:in `const_missing' |