RailsのRakeタスク作成〜RSpecでのテストまでの流れをまとめました。 できるだけシンプルにまとめたので、Rakeタスクの作成にはじめてトライされる方はぜひご一読ください。 02/13 22:10全体的に説明書きを書き直し 😼 Rakeタスクファイルの作成次のコマンドを実行すると、Rakeタスク用のファイルがlib/tasksの下に作成されます。 (reportsの部分は任意の名前に変更してください)
この記事はコミュニティ ゲスト投稿者兼 Engine Yard OB の Andre Arko 氏から英語版ブログで2010年10月3日に寄せられたものです。Arko 氏は 5 年前から Ruby and Rails を使ってウェブ アプリケーションを作成されており、Bundler コア チームのメンバーでもあります。同氏は Plex に勤務するかたわら、@indirect としてのツイートや、andre.arko.net でのブログも公開しています。 Rails 3.0 の gem プラグイン ついに Rails 3.0 がリリースされました。このバージョンには Railtie という、Rails を拡張するための素晴らしい新機能が追加されています。Railtie は Rails 3 のコア コンポーネントの基盤であり、これには Carlhuda さんが何か月もかけて丁寧にリファクタリン
このウェブサイトは販売用です! twiwt.org は、あなたがお探しの情報の全ての最新かつ最適なソースです。一般トピックからここから検索できる内容は、twiwt.orgが全てとなります。あなたがお探しの内容が見つかることを願っています!
最近、いわゆるRailsの古めのバージョンで書かれたプチレガシーな感じのアプリケーションを触っていて思ったこと。 ちなみに、この話題は多くの人にとって大分今更感のある内容なので、逆にこれを読んで「今更だなぁ、そんなのとっくに結論出てるでしょ」と思わない人はヤバい。 めんどくさいのでデータ永続化を行うためのミドルウェアはMySQLという前提で書く。 単純に言うと、いわゆるRailsアプリのMVCではMがActiveRecordかなんかを継承していて、そのまま作るとModelとtableが一対一対応になってしまう これだと、どのModelにも属さないようなビジネスロジックを置くべき場所がどこなのかよくわからない 「どのModelにも属さないようなビジネスロジックなんてないでしょ!」「どのModelにも属さないビジネスロジックがある時点で設計おかしいでしょ!」と思った人は幸福である。頭が。 ちな
Warning: mysql_real_escape_string(): No such file or directory in /home/sites/heteml/users/n/a/k/nakajijapan/web/nakajijapan.blog/wp-content/plugins/easy-google-syntax-highlighter/easy-google-syntax-highlighter.php on line 50 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/sites/heteml/users/n/a/k/nakajijapan/web/nakajijapan.blog/wp-content/plugins/easy-
このウェブサイトは販売用です! twiwt.org は、あなたがお探しの情報の全ての最新かつ最適なソースです。一般トピックからここから検索できる内容は、twiwt.orgが全てとなります。あなたがお探しの内容が見つかることを願っています!
UPDATE: see my new article on adding real-time to your Rails application. Despite the recent distaste for Rails, I still think its a nice framework for developing websites (e.g. devise & active record). However, if you want real-time communication Socket.IO and Node.js seem to be the best options. If you already have an existing Rails application porting the entire application to Node.js is likely
Rails 4でSinatra::Streaming相当のストリーミング機構が入るとのことですが、そもそもRackやEventMachineに寄り添ったストリーミングは筋悪というか強引すぎると考えていて(Phusionの人の懸念に近い)、それなら最初から向いてるテクノロジーを使ったほうがいいよねと思いNode.jsを触ることにしました。 といってもストリーミングのためだけにすべてをNodeで書く気はなくて、メイン部分をSinatraやRailsで処理し、ストリーミング部分(EventSourceやWebSocket、あるいはSocket.IOに丸投げ)をNodeで処理し、この2つがZeroMQかなんかでプロセス間通信するのが理想かなと思っています。つまりクライアント(ブラウザ)はまずRailsに接続し、そこでnew EventSource('http://host:8080/sse')みた
先にRuby2.0の要約と付け足しをやったけど、今度はRails4。Rails4はざっくり見た感じ、導入負担が少なくていいものらしい。ザックリとしか書かないので、詳しくは下の雑誌で。 amazon 表面上の違いは、今までのバージョンアップほどないらしいけど、根本的な内部の変更があるみたい。 それまでとの大きな相違点は ・Ruby2.0対応 ・マイナー機能の削除 ・動作速度アップ(体感できるほどらしい) ・セキュリティの向上 って書いてあるよ。 以下、細かく見ていく。 ん~アメリカで流行った後は、南米で流行っちゃったのかぁ。もう、日本でRuby作ってようと作ってまいとあんまり関係ない感じになっちゃってるな。まぁ元々、Rubyが逆輸入されたような形で、RailsがRubyを盛り立てたところがありましたが、今後も重要な位置を占めるのは間違いない様子です。 マイナー機能の削除ですが、具体的には、
Rails3.2/GitHub/Pivotalという割とモダンな環境で2ヶ月間開発してました。その契約期間が終了したので、振り返ってみます。 Gems 自分の担当で、初めて(本格的に)使ったGemたち no title 帳票PDF出力 no title PDF解析(テスト用) no title Zip圧縮 no title ユーザー認証 no title HTML加工 no title 検索フォーム補助 no title よりよいフィクスチャ no title RSpecマッチャ拡張 no title 並列テスト no title プログレスバー型RSpecフォーマッタ 日に日にテスト実行時間が長くなっていて、どうにかしたいと思って最終日に探してすぐ導入したParallel testsが印象的です。 Retrospection ひとり開発でやっていたことが活かせた Railsは経験の蓄積が
RubyやRailsで外部APIを利用するソフトウェアを開発しているときに、テストで実際に何度もAPIに問い合わせにをしていたら、遅くて話になりません。ましてや、外部APIがメンテナンスなんてことになったら、開発が止まってしまいます。 そこで、webmockなどを利用して、HTTPリクエストやレスポンスのmockを作成することが望ましいです。 vcrを組み合わせて利用すれば、初回だけ実際にHTTPリクエストとレスポンスを記録して、2回目以降は記録したデータからmockとしてデータを返すように簡単にできます。 webmockとvcrのインストール方法Gemfileに以下のように記述する group :development, :test do gem 'webmock' gem 'vcr' endgemをインストールする $ bundletest/test_helper.rbにVCRに関する
Rails 3.2.9/Bootstrap/Bootswatchで「どうぶつの森 QRコードまとめ」作ってみた! Dec 7th, 2012 Tweet 2012年11月最高に輝いてたテック記事「Rails3、Twitter Bootstrap、Bootswatch を使ったレスポンシブなエロサイト「babyshark」をリリースしました」をみて泪流したので、Railsで「どうぶつの森 QRコードまとめ」を作ってみました。 ということで今回やったことまとめと反省、今後の目標です。 どうぶつの森 QR コードまとめ 目次 (1) 今回使った技術まとめ (2) 開始時の目標と現時点の自己採点 (3) 今後の目標 (1)今回使った技術まとめ 今回使った技術はほとんどをブログの記事にしています。以下の記事が今回使った技術です。 環境構築編 SSH認証キーをBitbucket/GitHubに設定
こんにちは、ursmです。 今回はRuby on RailsとMongoidを使って簡単なブログアプリケーションを作ってみます。 Mongoidとは RubyからMongoDBを操作するためのライブラリのひとつです。Rubyのオブジェクトをドキュメントにマッピングすることから、ORMならぬODM (Object Document Mapper) と呼ばれます。Railsのモデル層を抽象化したライブラリであるActiveModelに準じたAPIを持っており、Railsとの組み合わせがとても簡単に行えます。 アプリケーションを生成する それでは早速始めましょう。Mongoidのバージョンは今時点の最新安定版である2.4.5を、Railsも同様に3.2.1を使います。 $ rails new blog --skip-active-record create create README.rdoc
Rails3.2.x で開発時にassets precompileに時間を要していたので、なんとか早くすべく調べていたら、stackoverflowに以下の記述があったので実際に試してみたらスピードアップしたので忘れないうちまとめてみた。 Capistranoを利用している場合は、Capistranoのビルトインタスクである ‘deploy/assets’ を使用する。 Capistranoのビルトインタスクを利用することで、assetsのみをプリコンパイルするためアプリ全体を対象にプリコンパイルするよりも早くなります。 変更のあったファイルだけをプリコンパイルする。 変更のあったファイルだけをプリコンパイルし、それ以外のファイルはスキップするたプリコンパイルにかかる時間が短くなります。 今回、私は Turbo Sprockets for Rails 3.2.x を使いました。 Sassの
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く