railsのgemを1.3.0にしてgenerateコマンドを実行すると
Gem::SourceIndex#search support for Regexp patterns is deprecated...
というエラーが出るようになったみたい。一応ちゃんとgenerateは出来てるみたいです。
↓のサイトにも書いてあったけど1.2に戻せば出なくなりました。
sudo gem uninstall rubygems-update -v 1.3.0
rubygems-update-1.2.0.gemをRubyForgeで落としてきて
sudo gem install rubygems-update-1.2.0.gem sudo update_rubygems gem -v 1.2.0
(=゚ω゚)ノ ぱりんもやってみるお
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1012624365?fr=rcmd_chie_detail
http://www.geocities.co.jp/Technopolis/2890/English/Number.html
を参考にして、フムフム…φ(@Д@━)
Σ(゜ロ゜〃)1000で割った余りを英語に直していけばいいかな?数字のお尻から
φ(・ω・ )こんな感じになりました 取りあえず999999999までで
def num_in_english(num) Integer(num) rescue return "半角の数字を入力してください。" print num, " " return "負でない数を入力してください。" if num < 0 return "数値が大きすぎます。" if num > 999999999 return "zero" if num == 0 output = [] cnt = 0 $ones_place = %w[zero one two three four five six seven eight nine] $tens_place = %w[zero ten twenty thirty fourty fifty sixty seventy eighty ninety] $teenagers = %w[zero eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen] $bignums = %w[hundred thousand millon] while true temp = [] num, mod = num.divmod(1000) temp = convert(mod) unless mod == 0 unless temp.empty? temp << $bignums[cnt] if cnt > 0 output = temp + output end cnt += 1 break if num == 0 end return output.join(" ") end def convert(num) case num when 1..9 $ones_place[num].to_a when 10..99 if num % 10 == 0 $tens_place[num / 10].to_a elsif num >= 11 and num <= 19 $teenagers[num % 10].to_a else return $tens_place[num / 10], $ones_place[num % 10] end when 100..999 arr = $ones_place[num / 100], $bignums[0] arr << convert(num % 100) unless num % 100 == 0 return arr end end
0 => "zero"
7 => "seven"
11 => "eleven"
16 => "sixteen"
34 => "thirty four"
56 => "fifty six"
88 => "eighty eight"
100 => "one hundred"
101 => "one hundred one"
234 => "two hundred thirty four"
4634 => "four thousand six hundred thirty four"
8888 => "eight thousand eight hundred eighty eight"
6000000 => "six millon"
7000321 => "seven millon three hundred twenty one"
7654321 => "seven millon six hundred fifty four thousand three hundred twenty one"
87654321 => "eighty seven millon six hundred fifty four thousand three hundred twenty one"
rochefortさんのと答えは合ってるε-(´▽`) ホッ
バグとかあったら教えてください+.(人´Д`*).+゜.
最初はターミナルを使っていたんだけど、選択範囲を自動でコピー出来ないのでitermに変更。
僕はvimしか使えないので(emacsもいつか覚えます)vimのpluginも入れました。
ここら辺あると良いですね。
ところで最初.vimの中のディレクトリにpluginというディレクトリがなくて
代わりにftpluginディレクトリがあったので、その中に全部入れてました。
ところがautocomplpop.vimの自動補完が効かない><;
pluginディレクトリに入れると効くようになりました。
あとはQuicksilverとかも入れたほうが良さそうです。