asana2flowdock 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +58 -0
- data/README.md +85 -0
- data/Rakefile +394 -0
- data/a.rb +336 -0
- data/a.yml +6 -0
- data/asana2flowdock.gemspec +1878 -0
- data/bin/amalgalite-pack +16 -0
- data/bin/asana2flowdock +274 -0
- data/bin/asana2flowdock-daemon +16 -0
- data/bin/coderay +16 -0
- data/bin/httparty +16 -0
- data/bin/pry +16 -0
- data/bin/sekrets +16 -0
- data/bin/sequel +16 -0
- data/config/asana2flowdock.yml.enc +2 -0
- data/lib/asana2flowdock.rb +98 -0
- data/lib/asana2flowdock/asana.rb +225 -0
- data/vendor/bundle/ruby/1.9.1/bin/amalgalite-pack +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/asana2flowdock +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/asana2flowdock-daemon +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/coderay +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/httparty +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/pry +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/sekrets +23 -0
- data/vendor/bundle/ruby/1.9.1/bin/sequel +23 -0
- data/vendor/bundle/ruby/1.9.1/build_info/amalgalite-1.3.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/arrayfields-4.7.4.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/chronic-0.10.2.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/coderay-1.1.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/coerce-0.0.6.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/daemons-1.1.9.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/fastercsv-1.5.5.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/fattr-2.2.2.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/flowdock-0.5.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/highline-1.6.21.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/httparty-0.13.1.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/json-1.8.1.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/main-6.0.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/main-6.1.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/map-6.5.5.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/method_source-0.8.2.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/multi_json-1.10.1.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/multi_xml-0.5.5.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/pry-0.9.12.6.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/sekrets-1.7.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/sequel-4.15.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/slop-3.5.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/build_info/threadify-1.3.0.info +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/CONTRIBUTING.md +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/HISTORY.md +315 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/LICENSE +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/Manifest.txt +104 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/README.md +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/Rakefile +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/TODO.md +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/bin/amalgalite-pack +147 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/a.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/blob.rb +88 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/bootstrap.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/define_aggregate.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/define_function.rb +104 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/fts3.rb +144 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/gem-db.rb +94 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/require_me.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/requires.rb +42 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/examples/schema-info.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/Makefile +220 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite.bundle +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite.c +329 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite.h +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_blob.c +240 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_blob.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_constants.c +378 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_constants.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_database.c +1177 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_database.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_requires_bootstrap.c +282 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_requires_bootstrap.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_statement.c +649 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/amalgalite_statement.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/extconf.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/gen_constants.rb +193 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/notes.txt +134 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/sqlite3.c +137414 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/sqlite3.h +7160 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/sqlite3.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/sqlite3_options.h +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/ext/amalgalite/c/sqlite3ext.h +447 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/1.9/amalgalite.bundle +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/aggregate.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/blob.rb +186 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/boolean.rb +42 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/busy_timeout.rb +47 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/column.rb +99 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/core_ext/kernel/require.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/csv_table_importer.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/database.rb +984 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/function.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/index.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/memory_database.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/packer.rb +231 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/paths.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/profile_tap.rb +131 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/progress_handler.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/requires.rb +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/schema.rb +225 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/sqlite3.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/sqlite3/constants.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/sqlite3/database/function.rb +48 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/sqlite3/database/status.rb +68 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/sqlite3/status.rb +60 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/sqlite3/version.rb +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/statement.rb +418 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/table.rb +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/taps.rb +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/taps/console.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/taps/io.rb +71 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/trace_tap.rb +35 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/type_map.rb +63 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/type_maps/default_map.rb +166 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/type_maps/storage_map.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/type_maps/text_map.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/version.rb +8 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/lib/amalgalite/view.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/aggregate_spec.rb +150 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/amalgalite_spec.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/blob_spec.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/boolean_spec.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/busy_handler.rb +157 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/data/iso-3166-country.txt +242 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/data/iso-3166-schema.sql +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/data/iso-3166-subcountry.txt +3995 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/data/make-iso-db.sh +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/database_spec.rb +510 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/default_map_spec.rb +92 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/function_spec.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/integeration_spec.rb +97 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/iso_3166_database.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/packer_spec.rb +60 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/paths_spec.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/progress_handler_spec.rb +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/requires_spec.rb +54 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/rtree_spec.rb +66 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/schema_spec.rb +131 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/spec_helper.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/sqlite3/constants_spec.rb +108 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/sqlite3/database_status_spec.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/sqlite3/status_spec.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/sqlite3/version_spec.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/sqlite3_spec.rb +53 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/statement_spec.rb +168 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/storage_map_spec.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/tap_spec.rb +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/text_map_spec.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/type_map_spec.rb +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/spec/version_spec.rb +8 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/tasks/custom.rake +99 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/tasks/default.rake +277 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/tasks/extension.rake +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/amalgalite-1.3.0/tasks/this.rb +209 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/README +378 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/arrayfields.gemspec +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/gemspec.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/install.rb +206 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/lib/arrayfields.rb +443 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/readme.rb +248 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/sample/a.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/sample/b.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/sample/c.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/sample/d.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/sample/e.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/test/arrayfields.rb +324 -0
- data/vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/test/memtest.rb +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/HISTORY.md +243 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/LICENSE +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/README.md +182 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/Rakefile +66 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/chronic.gemspec +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic.rb +150 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/date.rb +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/grabber.rb +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/handler.rb +97 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/handlers.rb +647 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/mini_date.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/numerizer.rb +130 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/ordinal.rb +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/parser.rb +268 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/pointer.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeater.rb +145 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_day.rb +54 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_day_name.rb +53 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_day_portion.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_fortnight.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_hour.rb +59 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_minute.rb +59 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_month.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_month_name.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_season.rb +111 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_season_name.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_second.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_time.rb +138 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_week.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_weekday.rb +86 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_weekend.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_year.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/scalar.rb +81 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/season.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/separator.rb +207 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/sign.rb +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/span.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/tag.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/time.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/time_zone.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/lib/chronic/token.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/helper.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_chronic.rb +183 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_daylight_savings.rb +118 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_handler.rb +128 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_mini_date.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_numerizer.rb +86 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_parsing.rb +1235 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_day_name.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_day_portion.rb +254 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_fortnight.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_hour.rb +68 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_minute.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_month.rb +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_month_name.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_season.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_time.rb +88 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_week.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_weekday.rb +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_weekend.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_repeater_year.rb +69 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_span.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/chronic-0.10.2/test/test_token.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/README_INDEX.rdoc +123 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/Rakefile +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/bin/coderay +215 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay.rb +284 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/duo.rb +81 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoder.rb +201 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/_map.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/comment_filter.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/count.rb +39 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/debug.rb +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/debug_lint.rb +63 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/div.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/html.rb +332 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/html/css.rb +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/html/numbering.rb +108 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/html/output.rb +166 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/json.rb +83 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/lines_of_code.rb +45 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/lint.rb +59 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/null.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/page.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/span.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/statistic.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/terminal.rb +195 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/text.rb +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/token_kind_filter.rb +111 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/xml.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/yaml.rb +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/for_redcloth.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/helpers/file_type.rb +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/helpers/plugin.rb +274 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/helpers/word_list.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanner.rb +355 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/_map.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/c.rb +189 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/clojure.rb +217 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/cpp.rb +215 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/css.rb +196 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/debug.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/delphi.rb +144 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/diff.rb +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/erb.rb +81 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/go.rb +208 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/groovy.rb +268 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/haml.rb +168 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/html.rb +275 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/java.rb +174 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/java/builtin_types.rb +421 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/java_script.rb +237 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/json.rb +98 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/lua.rb +280 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/php.rb +527 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/python.rb +287 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/raydebug.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/ruby.rb +470 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/ruby/patterns.rb +178 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/ruby/string_state.rb +71 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/sass.rb +232 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/sql.rb +177 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/taskpaper.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/text.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/xml.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/scanners/yaml.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/style.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/styles/_map.rb +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/styles/alpha.rb +152 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/token_kinds.rb +85 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/tokens.rb +161 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/tokens_proxy.rb +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/version.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/test/functional/basic.rb +318 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/test/functional/examples.rb +129 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/test/functional/for_redcloth.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/coderay-1.1.0/test/functional/suite.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/coerce-0.0.6/README +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/coerce-0.0.6/Rakefile +392 -0
- data/vendor/bundle/ruby/1.9.1/gems/coerce-0.0.6/coerce.gemspec +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/coerce-0.0.6/lib/coerce.rb +210 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/LICENSE +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/README +214 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/Rakefile +90 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/Releases +195 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/TODO +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/call/call.rb +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/call/call_monitor.rb +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/daemonize/daemonize.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_crash.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_exec.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_exit.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_hanging.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_keep_pid_files.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_monitor.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_multiple.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_normal.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_ontop.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_optionparser.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_proc.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_proc_multiple.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_proc_rand.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_proc_simple.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/ctrl_slowstop.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/myserver.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/myserver_crashing.rb +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/myserver_exiting.rb +8 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/myserver_hanging.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/examples/run/myserver_slowstop.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons.rb +315 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/application.rb +477 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/application_group.rb +194 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/change_privilege.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/cmdline.rb +121 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/controller.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/daemonize.rb +169 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/etc_extension.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/exceptions.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/monitor.rb +138 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/pid.rb +108 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/pidfile.rb +116 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/lib/daemons/pidmem.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/daemons-1.1.9/setup.rb +1360 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/AUTHORS +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/CHANGELOG +182 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/COPYING +340 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/INSTALL +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/LICENSE +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/README +71 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/Rakefile +94 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/TODO +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/csv_converters.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/csv_filter.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/csv_reading.rb +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/csv_table.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/csv_writing.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/purchase.csv +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/examples/shortcut_interface.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/lib/faster_csv.rb +2025 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/lib/fastercsv.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/line_endings.gz +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_csv_parsing.rb +191 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_csv_writing.rb +96 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_data_converters.rb +260 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_encodings.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_features.rb +212 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_headers.rb +277 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_interface.rb +376 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_row.rb +305 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_serialization.rb +154 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_speed.rb +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/tc_table.rb +408 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/test_data.csv +1000 -0
- data/vendor/bundle/ruby/1.9.1/gems/fastercsv-1.5.5/test/ts_all.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/LICENSE +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/README +347 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/README.erb +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/Rakefile +376 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/lib/fattr.rb +206 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/a.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/b.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/c.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/d.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/e.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/f.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/g.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/h.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/test/fattr_test.rb +173 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/Gemfile +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/LICENSE +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/README.md +145 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/Rakefile +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/VERSION +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/flowdock.gemspec +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/lib/flowdock.rb +181 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/lib/flowdock/capistrano.rb +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/spec/flowdock_spec.rb +435 -0
- data/vendor/bundle/ruby/1.9.1/gems/flowdock-0.5.0/spec/spec_helper.rb +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/AUTHORS +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/CHANGELOG +357 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/COPYING +340 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/INSTALL +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/LICENSE +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/README.rdoc +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/Rakefile +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/TODO +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/ansi_colors.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/asking_for_arrays.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/basic_usage.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/color_scheme.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/get_character.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/limit.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/menus.rb +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/overwrite.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/page_and_wrap.rb +322 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/password.rb +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/repeat_entry.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/trapping_eof.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/using_readline.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/highline.gemspec +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline.rb +1034 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/color_scheme.rb +134 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/compatibility.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/import.rb +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/menu.rb +381 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/question.rb +481 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/simulate.rb +48 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/string_extensions.rb +111 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/style.rb +181 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/lib/highline/system_extensions.rb +242 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/setup.rb +1360 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/site/highline.css +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/site/images/logo.png +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/site/index.html +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/string_methods.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_color_scheme.rb +96 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_highline.rb +1134 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_import.rb +52 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_menu.rb +439 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_string_extension.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_string_highline.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_style.rb +567 -0
- data/vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/ts_all.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/Gemfile +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/Guardfile +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/History +303 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/README.md +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/Rakefile +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/bin/httparty +117 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/cucumber.yml +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/aaws.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/basic.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/crack.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/custom_parsers.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/delicious.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/google.rb +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/headers_and_user_agents.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/rubyurl.rb +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/stackexchange.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/tripit_sign_in.rb +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/twitter.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/whoismyrep.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/basic_authentication.feature +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/command_line.feature +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/deals_with_http_error_codes.feature +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/digest_authentication.feature +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/handles_compressed_responses.feature +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/handles_multiple_formats.feature +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/steps/env.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/steps/httparty_response_steps.rb +52 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/steps/httparty_steps.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/steps/mongrel_helper.rb +94 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/steps/remote_service_steps.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/supports_read_timeout_option.feature +13 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/supports_redirection.feature +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/features/supports_timeout_option.feature +13 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/httparty.gemspec +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty.rb +600 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/connection_adapter.rb +187 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/cookie_hash.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/core_extensions.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/exceptions.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/hash_conversions.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/logger/apache_logger.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/logger/curl_logger.rb +48 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/logger/logger.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/module_inheritable_attributes.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/net_digest_auth.rb +84 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/parser.rb +141 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/request.rb +331 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/response.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/response/headers.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/lib/httparty/version.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/script/release +42 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/delicious.xml +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/empty.xml +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/google.html +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generate.sh +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/1fe462c2.0 +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/bogushost.crt +13 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/ca.crt +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/ca.key +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/selfsigned.crt +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/server.crt +13 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/generated/server.key +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/ssl/openssl-exts.cnf +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/twitter.csv +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/twitter.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/twitter.xml +403 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/fixtures/undefined_method_add_node_for_nil.xml +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/connection_adapter_spec.rb +354 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/cookie_hash_spec.rb +83 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/exception_spec.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/logger/apache_logger_spec.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/logger/curl_logger_spec.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/logger/logger_spec.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/net_digest_auth_spec.rb +152 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/parser_spec.rb +165 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/request_spec.rb +638 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/response_spec.rb +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty/ssl_spec.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/httparty_spec.rb +764 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/spec.opts +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/spec_helper.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/support/ssl_test_helper.rb +47 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/support/ssl_test_server.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/spec/support/stub_response.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/website/css/common.css +47 -0
- data/vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/website/index.html +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/CHANGES +284 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/COPYING +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/COPYING-json-jruby +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/GPL +340 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/Gemfile +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/README-json-jruby.markdown +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/README.rdoc +358 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/Rakefile +412 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/TODO +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/VERSION +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/data/example.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/data/index.html +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/data/prototype.js +4184 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/fbuffer/fbuffer.h +181 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/Makefile +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/depend +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/extconf.rb +14 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/generator.bundle +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/generator.c +1435 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/generator.h +148 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/generator/generator.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/Makefile +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/depend +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/extconf.rb +13 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/parser.bundle +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/parser.c +2204 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/parser.h +77 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/parser.o +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/ext/json/ext/parser/parser.rl +927 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/install.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/ByteListTranscoder.java +167 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/Generator.java +444 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/GeneratorMethods.java +232 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/GeneratorService.java +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/GeneratorState.java +543 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/OptionsReader.java +114 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/Parser.java +2644 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/Parser.rl +968 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/ParserService.java +35 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/RuntimeInfo.java +121 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/StringDecoder.java +167 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/StringEncoder.java +106 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/java/src/json/ext/Utils.java +89 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/json-java.gemspec +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/json.gemspec +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/json_pure.gemspec +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/bigdecimal.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/complex.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/core.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/date.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/date_time.rb +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/exception.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/ostruct.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/range.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/rational.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/regexp.rb +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/struct.rb +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/symbol.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/add/time.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/common.rb +484 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/ext.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/ext/generator.bundle +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/ext/parser.bundle +0 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/generic_object.rb +70 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/pure.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/pure/generator.rb +522 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/pure/parser.rb +359 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/lib/json/version.rb +8 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail1.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail10.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail11.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail12.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail13.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail14.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail18.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail19.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail2.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail20.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail21.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail22.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail23.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail24.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail25.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail27.json +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail28.json +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail3.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail4.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail5.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail6.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail7.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail8.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/fail9.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass1.json +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass15.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass16.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass17.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass2.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass26.json +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/fixtures/pass3.json +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/setup_variant.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json.rb +545 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_addition.rb +196 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_encoding.rb +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_fixtures.rb +35 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_generate.rb +322 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_generic_object.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_string_matching.rb +39 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tests/test_json_unicode.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tools/fuzz.rb +139 -0
- data/vendor/bundle/ruby/1.9.1/gems/json-1.8.1/tools/server.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/LICENSE +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/README +1177 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/README.erb +881 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/Rakefile +394 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/TODO +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/a.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main.rb +93 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/cast.rb +163 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/dsl.rb +77 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/factories.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/getoptlong.rb +470 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/logger.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/mode.rb +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/parameter.rb +735 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/program.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/program/class_methods.rb +381 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/program/instance_methods.rb +303 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/softspoken.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/stdext.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/test.rb +89 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/usage.rb +212 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/lib/main/util.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/main.gemspec +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/a.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/b.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/c.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/d.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/e.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/f.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/g.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/h.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/j.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.0.0/test/main_test.rb +954 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/LICENSE +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/README +1177 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/README.erb +881 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/Rakefile +394 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/TODO +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/a.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main.rb +94 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/cast.rb +163 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/daemon.rb +525 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/dsl.rb +77 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/factories.rb +28 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/getoptlong.rb +470 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/logger.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/mode.rb +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/parameter.rb +735 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/program.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/program/class_methods.rb +392 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/program/instance_methods.rb +308 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/softspoken.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/stdext.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/test.rb +89 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/usage.rb +212 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/lib/main/util.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/main.gemspec +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/a.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/b.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/c.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/d.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/e.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/f.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/g.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/h.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/j.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/main-6.1.0/test/main_test.rb +954 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/LICENSE +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/README +145 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/Rakefile +394 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/a.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/lib/map.rb +1190 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/lib/map/integrations/active_record.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/lib/map/options.rb +188 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/lib/map/params.rb +79 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/lib/map/struct.rb +52 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/map.gemspec +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/test/leak.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/test/lib/testing.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/map-6.5.5/test/map_test.rb +802 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/Gemfile +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/LICENSE +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/README.markdown +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/Rakefile +79 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/lib/method_source.rb +141 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/lib/method_source/code_helpers.rb +154 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/lib/method_source/source_location.rb +138 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/lib/method_source/version.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/method_source.gemspec +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/test/test.rb +138 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/test/test_code_helpers.rb +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/method_source-0.8.2/test/test_helper.rb +98 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/CHANGELOG.md +220 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/CONTRIBUTING.md +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/Gemfile +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/LICENSE.md +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/README.md +119 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/Rakefile +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json.rb +158 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapter.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapter_error.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/jr_jackson.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/json_common.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/json_gem.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/json_pure.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/nsjsonserialization.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/oj.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/ok_json.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/yajl.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/convertible_hash_keys.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/options.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/parse_error.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/vendor/okjson.rb +606 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/version.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/multi_json.gemspec +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/gson_adapter_spec.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/jr_jackson_adapter_spec.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/json_gem_adapter_spec.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/json_pure_adapter_spec.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/multi_json_spec.rb +200 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/nsjsonserialization_adapter_spec.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/oj_adapter_spec.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/ok_json_adapter_spec.rb +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/shared/adapter.rb +236 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/shared/json_common_adapter.rb +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/shared/options.rb +119 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/spec_helper.rb +77 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/spec/yajl_adapter_spec.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/CHANGELOG.md +93 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/CONTRIBUTING.md +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/LICENSE.md +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/README.md +97 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/Rakefile +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml.rb +296 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/libxml.rb +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/libxml2_parser.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/ox.rb +97 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/rexml.rb +113 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/version.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/multi_xml.gemspec +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/spec/helper.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/spec/multi_xml_spec.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/spec/parser_shared_example.rb +694 -0
- data/vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/spec/speed.rb +63 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/CHANGELOG +534 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/CONTRIBUTORS +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/Gemfile +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/LICENSE +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/README.markdown +400 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/Rakefile +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/TODO +117 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/bin/pry +16 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry.rb +274 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/cli.rb +202 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/code.rb +385 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/code/code_range.rb +70 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/code/loc.rb +92 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/code_object.rb +153 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/command.rb +689 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/command_set.rb +400 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/amend_line.rb +99 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/bang.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/bang_pry.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cat.rb +53 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cat/abstract_formatter.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cat/exception_formatter.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cat/file_formatter.rb +84 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cat/input_expression_formatter.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cd.rb +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/code_collector.rb +165 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/disable_pry.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/disabled_commands.rb +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/easter_eggs.rb +112 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/edit.rb +207 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/edit/exception_patcher.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/edit/file_and_line_locator.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/edit/method_patcher.rb +122 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/exit.rb +42 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/exit_all.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/exit_program.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/find_method.rb +199 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/fix_indent.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/gem_cd.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/gem_install.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/gem_list.rb +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/gem_open.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/gist.rb +102 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/help.rb +164 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/hist.rb +161 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/import_set.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/install_command.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/jump_to.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/ls.rb +338 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/nesting.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/play.rb +69 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/pry_backtrace.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/pry_version.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/raise_up.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/reload_code.rb +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/reset.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/ri.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/save_file.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/shell_command.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/shell_mode.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/show_doc.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/show_info.rb +200 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/show_input.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/show_source.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/simple_prompt.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/stat.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/switch_to.rb +23 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/toggle_color.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/whereami.rb +182 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/wtf.rb +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/completion.rb +321 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/config.rb +258 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/core_extensions.rb +121 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/custom_completions.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/editor.rb +129 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers.rb +5 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers/base_helpers.rb +200 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers/command_helpers.rb +154 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers/documentation_helpers.rb +76 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers/options_helpers.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers/table.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/helpers/text.rb +108 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/history.rb +124 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/history_array.rb +116 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/hooks.rb +250 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/indent.rb +406 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/method.rb +551 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/method/disowned.rb +53 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/method/weird_method_locator.rb +186 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/module_candidate.rb +146 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/pager.rb +90 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/plugins.rb +103 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/pry_class.rb +456 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/pry_instance.rb +765 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/rbx_method.rb +13 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/rbx_path.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/repl_file_loader.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/rubygem.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/terminal.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/test/helper.rb +185 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/version.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/wrapped_module.rb +387 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/man/pry.1 +195 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/man/pry.1.html +204 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/man/pry.1.ronn +141 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/pry.gemspec +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/Procfile +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/cli_spec.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/code_object_spec.rb +277 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/code_spec.rb +219 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/command_helpers_spec.rb +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/command_integration_spec.rb +644 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/command_set_spec.rb +627 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/command_spec.rb +821 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/amend_line_spec.rb +247 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/bang_spec.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/cat_spec.rb +164 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/cd_spec.rb +250 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/disable_pry_spec.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/edit_spec.rb +727 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/exit_all_spec.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/exit_program_spec.rb +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/exit_spec.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/find_method_spec.rb +70 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/gem_list_spec.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/gist_spec.rb +79 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/help_spec.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/hist_spec.rb +181 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/jump_to_spec.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/ls_spec.rb +181 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/play_spec.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/raise_up_spec.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/save_file_spec.rb +177 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/show_doc_spec.rb +510 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/show_input_spec.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/show_source_spec.rb +782 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/whereami_spec.rb +203 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/completion_spec.rb +241 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/control_d_handler_spec.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/documentation_helper_spec.rb +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/editor_spec.rb +79 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/exception_whitelist_spec.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/candidate_helper1.rb +11 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/candidate_helper2.rb +8 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/example.erb +5 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/example_nesting.rb +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/show_source_doc_examples.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/testrc +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/testrcbad +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/fixtures/whereami_helper.rb +6 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/helper.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/helpers/bacon.rb +86 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/helpers/mock_pry.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/helpers/table_spec.rb +105 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/history_array_spec.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/hooks_spec.rb +522 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/indent_spec.rb +301 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/input_stack_spec.rb +90 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/method_spec.rb +482 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/prompt_spec.rb +60 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/pry_defaults_spec.rb +419 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/pry_history_spec.rb +99 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/pry_output_spec.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/pry_spec.rb +515 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/run_command_spec.rb +25 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/sticky_locals_spec.rb +157 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/syntax_checking_spec.rb +81 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/wrapped_module_spec.rb +261 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/wiki/Customizing-pry.md +397 -0
- data/vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/wiki/Home.md +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/README +144 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/Rakefile +390 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/bin/sekrets +372 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/lib/sekrets.rb +511 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/lib/sekrets/capistrano.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/sekrets.gemspec +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/test/lib/testing.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/test/sekrets_test.rb +167 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/CHANGELOG +5790 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/MIT-LICENSE +19 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/README.rdoc +815 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/Rakefile +186 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/bin/sequel +244 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/active_record.rdoc +912 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/advanced_associations.rdoc +818 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/association_basics.rdoc +1763 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/bin_sequel.rdoc +144 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/cheat_sheet.rdoc +220 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/code_order.rdoc +96 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/core_extensions.rdoc +364 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/dataset_basics.rdoc +105 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/dataset_filtering.rdoc +191 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/extensions.rdoc +84 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/mass_assignment.rdoc +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/migration.rdoc +611 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/model_hooks.rdoc +262 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/model_plugins.rdoc +270 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/mssql_stored_procedures.rdoc +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/object_model.rdoc +573 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/opening_databases.rdoc +489 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/postgresql.rdoc +326 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/prepared_statements.rdoc +139 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/querying.rdoc +1017 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/reflection.rdoc +121 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/1.0.txt +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/1.1.txt +143 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/1.3.txt +101 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/1.4.0.txt +53 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/1.5.0.txt +155 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.0.0.txt +298 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.1.0.txt +271 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.10.0.txt +328 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.11.0.txt +215 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.12.0.txt +534 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.2.0.txt +253 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.3.0.txt +88 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.4.0.txt +106 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.5.0.txt +137 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.6.0.txt +157 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.7.0.txt +166 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.8.0.txt +171 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/2.9.0.txt +97 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.0.0.txt +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.1.0.txt +406 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.10.0.txt +286 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.11.0.txt +254 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.12.0.txt +304 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.13.0.txt +210 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.14.0.txt +118 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.15.0.txt +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.16.0.txt +45 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.17.0.txt +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.18.0.txt +120 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.19.0.txt +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.2.0.txt +268 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.20.0.txt +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.21.0.txt +87 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.22.0.txt +39 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.23.0.txt +172 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.24.0.txt +420 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.25.0.txt +88 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.26.0.txt +88 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.27.0.txt +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.28.0.txt +304 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.29.0.txt +459 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.3.0.txt +192 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.30.0.txt +135 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.31.0.txt +146 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.32.0.txt +202 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.33.0.txt +157 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.34.0.txt +671 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.35.0.txt +144 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.36.0.txt +245 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.37.0.txt +338 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.38.0.txt +234 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.39.0.txt +237 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.4.0.txt +325 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.40.0.txt +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.41.0.txt +155 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.42.0.txt +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.43.0.txt +105 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.44.0.txt +152 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.45.0.txt +179 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.46.0.txt +122 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.47.0.txt +270 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.48.0.txt +477 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.5.0.txt +510 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.6.0.txt +366 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.7.0.txt +179 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.8.0.txt +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/3.9.0.txt +233 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.0.0.txt +262 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.1.0.txt +85 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.10.0.txt +226 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.11.0.txt +147 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.12.0.txt +105 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.13.0.txt +169 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.14.0.txt +68 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.15.0.txt +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.2.0.txt +129 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.3.0.txt +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.4.0.txt +92 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.5.0.txt +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.6.0.txt +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.7.0.txt +103 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.8.0.txt +175 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/release_notes/4.9.0.txt +190 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/schema_modification.rdoc +654 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/security.rdoc +370 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/sharding.rdoc +245 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/sql.rdoc +589 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/testing.rdoc +176 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/thread_safety.rdoc +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/transactions.rdoc +168 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/validations.rdoc +540 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/doc/virtual_rows.rdoc +272 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel.rb +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/ado.rb +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/ado/access.rb +335 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/ado/mssql.rb +69 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/amalgalite.rb +179 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/cubrid.rb +143 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/db2.rb +229 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/dbi.rb +101 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/do.rb +156 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/do/mysql.rb +64 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/do/postgres.rb +42 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/do/sqlite3.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/fdbsql.rb +285 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/firebird.rb +104 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/ibmdb.rb +476 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/informix.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc.rb +794 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/as400.rb +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/cubrid.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/db2.rb +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/derby.rb +312 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/fdbsql.rb +65 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/firebirdsql.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/h2.rb +227 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/hsqldb.rb +231 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/informix-sqli.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/jdbcprogress.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/jtds.rb +45 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/mssql.rb +47 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/mysql.rb +90 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/oracle.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/postgresql.rb +215 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/sqlanywhere.rb +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/sqlite.rb +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/sqlserver.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/jdbc/transactions.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/mock.rb +391 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/mysql.rb +372 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/mysql2.rb +200 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/odbc.rb +149 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/odbc/db2.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/odbc/mssql.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/odbc/progress.rb +8 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/openbase.rb +53 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/oracle.rb +459 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/postgres.rb +877 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/access.rb +299 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/cubrid.rb +243 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/db2.rb +403 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/fdbsql.rb +550 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/firebird.rb +245 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/informix.rb +52 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/mssql.rb +1037 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/mysql.rb +984 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb +182 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/oracle.rb +522 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/postgres.rb +1617 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/progress.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/sqlanywhere.rb +470 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/shared/sqlite.rb +729 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/sqlanywhere.rb +177 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/sqlite.rb +413 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/swift.rb +150 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/swift/mysql.rb +47 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/swift/postgres.rb +45 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/swift/sqlite.rb +35 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/tinytds.rb +282 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/utils/emulate_offset_with_reverse_and_count.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/utils/emulate_offset_with_row_number.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/utils/pg_types.rb +68 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/utils/replace.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/utils/split_alter_table.rb +44 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/utils/stored_procedures.rb +74 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/ast_transformer.rb +200 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/connection_pool.rb +110 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/connection_pool/sharded_single.rb +98 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/connection_pool/sharded_threaded.rb +265 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/connection_pool/single.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/connection_pool/threaded.rb +198 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/core.rb +394 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/connecting.rb +318 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/dataset.rb +69 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/dataset_defaults.rb +175 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/features.rb +134 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/logging.rb +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/misc.rb +534 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/query.rb +329 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/schema_generator.rb +525 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/schema_methods.rb +964 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/database/transactions.rb +353 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/actions.rb +1045 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/features.rb +203 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/graph.rb +272 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/misc.rb +279 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/mutation.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/placeholder_literalizer.rb +179 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/prepared_statements.rb +283 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/query.rb +1136 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/dataset/sql.rb +1555 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/deprecated.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/exceptions.rb +77 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/_pretty_table.rb +84 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/arbitrary_servers.rb +110 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/blank.rb +47 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/columns_introspection.rb +83 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/connection_validator.rb +110 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/constraint_validations.rb +455 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/core_extensions.rb +230 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/core_refinements.rb +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/current_datetime_timestamp.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/dataset_source_alias.rb +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/date_arithmetic.rb +192 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/empty_array_ignore_nulls.rb +34 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/error_sql.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/eval_inspect.rb +182 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/filter_having.rb +59 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/from_block.rb +32 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/graph_each.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/hash_aliases.rb +45 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/inflector.rb +246 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/looser_typecasting.rb +44 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/meta_def.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/migration.rb +736 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/mssql_emulate_lateral_with_apply.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/named_timezones.rb +99 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/null_dataset.rb +105 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pagination.rb +121 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_array.rb +606 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_array_ops.rb +324 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_enum.rb +136 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_hstore.rb +357 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_hstore_ops.rb +349 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_inet.rb +118 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_interval.rb +198 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_json.rb +365 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_json_ops.rb +434 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_loose_count.rb +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_range.rb +546 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_range_ops.rb +162 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_row.rb +615 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_row_ops.rb +194 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pg_static_cache_updater.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/pretty_table.rb +36 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/query.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/query_literals.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/round_timestamps.rb +52 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/ruby18_symbol_extensions.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/schema_caching.rb +75 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/schema_dumper.rb +476 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/select_remove.rb +48 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/sequel_3_dataset_methods.rb +118 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/server_block.rb +149 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/set_overrides.rb +72 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/split_array_nil.rb +66 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/sql_expr.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/string_date_time.rb +50 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/thread_local_timezones.rb +55 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/extensions/to_dot.rb +154 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model.rb +175 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/associations.rb +3171 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/base.rb +2306 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/dataset_module.rb +30 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/default_inflections.rb +45 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/errors.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/exceptions.rb +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/inflections.rb +162 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/model/plugins.rb +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/no_core_ext.rb +1 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/active_model.rb +99 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/after_initialize.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/association_autoreloading.rb +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/association_dependencies.rb +97 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/association_pks.rb +167 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/association_proxies.rb +105 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/auto_validations.rb +161 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/blacklist_security.rb +93 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/boolean_readers.rb +56 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/caching.rb +153 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/class_table_inheritance.rb +292 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/column_select.rb +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/composition.rb +187 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/constraint_validations.rb +229 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/dataset_associations.rb +107 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/defaults_setter.rb +69 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/dirty.rb +231 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/eager_each.rb +64 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/error_splitter.rb +54 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/force_encoding.rb +81 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/hook_class_methods.rb +125 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/input_transformer.rb +79 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/insert_returning_select.rb +70 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/instance_filters.rb +131 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/instance_hooks.rb +96 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/json_serializer.rb +352 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/lazy_attributes.rb +117 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/list.rb +189 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/many_through_many.rb +317 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/many_to_one_pk_lookup.rb +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/modification_detection.rb +90 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/mssql_optimistic_locking.rb +92 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/nested_attributes.rb +323 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/optimistic_locking.rb +83 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/pg_array_associations.rb +528 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/pg_row.rb +123 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/pg_typecast_on_load.rb +78 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/prepared_statements.rb +205 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/prepared_statements_associations.rb +116 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/prepared_statements_safe.rb +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/prepared_statements_with_pk.rb +59 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/rcte_tree.rb +343 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/schema.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/scissors.rb +33 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/serialization.rb +235 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/serialization_modification_detection.rb +84 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/sharding.rb +117 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/single_table_inheritance.rb +230 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/skip_create_refresh.rb +35 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/split_values.rb +64 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/static_cache.rb +215 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/string_stripper.rb +57 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/subclasses.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/table_select.rb +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/tactical_eager_loading.rb +85 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/timestamps.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/touch.rb +140 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/tree.rb +156 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/typecast_on_load.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/unlimited_update.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/update_or_create.rb +60 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/update_primary_key.rb +70 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/validation_class_methods.rb +439 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/validation_helpers.rb +291 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/plugins/xml_serializer.rb +410 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/sql.rb +1865 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/timezones.rb +221 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/version.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/db2_spec.rb +148 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/fdbsql_spec.rb +429 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/firebird_spec.rb +417 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/informix_spec.rb +100 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/mssql_spec.rb +722 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/mysql_spec.rb +1304 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/oracle_spec.rb +315 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/postgres_spec.rb +3537 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/spec_helper.rb +76 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/sqlanywhere_spec.rb +170 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/adapters/sqlite_spec.rb +650 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/bin_spec.rb +256 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/connection_pool_spec.rb +982 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/database_spec.rb +2487 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/dataset_spec.rb +4970 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/deprecated_spec.rb +70 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/expression_filters_spec.rb +1197 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/mock_adapter_spec.rb +462 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/object_graph_spec.rb +303 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/placeholder_literalizer_spec.rb +163 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/schema_generator_spec.rb +179 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/schema_spec.rb +1610 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/spec_helper.rb +49 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core/version_spec.rb +7 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/core_extensions_spec.rb +695 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/active_model_spec.rb +123 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/after_initialize_spec.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/arbitrary_servers_spec.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/association_dependencies_spec.rb +117 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/association_pks_spec.rb +281 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/association_proxies_spec.rb +86 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/auto_validations_spec.rb +158 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/blacklist_security_spec.rb +87 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/blank_spec.rb +69 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/boolean_readers_spec.rb +93 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/caching_spec.rb +270 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/class_table_inheritance_spec.rb +274 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/column_select_spec.rb +108 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/columns_introspection_spec.rb +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/composition_spec.rb +242 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/connection_validator_spec.rb +118 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/constraint_validations_plugin_spec.rb +274 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/constraint_validations_spec.rb +325 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/core_refinements_spec.rb +519 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/current_datetime_timestamp_spec.rb +27 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/dataset_associations_spec.rb +311 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/dataset_source_alias_spec.rb +51 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/date_arithmetic_spec.rb +157 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/defaults_setter_spec.rb +101 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/dirty_spec.rb +180 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/eager_each_spec.rb +42 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/empty_array_ignore_nulls_spec.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/error_splitter_spec.rb +18 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/error_sql_spec.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/eval_inspect_spec.rb +73 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/filter_having_spec.rb +40 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/force_encoding_spec.rb +114 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/from_block_spec.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/graph_each_spec.rb +109 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/hash_aliases_spec.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/hook_class_methods_spec.rb +416 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/inflector_spec.rb +183 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/input_transformer_spec.rb +54 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/insert_returning_select_spec.rb +46 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/instance_filters_spec.rb +79 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/instance_hooks_spec.rb +276 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/json_serializer_spec.rb +267 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/lazy_attributes_spec.rb +170 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/list_spec.rb +265 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/looser_typecasting_spec.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/many_through_many_spec.rb +2159 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/meta_def_spec.rb +21 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/migration_spec.rb +709 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/modification_detection_spec.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/mssql_optimistic_locking_spec.rb +91 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/named_timezones_spec.rb +108 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/nested_attributes_spec.rb +697 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/null_dataset_spec.rb +85 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/optimistic_locking_spec.rb +128 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pagination_spec.rb +118 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_array_associations_spec.rb +736 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_array_ops_spec.rb +143 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_array_spec.rb +390 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_enum_spec.rb +64 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_hstore_ops_spec.rb +236 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_hstore_spec.rb +206 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_inet_spec.rb +52 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_interval_spec.rb +76 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_json_ops_spec.rb +226 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_json_spec.rb +218 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_loose_count_spec.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_range_ops_spec.rb +58 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_range_spec.rb +404 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_row_ops_spec.rb +60 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_row_plugin_spec.rb +62 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_row_spec.rb +360 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_static_cache_updater_spec.rb +92 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pg_typecast_on_load_spec.rb +63 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/prepared_statements_associations_spec.rb +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/prepared_statements_safe_spec.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/prepared_statements_spec.rb +103 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/prepared_statements_with_pk_spec.rb +31 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/pretty_table_spec.rb +92 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/query_literals_spec.rb +167 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/query_spec.rb +102 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/rcte_tree_spec.rb +387 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/round_timestamps_spec.rb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/schema_caching_spec.rb +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/schema_dumper_spec.rb +788 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/schema_spec.rb +113 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/scissors_spec.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/select_remove_spec.rb +38 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/sequel_3_dataset_methods_spec.rb +101 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/serialization_modification_detection_spec.rb +98 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/serialization_spec.rb +340 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/server_block_spec.rb +90 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/set_overrides_spec.rb +61 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/sharding_spec.rb +198 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/shared_caching_spec.rb +175 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/single_table_inheritance_spec.rb +276 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/skip_create_refresh_spec.rb +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/spec_helper.rb +96 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/split_array_nil_spec.rb +24 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/split_values_spec.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/sql_expr_spec.rb +60 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/static_cache_spec.rb +355 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/string_date_time_spec.rb +95 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/string_stripper_spec.rb +68 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/subclasses_spec.rb +66 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/table_select_spec.rb +71 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/tactical_eager_loading_spec.rb +82 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/thread_local_timezones_spec.rb +67 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/timestamps_spec.rb +175 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/to_dot_spec.rb +154 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/touch_spec.rb +203 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/tree_spec.rb +270 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/typecast_on_load_spec.rb +80 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/unlimited_update_spec.rb +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/update_or_create_spec.rb +81 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/update_primary_key_spec.rb +100 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/validation_class_methods_spec.rb +1030 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/validation_helpers_spec.rb +520 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/xml_serializer_spec.rb +207 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_down_migration/001_create_alt_basic.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_down_migration/002_create_alt_advanced.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_timestamped_migrations/1273253849_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_timestamped_migrations/1273253851_create_nodes.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_timestamped_migrations/1273253853_3_create_users.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_up_migration/001_create_alt_basic.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/bad_up_migration/002_create_alt_advanced.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/convert_to_timestamp_migrations/001_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/convert_to_timestamp_migrations/002_create_nodes.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/convert_to_timestamp_migrations/003_3_create_users.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/convert_to_timestamp_migrations/1273253850_create_artists.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/convert_to_timestamp_migrations/1273253852_create_albums.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/duplicate_integer_migrations/001_create_alt_advanced.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/duplicate_integer_migrations/001_create_alt_basic.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/duplicate_timestamped_migrations/1273253849_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/duplicate_timestamped_migrations/1273253853_create_nodes.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/duplicate_timestamped_migrations/1273253853_create_users.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/integer_migrations/001_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/integer_migrations/002_create_nodes.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/integer_migrations/003_3_create_users.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/interleaved_timestamped_migrations/1273253849_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/interleaved_timestamped_migrations/1273253850_create_artists.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/interleaved_timestamped_migrations/1273253851_create_nodes.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/interleaved_timestamped_migrations/1273253852_create_albums.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/interleaved_timestamped_migrations/1273253853_3_create_users.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/missing_integer_migrations/001_create_alt_basic.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/missing_integer_migrations/003_create_alt_advanced.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/missing_timestamped_migrations/1273253849_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/missing_timestamped_migrations/1273253853_3_create_users.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/reversible_migrations/001_reversible.rb +5 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/reversible_migrations/002_reversible.rb +5 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/reversible_migrations/003_reversible.rb +5 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/reversible_migrations/004_reversible.rb +5 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/reversible_migrations/005_reversible.rb +10 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/timestamped_migrations/1273253849_create_sessions.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/timestamped_migrations/1273253851_create_nodes.rb +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/timestamped_migrations/1273253853_3_create_users.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/transaction_specified_migrations/001_create_alt_basic.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/transaction_specified_migrations/002_create_basic.rb +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/transaction_unspecified_migrations/001_create_alt_basic.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/transaction_unspecified_migrations/002_create_basic.rb +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/uppercase_timestamped_migrations/1273253849_CREATE_SESSIONS.RB +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/uppercase_timestamped_migrations/1273253851_CREATE_NODES.RB +9 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/files/uppercase_timestamped_migrations/1273253853_3_CREATE_USERS.RB +4 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/associations_test.rb +2453 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/database_test.rb +113 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/dataset_test.rb +1798 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/eager_loader_test.rb +687 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/migrator_test.rb +240 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/model_test.rb +226 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/plugin_test.rb +2162 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/prepared_statement_test.rb +426 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/schema_test.rb +801 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/spec_helper.rb +111 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/timezone_test.rb +86 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/transaction_test.rb +374 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/integration/type_test.rb +133 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/association_reflection_spec.rb +500 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/associations_spec.rb +4316 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/base_spec.rb +746 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/class_dataset_methods_spec.rb +145 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/dataset_methods_spec.rb +149 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/eager_loading_spec.rb +2080 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/hooks_spec.rb +536 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/inflector_spec.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/model_spec.rb +992 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/plugins_spec.rb +299 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/record_spec.rb +2053 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/spec_helper.rb +64 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/model/validations_spec.rb +191 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/rspec_helper.rb +22 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/sequel_coverage.rb +15 -0
- data/vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/spec_config.rb +2 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/CHANGES.md +303 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/Gemfile +3 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/LICENSE +20 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/README.md +182 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/Rakefile +29 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/lib/slop.rb +687 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/lib/slop/commands.rb +196 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/lib/slop/option.rb +209 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/slop.gemspec +17 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/test/commands_test.rb +26 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/test/helper.rb +12 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/test/option_test.rb +138 -0
- data/vendor/bundle/ruby/1.9.1/gems/slop-3.5.0/test/slop_test.rb +518 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/README +151 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/README.erb +43 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/lib/threadify.rb +176 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/rakefile +222 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/sample/a.rb +37 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/sample/b.rb +41 -0
- data/vendor/bundle/ruby/1.9.1/gems/threadify-1.3.0/threadify.gemspec +26 -0
- data/vendor/bundle/ruby/1.9.1/specifications/amalgalite-1.3.0.gemspec +52 -0
- data/vendor/bundle/ruby/1.9.1/specifications/arrayfields-4.7.4.gemspec +16 -0
- data/vendor/bundle/ruby/1.9.1/specifications/chronic-0.10.2.gemspec +42 -0
- data/vendor/bundle/ruby/1.9.1/specifications/coderay-1.1.0.gemspec +23 -0
- data/vendor/bundle/ruby/1.9.1/specifications/coerce-0.0.6.gemspec +30 -0
- data/vendor/bundle/ruby/1.9.1/specifications/daemons-1.1.9.gemspec +19 -0
- data/vendor/bundle/ruby/1.9.1/specifications/fastercsv-1.5.5.gemspec +20 -0
- data/vendor/bundle/ruby/1.9.1/specifications/fattr-2.2.2.gemspec +18 -0
- data/vendor/bundle/ruby/1.9.1/specifications/flowdock-0.5.0.gemspec +51 -0
- data/vendor/bundle/ruby/1.9.1/specifications/highline-1.6.21.gemspec +21 -0
- data/vendor/bundle/ruby/1.9.1/specifications/httparty-0.13.1.gemspec +35 -0
- data/vendor/bundle/ruby/1.9.1/specifications/json-1.8.1.gemspec +36 -0
- data/vendor/bundle/ruby/1.9.1/specifications/main-6.0.0.gemspec +39 -0
- data/vendor/bundle/ruby/1.9.1/specifications/main-6.1.0.gemspec +39 -0
- data/vendor/bundle/ruby/1.9.1/specifications/map-6.5.5.gemspec +18 -0
- data/vendor/bundle/ruby/1.9.1/specifications/method_source-0.8.2.gemspec +31 -0
- data/vendor/bundle/ruby/1.9.1/specifications/multi_json-1.10.1.gemspec +30 -0
- data/vendor/bundle/ruby/1.9.1/specifications/multi_xml-0.5.5.gemspec +30 -0
- data/vendor/bundle/ruby/1.9.1/specifications/pry-0.9.12.6.gemspec +51 -0
- data/vendor/bundle/ruby/1.9.1/specifications/sekrets-1.7.0.gemspec +43 -0
- data/vendor/bundle/ruby/1.9.1/specifications/sequel-4.15.0.gemspec +22 -0
- data/vendor/bundle/ruby/1.9.1/specifications/slop-3.5.0.gemspec +33 -0
- data/vendor/bundle/ruby/1.9.1/specifications/threadify-1.3.0.gemspec +16 -0
- metadata +1804 -0
|
@@ -0,0 +1,2306 @@
|
|
|
1
|
+
module Sequel
|
|
2
|
+
class Model
|
|
3
|
+
extend Enumerable
|
|
4
|
+
extend Inflections
|
|
5
|
+
|
|
6
|
+
# Class methods for Sequel::Model that implement basic model functionality.
|
|
7
|
+
#
|
|
8
|
+
# * All of the method names in Model::DATASET_METHODS have class methods created that call
|
|
9
|
+
# the Model's dataset with the method of the same name with the given arguments.
|
|
10
|
+
module ClassMethods
|
|
11
|
+
# Which columns should be the only columns allowed in a call to a mass assignment method (e.g. set)
|
|
12
|
+
# (default: not set, so all columns not otherwise restricted are allowed).
|
|
13
|
+
attr_reader :allowed_columns
|
|
14
|
+
|
|
15
|
+
# Array of modules that extend this model's dataset. Stored
|
|
16
|
+
# so that if the model's dataset is changed, it will be extended
|
|
17
|
+
# with all of these modules.
|
|
18
|
+
attr_reader :dataset_method_modules
|
|
19
|
+
|
|
20
|
+
# The default options to use for Model#set_fields. These are merged with
|
|
21
|
+
# the options given to set_fields.
|
|
22
|
+
attr_accessor :default_set_fields_options
|
|
23
|
+
|
|
24
|
+
# SQL string fragment used for faster DELETE statement creation when deleting/destroying
|
|
25
|
+
# model instances, or nil if the optimization should not be used. For internal use only.
|
|
26
|
+
attr_reader :fast_instance_delete_sql
|
|
27
|
+
|
|
28
|
+
# The dataset that instance datasets (#this) are based on. Generally a naked version of
|
|
29
|
+
# the model's dataset limited to one row. For internal use only.
|
|
30
|
+
attr_reader :instance_dataset
|
|
31
|
+
|
|
32
|
+
# Array of plugin modules loaded by this class
|
|
33
|
+
#
|
|
34
|
+
# Sequel::Model.plugins
|
|
35
|
+
# # => [Sequel::Model, Sequel::Model::Associations]
|
|
36
|
+
attr_reader :plugins
|
|
37
|
+
|
|
38
|
+
# The primary key for the class. Sequel can determine this automatically for
|
|
39
|
+
# many databases, but not all, so you may need to set it manually. If not
|
|
40
|
+
# determined automatically, the default is :id.
|
|
41
|
+
attr_reader :primary_key
|
|
42
|
+
|
|
43
|
+
# Whether to raise an error instead of returning nil on a failure
|
|
44
|
+
# to save/create/save_changes/update/destroy due to a validation failure or
|
|
45
|
+
# a before_* hook returning false (default: true).
|
|
46
|
+
attr_accessor :raise_on_save_failure
|
|
47
|
+
|
|
48
|
+
# Whether to raise an error when unable to typecast data for a column
|
|
49
|
+
# (default: true). This should be set to false if you want to use
|
|
50
|
+
# validations to display nice error messages to the user (e.g. most
|
|
51
|
+
# web applications). You can use the validates_schema_types validation
|
|
52
|
+
# (from the validation_helpers plugin) in connection with this setting to
|
|
53
|
+
# check for typecast failures during validation.
|
|
54
|
+
attr_accessor :raise_on_typecast_failure
|
|
55
|
+
|
|
56
|
+
# Whether to raise an error if an UPDATE or DELETE query related to
|
|
57
|
+
# a model instance does not modify exactly 1 row. If set to false,
|
|
58
|
+
# Sequel will not check the number of rows modified (default: true).
|
|
59
|
+
attr_accessor :require_modification
|
|
60
|
+
|
|
61
|
+
# Should be the literal primary key column name if this Model's table has a simple primary key, or
|
|
62
|
+
# nil if the model has a compound primary key or no primary key.
|
|
63
|
+
attr_reader :simple_pk
|
|
64
|
+
|
|
65
|
+
# Should be the literal table name if this Model's dataset is a simple table (no select, order, join, etc.),
|
|
66
|
+
# or nil otherwise. This and simple_pk are used for an optimization in Model.[].
|
|
67
|
+
attr_reader :simple_table
|
|
68
|
+
|
|
69
|
+
# Whether new/set/update and their variants should raise an error
|
|
70
|
+
# if an invalid key is used. A key is invalid if no setter method exists
|
|
71
|
+
# for that key or the access to the setter method is restricted (e.g. due to it
|
|
72
|
+
# being a primary key field). If set to false, silently skip
|
|
73
|
+
# any key where the setter method doesn't exist or access to it is restricted.
|
|
74
|
+
attr_accessor :strict_param_setting
|
|
75
|
+
|
|
76
|
+
# Whether to typecast the empty string ('') to nil for columns that
|
|
77
|
+
# are not string or blob. In most cases the empty string would be the
|
|
78
|
+
# way to specify a NULL SQL value in string form (nil.to_s == ''),
|
|
79
|
+
# and an empty string would not usually be typecast correctly for other
|
|
80
|
+
# types, so the default is true.
|
|
81
|
+
attr_accessor :typecast_empty_string_to_nil
|
|
82
|
+
|
|
83
|
+
# Whether to typecast attribute values on assignment (default: true).
|
|
84
|
+
# If set to false, no typecasting is done, so it will be left up to the
|
|
85
|
+
# database to typecast the value correctly.
|
|
86
|
+
attr_accessor :typecast_on_assignment
|
|
87
|
+
|
|
88
|
+
# Whether to enable the after_commit and after_rollback hooks when saving/destroying
|
|
89
|
+
# instances. On by default, can be turned off for performance reasons or when using
|
|
90
|
+
# prepared transactions (which aren't compatible with after commit/rollback).
|
|
91
|
+
attr_accessor :use_after_commit_rollback
|
|
92
|
+
|
|
93
|
+
# Whether to use a transaction by default when saving/deleting records (default: true).
|
|
94
|
+
# If you are sending database queries in before_* or after_* hooks, you shouldn't change
|
|
95
|
+
# the default setting without a good reason.
|
|
96
|
+
attr_accessor :use_transactions
|
|
97
|
+
|
|
98
|
+
# Returns the first record from the database matching the conditions.
|
|
99
|
+
# If a hash is given, it is used as the conditions. If another
|
|
100
|
+
# object is given, it finds the first record whose primary key(s) match
|
|
101
|
+
# the given argument(s). If no object is returned by the dataset, returns nil.
|
|
102
|
+
#
|
|
103
|
+
# Artist[1] # SELECT * FROM artists WHERE id = 1
|
|
104
|
+
# # => #<Artist {:id=>1, ...}>
|
|
105
|
+
#
|
|
106
|
+
# Artist[:name=>'Bob'] # SELECT * FROM artists WHERE (name = 'Bob') LIMIT 1
|
|
107
|
+
# # => #<Artist {:name=>'Bob', ...}>
|
|
108
|
+
def [](*args)
|
|
109
|
+
args = args.first if args.size <= 1
|
|
110
|
+
args.is_a?(Hash) ? first_where(args) : (primary_key_lookup(args) unless args.nil?)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Initializes a model instance as an existing record. This constructor is
|
|
114
|
+
# used by Sequel to initialize model instances when fetching records.
|
|
115
|
+
# Requires that values be a hash where all keys are symbols. It
|
|
116
|
+
# probably should not be used by external code.
|
|
117
|
+
def call(values)
|
|
118
|
+
o = allocate
|
|
119
|
+
o.instance_variable_set(:@values, values)
|
|
120
|
+
o
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Clear the setter_methods cache
|
|
124
|
+
def clear_setter_methods_cache
|
|
125
|
+
@setter_methods = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Returns the columns in the result set in their original order.
|
|
129
|
+
# Generally, this will use the columns determined via the database
|
|
130
|
+
# schema, but in certain cases (e.g. models that are based on a joined
|
|
131
|
+
# dataset) it will use <tt>Dataset#columns</tt> to find the columns.
|
|
132
|
+
#
|
|
133
|
+
# Artist.columns
|
|
134
|
+
# # => [:id, :name]
|
|
135
|
+
def columns
|
|
136
|
+
@columns || set_columns(dataset.naked.columns)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Creates instance using new with the given values and block, and saves it.
|
|
140
|
+
#
|
|
141
|
+
# Artist.create(:name=>'Bob')
|
|
142
|
+
# # INSERT INTO artists (name) VALUES ('Bob')
|
|
143
|
+
#
|
|
144
|
+
# Artist.create do |a|
|
|
145
|
+
# a.name = 'Jim'
|
|
146
|
+
# end # INSERT INTO artists (name) VALUES ('Jim')
|
|
147
|
+
def create(values = {}, &block)
|
|
148
|
+
new(values, &block).save
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Returns the dataset associated with the Model class. Raises
|
|
152
|
+
# an +Error+ if there is no associated dataset for this class.
|
|
153
|
+
# In most cases, you don't need to call this directly, as Model
|
|
154
|
+
# proxies many dataset methods to the underlying dataset.
|
|
155
|
+
#
|
|
156
|
+
# Artist.dataset.all # SELECT * FROM artists
|
|
157
|
+
def dataset
|
|
158
|
+
@dataset || raise(Error, "No dataset associated with #{self}")
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Alias of set_dataset
|
|
162
|
+
def dataset=(ds)
|
|
163
|
+
set_dataset(ds)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Extend the dataset with a module, similar to adding
|
|
167
|
+
# a plugin with the methods defined in DatasetMethods.
|
|
168
|
+
# This is the recommended way to add methods to model datasets.
|
|
169
|
+
#
|
|
170
|
+
# If an argument, it should be a module, and is used to extend
|
|
171
|
+
# the underlying dataset. Otherwise an anonymous module is created, and
|
|
172
|
+
# if a block is given, it is module_evaled, allowing you do define
|
|
173
|
+
# dataset methods directly using the standard ruby def syntax.
|
|
174
|
+
# Returns the module given or the anonymous module created.
|
|
175
|
+
#
|
|
176
|
+
# # Usage with existing module
|
|
177
|
+
# Artist.dataset_module Sequel::ColumnsIntrospection
|
|
178
|
+
#
|
|
179
|
+
# # Usage with anonymous module
|
|
180
|
+
# Artist.dataset_module do
|
|
181
|
+
# def foo
|
|
182
|
+
# :bar
|
|
183
|
+
# end
|
|
184
|
+
# end
|
|
185
|
+
# Artist.dataset.foo
|
|
186
|
+
# # => :bar
|
|
187
|
+
# Artist.foo
|
|
188
|
+
# # => :bar
|
|
189
|
+
#
|
|
190
|
+
# Any anonymous modules created are actually instances of Sequel::Model::DatasetModule
|
|
191
|
+
# (a Module subclass), which allows you to call the subset method on them:
|
|
192
|
+
#
|
|
193
|
+
# Artist.dataset_module do
|
|
194
|
+
# subset :released, Sequel.identifier(release_date) > Sequel::CURRENT_DATE
|
|
195
|
+
# end
|
|
196
|
+
#
|
|
197
|
+
# Any public methods in the dataset module will have class methods created that
|
|
198
|
+
# call the method on the dataset, assuming that the class method is not already
|
|
199
|
+
# defined.
|
|
200
|
+
def dataset_module(mod = nil)
|
|
201
|
+
if mod
|
|
202
|
+
raise Error, "can't provide both argument and block to Model.dataset_module" if block_given?
|
|
203
|
+
dataset_extend(mod)
|
|
204
|
+
mod
|
|
205
|
+
else
|
|
206
|
+
@dataset_module ||= DatasetModule.new(self)
|
|
207
|
+
@dataset_module.module_eval(&Proc.new) if block_given?
|
|
208
|
+
dataset_extend(@dataset_module)
|
|
209
|
+
@dataset_module
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Returns the database associated with the Model class.
|
|
214
|
+
# If this model doesn't have a database associated with it,
|
|
215
|
+
# assumes the superclass's database, or the first object in
|
|
216
|
+
# Sequel::DATABASES. If no Sequel::Database object has
|
|
217
|
+
# been created, raises an error.
|
|
218
|
+
#
|
|
219
|
+
# Artist.db.transaction do # BEGIN
|
|
220
|
+
# Artist.create(:name=>'Bob')
|
|
221
|
+
# # INSERT INTO artists (name) VALUES ('Bob')
|
|
222
|
+
# end # COMMIT
|
|
223
|
+
def db
|
|
224
|
+
return @db if @db
|
|
225
|
+
@db = self == Model ? Sequel.synchronize{DATABASES.first} : superclass.db
|
|
226
|
+
raise(Error, "No database associated with #{self}: have you called Sequel.connect or #{self}.db= ?") unless @db
|
|
227
|
+
@db
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Sets the database associated with the Model class. If the
|
|
231
|
+
# model has an associated dataset, sets the model's dataset
|
|
232
|
+
# to a dataset on the new database with the same options
|
|
233
|
+
# used by the current dataset. This can be used directly on
|
|
234
|
+
# Sequel::Model to set the default database to be used
|
|
235
|
+
# by subclasses, or to override the database used for specific
|
|
236
|
+
# models:
|
|
237
|
+
#
|
|
238
|
+
# Sequel::Model.db = DB1
|
|
239
|
+
# Artist.db = DB2
|
|
240
|
+
#
|
|
241
|
+
# Note that you should not use this to change the model's database
|
|
242
|
+
# at runtime. If you have that need, you should look into Sequel's
|
|
243
|
+
# sharding support.
|
|
244
|
+
def db=(db)
|
|
245
|
+
@db = db
|
|
246
|
+
set_dataset(db.dataset.clone(@dataset.opts)) if @dataset
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Returns the cached schema information if available or gets it
|
|
250
|
+
# from the database. This is a hash where keys are column symbols
|
|
251
|
+
# and values are hashes of information related to the column. See
|
|
252
|
+
# <tt>Database#schema</tt>.
|
|
253
|
+
#
|
|
254
|
+
# Artist.db_schema
|
|
255
|
+
# # {:id=>{:type=>:integer, :primary_key=>true, ...},
|
|
256
|
+
# # :name=>{:type=>:string, :primary_key=>false, ...}}
|
|
257
|
+
def db_schema
|
|
258
|
+
@db_schema ||= get_db_schema
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Create a column alias, where the column methods have one name, but the underlying storage uses a
|
|
262
|
+
# different name.
|
|
263
|
+
def def_column_alias(meth, column)
|
|
264
|
+
clear_setter_methods_cache
|
|
265
|
+
overridable_methods_module.module_eval do
|
|
266
|
+
define_method(meth){self[column]}
|
|
267
|
+
define_method("#{meth}="){|v| self[column] = v}
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# If a block is given, define a method on the dataset (if the model currently has an dataset) with the given argument name using
|
|
272
|
+
# the given block. Also define a class method on the model that calls the
|
|
273
|
+
# dataset method. Stores the method name and block so that it can be reapplied if the model's
|
|
274
|
+
# dataset changes.
|
|
275
|
+
#
|
|
276
|
+
# If a block is not given, just define a class method on the model for each argument
|
|
277
|
+
# that calls the dataset method of the same argument name.
|
|
278
|
+
#
|
|
279
|
+
# It is recommended that you define methods inside a block passed to #dataset_module
|
|
280
|
+
# instead of using this method, as #dataset_module allows you to use normal
|
|
281
|
+
# ruby def syntax.
|
|
282
|
+
#
|
|
283
|
+
# # Add new dataset method and class method that calls it
|
|
284
|
+
# Artist.def_dataset_method(:by_name){order(:name)}
|
|
285
|
+
# Artist.filter(:name.like('A%')).by_name
|
|
286
|
+
# Artist.by_name.filter(:name.like('A%'))
|
|
287
|
+
#
|
|
288
|
+
# # Just add a class method that calls an existing dataset method
|
|
289
|
+
# Artist.def_dataset_method(:server!)
|
|
290
|
+
# Artist.server!(:server1)
|
|
291
|
+
def def_dataset_method(*args, &block)
|
|
292
|
+
raise(Error, "No arguments given") if args.empty?
|
|
293
|
+
|
|
294
|
+
if block
|
|
295
|
+
raise(Error, "Defining a dataset method using a block requires only one argument") if args.length > 1
|
|
296
|
+
dataset_module{define_method(args.first, &block)}
|
|
297
|
+
else
|
|
298
|
+
args.each{|arg| def_model_dataset_method(arg)}
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# Finds a single record according to the supplied filter.
|
|
303
|
+
# You are encouraged to use Model.[] or Model.first instead of this method.
|
|
304
|
+
#
|
|
305
|
+
# Artist.find(:name=>'Bob')
|
|
306
|
+
# # SELECT * FROM artists WHERE (name = 'Bob') LIMIT 1
|
|
307
|
+
#
|
|
308
|
+
# Artist.find{name > 'M'}
|
|
309
|
+
# # SELECT * FROM artists WHERE (name > 'M') LIMIT 1
|
|
310
|
+
def find(*args, &block)
|
|
311
|
+
if args.length == 1 && !block
|
|
312
|
+
# Use optimized finder
|
|
313
|
+
first_where(args.first)
|
|
314
|
+
else
|
|
315
|
+
filter(*args, &block).first
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Like +find+ but invokes create with given conditions when record does not
|
|
320
|
+
# exist. Unlike +find+ in that the block used in this method is not passed
|
|
321
|
+
# to +find+, but instead is passed to +create+ only if +find+ does not
|
|
322
|
+
# return an object.
|
|
323
|
+
#
|
|
324
|
+
# Artist.find_or_create(:name=>'Bob')
|
|
325
|
+
# # SELECT * FROM artists WHERE (name = 'Bob') LIMIT 1
|
|
326
|
+
# # INSERT INTO artists (name) VALUES ('Bob')
|
|
327
|
+
#
|
|
328
|
+
# Artist.find_or_create(:name=>'Jim'){|a| a.hometown = 'Sactown'}
|
|
329
|
+
# # SELECT * FROM artists WHERE (name = 'Jim') LIMIT 1
|
|
330
|
+
# # INSERT INTO artists (name, hometown) VALUES ('Jim', 'Sactown')
|
|
331
|
+
def find_or_create(cond, &block)
|
|
332
|
+
find(cond) || create(cond, &block)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
FINDER_TYPES = [:first, :all, :each, :get].freeze
|
|
337
|
+
|
|
338
|
+
# Create an optimized finder method using a dataset placeholder literalizer.
|
|
339
|
+
# This pre-computes the SQL to use for the query, except for given arguments.
|
|
340
|
+
#
|
|
341
|
+
# There are two ways to use this. The recommended way is to pass a symbol
|
|
342
|
+
# that represents a model class method that returns a dataset:
|
|
343
|
+
#
|
|
344
|
+
# def Artist.by_name(name)
|
|
345
|
+
# where(:name=>name)
|
|
346
|
+
# end
|
|
347
|
+
#
|
|
348
|
+
# Artist.finder :by_name
|
|
349
|
+
#
|
|
350
|
+
# This creates an optimized first_by_name method, which you can call normally:
|
|
351
|
+
#
|
|
352
|
+
# Artist.first_by_name("Joe")
|
|
353
|
+
#
|
|
354
|
+
# The alternative way to use this to pass your own block:
|
|
355
|
+
#
|
|
356
|
+
# Artist.finder(:name=>:first_by_name){|pl, ds| ds.where(:name=>pl.arg).limit(1)}
|
|
357
|
+
#
|
|
358
|
+
# Note that if you pass your own block, you are responsible for manually setting
|
|
359
|
+
# limits if necessary (as shown above).
|
|
360
|
+
#
|
|
361
|
+
# Options:
|
|
362
|
+
# :arity :: When using a symbol method name, this specifies the arity of the method.
|
|
363
|
+
# This should be used if if the method accepts an arbitrary number of arguments,
|
|
364
|
+
# or the method has default argument values. Note that if the method is defined
|
|
365
|
+
# as a dataset method, the class method Sequel creates accepts an arbitrary number
|
|
366
|
+
# of arguments, so you should use this option in that case. If you want to handle
|
|
367
|
+
# multiple possible arities, you need to call the finder method multiple times with
|
|
368
|
+
# unique :arity and :name methods each time.
|
|
369
|
+
# :name :: The name of the method to create. This must be given if you pass a block.
|
|
370
|
+
# If you use a symbol, this defaults to the symbol prefixed by the type.
|
|
371
|
+
# :mod :: The module in which to create the finder method. Defaults to the singleton
|
|
372
|
+
# class of the model.
|
|
373
|
+
# :type :: The type of query to run. Can be :first, :each, :all, or :get, defaults to
|
|
374
|
+
# :first.
|
|
375
|
+
#
|
|
376
|
+
# Caveats:
|
|
377
|
+
#
|
|
378
|
+
# This doesn't handle all possible cases. For example, if you have a method such as:
|
|
379
|
+
#
|
|
380
|
+
# def Artist.by_name(name)
|
|
381
|
+
# name ? where(:name=>name) : exclude(:name=>nil)
|
|
382
|
+
# end
|
|
383
|
+
#
|
|
384
|
+
# Then calling a finder without an argument will not work as you expect.
|
|
385
|
+
#
|
|
386
|
+
# Artist.finder :by_name
|
|
387
|
+
# Artist.by_name(nil).first
|
|
388
|
+
# # WHERE (name IS NOT NULL)
|
|
389
|
+
# Artist.first_by_name(nil)
|
|
390
|
+
# # WHERE (name IS NULL)
|
|
391
|
+
#
|
|
392
|
+
# See Dataset::PlaceholderLiteralizer for additional caveats.
|
|
393
|
+
def finder(meth=OPTS, opts=OPTS, &block)
|
|
394
|
+
if block
|
|
395
|
+
raise Error, "cannot pass both a method name argument and a block of Model.finder" unless meth.is_a?(Hash)
|
|
396
|
+
raise Error, "cannot pass two option hashes to Model.finder" unless opts.equal?(OPTS)
|
|
397
|
+
opts = meth
|
|
398
|
+
raise Error, "must provide method name via :name option when passing block to Model.finder" unless meth_name = opts[:name]
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
type = opts.fetch(:type, :first)
|
|
402
|
+
unless prepare = opts[:prepare]
|
|
403
|
+
raise Error, ":type option to Model.finder must be :first, :all, :each, or :get" unless FINDER_TYPES.include?(type)
|
|
404
|
+
end
|
|
405
|
+
limit1 = type == :first || type == :get
|
|
406
|
+
meth_name ||= opts[:name] || :"#{type}_#{meth}"
|
|
407
|
+
|
|
408
|
+
argn = lambda do |model|
|
|
409
|
+
if arity = opts[:arity]
|
|
410
|
+
arity
|
|
411
|
+
else
|
|
412
|
+
method = block || model.method(meth)
|
|
413
|
+
(method.arity < 0 ? method.arity.abs - 1 : method.arity)
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
loader_proc = if prepare
|
|
418
|
+
proc do |model|
|
|
419
|
+
args = prepare_method_args('$a', argn.call(model))
|
|
420
|
+
ds = if block
|
|
421
|
+
model.instance_exec(*args, &block)
|
|
422
|
+
else
|
|
423
|
+
model.send(meth, *args)
|
|
424
|
+
end
|
|
425
|
+
ds = ds.limit(1) if limit1
|
|
426
|
+
model_name = model.name
|
|
427
|
+
if model_name.to_s.empty?
|
|
428
|
+
model_name = model.object_id
|
|
429
|
+
else
|
|
430
|
+
model_name = model_name.gsub(/\W/, '_')
|
|
431
|
+
end
|
|
432
|
+
ds.prepare(type, :"#{model_name}_#{meth_name}")
|
|
433
|
+
end
|
|
434
|
+
else
|
|
435
|
+
proc do |model|
|
|
436
|
+
n = argn.call(model)
|
|
437
|
+
block ||= lambda do |pl, model2|
|
|
438
|
+
args = (0...n).map{pl.arg}
|
|
439
|
+
ds = model2.send(meth, *args)
|
|
440
|
+
ds = ds.limit(1) if limit1
|
|
441
|
+
ds
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
Sequel::Dataset::PlaceholderLiteralizer.loader(model, &block)
|
|
445
|
+
end
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
Sequel.synchronize{@finder_loaders[meth_name] = loader_proc}
|
|
449
|
+
mod = opts[:mod] || (class << self; self; end)
|
|
450
|
+
if prepare
|
|
451
|
+
def_prepare_method(mod, meth_name)
|
|
452
|
+
else
|
|
453
|
+
def_finder_method(mod, meth_name, type)
|
|
454
|
+
end
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# An alias for calling first on the model's dataset, but with
|
|
458
|
+
# optimized handling of the single argument case.
|
|
459
|
+
def first(*args, &block)
|
|
460
|
+
if args.length == 1 && !block && !args.first.is_a?(Integer)
|
|
461
|
+
# Use optimized finder
|
|
462
|
+
first_where(args.first)
|
|
463
|
+
else
|
|
464
|
+
dataset.first(*args, &block)
|
|
465
|
+
end
|
|
466
|
+
end
|
|
467
|
+
|
|
468
|
+
# An alias for calling first! on the model's dataset, but with
|
|
469
|
+
# optimized handling of the single argument case.
|
|
470
|
+
def first!(*args, &block)
|
|
471
|
+
first(*args, &block) || raise(Sequel::NoMatchingRow)
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
# Clear the setter_methods cache when a module is included, as it
|
|
475
|
+
# may contain setter methods.
|
|
476
|
+
def include(*mods)
|
|
477
|
+
clear_setter_methods_cache
|
|
478
|
+
super
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
# If possible, set the dataset for the model subclass as soon as it
|
|
482
|
+
# is created. Also, make sure the inherited class instance variables
|
|
483
|
+
# are copied into the subclass.
|
|
484
|
+
#
|
|
485
|
+
# Sequel queries the database to get schema information as soon as
|
|
486
|
+
# a model class is created:
|
|
487
|
+
#
|
|
488
|
+
# class Artist < Sequel::Model # Causes schema query
|
|
489
|
+
# end
|
|
490
|
+
def inherited(subclass)
|
|
491
|
+
super
|
|
492
|
+
ivs = subclass.instance_variables.collect{|x| x.to_s}
|
|
493
|
+
inherited_instance_variables.each do |iv, dup|
|
|
494
|
+
next if ivs.include?(iv.to_s)
|
|
495
|
+
if (sup_class_value = instance_variable_get(iv)) && dup
|
|
496
|
+
sup_class_value = case dup
|
|
497
|
+
when :dup
|
|
498
|
+
sup_class_value.dup
|
|
499
|
+
when :hash_dup
|
|
500
|
+
h = {}
|
|
501
|
+
sup_class_value.each{|k,v| h[k] = v.dup}
|
|
502
|
+
h
|
|
503
|
+
when Proc
|
|
504
|
+
dup.call(sup_class_value)
|
|
505
|
+
else
|
|
506
|
+
raise Error, "bad inherited instance variable type: #{dup.inspect}"
|
|
507
|
+
end
|
|
508
|
+
end
|
|
509
|
+
subclass.instance_variable_set(iv, sup_class_value)
|
|
510
|
+
end
|
|
511
|
+
unless ivs.include?("@dataset")
|
|
512
|
+
if self == Model || !@dataset
|
|
513
|
+
n = subclass.name
|
|
514
|
+
unless n.nil? || n.empty?
|
|
515
|
+
db
|
|
516
|
+
subclass.set_dataset(subclass.implicit_table_name) rescue nil
|
|
517
|
+
end
|
|
518
|
+
elsif @dataset
|
|
519
|
+
subclass.set_dataset(@dataset.clone, :inherited=>true) rescue nil
|
|
520
|
+
end
|
|
521
|
+
end
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
# Returns the implicit table name for the model class, which is the demodulized,
|
|
525
|
+
# underscored, pluralized name of the class.
|
|
526
|
+
#
|
|
527
|
+
# Artist.implicit_table_name # => :artists
|
|
528
|
+
# Foo::ArtistAlias.implicit_table_name # => :artist_aliases
|
|
529
|
+
def implicit_table_name
|
|
530
|
+
pluralize(underscore(demodulize(name))).to_sym
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
# Calls #call with the values hash. Only for backwards compatibility.
|
|
534
|
+
def load(values)
|
|
535
|
+
call(values)
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
# Clear the setter_methods cache when a setter method is added
|
|
539
|
+
def method_added(meth)
|
|
540
|
+
clear_setter_methods_cache if meth.to_s =~ SETTER_METHOD_REGEXP
|
|
541
|
+
super
|
|
542
|
+
end
|
|
543
|
+
|
|
544
|
+
# Mark the model as not having a primary key. Not having a primary key
|
|
545
|
+
# can cause issues, among which is that you won't be able to update records.
|
|
546
|
+
#
|
|
547
|
+
# Artist.primary_key # => :id
|
|
548
|
+
# Artist.no_primary_key
|
|
549
|
+
# Artist.primary_key # => nil
|
|
550
|
+
def no_primary_key
|
|
551
|
+
clear_setter_methods_cache
|
|
552
|
+
self.simple_pk = @primary_key = nil
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
# Loads a plugin for use with the model class, passing optional arguments
|
|
556
|
+
# to the plugin. If the plugin is a module, load it directly. Otherwise,
|
|
557
|
+
# require the plugin from either sequel/plugins/#{plugin} or
|
|
558
|
+
# sequel_#{plugin}, and then attempt to load the module using a
|
|
559
|
+
# the camelized plugin name under Sequel::Plugins.
|
|
560
|
+
def plugin(plugin, *args, &block)
|
|
561
|
+
m = plugin.is_a?(Module) ? plugin : plugin_module(plugin)
|
|
562
|
+
unless @plugins.include?(m)
|
|
563
|
+
@plugins << m
|
|
564
|
+
m.apply(self, *args, &block) if m.respond_to?(:apply)
|
|
565
|
+
extend(m::ClassMethods) if plugin_module_defined?(m, :ClassMethods)
|
|
566
|
+
include(m::InstanceMethods) if plugin_module_defined?(m, :InstanceMethods)
|
|
567
|
+
if plugin_module_defined?(m, :DatasetMethods)
|
|
568
|
+
dataset_extend(m::DatasetMethods, :create_class_methods=>false)
|
|
569
|
+
end
|
|
570
|
+
end
|
|
571
|
+
m.configure(self, *args, &block) if m.respond_to?(:configure)
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
# Returns primary key attribute hash. If using a composite primary key
|
|
575
|
+
# value such be an array with values for each primary key in the correct
|
|
576
|
+
# order. For a standard primary key, value should be an object with a
|
|
577
|
+
# compatible type for the key. If the model does not have a primary key,
|
|
578
|
+
# raises an +Error+.
|
|
579
|
+
#
|
|
580
|
+
# Artist.primary_key_hash(1) # => {:id=>1}
|
|
581
|
+
# Artist.primary_key_hash([1, 2]) # => {:id1=>1, :id2=>2}
|
|
582
|
+
def primary_key_hash(value)
|
|
583
|
+
raise(Error, "#{self} does not have a primary key") unless key = @primary_key
|
|
584
|
+
case key
|
|
585
|
+
when Array
|
|
586
|
+
hash = {}
|
|
587
|
+
key.each_with_index{|k,i| hash[k] = value[i]}
|
|
588
|
+
hash
|
|
589
|
+
else
|
|
590
|
+
{key => value}
|
|
591
|
+
end
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
# Return a hash where the keys are qualified column references. Uses the given
|
|
595
|
+
# qualifier if provided, or the table_name otherwise. This is useful if you
|
|
596
|
+
# plan to join other tables to this table and you want the column references
|
|
597
|
+
# to be qualified.
|
|
598
|
+
#
|
|
599
|
+
# Artist.filter(Artist.qualified_primary_key_hash(1))
|
|
600
|
+
# # SELECT * FROM artists WHERE (artists.id = 1)
|
|
601
|
+
def qualified_primary_key_hash(value, qualifier=table_name)
|
|
602
|
+
h = primary_key_hash(value)
|
|
603
|
+
h.to_a.each{|k,v| h[SQL::QualifiedIdentifier.new(qualifier, k)] = h.delete(k)}
|
|
604
|
+
h
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
# Similar to finder, but uses a prepared statement instead of a placeholder
|
|
608
|
+
# literalizer. This makes the SQL used static (cannot vary per call), but
|
|
609
|
+
# allows binding argument values instead of literalizing them into the SQL
|
|
610
|
+
# query string.
|
|
611
|
+
#
|
|
612
|
+
# If a block is used with this method, it is instance_execed by the model,
|
|
613
|
+
# and should accept the desired number of placeholder arguments.
|
|
614
|
+
#
|
|
615
|
+
# The options are the same as the options for finder, with the following
|
|
616
|
+
# exception:
|
|
617
|
+
# :type :: Specifies the type of prepared statement to create
|
|
618
|
+
def prepared_finder(meth=OPTS, opts=OPTS, &block)
|
|
619
|
+
if block
|
|
620
|
+
raise Error, "cannot pass both a method name argument and a block of Model.finder" unless meth.is_a?(Hash)
|
|
621
|
+
meth = meth.merge(:prepare=>true)
|
|
622
|
+
else
|
|
623
|
+
opts = opts.merge(:prepare=>true)
|
|
624
|
+
end
|
|
625
|
+
finder(meth, opts, &block)
|
|
626
|
+
end
|
|
627
|
+
|
|
628
|
+
# Restrict the setting of the primary key(s) when using mass assignment (e.g. +set+). Because
|
|
629
|
+
# this is the default, this only make sense to use in a subclass where the
|
|
630
|
+
# parent class has used +unrestrict_primary_key+.
|
|
631
|
+
def restrict_primary_key
|
|
632
|
+
clear_setter_methods_cache
|
|
633
|
+
@restrict_primary_key = true
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
# Whether or not setting the primary key(s) when using mass assignment (e.g. +set+) is
|
|
637
|
+
# restricted, true by default.
|
|
638
|
+
def restrict_primary_key?
|
|
639
|
+
@restrict_primary_key
|
|
640
|
+
end
|
|
641
|
+
|
|
642
|
+
# Set the columns to allow when using mass assignment (e.g. +set+). Using this means that
|
|
643
|
+
# any columns not listed here will not be modified. If you have any virtual
|
|
644
|
+
# setter methods (methods that end in =) that you want to be used during
|
|
645
|
+
# mass assignment, they need to be listed here as well (without the =).
|
|
646
|
+
#
|
|
647
|
+
# It may be better to use a method such as +set_only+ or +set_fields+ that lets you specify
|
|
648
|
+
# the allowed fields per call.
|
|
649
|
+
#
|
|
650
|
+
# Artist.set_allowed_columns(:name, :hometown)
|
|
651
|
+
# Artist.set(:name=>'Bob', :hometown=>'Sactown') # No Error
|
|
652
|
+
# Artist.set(:name=>'Bob', :records_sold=>30000) # Error
|
|
653
|
+
def set_allowed_columns(*cols)
|
|
654
|
+
clear_setter_methods_cache
|
|
655
|
+
@allowed_columns = cols
|
|
656
|
+
end
|
|
657
|
+
|
|
658
|
+
# Sets the dataset associated with the Model class. +ds+ can be a +Symbol+,
|
|
659
|
+
# +LiteralString+, <tt>SQL::Identifier</tt>, <tt>SQL::QualifiedIdentifier</tt>,
|
|
660
|
+
# <tt>SQL::AliasedExpression</tt>
|
|
661
|
+
# (all specifying a table name in the current database), or a +Dataset+.
|
|
662
|
+
# If a dataset is used, the model's database is changed to the database of the given
|
|
663
|
+
# dataset. If a dataset is not used, a dataset is created from the current
|
|
664
|
+
# database with the table name given. Other arguments raise an +Error+.
|
|
665
|
+
# Returns self.
|
|
666
|
+
#
|
|
667
|
+
# This changes the row_proc of the dataset to return
|
|
668
|
+
# model objects and extends the dataset with the dataset_method_modules.
|
|
669
|
+
# It also attempts to determine the database schema for the model,
|
|
670
|
+
# based on the given dataset.
|
|
671
|
+
#
|
|
672
|
+
# Artist.set_dataset(:tbl_artists)
|
|
673
|
+
# Artist.set_dataset(DB[:artists])
|
|
674
|
+
#
|
|
675
|
+
# Note that you should not use this to change the model's dataset
|
|
676
|
+
# at runtime. If you have that need, you should look into Sequel's
|
|
677
|
+
# sharding support.
|
|
678
|
+
def set_dataset(ds, opts=OPTS)
|
|
679
|
+
inherited = opts[:inherited]
|
|
680
|
+
@dataset = convert_input_dataset(ds)
|
|
681
|
+
@require_modification = Sequel::Model.require_modification.nil? ? @dataset.provides_accurate_rows_matched? : Sequel::Model.require_modification
|
|
682
|
+
if inherited
|
|
683
|
+
self.simple_table = superclass.simple_table
|
|
684
|
+
@columns = @dataset.columns rescue nil
|
|
685
|
+
else
|
|
686
|
+
@dataset_method_modules.each{|m| @dataset.extend(m)} if @dataset_method_modules
|
|
687
|
+
end
|
|
688
|
+
@dataset.model = self if @dataset.respond_to?(:model=)
|
|
689
|
+
check_non_connection_error{@db_schema = (inherited ? superclass.db_schema : get_db_schema)}
|
|
690
|
+
reset_instance_dataset
|
|
691
|
+
self
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
# Sets the primary key for this model. You can use either a regular
|
|
695
|
+
# or a composite primary key. To not use a primary key, set to nil
|
|
696
|
+
# or use +no_primary_key+. On most adapters, Sequel can automatically
|
|
697
|
+
# determine the primary key to use, so this method is not needed often.
|
|
698
|
+
#
|
|
699
|
+
# class Person < Sequel::Model
|
|
700
|
+
# # regular key
|
|
701
|
+
# set_primary_key :person_id
|
|
702
|
+
# end
|
|
703
|
+
#
|
|
704
|
+
# class Tagging < Sequel::Model
|
|
705
|
+
# # composite key
|
|
706
|
+
# set_primary_key [:taggable_id, :tag_id]
|
|
707
|
+
# end
|
|
708
|
+
def set_primary_key(key)
|
|
709
|
+
clear_setter_methods_cache
|
|
710
|
+
if key.is_a?(Array)
|
|
711
|
+
if key.length < 2
|
|
712
|
+
key = key.first
|
|
713
|
+
else
|
|
714
|
+
key = key.dup.freeze
|
|
715
|
+
end
|
|
716
|
+
end
|
|
717
|
+
self.simple_pk = if key && !key.is_a?(Array)
|
|
718
|
+
(@dataset || db).literal(key)
|
|
719
|
+
end
|
|
720
|
+
@primary_key = key
|
|
721
|
+
end
|
|
722
|
+
|
|
723
|
+
# Cache of setter methods to allow by default, in order to speed up new/set/update instance methods.
|
|
724
|
+
def setter_methods
|
|
725
|
+
@setter_methods ||= get_setter_methods
|
|
726
|
+
end
|
|
727
|
+
|
|
728
|
+
# Sets up a dataset method that returns a filtered dataset.
|
|
729
|
+
# Sometimes thought of as a scope, and like most dataset methods,
|
|
730
|
+
# they can be chained.
|
|
731
|
+
# For example:
|
|
732
|
+
#
|
|
733
|
+
# Topic.subset(:joes, :username.like('%joe%'))
|
|
734
|
+
# Topic.subset(:popular){num_posts > 100}
|
|
735
|
+
# Topic.subset(:recent){created_on > Date.today - 7}
|
|
736
|
+
#
|
|
737
|
+
# Allows you to do:
|
|
738
|
+
#
|
|
739
|
+
# Topic.joes.recent.popular
|
|
740
|
+
#
|
|
741
|
+
# to get topics with a username that includes joe that
|
|
742
|
+
# have more than 100 posts and were created less than
|
|
743
|
+
# 7 days ago.
|
|
744
|
+
#
|
|
745
|
+
# Both the args given and the block are passed to <tt>Dataset#filter</tt>.
|
|
746
|
+
#
|
|
747
|
+
# This method creates dataset methods that do not accept arguments. To create
|
|
748
|
+
# dataset methods that accept arguments, you should use define a
|
|
749
|
+
# method directly inside a #dataset_module block.
|
|
750
|
+
def subset(name, *args, &block)
|
|
751
|
+
dataset_module.subset(name, *args, &block)
|
|
752
|
+
end
|
|
753
|
+
|
|
754
|
+
# Returns name of primary table for the dataset. If the table for the dataset
|
|
755
|
+
# is aliased, returns the aliased name.
|
|
756
|
+
#
|
|
757
|
+
# Artist.table_name # => :artists
|
|
758
|
+
# Sequel::Model(:foo).table_name # => :foo
|
|
759
|
+
# Sequel::Model(:foo___bar).table_name # => :bar
|
|
760
|
+
def table_name
|
|
761
|
+
dataset.first_source_alias
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
# Allow the setting of the primary key(s) when using the mass assignment methods.
|
|
765
|
+
# Using this method can open up security issues, be very careful before using it.
|
|
766
|
+
#
|
|
767
|
+
# Artist.set(:id=>1) # Error
|
|
768
|
+
# Artist.unrestrict_primary_key
|
|
769
|
+
# Artist.set(:id=>1) # No Error
|
|
770
|
+
def unrestrict_primary_key
|
|
771
|
+
clear_setter_methods_cache
|
|
772
|
+
@restrict_primary_key = false
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
# Return the model instance with the primary key, or nil if there is no matching record.
|
|
776
|
+
def with_pk(pk)
|
|
777
|
+
primary_key_lookup(pk)
|
|
778
|
+
end
|
|
779
|
+
|
|
780
|
+
# Return the model instance with the primary key, or raise NoMatchingRow if there is no matching record.
|
|
781
|
+
def with_pk!(pk)
|
|
782
|
+
with_pk(pk) || raise(NoMatchingRow)
|
|
783
|
+
end
|
|
784
|
+
|
|
785
|
+
# Add model methods that call dataset methods
|
|
786
|
+
Plugins.def_dataset_methods(self, DATASET_METHODS)
|
|
787
|
+
|
|
788
|
+
private
|
|
789
|
+
|
|
790
|
+
# Yield to the passed block and swallow all errors other than DatabaseConnectionErrors.
|
|
791
|
+
def check_non_connection_error
|
|
792
|
+
begin
|
|
793
|
+
yield
|
|
794
|
+
rescue Sequel::DatabaseConnectionError
|
|
795
|
+
raise
|
|
796
|
+
rescue
|
|
797
|
+
nil
|
|
798
|
+
end
|
|
799
|
+
end
|
|
800
|
+
|
|
801
|
+
# Convert the given object to a Dataset that should be used as
|
|
802
|
+
# this model's dataset.
|
|
803
|
+
def convert_input_dataset(ds)
|
|
804
|
+
case ds
|
|
805
|
+
when Symbol, SQL::Identifier, SQL::QualifiedIdentifier, SQL::AliasedExpression, LiteralString
|
|
806
|
+
self.simple_table = db.literal(ds)
|
|
807
|
+
ds = db.from(ds)
|
|
808
|
+
when Dataset
|
|
809
|
+
self.simple_table = if ds.send(:simple_select_all?)
|
|
810
|
+
ds.literal(ds.first_source_table)
|
|
811
|
+
end
|
|
812
|
+
@db = ds.db
|
|
813
|
+
else
|
|
814
|
+
raise(Error, "Model.set_dataset takes one of the following classes as an argument: Symbol, LiteralString, SQL::Identifier, SQL::QualifiedIdentifier, SQL::AliasedExpression, Dataset")
|
|
815
|
+
end
|
|
816
|
+
set_dataset_row_proc(ds)
|
|
817
|
+
ds
|
|
818
|
+
end
|
|
819
|
+
|
|
820
|
+
# Add the module to the class's dataset_method_modules. Extend the dataset with the
|
|
821
|
+
# module if the model has a dataset. Add dataset methods to the class for all
|
|
822
|
+
# public dataset methods.
|
|
823
|
+
def dataset_extend(mod, opts=OPTS)
|
|
824
|
+
@dataset.extend(mod) if @dataset
|
|
825
|
+
reset_instance_dataset
|
|
826
|
+
dataset_method_modules << mod
|
|
827
|
+
unless opts[:create_class_methods] == false
|
|
828
|
+
mod.public_instance_methods.each{|meth| def_model_dataset_method(meth)}
|
|
829
|
+
end
|
|
830
|
+
end
|
|
831
|
+
|
|
832
|
+
# Create a column accessor for a column with a method name that is hard to use in ruby code.
|
|
833
|
+
def def_bad_column_accessor(column)
|
|
834
|
+
overridable_methods_module.module_eval do
|
|
835
|
+
define_method(column){self[column]}
|
|
836
|
+
define_method("#{column}="){|v| self[column] = v}
|
|
837
|
+
end
|
|
838
|
+
end
|
|
839
|
+
|
|
840
|
+
# Create the column accessors. For columns that can be used as method names directly in ruby code,
|
|
841
|
+
# use a string to define the method for speed. For other columns names, use a block.
|
|
842
|
+
def def_column_accessor(*columns)
|
|
843
|
+
clear_setter_methods_cache
|
|
844
|
+
columns, bad_columns = columns.partition{|x| NORMAL_METHOD_NAME_REGEXP.match(x.to_s)}
|
|
845
|
+
bad_columns.each{|x| def_bad_column_accessor(x)}
|
|
846
|
+
im = instance_methods.collect{|x| x.to_s}
|
|
847
|
+
columns.each do |column|
|
|
848
|
+
meth = "#{column}="
|
|
849
|
+
overridable_methods_module.module_eval("def #{column}; self[:#{column}] end", __FILE__, __LINE__) unless im.include?(column.to_s)
|
|
850
|
+
overridable_methods_module.module_eval("def #{meth}(v); self[:#{column}] = v end", __FILE__, __LINE__) unless im.include?(meth)
|
|
851
|
+
end
|
|
852
|
+
end
|
|
853
|
+
|
|
854
|
+
# Define a model method that calls the dataset method with the same name,
|
|
855
|
+
# only used for methods with names that can't be presented directly in
|
|
856
|
+
# ruby code.
|
|
857
|
+
def def_model_dataset_method(meth)
|
|
858
|
+
return if respond_to?(meth, true)
|
|
859
|
+
|
|
860
|
+
if meth.to_s =~ NORMAL_METHOD_NAME_REGEXP
|
|
861
|
+
instance_eval("def #{meth}(*args, &block); dataset.#{meth}(*args, &block) end", __FILE__, __LINE__)
|
|
862
|
+
else
|
|
863
|
+
(class << self; self; end).send(:define_method, meth){|*args, &block| dataset.send(meth, *args, &block)}
|
|
864
|
+
end
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
# Define a finder method in the given module with the given method name that
|
|
868
|
+
# load rows using the finder with the given name.
|
|
869
|
+
def def_finder_method(mod, meth, type)
|
|
870
|
+
mod.send(:define_method, meth){|*args, &block| finder_for(meth).send(type, *args, &block)}
|
|
871
|
+
end
|
|
872
|
+
|
|
873
|
+
# Define a prepared_finder method in the given module that will call the associated prepared
|
|
874
|
+
# statement.
|
|
875
|
+
def def_prepare_method(mod, meth)
|
|
876
|
+
mod.send(:define_method, meth){|*args, &block| finder_for(meth).call(prepare_method_arg_hash(args), &block)}
|
|
877
|
+
end
|
|
878
|
+
|
|
879
|
+
# Find the finder to use for the give method. If a finder has not been loaded
|
|
880
|
+
# for the method, load the finder and set correctly in the finders hash, then
|
|
881
|
+
# return the finder.
|
|
882
|
+
def finder_for(meth)
|
|
883
|
+
unless finder = Sequel.synchronize{@finders[meth]}
|
|
884
|
+
finder_loader = @finder_loaders.fetch(meth)
|
|
885
|
+
finder = finder_loader.call(self)
|
|
886
|
+
Sequel.synchronize{@finders[meth] = finder}
|
|
887
|
+
end
|
|
888
|
+
finder
|
|
889
|
+
end
|
|
890
|
+
|
|
891
|
+
# Get the schema from the database, fall back on checking the columns
|
|
892
|
+
# via the database if that will return inaccurate results or if
|
|
893
|
+
# it raises an error.
|
|
894
|
+
def get_db_schema(reload = false)
|
|
895
|
+
set_columns(nil)
|
|
896
|
+
return nil unless @dataset
|
|
897
|
+
schema_hash = {}
|
|
898
|
+
ds_opts = dataset.opts
|
|
899
|
+
get_columns = proc{check_non_connection_error{columns} || []}
|
|
900
|
+
schema_array = check_non_connection_error{db.schema(dataset, :reload=>reload)} if db.supports_schema_parsing?
|
|
901
|
+
if schema_array
|
|
902
|
+
schema_array.each{|k,v| schema_hash[k] = v}
|
|
903
|
+
|
|
904
|
+
# Set the primary key(s) based on the schema information,
|
|
905
|
+
# if the schema information includes primary key information
|
|
906
|
+
if schema_array.all?{|k,v| v.has_key?(:primary_key)}
|
|
907
|
+
pks = schema_array.collect{|k,v| k if v[:primary_key]}.compact
|
|
908
|
+
pks.length > 0 ? set_primary_key(pks) : no_primary_key
|
|
909
|
+
end
|
|
910
|
+
|
|
911
|
+
if (select = ds_opts[:select]) && !(select.length == 1 && select.first.is_a?(SQL::ColumnAll))
|
|
912
|
+
# We don't remove the columns from the schema_hash,
|
|
913
|
+
# as it's possible they will be used for typecasting
|
|
914
|
+
# even if they are not selected.
|
|
915
|
+
cols = get_columns.call
|
|
916
|
+
cols.each{|c| schema_hash[c] ||= {}}
|
|
917
|
+
def_column_accessor(*schema_hash.keys)
|
|
918
|
+
else
|
|
919
|
+
# Dataset is for a single table with all columns,
|
|
920
|
+
# so set the columns based on the order they were
|
|
921
|
+
# returned by the schema.
|
|
922
|
+
cols = schema_array.collect{|k,v| k}
|
|
923
|
+
set_columns(cols)
|
|
924
|
+
# Also set the columns for the dataset, so the dataset
|
|
925
|
+
# doesn't have to do a query to get them.
|
|
926
|
+
dataset.instance_variable_set(:@columns, cols)
|
|
927
|
+
end
|
|
928
|
+
else
|
|
929
|
+
# If the dataset uses multiple tables or custom sql or getting
|
|
930
|
+
# the schema raised an error, just get the columns and
|
|
931
|
+
# create an empty schema hash for it.
|
|
932
|
+
get_columns.call.each{|c| schema_hash[c] = {}}
|
|
933
|
+
end
|
|
934
|
+
schema_hash
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
# Uncached version of setter_methods, to be overridden by plugins
|
|
938
|
+
# that want to modify the methods used.
|
|
939
|
+
def get_setter_methods
|
|
940
|
+
if allowed_columns
|
|
941
|
+
allowed_columns.map{|x| "#{x}="}
|
|
942
|
+
else
|
|
943
|
+
meths = instance_methods.collect{|x| x.to_s}.grep(SETTER_METHOD_REGEXP) - RESTRICTED_SETTER_METHODS
|
|
944
|
+
meths -= Array(primary_key).map{|x| "#{x}="} if primary_key && restrict_primary_key?
|
|
945
|
+
meths
|
|
946
|
+
end
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
# A hash of instance variables to automatically set up in subclasses.
|
|
950
|
+
# See Sequel::Model::INHERITED_INSTANCE_VARIABLES. It is safe to modify
|
|
951
|
+
# the hash returned by this method, though it may not be safe to modify
|
|
952
|
+
# values of the hash.
|
|
953
|
+
def inherited_instance_variables
|
|
954
|
+
INHERITED_INSTANCE_VARIABLES.dup
|
|
955
|
+
end
|
|
956
|
+
|
|
957
|
+
# For the given opts hash and default name or :class option, add a
|
|
958
|
+
# :class_name option unless already present which contains the name
|
|
959
|
+
# of the class to use as a string. The purpose is to allow late
|
|
960
|
+
# binding to the class later using constantize.
|
|
961
|
+
def late_binding_class_option(opts, default)
|
|
962
|
+
case opts[:class]
|
|
963
|
+
when String, Symbol
|
|
964
|
+
# Delete :class to allow late binding
|
|
965
|
+
opts[:class_name] ||= opts.delete(:class).to_s
|
|
966
|
+
when Class
|
|
967
|
+
opts[:class_name] ||= opts[:class].name
|
|
968
|
+
end
|
|
969
|
+
opts[:class_name] ||= ((name || '').split("::")[0..-2] + [camelize(default)]).join('::')
|
|
970
|
+
end
|
|
971
|
+
|
|
972
|
+
# Module that the class includes that holds methods the class adds for column accessors and
|
|
973
|
+
# associations so that the methods can be overridden with +super+.
|
|
974
|
+
def overridable_methods_module
|
|
975
|
+
include(@overridable_methods_module = Module.new) unless @overridable_methods_module
|
|
976
|
+
@overridable_methods_module
|
|
977
|
+
end
|
|
978
|
+
|
|
979
|
+
# Returns the module for the specified plugin. If the module is not
|
|
980
|
+
# defined, the corresponding plugin required.
|
|
981
|
+
def plugin_module(plugin)
|
|
982
|
+
module_name = plugin.to_s.gsub(/(^|_)(.)/){|x| x[-1..-1].upcase}
|
|
983
|
+
if !Sequel::Plugins.const_defined?(module_name) ||
|
|
984
|
+
(Sequel.const_defined?(module_name) &&
|
|
985
|
+
Sequel::Plugins.const_get(module_name) == Sequel.const_get(module_name))
|
|
986
|
+
begin
|
|
987
|
+
require "sequel/plugins/#{plugin}"
|
|
988
|
+
rescue LoadError => e
|
|
989
|
+
begin
|
|
990
|
+
require "sequel_#{plugin}"
|
|
991
|
+
rescue LoadError => e2
|
|
992
|
+
e.message << "; #{e2.message}"
|
|
993
|
+
raise e
|
|
994
|
+
end
|
|
995
|
+
end
|
|
996
|
+
end
|
|
997
|
+
Sequel::Plugins.const_get(module_name)
|
|
998
|
+
end
|
|
999
|
+
|
|
1000
|
+
# Check if the plugin module +plugin+ defines the constant named by +submod+.
|
|
1001
|
+
def plugin_module_defined?(plugin, submod)
|
|
1002
|
+
if RUBY_VERSION >= '1.9'
|
|
1003
|
+
plugin.const_defined?(submod, false)
|
|
1004
|
+
else
|
|
1005
|
+
# :nocov:
|
|
1006
|
+
plugin.const_defined?(submod)
|
|
1007
|
+
# :nocov:
|
|
1008
|
+
end
|
|
1009
|
+
end
|
|
1010
|
+
|
|
1011
|
+
# An hash of prepared argument values for the given arguments, with keys
|
|
1012
|
+
# starting at a. Used by the methods created by prepared_finder.
|
|
1013
|
+
def prepare_method_arg_hash(args)
|
|
1014
|
+
h = {}
|
|
1015
|
+
prepare_method_args('a', args.length).zip(args).each{|k, v| h[k] = v}
|
|
1016
|
+
h
|
|
1017
|
+
end
|
|
1018
|
+
|
|
1019
|
+
# An array of prepared statement argument names, of length n and starting with base.
|
|
1020
|
+
def prepare_method_args(base, n)
|
|
1021
|
+
(0...n).map do
|
|
1022
|
+
s = base.to_sym
|
|
1023
|
+
base = base.next
|
|
1024
|
+
s
|
|
1025
|
+
end
|
|
1026
|
+
end
|
|
1027
|
+
|
|
1028
|
+
# Find the row in the dataset that matches the primary key. Uses
|
|
1029
|
+
# a static SQL optimization if the table and primary key are simple.
|
|
1030
|
+
#
|
|
1031
|
+
# This method should not be called with a nil primary key, in case
|
|
1032
|
+
# it is overridden by plugins which assume that the passed argument
|
|
1033
|
+
# is valid.
|
|
1034
|
+
def primary_key_lookup(pk)
|
|
1035
|
+
if sql = @fast_pk_lookup_sql
|
|
1036
|
+
sql = sql.dup
|
|
1037
|
+
ds = dataset
|
|
1038
|
+
ds.literal_append(sql, pk)
|
|
1039
|
+
ds.fetch_rows(sql){|r| return ds.row_proc.call(r)}
|
|
1040
|
+
nil
|
|
1041
|
+
elsif dataset.joined_dataset?
|
|
1042
|
+
first_where(qualified_primary_key_hash(pk))
|
|
1043
|
+
else
|
|
1044
|
+
first_where(primary_key_hash(pk))
|
|
1045
|
+
end
|
|
1046
|
+
end
|
|
1047
|
+
|
|
1048
|
+
# Reset the cached fast primary lookup SQL if a simple table and primary key
|
|
1049
|
+
# are used, or set it to nil if not used.
|
|
1050
|
+
def reset_fast_pk_lookup_sql
|
|
1051
|
+
@fast_pk_lookup_sql = if @simple_table && @simple_pk
|
|
1052
|
+
"SELECT * FROM #@simple_table WHERE #@simple_pk = ".freeze
|
|
1053
|
+
end
|
|
1054
|
+
@fast_instance_delete_sql = if @simple_table && @simple_pk
|
|
1055
|
+
"DELETE FROM #@simple_table WHERE #@simple_pk = ".freeze
|
|
1056
|
+
end
|
|
1057
|
+
end
|
|
1058
|
+
|
|
1059
|
+
# Reset the instance dataset to a modified copy of the current dataset,
|
|
1060
|
+
# should be used whenever the model's dataset is modified.
|
|
1061
|
+
def reset_instance_dataset
|
|
1062
|
+
@finders.clear if @finders
|
|
1063
|
+
@instance_dataset = @dataset.limit(1).naked if @dataset
|
|
1064
|
+
end
|
|
1065
|
+
|
|
1066
|
+
# Set the columns for this model and create accessor methods for each column.
|
|
1067
|
+
def set_columns(new_columns)
|
|
1068
|
+
@columns = new_columns
|
|
1069
|
+
def_column_accessor(*new_columns) if new_columns
|
|
1070
|
+
@columns
|
|
1071
|
+
end
|
|
1072
|
+
|
|
1073
|
+
# Set the dataset's row_proc to the current model.
|
|
1074
|
+
def set_dataset_row_proc(ds)
|
|
1075
|
+
ds.row_proc = self
|
|
1076
|
+
end
|
|
1077
|
+
|
|
1078
|
+
# Reset the fast primary key lookup SQL when the simple_pk value changes.
|
|
1079
|
+
def simple_pk=(pk)
|
|
1080
|
+
@simple_pk = pk
|
|
1081
|
+
reset_fast_pk_lookup_sql
|
|
1082
|
+
end
|
|
1083
|
+
|
|
1084
|
+
# Reset the fast primary key lookup SQL when the simple_table value changes.
|
|
1085
|
+
def simple_table=(t)
|
|
1086
|
+
@simple_table = t
|
|
1087
|
+
reset_fast_pk_lookup_sql
|
|
1088
|
+
end
|
|
1089
|
+
|
|
1090
|
+
# Returns a copy of the model's dataset with custom SQL
|
|
1091
|
+
#
|
|
1092
|
+
# Artist.fetch("SELECT * FROM artists WHERE name LIKE 'A%'")
|
|
1093
|
+
# Artist.fetch("SELECT * FROM artists WHERE id = ?", 1)
|
|
1094
|
+
alias fetch with_sql
|
|
1095
|
+
end
|
|
1096
|
+
|
|
1097
|
+
# Sequel::Model instance methods that implement basic model functionality.
|
|
1098
|
+
#
|
|
1099
|
+
# * All of the methods in +HOOKS+ and +AROUND_HOOKS+ create instance methods that are called
|
|
1100
|
+
# by Sequel when the appropriate action occurs. For example, when destroying
|
|
1101
|
+
# a model object, Sequel will call +around_destroy+, which will call +before_destroy+, do
|
|
1102
|
+
# the destroy, and then call +after_destroy+.
|
|
1103
|
+
# * The following instance_methods all call the class method of the same
|
|
1104
|
+
# name: columns, db, primary_key, db_schema.
|
|
1105
|
+
# * All of the methods in +BOOLEAN_SETTINGS+ create attr_writers allowing you
|
|
1106
|
+
# to set values for the attribute. It also creates instance getters returning
|
|
1107
|
+
# the value of the setting. If the value has not yet been set, it
|
|
1108
|
+
# gets the default value from the class by calling the class method of the same name.
|
|
1109
|
+
module InstanceMethods
|
|
1110
|
+
HOOKS.each{|h| class_eval("def #{h}; end", __FILE__, __LINE__)}
|
|
1111
|
+
AROUND_HOOKS.each{|h| class_eval("def #{h}; yield end", __FILE__, __LINE__)}
|
|
1112
|
+
|
|
1113
|
+
# Define instance method(s) that calls class method(s) of the
|
|
1114
|
+
# same name. Replaces the construct:
|
|
1115
|
+
#
|
|
1116
|
+
# define_method(meth){self.class.send(meth)}
|
|
1117
|
+
[:columns, :db, :primary_key, :db_schema].each{|meth| class_eval("def #{meth}; self.class.#{meth} end", __FILE__, __LINE__)}
|
|
1118
|
+
|
|
1119
|
+
# Define instance method(s) that calls class method(s) of the
|
|
1120
|
+
# same name, caching the result in an instance variable. Define
|
|
1121
|
+
# standard attr_writer method for modifying that instance variable.
|
|
1122
|
+
BOOLEAN_SETTINGS.each{|meth| class_eval("def #{meth}; !defined?(@#{meth}) ? (frozen? ? self.class.#{meth} : (@#{meth} = self.class.#{meth})) : @#{meth} end", __FILE__, __LINE__)}
|
|
1123
|
+
attr_writer(*BOOLEAN_SETTINGS)
|
|
1124
|
+
|
|
1125
|
+
# The hash of attribute values. Keys are symbols with the names of the
|
|
1126
|
+
# underlying database columns.
|
|
1127
|
+
#
|
|
1128
|
+
# Artist.new(:name=>'Bob').values # => {:name=>'Bob'}
|
|
1129
|
+
# Artist[1].values # => {:id=>1, :name=>'Jim', ...}
|
|
1130
|
+
attr_reader :values
|
|
1131
|
+
alias to_hash values
|
|
1132
|
+
|
|
1133
|
+
# Creates new instance and passes the given values to set.
|
|
1134
|
+
# If a block is given, yield the instance to the block unless
|
|
1135
|
+
# from_db is true.
|
|
1136
|
+
#
|
|
1137
|
+
# Arguments:
|
|
1138
|
+
# values :: should be a hash to pass to set.
|
|
1139
|
+
# from_db :: only for backwards compatibility, forget it exists.
|
|
1140
|
+
#
|
|
1141
|
+
# Artist.new(:name=>'Bob')
|
|
1142
|
+
#
|
|
1143
|
+
# Artist.new do |a|
|
|
1144
|
+
# a.name = 'Bob'
|
|
1145
|
+
# end
|
|
1146
|
+
def initialize(values = {})
|
|
1147
|
+
@values = {}
|
|
1148
|
+
@new = true
|
|
1149
|
+
@modified = true
|
|
1150
|
+
initialize_set(values)
|
|
1151
|
+
changed_columns.clear
|
|
1152
|
+
yield self if block_given?
|
|
1153
|
+
end
|
|
1154
|
+
|
|
1155
|
+
# Returns value of the column's attribute.
|
|
1156
|
+
#
|
|
1157
|
+
# Artist[1][:id] #=> 1
|
|
1158
|
+
def [](column)
|
|
1159
|
+
@values[column]
|
|
1160
|
+
end
|
|
1161
|
+
|
|
1162
|
+
# Sets the value for the given column. If typecasting is enabled for
|
|
1163
|
+
# this object, typecast the value based on the column's type.
|
|
1164
|
+
# If this is a new record or the typecasted value isn't the same
|
|
1165
|
+
# as the current value for the column, mark the column as changed.
|
|
1166
|
+
#
|
|
1167
|
+
# a = Artist.new
|
|
1168
|
+
# a[:name] = 'Bob'
|
|
1169
|
+
# a.values #=> {:name=>'Bob'}
|
|
1170
|
+
def []=(column, value)
|
|
1171
|
+
# If it is new, it doesn't have a value yet, so we should
|
|
1172
|
+
# definitely set the new value.
|
|
1173
|
+
# If the column isn't in @values, we can't assume it is
|
|
1174
|
+
# NULL in the database, so assume it has changed.
|
|
1175
|
+
v = typecast_value(column, value)
|
|
1176
|
+
vals = @values
|
|
1177
|
+
if new? || !vals.include?(column) || v != (c = vals[column]) || v.class != c.class
|
|
1178
|
+
change_column_value(column, v)
|
|
1179
|
+
end
|
|
1180
|
+
end
|
|
1181
|
+
|
|
1182
|
+
# Alias of eql?
|
|
1183
|
+
def ==(obj)
|
|
1184
|
+
eql?(obj)
|
|
1185
|
+
end
|
|
1186
|
+
|
|
1187
|
+
# If pk is not nil, true only if the objects have the same class and pk.
|
|
1188
|
+
# If pk is nil, false.
|
|
1189
|
+
#
|
|
1190
|
+
# Artist[1] === Artist[1] # true
|
|
1191
|
+
# Artist.new === Artist.new # false
|
|
1192
|
+
# Artist[1].set(:name=>'Bob') == Artist[1] # => true
|
|
1193
|
+
def ===(obj)
|
|
1194
|
+
pk.nil? ? false : (obj.class == model) && (obj.pk == pk)
|
|
1195
|
+
end
|
|
1196
|
+
|
|
1197
|
+
# class is defined in Object, but it is also a keyword,
|
|
1198
|
+
# and since a lot of instance methods call class methods,
|
|
1199
|
+
# this alias makes it so you can use model instead of
|
|
1200
|
+
# self.class.
|
|
1201
|
+
#
|
|
1202
|
+
# Artist.new.model # => Artist
|
|
1203
|
+
alias_method :model, :class
|
|
1204
|
+
|
|
1205
|
+
# The autoincrementing primary key for this model object. Should be
|
|
1206
|
+
# overridden if you have a composite primary key with one part of it
|
|
1207
|
+
# being autoincrementing.
|
|
1208
|
+
def autoincrementing_primary_key
|
|
1209
|
+
primary_key
|
|
1210
|
+
end
|
|
1211
|
+
|
|
1212
|
+
# The columns that have been updated. This isn't completely accurate,
|
|
1213
|
+
# as it could contain columns whose values have not changed.
|
|
1214
|
+
#
|
|
1215
|
+
# a = Artist[1]
|
|
1216
|
+
# a.changed_columns # => []
|
|
1217
|
+
# a.name = 'Bob'
|
|
1218
|
+
# a.changed_columns # => [:name]
|
|
1219
|
+
def changed_columns
|
|
1220
|
+
@changed_columns ||= []
|
|
1221
|
+
end
|
|
1222
|
+
|
|
1223
|
+
# Deletes and returns +self+. Does not run destroy hooks.
|
|
1224
|
+
# Look into using +destroy+ instead.
|
|
1225
|
+
#
|
|
1226
|
+
# Artist[1].delete # DELETE FROM artists WHERE (id = 1)
|
|
1227
|
+
# # => #<Artist {:id=>1, ...}>
|
|
1228
|
+
def delete
|
|
1229
|
+
raise Sequel::Error, "can't delete frozen object" if frozen?
|
|
1230
|
+
_delete
|
|
1231
|
+
self
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
# Like delete but runs hooks before and after delete.
|
|
1235
|
+
# If before_destroy returns false, returns false without
|
|
1236
|
+
# deleting the object from the database. Otherwise, deletes
|
|
1237
|
+
# the item from the database and returns self. Uses a transaction
|
|
1238
|
+
# if use_transactions is true or if the :transaction option is given and
|
|
1239
|
+
# true.
|
|
1240
|
+
#
|
|
1241
|
+
# Artist[1].destroy # BEGIN; DELETE FROM artists WHERE (id = 1); COMMIT;
|
|
1242
|
+
# # => #<Artist {:id=>1, ...}>
|
|
1243
|
+
def destroy(opts = OPTS)
|
|
1244
|
+
raise Sequel::Error, "can't destroy frozen object" if frozen?
|
|
1245
|
+
checked_save_failure(opts){checked_transaction(opts){_destroy(opts)}}
|
|
1246
|
+
end
|
|
1247
|
+
|
|
1248
|
+
# Iterates through all of the current values using each.
|
|
1249
|
+
#
|
|
1250
|
+
# Album[1].each{|k, v| puts "#{k} => #{v}"}
|
|
1251
|
+
# # id => 1
|
|
1252
|
+
# # name => 'Bob'
|
|
1253
|
+
def each(&block)
|
|
1254
|
+
@values.each(&block)
|
|
1255
|
+
end
|
|
1256
|
+
|
|
1257
|
+
# Compares model instances by values.
|
|
1258
|
+
#
|
|
1259
|
+
# Artist[1] == Artist[1] # => true
|
|
1260
|
+
# Artist.new == Artist.new # => true
|
|
1261
|
+
# Artist[1].set(:name=>'Bob') == Artist[1] # => false
|
|
1262
|
+
def eql?(obj)
|
|
1263
|
+
(obj.class == model) && (obj.values == @values)
|
|
1264
|
+
end
|
|
1265
|
+
|
|
1266
|
+
# Returns the validation errors associated with this object.
|
|
1267
|
+
# See +Errors+.
|
|
1268
|
+
def errors
|
|
1269
|
+
@errors ||= errors_class.new
|
|
1270
|
+
end
|
|
1271
|
+
|
|
1272
|
+
# Returns true when current instance exists, false otherwise.
|
|
1273
|
+
# Generally an object that isn't new will exist unless it has
|
|
1274
|
+
# been deleted. Uses a database query to check for existence,
|
|
1275
|
+
# unless the model object is new, in which case this is always
|
|
1276
|
+
# false.
|
|
1277
|
+
#
|
|
1278
|
+
# Artist[1].exists? # SELECT 1 FROM artists WHERE (id = 1)
|
|
1279
|
+
# # => true
|
|
1280
|
+
# Artist.new.exists?
|
|
1281
|
+
# # => false
|
|
1282
|
+
def exists?
|
|
1283
|
+
new? ? false : !this.get(SQL::AliasedExpression.new(1, :one)).nil?
|
|
1284
|
+
end
|
|
1285
|
+
|
|
1286
|
+
# Ignore the model's setter method cache when this instances extends a module, as the
|
|
1287
|
+
# module may contain setter methods.
|
|
1288
|
+
def extend(mod)
|
|
1289
|
+
@singleton_setter_added = true
|
|
1290
|
+
super
|
|
1291
|
+
end
|
|
1292
|
+
|
|
1293
|
+
# Freeze the object in such a way that it is still usable but not modifiable.
|
|
1294
|
+
# Once an object is frozen, you cannot modify it's values, changed_columns,
|
|
1295
|
+
# errors, or dataset.
|
|
1296
|
+
def freeze
|
|
1297
|
+
values.freeze
|
|
1298
|
+
changed_columns.freeze
|
|
1299
|
+
errors
|
|
1300
|
+
validate
|
|
1301
|
+
errors.freeze
|
|
1302
|
+
this.freeze if !new? && model.primary_key
|
|
1303
|
+
super
|
|
1304
|
+
end
|
|
1305
|
+
|
|
1306
|
+
# Value that should be unique for objects with the same class and pk (if pk is not nil), or
|
|
1307
|
+
# the same class and values (if pk is nil).
|
|
1308
|
+
#
|
|
1309
|
+
# Artist[1].hash == Artist[1].hash # true
|
|
1310
|
+
# Artist[1].set(:name=>'Bob').hash == Artist[1].hash # true
|
|
1311
|
+
# Artist.new.hash == Artist.new.hash # true
|
|
1312
|
+
# Artist.new(:name=>'Bob').hash == Artist.new.hash # false
|
|
1313
|
+
def hash
|
|
1314
|
+
case primary_key
|
|
1315
|
+
when Array
|
|
1316
|
+
[model, !pk.all? ? @values : pk].hash
|
|
1317
|
+
when Symbol
|
|
1318
|
+
[model, pk.nil? ? @values : pk].hash
|
|
1319
|
+
else
|
|
1320
|
+
[model, @values].hash
|
|
1321
|
+
end
|
|
1322
|
+
end
|
|
1323
|
+
|
|
1324
|
+
# Returns value for the :id attribute, even if the primary key is
|
|
1325
|
+
# not id. To get the primary key value, use +pk+.
|
|
1326
|
+
#
|
|
1327
|
+
# Artist[1].id # => 1
|
|
1328
|
+
def id
|
|
1329
|
+
@values[:id]
|
|
1330
|
+
end
|
|
1331
|
+
|
|
1332
|
+
# Returns a string representation of the model instance including
|
|
1333
|
+
# the class name and values.
|
|
1334
|
+
def inspect
|
|
1335
|
+
"#<#{model.name} @values=#{inspect_values}>"
|
|
1336
|
+
end
|
|
1337
|
+
|
|
1338
|
+
# Returns the keys in +values+. May not include all column names.
|
|
1339
|
+
#
|
|
1340
|
+
# Artist.new.keys # => []
|
|
1341
|
+
# Artist.new(:name=>'Bob').keys # => [:name]
|
|
1342
|
+
# Artist[1].keys # => [:id, :name]
|
|
1343
|
+
def keys
|
|
1344
|
+
@values.keys
|
|
1345
|
+
end
|
|
1346
|
+
|
|
1347
|
+
# Refresh this record using +for_update+ unless this is a new record. Returns self.
|
|
1348
|
+
# This can be used to make sure no other process is updating the record at the
|
|
1349
|
+
# same time.
|
|
1350
|
+
#
|
|
1351
|
+
# a = Artist[1]
|
|
1352
|
+
# Artist.db.transaction do
|
|
1353
|
+
# a.lock!
|
|
1354
|
+
# a.update(:name=>'A')
|
|
1355
|
+
# end
|
|
1356
|
+
def lock!
|
|
1357
|
+
_refresh(this.for_update) unless new?
|
|
1358
|
+
self
|
|
1359
|
+
end
|
|
1360
|
+
|
|
1361
|
+
# Remove elements of the model object that make marshalling fail. Returns self.
|
|
1362
|
+
#
|
|
1363
|
+
# a = Artist[1]
|
|
1364
|
+
# a.marshallable!
|
|
1365
|
+
# Marshal.dump(a)
|
|
1366
|
+
def marshallable!
|
|
1367
|
+
@this = nil
|
|
1368
|
+
self
|
|
1369
|
+
end
|
|
1370
|
+
|
|
1371
|
+
# Explicitly mark the object as modified, so +save_changes+/+update+ will
|
|
1372
|
+
# run callbacks even if no columns have changed.
|
|
1373
|
+
#
|
|
1374
|
+
# a = Artist[1]
|
|
1375
|
+
# a.save_changes # No callbacks run, as no changes
|
|
1376
|
+
# a.modified!
|
|
1377
|
+
# a.save_changes # Callbacks run, even though no changes made
|
|
1378
|
+
#
|
|
1379
|
+
# If a column is given, specifically marked that column as modified,
|
|
1380
|
+
# so that +save_changes+/+update+ will include that column in the
|
|
1381
|
+
# update. This should be used if you plan on mutating the column
|
|
1382
|
+
# value instead of assigning a new column value:
|
|
1383
|
+
#
|
|
1384
|
+
# a.modified!(:name)
|
|
1385
|
+
# a.name.gsub!(/[aeou]/, 'i')
|
|
1386
|
+
def modified!(column=nil)
|
|
1387
|
+
if column && !changed_columns.include?(column)
|
|
1388
|
+
changed_columns << column
|
|
1389
|
+
end
|
|
1390
|
+
@modified = true
|
|
1391
|
+
end
|
|
1392
|
+
|
|
1393
|
+
# Whether this object has been modified since last saved, used by
|
|
1394
|
+
# save_changes to determine whether changes should be saved. New
|
|
1395
|
+
# values are always considered modified.
|
|
1396
|
+
#
|
|
1397
|
+
# a = Artist[1]
|
|
1398
|
+
# a.modified? # => false
|
|
1399
|
+
# a.set(:name=>'Jim')
|
|
1400
|
+
# a.modified? # => true
|
|
1401
|
+
#
|
|
1402
|
+
# If a column is given, specifically check if the given column has
|
|
1403
|
+
# been modified:
|
|
1404
|
+
#
|
|
1405
|
+
# a.modified?(:num_albums) # => false
|
|
1406
|
+
# a.num_albums = 10
|
|
1407
|
+
# a.modified?(:num_albums) # => true
|
|
1408
|
+
def modified?(column=nil)
|
|
1409
|
+
if column
|
|
1410
|
+
changed_columns.include?(column)
|
|
1411
|
+
else
|
|
1412
|
+
@modified || !changed_columns.empty?
|
|
1413
|
+
end
|
|
1414
|
+
end
|
|
1415
|
+
|
|
1416
|
+
# Returns true if the current instance represents a new record.
|
|
1417
|
+
#
|
|
1418
|
+
# Artist.new.new? # => true
|
|
1419
|
+
# Artist[1].new? # => false
|
|
1420
|
+
def new?
|
|
1421
|
+
defined?(@new) ? @new : (@new = false)
|
|
1422
|
+
end
|
|
1423
|
+
|
|
1424
|
+
# Returns the primary key value identifying the model instance.
|
|
1425
|
+
# Raises an +Error+ if this model does not have a primary key.
|
|
1426
|
+
# If the model has a composite primary key, returns an array of values.
|
|
1427
|
+
#
|
|
1428
|
+
# Artist[1].pk # => 1
|
|
1429
|
+
# Artist[[1, 2]].pk # => [1, 2]
|
|
1430
|
+
def pk
|
|
1431
|
+
raise(Error, "No primary key is associated with this model") unless key = primary_key
|
|
1432
|
+
if key.is_a?(Array)
|
|
1433
|
+
vals = @values
|
|
1434
|
+
key.map{|k| vals[k]}
|
|
1435
|
+
else
|
|
1436
|
+
@values[key]
|
|
1437
|
+
end
|
|
1438
|
+
end
|
|
1439
|
+
|
|
1440
|
+
# Returns a hash mapping the receivers primary key column(s) to their values.
|
|
1441
|
+
#
|
|
1442
|
+
# Artist[1].pk_hash # => {:id=>1}
|
|
1443
|
+
# Artist[[1, 2]].pk_hash # => {:id1=>1, :id2=>2}
|
|
1444
|
+
def pk_hash
|
|
1445
|
+
model.primary_key_hash(pk)
|
|
1446
|
+
end
|
|
1447
|
+
|
|
1448
|
+
# Reloads attributes from database and returns self. Also clears all
|
|
1449
|
+
# changed_columns information. Raises an +Error+ if the record no longer
|
|
1450
|
+
# exists in the database.
|
|
1451
|
+
#
|
|
1452
|
+
# a = Artist[1]
|
|
1453
|
+
# a.name = 'Jim'
|
|
1454
|
+
# a.refresh
|
|
1455
|
+
# a.name # => 'Bob'
|
|
1456
|
+
def refresh
|
|
1457
|
+
raise Sequel::Error, "can't refresh frozen object" if frozen?
|
|
1458
|
+
_refresh(this)
|
|
1459
|
+
self
|
|
1460
|
+
end
|
|
1461
|
+
|
|
1462
|
+
# Alias of refresh, but not aliased directly to make overriding in a plugin easier.
|
|
1463
|
+
def reload
|
|
1464
|
+
refresh
|
|
1465
|
+
end
|
|
1466
|
+
|
|
1467
|
+
# Creates or updates the record, after making sure the record
|
|
1468
|
+
# is valid and before hooks execute successfully. Fails if:
|
|
1469
|
+
#
|
|
1470
|
+
# * the record is not valid, or
|
|
1471
|
+
# * before_save returns false, or
|
|
1472
|
+
# * the record is new and before_create returns false, or
|
|
1473
|
+
# * the record is not new and before_update returns false.
|
|
1474
|
+
#
|
|
1475
|
+
# If +save+ fails and either raise_on_save_failure or the
|
|
1476
|
+
# :raise_on_failure option is true, it raises ValidationFailed
|
|
1477
|
+
# or HookFailed. Otherwise it returns nil.
|
|
1478
|
+
#
|
|
1479
|
+
# If it succeeds, it returns self.
|
|
1480
|
+
#
|
|
1481
|
+
# You can provide an optional list of columns to update, in which
|
|
1482
|
+
# case it only updates those columns, or a options hash.
|
|
1483
|
+
#
|
|
1484
|
+
# Takes the following options:
|
|
1485
|
+
#
|
|
1486
|
+
# :changed :: save all changed columns, instead of all columns or the columns given
|
|
1487
|
+
# :columns :: array of specific columns that should be saved.
|
|
1488
|
+
# :raise_on_failure :: set to true or false to override the current
|
|
1489
|
+
# +raise_on_save_failure+ setting
|
|
1490
|
+
# :server :: set the server/shard on the object before saving, and use that
|
|
1491
|
+
# server/shard in any transaction.
|
|
1492
|
+
# :transaction :: set to true or false to override the current
|
|
1493
|
+
# +use_transactions+ setting
|
|
1494
|
+
# :validate :: set to false to skip validation
|
|
1495
|
+
def save(opts=OPTS)
|
|
1496
|
+
raise Sequel::Error, "can't save frozen object" if frozen?
|
|
1497
|
+
set_server(opts[:server]) if opts[:server]
|
|
1498
|
+
_before_validation
|
|
1499
|
+
if opts[:validate] != false
|
|
1500
|
+
unless checked_save_failure(opts){_valid?(true, opts)}
|
|
1501
|
+
raise(ValidationFailed.new(self)) if raise_on_failure?(opts)
|
|
1502
|
+
return
|
|
1503
|
+
end
|
|
1504
|
+
end
|
|
1505
|
+
checked_save_failure(opts){checked_transaction(opts){_save(opts)}}
|
|
1506
|
+
end
|
|
1507
|
+
|
|
1508
|
+
# Saves only changed columns if the object has been modified.
|
|
1509
|
+
# If the object has not been modified, returns nil. If unable to
|
|
1510
|
+
# save, returns false unless +raise_on_save_failure+ is true.
|
|
1511
|
+
#
|
|
1512
|
+
# a = Artist[1]
|
|
1513
|
+
# a.save_changes # => nil
|
|
1514
|
+
# a.name = 'Jim'
|
|
1515
|
+
# a.save_changes # UPDATE artists SET name = 'Bob' WHERE (id = 1)
|
|
1516
|
+
# # => #<Artist {:id=>1, :name=>'Jim', ...}
|
|
1517
|
+
def save_changes(opts=OPTS)
|
|
1518
|
+
save(opts.merge(:changed=>true)) || false if modified?
|
|
1519
|
+
end
|
|
1520
|
+
|
|
1521
|
+
# Updates the instance with the supplied values with support for virtual
|
|
1522
|
+
# attributes, raising an exception if a value is used that doesn't have
|
|
1523
|
+
# a setter method (or ignoring it if <tt>strict_param_setting = false</tt>).
|
|
1524
|
+
# Does not save the record.
|
|
1525
|
+
#
|
|
1526
|
+
# artist.set(:name=>'Jim')
|
|
1527
|
+
# artist.name # => 'Jim'
|
|
1528
|
+
def set(hash)
|
|
1529
|
+
set_restricted(hash, :default)
|
|
1530
|
+
end
|
|
1531
|
+
|
|
1532
|
+
# Set all values using the entries in the hash, ignoring any setting of
|
|
1533
|
+
# allowed_columns in the model.
|
|
1534
|
+
#
|
|
1535
|
+
# Artist.set_allowed_columns(:num_albums)
|
|
1536
|
+
# artist.set_all(:name=>'Jim')
|
|
1537
|
+
# artist.name # => 'Jim'
|
|
1538
|
+
def set_all(hash)
|
|
1539
|
+
set_restricted(hash, :all)
|
|
1540
|
+
end
|
|
1541
|
+
|
|
1542
|
+
# For each of the fields in the given array +fields+, call the setter
|
|
1543
|
+
# method with the value of that +hash+ entry for the field. Returns self.
|
|
1544
|
+
#
|
|
1545
|
+
# You can provide an options hash, with the following options currently respected:
|
|
1546
|
+
# :missing :: Can be set to :skip to skip missing entries or :raise to raise an
|
|
1547
|
+
# Error for missing entries. The default behavior is not to check for
|
|
1548
|
+
# missing entries, in which case the default value is used. To be
|
|
1549
|
+
# friendly with most web frameworks, the missing check will also check
|
|
1550
|
+
# for the string version of the argument in the hash if given a symbol.
|
|
1551
|
+
#
|
|
1552
|
+
# Examples:
|
|
1553
|
+
#
|
|
1554
|
+
# artist.set_fields({:name=>'Jim'}, [:name])
|
|
1555
|
+
# artist.name # => 'Jim'
|
|
1556
|
+
#
|
|
1557
|
+
# artist.set_fields({:hometown=>'LA'}, [:name])
|
|
1558
|
+
# artist.name # => nil
|
|
1559
|
+
# artist.hometown # => 'Sac'
|
|
1560
|
+
#
|
|
1561
|
+
# artist.name # => 'Jim'
|
|
1562
|
+
# artist.set_fields({}, [:name], :missing=>:skip)
|
|
1563
|
+
# artist.name # => 'Jim'
|
|
1564
|
+
#
|
|
1565
|
+
# artist.name # => 'Jim'
|
|
1566
|
+
# artist.set_fields({}, [:name], :missing=>:raise)
|
|
1567
|
+
# # Sequel::Error raised
|
|
1568
|
+
def set_fields(hash, fields, opts=nil)
|
|
1569
|
+
opts = if opts
|
|
1570
|
+
model.default_set_fields_options.merge(opts)
|
|
1571
|
+
else
|
|
1572
|
+
model.default_set_fields_options
|
|
1573
|
+
end
|
|
1574
|
+
|
|
1575
|
+
case opts[:missing]
|
|
1576
|
+
when :skip
|
|
1577
|
+
fields.each do |f|
|
|
1578
|
+
if hash.has_key?(f)
|
|
1579
|
+
send("#{f}=", hash[f])
|
|
1580
|
+
elsif f.is_a?(Symbol) && hash.has_key?(sf = f.to_s)
|
|
1581
|
+
send("#{sf}=", hash[sf])
|
|
1582
|
+
end
|
|
1583
|
+
end
|
|
1584
|
+
when :raise
|
|
1585
|
+
fields.each do |f|
|
|
1586
|
+
if hash.has_key?(f)
|
|
1587
|
+
send("#{f}=", hash[f])
|
|
1588
|
+
elsif f.is_a?(Symbol) && hash.has_key?(sf = f.to_s)
|
|
1589
|
+
send("#{sf}=", hash[sf])
|
|
1590
|
+
else
|
|
1591
|
+
raise(Sequel::Error, "missing field in hash: #{f.inspect} not in #{hash.inspect}")
|
|
1592
|
+
end
|
|
1593
|
+
end
|
|
1594
|
+
else
|
|
1595
|
+
fields.each{|f| send("#{f}=", hash[f])}
|
|
1596
|
+
end
|
|
1597
|
+
self
|
|
1598
|
+
end
|
|
1599
|
+
|
|
1600
|
+
# Set the values using the entries in the hash, only if the key
|
|
1601
|
+
# is included in only. It may be a better idea to use +set_fields+
|
|
1602
|
+
# instead of this method.
|
|
1603
|
+
#
|
|
1604
|
+
# artist.set_only({:name=>'Jim'}, :name)
|
|
1605
|
+
# artist.name # => 'Jim'
|
|
1606
|
+
#
|
|
1607
|
+
# artist.set_only({:hometown=>'LA'}, :name) # Raise Error
|
|
1608
|
+
def set_only(hash, *only)
|
|
1609
|
+
set_restricted(hash, only.flatten)
|
|
1610
|
+
end
|
|
1611
|
+
|
|
1612
|
+
# Set the shard that this object is tied to. Returns self.
|
|
1613
|
+
def set_server(s)
|
|
1614
|
+
@server = s
|
|
1615
|
+
@this.opts[:server] = s if @this
|
|
1616
|
+
self
|
|
1617
|
+
end
|
|
1618
|
+
|
|
1619
|
+
# Clear the setter_methods cache when a method is added
|
|
1620
|
+
def singleton_method_added(meth)
|
|
1621
|
+
@singleton_setter_added = true if meth.to_s =~ SETTER_METHOD_REGEXP
|
|
1622
|
+
super
|
|
1623
|
+
end
|
|
1624
|
+
|
|
1625
|
+
# Returns (naked) dataset that should return only this instance.
|
|
1626
|
+
#
|
|
1627
|
+
# Artist[1].this
|
|
1628
|
+
# # SELECT * FROM artists WHERE (id = 1) LIMIT 1
|
|
1629
|
+
def this
|
|
1630
|
+
return @this if @this
|
|
1631
|
+
raise Error, "No dataset for model #{model}" unless ds = model.instance_dataset
|
|
1632
|
+
|
|
1633
|
+
cond = if ds.joined_dataset?
|
|
1634
|
+
model.qualified_primary_key_hash(pk)
|
|
1635
|
+
else
|
|
1636
|
+
pk_hash
|
|
1637
|
+
end
|
|
1638
|
+
|
|
1639
|
+
@this = use_server(ds.where(cond))
|
|
1640
|
+
end
|
|
1641
|
+
|
|
1642
|
+
# Runs #set with the passed hash and then runs save_changes.
|
|
1643
|
+
#
|
|
1644
|
+
# artist.update(:name=>'Jim') # UPDATE artists SET name = 'Jim' WHERE (id = 1)
|
|
1645
|
+
def update(hash)
|
|
1646
|
+
update_restricted(hash, :default)
|
|
1647
|
+
end
|
|
1648
|
+
|
|
1649
|
+
# Update all values using the entries in the hash, ignoring any setting of
|
|
1650
|
+
# +allowed_columns+ in the model.
|
|
1651
|
+
#
|
|
1652
|
+
# Artist.set_allowed_columns(:num_albums)
|
|
1653
|
+
# artist.update_all(:name=>'Jim') # UPDATE artists SET name = 'Jim' WHERE (id = 1)
|
|
1654
|
+
def update_all(hash)
|
|
1655
|
+
update_restricted(hash, :all)
|
|
1656
|
+
end
|
|
1657
|
+
|
|
1658
|
+
# Update the instances values by calling +set_fields+ with the arguments, then
|
|
1659
|
+
# saves any changes to the record. Returns self.
|
|
1660
|
+
#
|
|
1661
|
+
# artist.update_fields({:name=>'Jim'}, [:name])
|
|
1662
|
+
# # UPDATE artists SET name = 'Jim' WHERE (id = 1)
|
|
1663
|
+
#
|
|
1664
|
+
# artist.update_fields({:hometown=>'LA'}, [:name])
|
|
1665
|
+
# # UPDATE artists SET name = NULL WHERE (id = 1)
|
|
1666
|
+
def update_fields(hash, fields, opts=nil)
|
|
1667
|
+
set_fields(hash, fields, opts)
|
|
1668
|
+
save_changes
|
|
1669
|
+
end
|
|
1670
|
+
|
|
1671
|
+
# Update the values using the entries in the hash, only if the key
|
|
1672
|
+
# is included in only. It may be a better idea to use +update_fields+
|
|
1673
|
+
# instead of this method.
|
|
1674
|
+
#
|
|
1675
|
+
# artist.update_only({:name=>'Jim'}, :name)
|
|
1676
|
+
# # UPDATE artists SET name = 'Jim' WHERE (id = 1)
|
|
1677
|
+
#
|
|
1678
|
+
# artist.update_only({:hometown=>'LA'}, :name) # Raise Error
|
|
1679
|
+
def update_only(hash, *only)
|
|
1680
|
+
update_restricted(hash, only.flatten)
|
|
1681
|
+
end
|
|
1682
|
+
|
|
1683
|
+
# Validates the object. If the object is invalid, errors should be added
|
|
1684
|
+
# to the errors attribute. By default, does nothing, as all models
|
|
1685
|
+
# are valid by default. See the {"Model Validations" guide}[rdoc-ref:doc/validations.rdoc].
|
|
1686
|
+
# for details about validation. Should not be called directly by
|
|
1687
|
+
# user code, call <tt>valid?</tt> instead to check if an object
|
|
1688
|
+
# is valid.
|
|
1689
|
+
def validate
|
|
1690
|
+
end
|
|
1691
|
+
|
|
1692
|
+
# Validates the object and returns true if no errors are reported.
|
|
1693
|
+
#
|
|
1694
|
+
# artist(:name=>'Valid').valid? # => true
|
|
1695
|
+
# artist(:name=>'Invalid').valid? # => false
|
|
1696
|
+
# artist.errors.full_messages # => ['name cannot be Invalid']
|
|
1697
|
+
def valid?(opts = OPTS)
|
|
1698
|
+
_before_validation
|
|
1699
|
+
_valid?(false, opts)
|
|
1700
|
+
end
|
|
1701
|
+
|
|
1702
|
+
private
|
|
1703
|
+
|
|
1704
|
+
# Run code before any validation is done, but also run it before saving
|
|
1705
|
+
# even if validation is skipped. This is a private hook. It exists so that
|
|
1706
|
+
# plugins can set values automatically before validation (as the values
|
|
1707
|
+
# need to be validated), but should be set even if validation is skipped.
|
|
1708
|
+
# Unlike the regular before_validation hook, we do not skip the save/validation
|
|
1709
|
+
# if this returns false.
|
|
1710
|
+
def _before_validation
|
|
1711
|
+
end
|
|
1712
|
+
|
|
1713
|
+
# Do the deletion of the object's dataset, and check that the row
|
|
1714
|
+
# was actually deleted.
|
|
1715
|
+
def _delete
|
|
1716
|
+
n = _delete_without_checking
|
|
1717
|
+
raise(NoExistingObject, "Attempt to delete object did not result in a single row modification (Rows Deleted: #{n}, SQL: #{_delete_dataset.delete_sql})") if require_modification && n != 1
|
|
1718
|
+
n
|
|
1719
|
+
end
|
|
1720
|
+
|
|
1721
|
+
# The dataset to use when deleting the object. The same as the object's
|
|
1722
|
+
# dataset by default.
|
|
1723
|
+
def _delete_dataset
|
|
1724
|
+
this
|
|
1725
|
+
end
|
|
1726
|
+
|
|
1727
|
+
# Actually do the deletion of the object's dataset. Return the
|
|
1728
|
+
# number of rows modified.
|
|
1729
|
+
def _delete_without_checking
|
|
1730
|
+
if sql = (m = model).fast_instance_delete_sql
|
|
1731
|
+
sql = sql.dup
|
|
1732
|
+
(ds = m.dataset).literal_append(sql, pk)
|
|
1733
|
+
ds.with_sql_delete(sql)
|
|
1734
|
+
else
|
|
1735
|
+
_delete_dataset.delete
|
|
1736
|
+
end
|
|
1737
|
+
end
|
|
1738
|
+
|
|
1739
|
+
# Internal destroy method, separted from destroy to
|
|
1740
|
+
# allow running inside a transaction
|
|
1741
|
+
def _destroy(opts)
|
|
1742
|
+
sh = {:server=>this_server}
|
|
1743
|
+
db.after_rollback(sh){after_destroy_rollback} if uacr = use_after_commit_rollback
|
|
1744
|
+
called = false
|
|
1745
|
+
around_destroy do
|
|
1746
|
+
called = true
|
|
1747
|
+
raise_hook_failure(:before_destroy) if before_destroy == false
|
|
1748
|
+
_destroy_delete
|
|
1749
|
+
after_destroy
|
|
1750
|
+
true
|
|
1751
|
+
end
|
|
1752
|
+
raise_hook_failure(:around_destroy) unless called
|
|
1753
|
+
db.after_commit(sh){after_destroy_commit} if uacr
|
|
1754
|
+
self
|
|
1755
|
+
end
|
|
1756
|
+
|
|
1757
|
+
# Internal delete method to call when destroying an object,
|
|
1758
|
+
# separated from delete to allow you to override destroy's version
|
|
1759
|
+
# without affecting delete.
|
|
1760
|
+
def _destroy_delete
|
|
1761
|
+
delete
|
|
1762
|
+
end
|
|
1763
|
+
|
|
1764
|
+
# Insert the record into the database, returning the primary key if
|
|
1765
|
+
# the record should be refreshed from the database.
|
|
1766
|
+
def _insert
|
|
1767
|
+
ds = _insert_dataset
|
|
1768
|
+
if _use_insert_select?(ds) && (h = _insert_select_raw(ds))
|
|
1769
|
+
_save_set_values(h)
|
|
1770
|
+
nil
|
|
1771
|
+
else
|
|
1772
|
+
iid = _insert_raw(ds)
|
|
1773
|
+
# if we have a regular primary key and it's not set in @values,
|
|
1774
|
+
# we assume it's the last inserted id
|
|
1775
|
+
if (pk = autoincrementing_primary_key) && pk.is_a?(Symbol) && !(vals = @values)[pk]
|
|
1776
|
+
vals[pk] = iid
|
|
1777
|
+
end
|
|
1778
|
+
pk
|
|
1779
|
+
end
|
|
1780
|
+
end
|
|
1781
|
+
|
|
1782
|
+
# The dataset to use when inserting a new object. The same as the model's
|
|
1783
|
+
# dataset by default.
|
|
1784
|
+
def _insert_dataset
|
|
1785
|
+
use_server(model.instance_dataset)
|
|
1786
|
+
end
|
|
1787
|
+
|
|
1788
|
+
# Insert into the given dataset and return the primary key created (if any).
|
|
1789
|
+
def _insert_raw(ds)
|
|
1790
|
+
ds.insert(@values)
|
|
1791
|
+
end
|
|
1792
|
+
|
|
1793
|
+
# Insert into the given dataset and return the hash of column values.
|
|
1794
|
+
def _insert_select_raw(ds)
|
|
1795
|
+
ds.insert_select(@values)
|
|
1796
|
+
end
|
|
1797
|
+
|
|
1798
|
+
# Refresh using a particular dataset, used inside save to make sure the same server
|
|
1799
|
+
# is used for reading newly inserted values from the database
|
|
1800
|
+
def _refresh(dataset)
|
|
1801
|
+
_refresh_set_values(_refresh_get(dataset) || raise(Error, "Record not found"))
|
|
1802
|
+
changed_columns.clear
|
|
1803
|
+
end
|
|
1804
|
+
|
|
1805
|
+
# Get the row of column data from the database.
|
|
1806
|
+
def _refresh_get(dataset)
|
|
1807
|
+
dataset.first
|
|
1808
|
+
end
|
|
1809
|
+
|
|
1810
|
+
# Set the refreshed values after
|
|
1811
|
+
def _refresh_set_values(h)
|
|
1812
|
+
@values = h
|
|
1813
|
+
end
|
|
1814
|
+
|
|
1815
|
+
# Internal version of save, split from save to allow running inside
|
|
1816
|
+
# it's own transaction.
|
|
1817
|
+
def _save(opts)
|
|
1818
|
+
sh = {:server=>this_server}
|
|
1819
|
+
db.after_rollback(sh){after_rollback} if uacr = use_after_commit_rollback
|
|
1820
|
+
was_new = false
|
|
1821
|
+
pk = nil
|
|
1822
|
+
called_save = false
|
|
1823
|
+
called_cu = false
|
|
1824
|
+
around_save do
|
|
1825
|
+
called_save = true
|
|
1826
|
+
raise_hook_failure(:before_save) if before_save == false
|
|
1827
|
+
if new?
|
|
1828
|
+
was_new = true
|
|
1829
|
+
around_create do
|
|
1830
|
+
called_cu = true
|
|
1831
|
+
raise_hook_failure(:before_create) if before_create == false
|
|
1832
|
+
pk = _insert
|
|
1833
|
+
@this = nil
|
|
1834
|
+
@new = false
|
|
1835
|
+
@was_new = true
|
|
1836
|
+
after_create
|
|
1837
|
+
true
|
|
1838
|
+
end
|
|
1839
|
+
raise_hook_failure(:around_create) unless called_cu
|
|
1840
|
+
else
|
|
1841
|
+
around_update do
|
|
1842
|
+
called_cu = true
|
|
1843
|
+
raise_hook_failure(:before_update) if before_update == false
|
|
1844
|
+
columns = opts[:columns]
|
|
1845
|
+
if columns.nil?
|
|
1846
|
+
@columns_updated = if opts[:changed]
|
|
1847
|
+
@values.reject{|k,v| !changed_columns.include?(k)}
|
|
1848
|
+
else
|
|
1849
|
+
_save_update_all_columns_hash
|
|
1850
|
+
end
|
|
1851
|
+
changed_columns.clear
|
|
1852
|
+
else # update only the specified columns
|
|
1853
|
+
columns = Array(columns)
|
|
1854
|
+
@columns_updated = @values.reject{|k, v| !columns.include?(k)}
|
|
1855
|
+
changed_columns.reject!{|c| columns.include?(c)}
|
|
1856
|
+
end
|
|
1857
|
+
_update_columns(@columns_updated)
|
|
1858
|
+
@this = nil
|
|
1859
|
+
after_update
|
|
1860
|
+
true
|
|
1861
|
+
end
|
|
1862
|
+
raise_hook_failure(:around_update) unless called_cu
|
|
1863
|
+
end
|
|
1864
|
+
after_save
|
|
1865
|
+
true
|
|
1866
|
+
end
|
|
1867
|
+
raise_hook_failure(:around_save) unless called_save
|
|
1868
|
+
if was_new
|
|
1869
|
+
@was_new = nil
|
|
1870
|
+
pk ? _save_refresh : changed_columns.clear
|
|
1871
|
+
else
|
|
1872
|
+
@columns_updated = nil
|
|
1873
|
+
end
|
|
1874
|
+
@modified = false
|
|
1875
|
+
db.after_commit(sh){after_commit} if uacr
|
|
1876
|
+
self
|
|
1877
|
+
end
|
|
1878
|
+
|
|
1879
|
+
# Refresh the object after saving it, used to get
|
|
1880
|
+
# default values of all columns. Separated from _save so it
|
|
1881
|
+
# can be overridden to avoid the refresh.
|
|
1882
|
+
def _save_refresh
|
|
1883
|
+
_save_set_values(_refresh_get(this.opts[:server] ? this : this.server(:default)) || raise(Error, "Record not found"))
|
|
1884
|
+
changed_columns.clear
|
|
1885
|
+
end
|
|
1886
|
+
|
|
1887
|
+
# Set values to the provided hash. Called after a create,
|
|
1888
|
+
# to set the full values from the database in the model instance.
|
|
1889
|
+
def _save_set_values(h)
|
|
1890
|
+
@values = h
|
|
1891
|
+
end
|
|
1892
|
+
|
|
1893
|
+
# Return a hash of values used when saving all columns of an
|
|
1894
|
+
# existing object (i.e. not passing specific columns to save
|
|
1895
|
+
# or using update/save_changes). Defaults to all of the
|
|
1896
|
+
# object's values except unmodified primary key columns, as some
|
|
1897
|
+
# databases don't like you setting primary key values even
|
|
1898
|
+
# to their existing values.
|
|
1899
|
+
def _save_update_all_columns_hash
|
|
1900
|
+
v = @values.dup
|
|
1901
|
+
Array(primary_key).each{|x| v.delete(x) unless changed_columns.include?(x)}
|
|
1902
|
+
v
|
|
1903
|
+
end
|
|
1904
|
+
|
|
1905
|
+
# Call _update with the given columns, if any are present.
|
|
1906
|
+
# Plugins can override this method in order to update with
|
|
1907
|
+
# additional columns, even when the column hash is initially empty.
|
|
1908
|
+
def _update_columns(columns)
|
|
1909
|
+
_update(columns) unless columns.empty?
|
|
1910
|
+
end
|
|
1911
|
+
|
|
1912
|
+
# Update this instance's dataset with the supplied column hash,
|
|
1913
|
+
# checking that only a single row was modified.
|
|
1914
|
+
def _update(columns)
|
|
1915
|
+
n = _update_without_checking(columns)
|
|
1916
|
+
raise(NoExistingObject, "Attempt to update object did not result in a single row modification (SQL: #{_update_dataset.update_sql(columns)})") if require_modification && n != 1
|
|
1917
|
+
n
|
|
1918
|
+
end
|
|
1919
|
+
|
|
1920
|
+
# The dataset to use when updating an object. The same as the object's
|
|
1921
|
+
# dataset by default.
|
|
1922
|
+
def _update_dataset
|
|
1923
|
+
this
|
|
1924
|
+
end
|
|
1925
|
+
|
|
1926
|
+
# Update this instances dataset with the supplied column hash.
|
|
1927
|
+
def _update_without_checking(columns)
|
|
1928
|
+
_update_dataset.update(columns)
|
|
1929
|
+
end
|
|
1930
|
+
|
|
1931
|
+
# Whether to use insert_select when inserting a new row.
|
|
1932
|
+
def _use_insert_select?(ds)
|
|
1933
|
+
(!ds.opts[:select] || ds.opts[:returning]) && ds.supports_insert_select?
|
|
1934
|
+
end
|
|
1935
|
+
|
|
1936
|
+
# Internal validation method. If +raise_errors+ is +true+, hook
|
|
1937
|
+
# failures will be raised as HookFailure exceptions. If it is
|
|
1938
|
+
# +false+, +false+ will be returned instead.
|
|
1939
|
+
def _valid?(raise_errors, opts)
|
|
1940
|
+
return errors.empty? if frozen?
|
|
1941
|
+
errors.clear
|
|
1942
|
+
called = false
|
|
1943
|
+
error = false
|
|
1944
|
+
around_validation do
|
|
1945
|
+
called = true
|
|
1946
|
+
if before_validation == false
|
|
1947
|
+
if raise_errors
|
|
1948
|
+
raise_hook_failure(:before_validation)
|
|
1949
|
+
else
|
|
1950
|
+
error = true
|
|
1951
|
+
end
|
|
1952
|
+
false
|
|
1953
|
+
else
|
|
1954
|
+
validate
|
|
1955
|
+
after_validation
|
|
1956
|
+
errors.empty?
|
|
1957
|
+
end
|
|
1958
|
+
end
|
|
1959
|
+
error = true unless called
|
|
1960
|
+
if error
|
|
1961
|
+
if raise_errors
|
|
1962
|
+
raise_hook_failure(:around_validation)
|
|
1963
|
+
else
|
|
1964
|
+
false
|
|
1965
|
+
end
|
|
1966
|
+
else
|
|
1967
|
+
errors.empty?
|
|
1968
|
+
end
|
|
1969
|
+
end
|
|
1970
|
+
|
|
1971
|
+
# If not raising on failure, check for HookFailed
|
|
1972
|
+
# being raised by yielding and swallow it.
|
|
1973
|
+
def checked_save_failure(opts)
|
|
1974
|
+
if raise_on_failure?(opts)
|
|
1975
|
+
yield
|
|
1976
|
+
else
|
|
1977
|
+
begin
|
|
1978
|
+
yield
|
|
1979
|
+
rescue HookFailed
|
|
1980
|
+
nil
|
|
1981
|
+
end
|
|
1982
|
+
end
|
|
1983
|
+
end
|
|
1984
|
+
|
|
1985
|
+
# If transactions should be used, wrap the yield in a transaction block.
|
|
1986
|
+
def checked_transaction(opts=OPTS)
|
|
1987
|
+
use_transaction?(opts) ? db.transaction({:server=>this_server}.merge(opts)){yield} : yield
|
|
1988
|
+
end
|
|
1989
|
+
|
|
1990
|
+
# Change the value of the column to given value, recording the change.
|
|
1991
|
+
def change_column_value(column, value)
|
|
1992
|
+
cc = changed_columns
|
|
1993
|
+
cc << column unless cc.include?(column)
|
|
1994
|
+
@values[column] = value
|
|
1995
|
+
end
|
|
1996
|
+
|
|
1997
|
+
# Default error class used for errors.
|
|
1998
|
+
def errors_class
|
|
1999
|
+
Errors
|
|
2000
|
+
end
|
|
2001
|
+
|
|
2002
|
+
if RUBY_VERSION >= '1.9'
|
|
2003
|
+
# Clone constructor -- freeze internal data structures if the original's
|
|
2004
|
+
# are frozen.
|
|
2005
|
+
def initialize_clone(other)
|
|
2006
|
+
super
|
|
2007
|
+
freeze if other.frozen?
|
|
2008
|
+
self
|
|
2009
|
+
end
|
|
2010
|
+
else
|
|
2011
|
+
# :nocov:
|
|
2012
|
+
# Ruby 1.8 doesn't support initialize_clone, so override clone to dup and freeze.
|
|
2013
|
+
def clone
|
|
2014
|
+
o = dup
|
|
2015
|
+
o.freeze if frozen?
|
|
2016
|
+
o
|
|
2017
|
+
end
|
|
2018
|
+
public :clone
|
|
2019
|
+
# :nocov:
|
|
2020
|
+
end
|
|
2021
|
+
|
|
2022
|
+
# Copy constructor -- Duplicate internal data structures.
|
|
2023
|
+
def initialize_copy(other)
|
|
2024
|
+
super
|
|
2025
|
+
@values = @values.dup
|
|
2026
|
+
@changed_columns = @changed_columns.dup if @changed_columns
|
|
2027
|
+
@errors = @errors.dup if @errors
|
|
2028
|
+
@this = @this.dup if @this
|
|
2029
|
+
self
|
|
2030
|
+
end
|
|
2031
|
+
|
|
2032
|
+
# Set the columns with the given hash. By default, the same as +set+, but
|
|
2033
|
+
# exists so it can be overridden. This is called only for new records, before
|
|
2034
|
+
# changed_columns is cleared.
|
|
2035
|
+
def initialize_set(h)
|
|
2036
|
+
set(h) unless h.empty?
|
|
2037
|
+
end
|
|
2038
|
+
|
|
2039
|
+
# Default inspection output for the values hash, overwrite to change what #inspect displays.
|
|
2040
|
+
def inspect_values
|
|
2041
|
+
@values.inspect
|
|
2042
|
+
end
|
|
2043
|
+
|
|
2044
|
+
# Whether to raise or return false if this action fails. If the
|
|
2045
|
+
# :raise_on_failure option is present in the hash, use that, otherwise,
|
|
2046
|
+
# fallback to the object's raise_on_save_failure (if set), or
|
|
2047
|
+
# class's default (if not).
|
|
2048
|
+
def raise_on_failure?(opts)
|
|
2049
|
+
opts.fetch(:raise_on_failure, raise_on_save_failure)
|
|
2050
|
+
end
|
|
2051
|
+
|
|
2052
|
+
# Raise an error appropriate to the hook type. May be swallowed by
|
|
2053
|
+
# checked_save_failure depending on the raise_on_failure? setting.
|
|
2054
|
+
def raise_hook_failure(type)
|
|
2055
|
+
raise HookFailed.new("the #{type} hook failed", self)
|
|
2056
|
+
end
|
|
2057
|
+
|
|
2058
|
+
# Get the ruby class or classes related to the given column's type.
|
|
2059
|
+
def schema_type_class(column)
|
|
2060
|
+
if (sch = db_schema[column]) && (type = sch[:type])
|
|
2061
|
+
db.schema_type_class(type)
|
|
2062
|
+
end
|
|
2063
|
+
end
|
|
2064
|
+
|
|
2065
|
+
# Call setter methods based on keys in hash, with the appropriate values.
|
|
2066
|
+
# Restrict which methods can be called based on the provided type.
|
|
2067
|
+
def set_restricted(hash, type)
|
|
2068
|
+
return self if hash.empty?
|
|
2069
|
+
meths = setter_methods(type)
|
|
2070
|
+
strict = strict_param_setting
|
|
2071
|
+
hash.each do |k,v|
|
|
2072
|
+
m = "#{k}="
|
|
2073
|
+
if meths.include?(m)
|
|
2074
|
+
send(m, v)
|
|
2075
|
+
elsif strict
|
|
2076
|
+
# Avoid using respond_to? or creating symbols from user input
|
|
2077
|
+
if public_methods.map{|s| s.to_s}.include?(m)
|
|
2078
|
+
if Array(model.primary_key).map{|s| s.to_s}.member?(k.to_s) && model.restrict_primary_key?
|
|
2079
|
+
raise Error, "#{k} is a restricted primary key"
|
|
2080
|
+
else
|
|
2081
|
+
raise Error, "#{k} is a restricted column"
|
|
2082
|
+
end
|
|
2083
|
+
else
|
|
2084
|
+
raise Error, "method #{m} doesn't exist"
|
|
2085
|
+
end
|
|
2086
|
+
end
|
|
2087
|
+
end
|
|
2088
|
+
self
|
|
2089
|
+
end
|
|
2090
|
+
|
|
2091
|
+
# Returns all methods that can be used for attribute assignment (those that end with =),
|
|
2092
|
+
# depending on the type:
|
|
2093
|
+
#
|
|
2094
|
+
# :default :: Use the default methods allowed in the model class.
|
|
2095
|
+
# :all :: Allow setting all setters, except those specifically restricted (such as ==).
|
|
2096
|
+
# Array :: Only allow setting of columns in the given array.
|
|
2097
|
+
def setter_methods(type)
|
|
2098
|
+
if type == :default
|
|
2099
|
+
if !@singleton_setter_added || model.allowed_columns
|
|
2100
|
+
return model.setter_methods
|
|
2101
|
+
end
|
|
2102
|
+
end
|
|
2103
|
+
|
|
2104
|
+
if type.is_a?(Array)
|
|
2105
|
+
type.map{|x| "#{x}="}
|
|
2106
|
+
else
|
|
2107
|
+
meths = methods.collect{|x| x.to_s}.grep(SETTER_METHOD_REGEXP) - RESTRICTED_SETTER_METHODS
|
|
2108
|
+
meths -= Array(primary_key).map{|x| "#{x}="} if type != :all && primary_key && model.restrict_primary_key?
|
|
2109
|
+
meths
|
|
2110
|
+
end
|
|
2111
|
+
end
|
|
2112
|
+
|
|
2113
|
+
# The server/shard that the model object's dataset uses, or :default if the
|
|
2114
|
+
# model object's dataset does not have an associated shard.
|
|
2115
|
+
def this_server
|
|
2116
|
+
if (s = @server)
|
|
2117
|
+
s
|
|
2118
|
+
elsif (t = @this)
|
|
2119
|
+
t.opts[:server] || :default
|
|
2120
|
+
else
|
|
2121
|
+
model.dataset.opts[:server] || :default
|
|
2122
|
+
end
|
|
2123
|
+
end
|
|
2124
|
+
|
|
2125
|
+
# Typecast the value to the column's type if typecasting. Calls the database's
|
|
2126
|
+
# typecast_value method, so database adapters can override/augment the handling
|
|
2127
|
+
# for database specific column types.
|
|
2128
|
+
def typecast_value(column, value)
|
|
2129
|
+
return value unless typecast_on_assignment && db_schema && (col_schema = db_schema[column])
|
|
2130
|
+
value = nil if '' == value and typecast_empty_string_to_nil and col_schema[:type] and ![:string, :blob].include?(col_schema[:type])
|
|
2131
|
+
raise(InvalidValue, "nil/NULL is not allowed for the #{column} column") if raise_on_typecast_failure && value.nil? && (col_schema[:allow_null] == false)
|
|
2132
|
+
begin
|
|
2133
|
+
model.db.typecast_value(col_schema[:type], value)
|
|
2134
|
+
rescue InvalidValue
|
|
2135
|
+
raise_on_typecast_failure ? raise : value
|
|
2136
|
+
end
|
|
2137
|
+
end
|
|
2138
|
+
|
|
2139
|
+
# Set the columns, filtered by the only and except arrays.
|
|
2140
|
+
def update_restricted(hash, type)
|
|
2141
|
+
set_restricted(hash, type)
|
|
2142
|
+
save_changes
|
|
2143
|
+
end
|
|
2144
|
+
|
|
2145
|
+
# Set the given dataset to use the current object's shard.
|
|
2146
|
+
def use_server(ds)
|
|
2147
|
+
@server ? ds.server(@server) : ds
|
|
2148
|
+
end
|
|
2149
|
+
|
|
2150
|
+
# Whether to use a transaction for this action. If the :transaction
|
|
2151
|
+
# option is present in the hash, use that, otherwise, fallback to the
|
|
2152
|
+
# object's default (if set), or class's default (if not).
|
|
2153
|
+
def use_transaction?(opts = OPTS)
|
|
2154
|
+
opts.fetch(:transaction, use_transactions)
|
|
2155
|
+
end
|
|
2156
|
+
end
|
|
2157
|
+
|
|
2158
|
+
# Dataset methods are methods that the model class extends its dataset with in
|
|
2159
|
+
# the call to set_dataset.
|
|
2160
|
+
module DatasetMethods
|
|
2161
|
+
# The model class associated with this dataset
|
|
2162
|
+
#
|
|
2163
|
+
# Artist.dataset.model # => Artist
|
|
2164
|
+
attr_accessor :model
|
|
2165
|
+
|
|
2166
|
+
# Assume if a single integer is given that it is a lookup by primary
|
|
2167
|
+
# key, and call with_pk with the argument.
|
|
2168
|
+
#
|
|
2169
|
+
# Artist.dataset[1] # SELECT * FROM artists WHERE (id = 1) LIMIT 1
|
|
2170
|
+
def [](*args)
|
|
2171
|
+
if args.length == 1 && (i = args.at(0)) && i.is_a?(Integer)
|
|
2172
|
+
with_pk(i)
|
|
2173
|
+
else
|
|
2174
|
+
super
|
|
2175
|
+
end
|
|
2176
|
+
end
|
|
2177
|
+
|
|
2178
|
+
# Destroy each row in the dataset by instantiating it and then calling
|
|
2179
|
+
# destroy on the resulting model object. This isn't as fast as deleting
|
|
2180
|
+
# the dataset, which does a single SQL call, but this runs any destroy
|
|
2181
|
+
# hooks on each object in the dataset.
|
|
2182
|
+
#
|
|
2183
|
+
# Artist.dataset.destroy
|
|
2184
|
+
# # DELETE FROM artists WHERE (id = 1)
|
|
2185
|
+
# # DELETE FROM artists WHERE (id = 2)
|
|
2186
|
+
# # ...
|
|
2187
|
+
def destroy
|
|
2188
|
+
pr = proc{all{|r| r.destroy}.length}
|
|
2189
|
+
model.use_transactions ? @db.transaction(:server=>opts[:server], &pr) : pr.call
|
|
2190
|
+
end
|
|
2191
|
+
|
|
2192
|
+
# Allow Sequel::Model classes to be used as dataset arguments when graphing:
|
|
2193
|
+
#
|
|
2194
|
+
# Artist.graph(Album, :artist_id=>id)
|
|
2195
|
+
# # SELECT artists.id, artists.name, albums.id AS albums_id, albums.artist_id, albums.name AS albums_name
|
|
2196
|
+
# # FROM artists LEFT OUTER JOIN albums ON (albums.artist_id = artists.id)
|
|
2197
|
+
def graph(table, *args, &block)
|
|
2198
|
+
if table.is_a?(Class) && table < Sequel::Model
|
|
2199
|
+
super(table.dataset, *args, &block)
|
|
2200
|
+
else
|
|
2201
|
+
super
|
|
2202
|
+
end
|
|
2203
|
+
end
|
|
2204
|
+
|
|
2205
|
+
# Handle Sequel::Model instances when inserting, using the model instance's
|
|
2206
|
+
# values for the insert, unless the model instance can be used directly in
|
|
2207
|
+
# SQL.
|
|
2208
|
+
#
|
|
2209
|
+
# Album.insert(Album.load(:name=>'A'))
|
|
2210
|
+
# # INSERT INTO albums (name) VALUES ('A')
|
|
2211
|
+
def insert_sql(*values)
|
|
2212
|
+
if values.size == 1 && (v = values.at(0)).is_a?(Sequel::Model) && !v.respond_to?(:sql_literal_append)
|
|
2213
|
+
super(v.to_hash)
|
|
2214
|
+
else
|
|
2215
|
+
super
|
|
2216
|
+
end
|
|
2217
|
+
end
|
|
2218
|
+
|
|
2219
|
+
# Allow Sequel::Model classes to be used as table name arguments in dataset
|
|
2220
|
+
# join methods:
|
|
2221
|
+
#
|
|
2222
|
+
# Artist.join(Album, :artist_id=>id)
|
|
2223
|
+
# # SELECT * FROM artists INNER JOIN albums ON (albums.artist_id = artists.id)
|
|
2224
|
+
def join_table(type, table, *args, &block)
|
|
2225
|
+
if table.is_a?(Class) && table < Sequel::Model
|
|
2226
|
+
if table.dataset.simple_select_all?
|
|
2227
|
+
super(type, table.table_name, *args, &block)
|
|
2228
|
+
else
|
|
2229
|
+
super(type, table.dataset, *args, &block)
|
|
2230
|
+
end
|
|
2231
|
+
else
|
|
2232
|
+
super
|
|
2233
|
+
end
|
|
2234
|
+
end
|
|
2235
|
+
|
|
2236
|
+
# If there is no order already defined on this dataset, order it by
|
|
2237
|
+
# the primary key and call last.
|
|
2238
|
+
#
|
|
2239
|
+
# Album.last
|
|
2240
|
+
# # SELECT * FROM albums ORDER BY id DESC LIMIT 1
|
|
2241
|
+
def last(*a, &block)
|
|
2242
|
+
if opts[:order].nil? && model && (pk = model.primary_key)
|
|
2243
|
+
order(*pk).last(*a, &block)
|
|
2244
|
+
else
|
|
2245
|
+
super
|
|
2246
|
+
end
|
|
2247
|
+
end
|
|
2248
|
+
|
|
2249
|
+
# If there is no order already defined on this dataset, order it by
|
|
2250
|
+
# the primary key and call paged_each.
|
|
2251
|
+
#
|
|
2252
|
+
# Album.paged_each{|row| }
|
|
2253
|
+
# # SELECT * FROM albums ORDER BY id LIMIT 1000 OFFSET 0
|
|
2254
|
+
# # SELECT * FROM albums ORDER BY id LIMIT 1000 OFFSET 1000
|
|
2255
|
+
# # SELECT * FROM albums ORDER BY id LIMIT 1000 OFFSET 2000
|
|
2256
|
+
# # ...
|
|
2257
|
+
def paged_each(*a, &block)
|
|
2258
|
+
if opts[:order].nil? && model && (pk = model.primary_key)
|
|
2259
|
+
order(*pk).paged_each(*a, &block)
|
|
2260
|
+
else
|
|
2261
|
+
super
|
|
2262
|
+
end
|
|
2263
|
+
end
|
|
2264
|
+
|
|
2265
|
+
# This allows you to call +to_hash+ without any arguments, which will
|
|
2266
|
+
# result in a hash with the primary key value being the key and the
|
|
2267
|
+
# model object being the value.
|
|
2268
|
+
#
|
|
2269
|
+
# Artist.dataset.to_hash # SELECT * FROM artists
|
|
2270
|
+
# # => {1=>#<Artist {:id=>1, ...}>,
|
|
2271
|
+
# # 2=>#<Artist {:id=>2, ...}>,
|
|
2272
|
+
# # ...}
|
|
2273
|
+
def to_hash(key_column=nil, value_column=nil)
|
|
2274
|
+
if key_column
|
|
2275
|
+
super
|
|
2276
|
+
else
|
|
2277
|
+
raise(Sequel::Error, "No primary key for model") unless model && (pk = model.primary_key)
|
|
2278
|
+
super(pk, value_column)
|
|
2279
|
+
end
|
|
2280
|
+
end
|
|
2281
|
+
|
|
2282
|
+
# Given a primary key value, return the first record in the dataset with that primary key
|
|
2283
|
+
# value. If no records matches, returns nil.
|
|
2284
|
+
#
|
|
2285
|
+
# # Single primary key
|
|
2286
|
+
# Artist.dataset.with_pk(1) # SELECT * FROM artists WHERE (id = 1) LIMIT 1
|
|
2287
|
+
#
|
|
2288
|
+
# # Composite primary key
|
|
2289
|
+
# Artist.dataset.with_pk([1, 2]) # SELECT * FROM artists
|
|
2290
|
+
# # WHERE ((id1 = 1) AND (id2 = 2)) LIMIT 1
|
|
2291
|
+
def with_pk(pk)
|
|
2292
|
+
first(model.qualified_primary_key_hash(pk))
|
|
2293
|
+
end
|
|
2294
|
+
|
|
2295
|
+
# Same as with_pk, but raises NoMatchingRow instead of returning nil if no
|
|
2296
|
+
# row matches.
|
|
2297
|
+
def with_pk!(pk)
|
|
2298
|
+
with_pk(pk) || raise(NoMatchingRow)
|
|
2299
|
+
end
|
|
2300
|
+
end
|
|
2301
|
+
|
|
2302
|
+
extend ClassMethods
|
|
2303
|
+
plugin self
|
|
2304
|
+
finder(:where, :arity=>1, :mod=>ClassMethods)
|
|
2305
|
+
end
|
|
2306
|
+
end
|