タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

programmingとrubyとlibraryに関するtakadoのブックマーク (3)

  • Rubyでニコニコ動画のダウンローダ - rubyco(るびこ)の日記

    ニコニコ動画にアクセスするnicovideoパッケージをgemでインストールすると、sample/nv_download.rb というファイルも入手できます。それを読んで勉強。で、nv_download.rbをもとにしてnico.rbを書きました。nv_download.rbの劣化コピーですみません。でも、自分で書き写して直すと理解が深まるので、おゆるしください。 require 'nicovideo' require 'yaml' require 'iconv' def puts(s) Kernel.puts Iconv.conv('cp932', 'UTF-8', s) end account = YAML.load_file('nico.yaml') mail, password = account['mail'], account['password'] nicovideo = N

    Rubyでニコニコ動画のダウンローダ - rubyco(るびこ)の日記
  • starruby.info

    starruby.info 2020 Copyright. All Rights Reserved. The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois). Privacy Policy

  • Pathname - ファイル名のグッドラッパー - 2nd life (移転しました)

    http://www.ruby-lang.org/ja/man/?cmd=view;name=pathname 先日のRails勉強会でetoさんにPathnameというパスやファイル名のすごい便利なライブラリを教えて貰った。で、早速使ってみたところめっちゃ便利でいま書いてるアプリケーションじゃほとんどのファイル名の操作に使ってるという。 使い方はめっちゃ簡単でパスやファイル名を引数としてオブジェクトを作るだけ。 require 'pathname' file = '/tmp/foo' path = Pathname.new file で、これの何が便利っていうとリファレンスマニュアルのメソッドを眺めて貰うと解るんだけど、ファイル関係の操作が何でもできてしまう。通常だとFileオブジェクトを作るには実体が無いとダメなんだけど無くてももちろん作れるため str = IO.read(file)

    Pathname - ファイル名のグッドラッパー - 2nd life (移転しました)
    takado
    takado 2007/05/21
    素晴らしい!だいたい「ファイル名の文字列が/で終わってるかどうか」なんてこっちが気にすることじゃないですよねー
  • 1