This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| フィーチャ: 入稿管理ビルダの認証権限 | |
| シナリオアウトライン: メソッドレベルの権限 | |
| 前提 DUの入稿管理ビルダがあり | |
| かつ AMSに"<ユーザ>"でログインしている | |
| ならば "save"ビルダコマンドの実行は"<save>" | |
| かつ "abandon!"ビルダコマンドの実行は"<abandon!>" | |
| かつ "reset"ビルダコマンドの実行は"<reset>" | |
| 例: | |
| | ユーザ | save | commit | abandon! | reset | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'mechanize' | |
| WWW::Mechanize::Page.class_eval do | |
| def images | |
| @images ||= search('img').map do |img| | |
| case src = img['src'] | |
| when %r{^https?://} | |
| src | |
| else | |
| (uri + src).to_s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Inline | |
| include Haml::Filters::Base | |
| def self.[](key) | |
| @@data[key.to_s] rescue nil | |
| end | |
| def render(str) | |
| @@data = Hash[*str.split(/^\s*@@\s*(\w+)\s*\n/m)[1..-1]] | |
| return nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User.transaction(:serializable) do | |
| ... | |
| # generates | |
| BEGIN ; | |
| SET TRANSACTION ISOLATION LEVEL SERIALIZABLE ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| def a | |
| end | |
| private | |
| def b | |
| end | |
| end | |
| Foo.new.should respond_to(:a) # passed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Spec::Matchers.define :be_extension_of do |expected| | |
| match do |obj| | |
| (class << obj; self; end).ancestors.include?(expected) | |
| end | |
| end | |
| obj = Object.new | |
| obj.should be_extension_of(Kernel) # => true | |
| obj.should be_extension_of(Spec) # Spec::Expectations::ExpectationNotMetError | |
| obj.extend(Spec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'chawan' | |
| text = '本日はバリ晴天なりっす' | |
| Chawan.parse(text) | |
| => [<名詞: '本日'>, <助詞: 'は'>, <名詞: 'バリ'>, <名詞: '晴天'>, <助動詞: 'なり'>, <助動詞: 'っす'>] | |
| Chawan.parse(text).noun | |
| => [<名詞: '本日'>, <名詞: 'バリ'>, <名詞: '晴天'>] | |
| Chawan.parse(text).compact.noun | |
| => [<名詞: '本日'>, <名詞: 'バリ晴天'>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'extlib' | |
| class Foo | |
| include Extlib::Hook | |
| def foo(arg) | |
| p [:foo, arg] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (momoko)</usr/lib/ruby/gems/1.8/gems># grep -rl link_to *sinatra* | |
| darkhelmet-sinatra_more-0.3.35/sinatra_more.gemspec | |
| darkhelmet-sinatra_more-0.3.35/lib/sinatra/markup_plugin/asset_tag_helpers.rb | |
| darkhelmet-sinatra_more-0.3.35/test/fixtures/markup_app/views/link_to.erb | |
| darkhelmet-sinatra_more-0.3.35/test/fixtures/markup_app/views/link_to.haml | |
| darkhelmet-sinatra_more-0.3.35/test/markup_plugin/test_asset_tag_helpers.rb | |
| darkhelmet-sinatra_more-0.3.35/README.rdoc | |
| darkhelmet-sinatra_more-0.3.35/ROADMAP | |
| sinatra-mapping-1.2.0/lib/sinatra/mapping.rb | |
| sinatra-mapping-1.2.0/test/fixtures/classic_application.rb |