List:
- foo
- bar
$ cat pry-method-name.rb | |
require 'rubygems' | |
require 'pry' | |
class A | |
def self.generate_method(name) | |
define_method name do | |
binding.pry | |
end | |
m = instance_method name |
#!/usr/bin/env ruby | |
# Data is taken from Wikipedia: http://j.mp/english-letters-frequencies | |
LETTERS_FREQUENCIES = { | |
'a' => 8.167, | |
'b' => 1.492, | |
'c' => 2.782, | |
'd' => 4.253, | |
'e' => 12.702, | |
'f' => 2.228, |
|de| | f|Cl|nf|ed|au| i|ti| |ma|ha|or|nn|ou| S|on|nd|on| | |
|ry| |is|th|is| b|eo|as| | |f |wh| o|ic| t|, | |he|h | | |
|ab| |la|pr|od|ge|ob| m|an| |s |is|el|ti|ng|il|d |ua|c | | |
|he| |ea|of|ho| m| t|et|ha| | t|od|ds|e |ki| c|t |ng|br| | |
|wo|m,|to|yo|hi|ve|u | t|ob| |pr|d |s |us| s|ul|le|ol|e | | |
| t|ca| t|wi| M|d |th|"A|ma|l |he| p|at|ap|it|he|ti|le|er| | |
|ry|d |un|Th|" |io|eo|n,|is| |bl|f |pu|Co|ic| o|he|at|mm| | |
|hi| | |in| | | t| | | | |ye| |ar| |s | | |. | |
GEM | |
remote: http://rubygems.org/ | |
specs: | |
POpen4 (0.1.4) | |
Platform (>= 0.4.0) | |
open4 | |
Platform (0.4.0) | |
actionmailer (3.1.3) | |
actionpack (= 3.1.3) | |
mail (~> 2.3.0) |
# Patches to make ActiveAdmin work with Mongoid. | |
# For more information see https://github.com/gregbell/active_admin/issues/26 and https://gist.github.com/1809524. | |
require "active_admin" | |
require "active_admin/resource_controller" | |
require 'ostruct' | |
module ActiveAdmin | |
class Namespace | |
# Disable comments |
2012-02-28T20:20:15+00:00 app[hub.1]: Invalid gemspec in [vendor/bundle/ruby/1.9.1/specifications/actionmailer_inline_css-1.4.0.gemspec]: invalid date format in specification: "2011-10-10 00:00:00.000000000Z" | |
2012-02-28T20:20:15+00:00 app[hub.1]: Invalid gemspec in [vendor/bundle/ruby/1.9.1/specifications/octokit-0.6.5.gemspec]: invalid date format in specification: "2011-10-15 00:00:00.000000000Z" | |
2012-02-28T20:20:15+00:00 app[hub.1]: Invalid gemspec in [vendor/bundle/ruby/1.9.1/specifications/omniauth-oauth2-1.0.0.gemspec]: invalid date format in specification: "2011-11-02 00:00:00.000000000Z" | |
2012-02-28T20:20:15+00:00 app[hub.1]: Invalid gemspec in [vendor/bundle/ruby/1.9.1/specifications/omniauth-github-1.0.1.gemspec]: invalid date format in specification: "2011-12-04 00:00:00.000000000Z" | |
2012-02-28T20:20:15+00:00 app[hub.1]: Invalid gemspec in [vendor/bundle/ruby/1.9.1/specifications/postmark-0.9.8.gemspec]: invalid date format in specification: "2011-08-23 00:00:00.000000000Z" | |
2012-02-28T20:20:15+00:00 |
on run {input, parameters} | |
tell application "Finder" | |
set sel to selection | |
if (count sel) > 0 then | |
set myTarget to item 1 of sel | |
else if (count window) > 0 then | |
set myTarget to target of window 1 | |
else | |
set myTarget to path to home folder | |
end if |
def init_var | |
puts 'init var...' | |
'var value' | |
end | |
puts 'define class A' | |
class A | |
@@var = init_var |