backbone-deep-rails 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/lib/backbone/deep/rails/version.rb +1 -1
  4. metadata +18 -245
  5. data/vendor/bundle/cache/activemodel-3.2.11.gem +0 -0
  6. data/vendor/bundle/cache/activesupport-3.2.11.gem +0 -0
  7. data/vendor/bundle/gems/activesupport-3.2.11/CHANGELOG.md +0 -157
  8. data/vendor/bundle/gems/activesupport-3.2.11/MIT-LICENSE +0 -20
  9. data/vendor/bundle/gems/activesupport-3.2.11/README.rdoc +0 -33
  10. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support.rb +0 -82
  11. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/all.rb +0 -3
  12. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/backtrace_cleaner.rb +0 -99
  13. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/base64.rb +0 -54
  14. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/basic_object.rb +0 -21
  15. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/benchmarkable.rb +0 -55
  16. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/buffered_logger.rb +0 -125
  17. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/builder.rb +0 -6
  18. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache.rb +0 -638
  19. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/file_store.rb +0 -178
  20. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/mem_cache_store.rb +0 -206
  21. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/memory_store.rb +0 -159
  22. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/null_store.rb +0 -44
  23. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb +0 -169
  24. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/callbacks.rb +0 -626
  25. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/concern.rb +0 -131
  26. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/configurable.rb +0 -90
  27. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext.rb +0 -3
  28. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array.rb +0 -8
  29. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/access.rb +0 -46
  30. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/conversions.rb +0 -164
  31. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/extract_options.rb +0 -29
  32. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/grouping.rb +0 -100
  33. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/prepend_and_append.rb +0 -7
  34. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/random_access.rb +0 -30
  35. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/uniq_by.rb +0 -16
  36. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/wrap.rb +0 -48
  37. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/benchmark.rb +0 -7
  38. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/big_decimal.rb +0 -1
  39. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/big_decimal/conversions.rb +0 -45
  40. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class.rb +0 -4
  41. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/attribute.rb +0 -115
  42. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/attribute_accessors.rb +0 -168
  43. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/delegating_attributes.rb +0 -44
  44. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/subclasses.rb +0 -36
  45. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/acts_like.rb +0 -8
  46. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/calculations.rb +0 -276
  47. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/conversions.rb +0 -106
  48. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/freeze.rb +0 -33
  49. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/zones.rb +0 -14
  50. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/acts_like.rb +0 -13
  51. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/calculations.rb +0 -143
  52. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/conversions.rb +0 -103
  53. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/zones.rb +0 -21
  54. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/enumerable.rb +0 -127
  55. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/exception.rb +0 -3
  56. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/file.rb +0 -2
  57. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/file/atomic.rb +0 -42
  58. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/file/path.rb +0 -5
  59. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/float.rb +0 -1
  60. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/float/rounding.rb +0 -19
  61. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash.rb +0 -9
  62. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/conversions.rb +0 -175
  63. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/deep_dup.rb +0 -18
  64. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/deep_merge.rb +0 -21
  65. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/diff.rb +0 -13
  66. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/except.rb +0 -23
  67. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/indifferent_access.rb +0 -24
  68. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/keys.rb +0 -54
  69. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/reverse_merge.rb +0 -23
  70. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/slice.rb +0 -40
  71. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer.rb +0 -3
  72. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer/inflections.rb +0 -17
  73. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer/multiple.rb +0 -10
  74. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer/time.rb +0 -39
  75. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/io.rb +0 -15
  76. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel.rb +0 -4
  77. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
  78. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/debugger.rb +0 -10
  79. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/reporting.rb +0 -93
  80. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/singleton_class.rb +0 -13
  81. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/load_error.rb +0 -23
  82. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/logger.rb +0 -83
  83. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module.rb +0 -12
  84. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/aliasing.rb +0 -70
  85. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/anonymous.rb +0 -24
  86. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/attr_internal.rb +0 -39
  87. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/attribute_accessors.rb +0 -64
  88. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/delegation.rb +0 -153
  89. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/deprecation.rb +0 -9
  90. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/introspection.rb +0 -88
  91. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/method_names.rb +0 -14
  92. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/qualified_const.rb +0 -64
  93. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/reachable.rb +0 -8
  94. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/remove_method.rb +0 -16
  95. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/synchronization.rb +0 -45
  96. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/name_error.rb +0 -18
  97. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric.rb +0 -2
  98. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric/bytes.rb +0 -44
  99. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric/time.rb +0 -79
  100. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object.rb +0 -13
  101. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/acts_like.rb +0 -10
  102. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/blank.rb +0 -121
  103. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/conversions.rb +0 -4
  104. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/duplicable.rb +0 -119
  105. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/inclusion.rb +0 -25
  106. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/instance_variables.rb +0 -33
  107. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/to_json.rb +0 -19
  108. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/to_param.rb +0 -55
  109. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/to_query.rb +0 -27
  110. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/try.rb +0 -57
  111. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/with_options.rb +0 -43
  112. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/proc.rb +0 -14
  113. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/process.rb +0 -1
  114. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/process/daemon.rb +0 -23
  115. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range.rb +0 -5
  116. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/blockless_step.rb +0 -29
  117. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/conversions.rb +0 -21
  118. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/cover.rb +0 -3
  119. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/include_range.rb +0 -21
  120. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/overlaps.rb +0 -8
  121. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/regexp.rb +0 -5
  122. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/rexml.rb +0 -46
  123. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string.rb +0 -14
  124. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/access.rb +0 -99
  125. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/behavior.rb +0 -6
  126. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/conversions.rb +0 -66
  127. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/encoding.rb +0 -11
  128. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/exclude.rb +0 -11
  129. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/filters.rb +0 -49
  130. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/inflections.rb +0 -202
  131. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/inquiry.rb +0 -13
  132. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/interpolation.rb +0 -2
  133. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/multibyte.rb +0 -72
  134. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/output_safety.rb +0 -186
  135. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/starts_ends_with.rb +0 -4
  136. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/strip.rb +0 -26
  137. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/xchar.rb +0 -18
  138. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/acts_like.rb +0 -8
  139. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/calculations.rb +0 -360
  140. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/conversions.rb +0 -85
  141. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/marshal.rb +0 -57
  142. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/publicize_conversion_methods.rb +0 -10
  143. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/zones.rb +0 -86
  144. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/uri.rb +0 -30
  145. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/dependencies.rb +0 -703
  146. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/dependencies/autoload.rb +0 -50
  147. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation.rb +0 -18
  148. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/behaviors.rb +0 -49
  149. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/method_wrappers.rb +0 -29
  150. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/proxy_wrappers.rb +0 -81
  151. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/reporting.rb +0 -65
  152. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/descendants_tracker.rb +0 -45
  153. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/duration.rb +0 -110
  154. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/file_update_checker.rb +0 -121
  155. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/file_watcher.rb +0 -36
  156. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/gzip.rb +0 -30
  157. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/hash_with_indifferent_access.rb +0 -178
  158. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/i18n.rb +0 -9
  159. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/i18n_railtie.rb +0 -102
  160. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflections.rb +0 -63
  161. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector.rb +0 -7
  162. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector/inflections.rb +0 -174
  163. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb +0 -321
  164. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector/transliterate.rb +0 -98
  165. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json.rb +0 -2
  166. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json/decoding.rb +0 -79
  167. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json/encoding.rb +0 -284
  168. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json/variable.rb +0 -9
  169. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb +0 -46
  170. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/locale/en.yml +0 -36
  171. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/log_subscriber.rb +0 -122
  172. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/log_subscriber/test_helper.rb +0 -101
  173. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/memoizable.rb +0 -116
  174. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/message_encryptor.rb +0 -103
  175. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/message_verifier.rb +0 -74
  176. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte.rb +0 -44
  177. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/chars.rb +0 -476
  178. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/exceptions.rb +0 -8
  179. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/unicode.rb +0 -393
  180. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/utils.rb +0 -60
  181. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/notifications.rb +0 -154
  182. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/notifications/fanout.rb +0 -61
  183. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/notifications/instrumenter.rb +0 -53
  184. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/option_merger.rb +0 -25
  185. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/ordered_hash.rb +0 -222
  186. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/ordered_options.rb +0 -61
  187. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/railtie.rb +0 -59
  188. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/rescuable.rb +0 -115
  189. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/ruby/shim.rb +0 -22
  190. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/string_inquirer.rb +0 -21
  191. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/tagged_logging.rb +0 -80
  192. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/test_case.rb +0 -34
  193. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/assertions.rb +0 -97
  194. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/declarative.rb +0 -40
  195. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/deprecation.rb +0 -55
  196. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/isolation.rb +0 -157
  197. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/mochaing.rb +0 -7
  198. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/pending.rb +0 -52
  199. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance.rb +0 -317
  200. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/jruby.rb +0 -115
  201. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/rubinius.rb +0 -113
  202. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby.rb +0 -152
  203. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby/mri.rb +0 -57
  204. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby/yarv.rb +0 -57
  205. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/setup_and_teardown.rb +0 -118
  206. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/time.rb +0 -35
  207. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/time/autoload.rb +0 -5
  208. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/time_with_zone.rb +0 -358
  209. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/values/time_zone.rb +0 -397
  210. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/values/unicode_tables.dat +0 -0
  211. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/version.rb +0 -10
  212. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/whiny_nil.rb +0 -24
  213. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini.rb +0 -168
  214. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/jdom.rb +0 -175
  215. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/libxml.rb +0 -80
  216. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/libxmlsax.rb +0 -86
  217. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/nokogiri.rb +0 -84
  218. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/nokogirisax.rb +0 -88
  219. data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/rexml.rb +0 -130
  220. data/vendor/bundle/specifications/activesupport-3.2.11.gemspec +0 -33
@@ -1,13 +0,0 @@
1
- require 'active_support/string_inquirer'
2
-
3
- class String
4
- # Wraps the current string in the <tt>ActiveSupport::StringInquirer</tt> class,
5
- # which gives you a prettier way to test for equality. Example:
6
- #
7
- # env = "production".inquiry
8
- # env.production? # => true
9
- # env.development? # => false
10
- def inquiry
11
- ActiveSupport::StringInquirer.new(self)
12
- end
13
- end
@@ -1,2 +0,0 @@
1
- require 'active_support/i18n'
2
- require 'i18n/core_ext/string/interpolate'
@@ -1,72 +0,0 @@
1
- # encoding: utf-8
2
- require 'active_support/multibyte'
3
-
4
- class String
5
- if RUBY_VERSION >= "1.9"
6
- # == Multibyte proxy
7
- #
8
- # +mb_chars+ is a multibyte safe proxy for string methods.
9
- #
10
- # In Ruby 1.8 and older it creates and returns an instance of the ActiveSupport::Multibyte::Chars class which
11
- # encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy
12
- # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsulated string.
13
- #
14
- # name = 'Claus Müller'
15
- # name.reverse # => "rell??M sualC"
16
- # name.length # => 13
17
- #
18
- # name.mb_chars.reverse.to_s # => "rellüM sualC"
19
- # name.mb_chars.length # => 12
20
- #
21
- # In Ruby 1.9 and newer +mb_chars+ returns +self+ because String is (mostly) encoding aware. This means that
22
- # it becomes easy to run one version of your code on multiple Ruby versions.
23
- #
24
- # == Method chaining
25
- #
26
- # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows
27
- # method chaining on the result of any of these methods.
28
- #
29
- # name.mb_chars.reverse.length # => 12
30
- #
31
- # == Interoperability and configuration
32
- #
33
- # The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between
34
- # String and Char work like expected. The bang! methods change the internal string representation in the Chars
35
- # object. Interoperability problems can be resolved easily with a +to_s+ call.
36
- #
37
- # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For
38
- # information about how to change the default Multibyte behavior see ActiveSupport::Multibyte.
39
- def mb_chars
40
- if ActiveSupport::Multibyte.proxy_class.consumes?(self)
41
- ActiveSupport::Multibyte.proxy_class.new(self)
42
- else
43
- self
44
- end
45
- end
46
-
47
- def is_utf8?
48
- case encoding
49
- when Encoding::UTF_8
50
- valid_encoding?
51
- when Encoding::ASCII_8BIT, Encoding::US_ASCII
52
- dup.force_encoding(Encoding::UTF_8).valid_encoding?
53
- else
54
- false
55
- end
56
- end
57
- else
58
- def mb_chars
59
- if ActiveSupport::Multibyte.proxy_class.wants?(self)
60
- ActiveSupport::Multibyte.proxy_class.new(self)
61
- else
62
- self
63
- end
64
- end
65
-
66
- # Returns true if the string has UTF-8 semantics (a String used for purely byte resources is unlikely to have
67
- # them), returns false otherwise.
68
- def is_utf8?
69
- ActiveSupport::Multibyte::Chars.consumes?(self)
70
- end
71
- end
72
- end
@@ -1,186 +0,0 @@
1
- require 'erb'
2
- require 'active_support/core_ext/kernel/singleton_class'
3
-
4
- class ERB
5
- module Util
6
- HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#x27;' }
7
- JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }
8
-
9
- if RUBY_VERSION >= '1.9'
10
- # A utility method for escaping HTML tag characters.
11
- # This method is also aliased as <tt>h</tt>.
12
- #
13
- # In your ERB templates, use this method to escape any unsafe content. For example:
14
- # <%=h @person.name %>
15
- #
16
- # ==== Example:
17
- # puts html_escape("is a > 0 & a < 10?")
18
- # # => is a &gt; 0 &amp; a &lt; 10?
19
- def html_escape(s)
20
- s = s.to_s
21
- if s.html_safe?
22
- s
23
- else
24
- s.gsub(/[&"'><]/, HTML_ESCAPE).html_safe
25
- end
26
- end
27
- else
28
- def html_escape(s) #:nodoc:
29
- s = s.to_s
30
- if s.html_safe?
31
- s
32
- else
33
- s.gsub(/[&"'><]/n) { |special| HTML_ESCAPE[special] }.html_safe
34
- end
35
- end
36
- end
37
-
38
- # Aliasing twice issues a warning "discarding old...". Remove first to avoid it.
39
- remove_method(:h)
40
- alias h html_escape
41
-
42
- module_function :h
43
-
44
- singleton_class.send(:remove_method, :html_escape)
45
- module_function :html_escape
46
-
47
- # A utility method for escaping HTML entities in JSON strings
48
- # using \uXXXX JavaScript escape sequences for string literals:
49
- #
50
- # json_escape("is a > 0 & a < 10?")
51
- # # => is a \u003E 0 \u0026 a \u003C 10?
52
- #
53
- # Note that after this operation is performed the output is not
54
- # valid JSON. In particular double quotes are removed:
55
- #
56
- # json_escape('{"name":"john","created_at":"2010-04-28T01:39:31Z","id":1}')
57
- # # => {name:john,created_at:2010-04-28T01:39:31Z,id:1}
58
- #
59
- # This method is also aliased as +j+, and available as a helper
60
- # in Rails templates:
61
- #
62
- # <%=j @person.to_json %>
63
- #
64
- def json_escape(s)
65
- result = s.to_s.gsub(/[&"><]/) { |special| JSON_ESCAPE[special] }
66
- s.html_safe? ? result.html_safe : result
67
- end
68
-
69
- alias j json_escape
70
- module_function :j
71
- module_function :json_escape
72
- end
73
- end
74
-
75
- class Object
76
- def html_safe?
77
- false
78
- end
79
- end
80
-
81
- class Numeric
82
- def html_safe?
83
- true
84
- end
85
- end
86
-
87
- module ActiveSupport #:nodoc:
88
- class SafeBuffer < String
89
- UNSAFE_STRING_METHODS = ["capitalize", "chomp", "chop", "delete", "downcase", "gsub", "lstrip", "next", "reverse", "rstrip", "slice", "squeeze", "strip", "sub", "succ", "swapcase", "tr", "tr_s", "upcase", "prepend"].freeze
90
-
91
- alias_method :original_concat, :concat
92
- private :original_concat
93
-
94
- class SafeConcatError < StandardError
95
- def initialize
96
- super "Could not concatenate to the buffer because it is not html safe."
97
- end
98
- end
99
-
100
- def [](*args)
101
- return super if args.size < 2
102
-
103
- if html_safe?
104
- new_safe_buffer = super
105
- new_safe_buffer.instance_eval { @html_safe = true }
106
- new_safe_buffer
107
- else
108
- to_str[*args]
109
- end
110
- end
111
-
112
- def safe_concat(value)
113
- raise SafeConcatError unless html_safe?
114
- original_concat(value)
115
- end
116
-
117
- def initialize(*)
118
- @html_safe = true
119
- super
120
- end
121
-
122
- def initialize_copy(other)
123
- super
124
- @html_safe = other.html_safe?
125
- end
126
-
127
- def clone_empty
128
- self[0, 0]
129
- end
130
-
131
- def concat(value)
132
- if !html_safe? || value.html_safe?
133
- super(value)
134
- else
135
- super(ERB::Util.h(value))
136
- end
137
- end
138
- alias << concat
139
-
140
- def +(other)
141
- dup.concat(other)
142
- end
143
-
144
- def html_safe?
145
- defined?(@html_safe) && @html_safe
146
- end
147
-
148
- def to_s
149
- self
150
- end
151
-
152
- def to_param
153
- to_str
154
- end
155
-
156
- def encode_with(coder)
157
- coder.represent_scalar nil, to_str
158
- end
159
-
160
- def to_yaml(*args)
161
- return super() if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
162
- to_str.to_yaml(*args)
163
- end
164
-
165
- UNSAFE_STRING_METHODS.each do |unsafe_method|
166
- if 'String'.respond_to?(unsafe_method)
167
- class_eval <<-EOT, __FILE__, __LINE__ + 1
168
- def #{unsafe_method}(*args, &block) # def capitalize(*args, &block)
169
- to_str.#{unsafe_method}(*args, &block) # to_str.capitalize(*args, &block)
170
- end # end
171
-
172
- def #{unsafe_method}!(*args) # def capitalize!(*args)
173
- @html_safe = false # @html_safe = false
174
- super # super
175
- end # end
176
- EOT
177
- end
178
- end
179
- end
180
- end
181
-
182
- class String
183
- def html_safe
184
- ActiveSupport::SafeBuffer.new(self)
185
- end
186
- end
@@ -1,4 +0,0 @@
1
- class String
2
- alias_method :starts_with?, :start_with?
3
- alias_method :ends_with?, :end_with?
4
- end
@@ -1,26 +0,0 @@
1
- require 'active_support/core_ext/object/try'
2
-
3
- class String
4
- # Strips indentation in heredocs.
5
- #
6
- # For example in
7
- #
8
- # if options[:usage]
9
- # puts <<-USAGE.strip_heredoc
10
- # This command does such and such.
11
- #
12
- # Supported options are:
13
- # -h This message
14
- # ...
15
- # USAGE
16
- # end
17
- #
18
- # the user would see the usage message aligned against the left margin.
19
- #
20
- # Technically, it looks for the least indented line in the whole string, and removes
21
- # that amount of leading whitespace.
22
- def strip_heredoc
23
- indent = scan(/^[ \t]*(?=\S)/).min.try(:size) || 0
24
- gsub(/^[ \t]{#{indent}}/, '')
25
- end
26
- end
@@ -1,18 +0,0 @@
1
- begin
2
- # See http://fast-xs.rubyforge.org/ by Eric Wong.
3
- # Also included with hpricot.
4
- require 'fast_xs'
5
- rescue LoadError
6
- # fast_xs extension unavailable
7
- else
8
- begin
9
- require 'builder'
10
- rescue LoadError
11
- # builder demands the first shot at defining String#to_xs
12
- end
13
-
14
- class String
15
- alias_method :original_xs, :to_xs if method_defined?(:to_xs)
16
- alias_method :to_xs, :fast_xs
17
- end
18
- end
@@ -1,8 +0,0 @@
1
- require 'active_support/core_ext/object/acts_like'
2
-
3
- class Time
4
- # Duck-types as a Time-like class. See Object#acts_like?.
5
- def acts_like_time?
6
- true
7
- end
8
- end
@@ -1,360 +0,0 @@
1
- require 'active_support/duration'
2
- require 'active_support/core_ext/time/conversions'
3
- require 'active_support/time_with_zone'
4
- require 'active_support/core_ext/time/zones'
5
-
6
- class Time
7
- COMMON_YEAR_DAYS_IN_MONTH = [nil, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
8
- DAYS_INTO_WEEK = { :monday => 0, :tuesday => 1, :wednesday => 2, :thursday => 3, :friday => 4, :saturday => 5, :sunday => 6 }
9
-
10
- class << self
11
- # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances
12
- def ===(other)
13
- super || (self == Time && other.is_a?(ActiveSupport::TimeWithZone))
14
- end
15
-
16
- # Return the number of days in the given month.
17
- # If no year is specified, it will use the current year.
18
- def days_in_month(month, year = now.year)
19
- return 29 if month == 2 && ::Date.gregorian_leap?(year)
20
- COMMON_YEAR_DAYS_IN_MONTH[month]
21
- end
22
-
23
- # Returns a new Time if requested year can be accommodated by Ruby's Time class
24
- # (i.e., if year is within either 1970..2038 or 1902..2038, depending on system architecture);
25
- # otherwise returns a DateTime.
26
- def time_with_datetime_fallback(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0, usec=0)
27
- time = ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec)
28
- # This check is needed because Time.utc(y) returns a time object in the 2000s for 0 <= y <= 138.
29
- time.year == year ? time : ::DateTime.civil_from_format(utc_or_local, year, month, day, hour, min, sec)
30
- rescue
31
- ::DateTime.civil_from_format(utc_or_local, year, month, day, hour, min, sec)
32
- end
33
-
34
- # Wraps class method +time_with_datetime_fallback+ with +utc_or_local+ set to <tt>:utc</tt>.
35
- def utc_time(*args)
36
- time_with_datetime_fallback(:utc, *args)
37
- end
38
-
39
- # Wraps class method +time_with_datetime_fallback+ with +utc_or_local+ set to <tt>:local</tt>.
40
- def local_time(*args)
41
- time_with_datetime_fallback(:local, *args)
42
- end
43
-
44
- # Returns <tt>Time.zone.now</tt> when <tt>Time.zone</tt> or <tt>config.time_zone</tt> are set, otherwise just returns <tt>Time.now</tt>.
45
- def current
46
- ::Time.zone ? ::Time.zone.now : ::Time.now
47
- end
48
- end
49
-
50
- # Tells whether the Time object's time lies in the past
51
- def past?
52
- self < ::Time.current
53
- end
54
-
55
- # Tells whether the Time object's time is today
56
- def today?
57
- to_date == ::Date.current
58
- end
59
-
60
- # Tells whether the Time object's time lies in the future
61
- def future?
62
- self > ::Time.current
63
- end
64
-
65
- # Seconds since midnight: Time.now.seconds_since_midnight
66
- def seconds_since_midnight
67
- to_i - change(:hour => 0).to_i + (usec / 1.0e+6)
68
- end
69
-
70
- # Returns a new Time where one or more of the elements have been changed according to the +options+ parameter. The time options
71
- # (hour, min, sec, usec) reset cascadingly, so if only the hour is passed, then minute, sec, and usec is set to 0. If the hour and
72
- # minute is passed, then sec and usec is set to 0.
73
- def change(options)
74
- ::Time.send(
75
- utc? ? :utc_time : :local_time,
76
- options[:year] || year,
77
- options[:month] || month,
78
- options[:day] || day,
79
- options[:hour] || hour,
80
- options[:min] || (options[:hour] ? 0 : min),
81
- options[:sec] || ((options[:hour] || options[:min]) ? 0 : sec),
82
- options[:usec] || ((options[:hour] || options[:min] || options[:sec]) ? 0 : usec)
83
- )
84
- end
85
-
86
- # Uses Date to provide precise Time calculations for years, months, and days.
87
- # The +options+ parameter takes a hash with any of these keys: <tt>:years</tt>,
88
- # <tt>:months</tt>, <tt>:weeks</tt>, <tt>:days</tt>, <tt>:hours</tt>,
89
- # <tt>:minutes</tt>, <tt>:seconds</tt>.
90
- def advance(options)
91
- unless options[:weeks].nil?
92
- options[:weeks], partial_weeks = options[:weeks].divmod(1)
93
- options[:days] = (options[:days] || 0) + 7 * partial_weeks
94
- end
95
-
96
- unless options[:days].nil?
97
- options[:days], partial_days = options[:days].divmod(1)
98
- options[:hours] = (options[:hours] || 0) + 24 * partial_days
99
- end
100
-
101
- d = to_date.advance(options)
102
- time_advanced_by_date = change(:year => d.year, :month => d.month, :day => d.day)
103
- seconds_to_advance = (options[:seconds] || 0) + (options[:minutes] || 0) * 60 + (options[:hours] || 0) * 3600
104
- seconds_to_advance == 0 ? time_advanced_by_date : time_advanced_by_date.since(seconds_to_advance)
105
- end
106
-
107
- # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension
108
- def ago(seconds)
109
- since(-seconds)
110
- end
111
-
112
- # Returns a new Time representing the time a number of seconds since the instance time
113
- def since(seconds)
114
- self + seconds
115
- rescue
116
- to_datetime.since(seconds)
117
- end
118
- alias :in :since
119
-
120
- # Returns a new Time representing the time a number of specified weeks ago.
121
- def weeks_ago(weeks)
122
- advance(:weeks => -weeks)
123
- end
124
-
125
- # Returns a new Time representing the time a number of specified months ago
126
- def months_ago(months)
127
- advance(:months => -months)
128
- end
129
-
130
- # Returns a new Time representing the time a number of specified months in the future
131
- def months_since(months)
132
- advance(:months => months)
133
- end
134
-
135
- # Returns a new Time representing the time a number of specified years ago
136
- def years_ago(years)
137
- advance(:years => -years)
138
- end
139
-
140
- # Returns a new Time representing the time a number of specified years in the future
141
- def years_since(years)
142
- advance(:years => years)
143
- end
144
-
145
- # Short-hand for years_ago(1)
146
- def prev_year
147
- years_ago(1)
148
- end
149
-
150
- # Short-hand for years_since(1)
151
- def next_year
152
- years_since(1)
153
- end
154
-
155
- # Short-hand for months_ago(1)
156
- def prev_month
157
- months_ago(1)
158
- end
159
-
160
- # Short-hand for months_since(1)
161
- def next_month
162
- months_since(1)
163
- end
164
-
165
- # Returns number of days to start of this week, week starts on start_day (default is :monday).
166
- def days_to_week_start(start_day = :monday)
167
- start_day_number = DAYS_INTO_WEEK[start_day]
168
- current_day_number = wday != 0 ? wday - 1 : 6
169
- days_span = current_day_number - start_day_number
170
- days_span >= 0 ? days_span : 7 + days_span
171
- end
172
-
173
- # Returns a new Time representing the "start" of this week, week starts on start_day (default is :monday, i.e. Monday, 0:00).
174
- def beginning_of_week(start_day = :monday)
175
- days_to_start = days_to_week_start(start_day)
176
- (self - days_to_start.days).midnight
177
- end
178
- alias :at_beginning_of_week :beginning_of_week
179
-
180
- # Returns a new +Date+/+DateTime+ representing the start of this week. Week is
181
- # assumed to start on a Monday. +DateTime+ objects have their time set to 0:00.
182
- def monday
183
- beginning_of_week
184
- end
185
-
186
- # Returns a new Time representing the end of this week, week starts on start_day (default is :monday, i.e. end of Sunday).
187
- def end_of_week(start_day = :monday)
188
- days_to_end = 6 - days_to_week_start(start_day)
189
- (self + days_to_end.days).end_of_day
190
- end
191
- alias :at_end_of_week :end_of_week
192
-
193
- # Returns a new +Date+/+DateTime+ representing the end of this week. Week is
194
- # assumed to start on a Monday. +DateTime+ objects have their time set to 23:59:59.
195
- def sunday
196
- end_of_week
197
- end
198
-
199
- # Returns a new Time representing the start of the given day in the previous week (default is :monday).
200
- def prev_week(day = :monday)
201
- ago(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour => 0)
202
- end
203
-
204
- # Returns a new Time representing the start of the given day in next week (default is :monday).
205
- def next_week(day = :monday)
206
- since(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour => 0)
207
- end
208
-
209
- # Returns a new Time representing the start of the day (0:00)
210
- def beginning_of_day
211
- #(self - seconds_since_midnight).change(:usec => 0)
212
- change(:hour => 0)
213
- end
214
- alias :midnight :beginning_of_day
215
- alias :at_midnight :beginning_of_day
216
- alias :at_beginning_of_day :beginning_of_day
217
-
218
- # Returns a new Time representing the end of the day, 23:59:59.999999 (.999999999 in ruby1.9)
219
- def end_of_day
220
- change(:hour => 23, :min => 59, :sec => 59, :usec => 999999.999)
221
- end
222
-
223
- # Returns a new Time representing the start of the hour (x:00)
224
- def beginning_of_hour
225
- change(:min => 0)
226
- end
227
- alias :at_beginning_of_hour :beginning_of_hour
228
-
229
- # Returns a new Time representing the end of the hour, x:59:59.999999 (.999999999 in ruby1.9)
230
- def end_of_hour
231
- change(
232
- :min => 59,
233
- :sec => 59,
234
- :usec => 999999.999
235
- )
236
- end
237
-
238
- # Returns a new Time representing the start of the month (1st of the month, 0:00)
239
- def beginning_of_month
240
- #self - ((self.mday-1).days + self.seconds_since_midnight)
241
- change(:day => 1, :hour => 0)
242
- end
243
- alias :at_beginning_of_month :beginning_of_month
244
-
245
- # Returns a new Time representing the end of the month (end of the last day of the month)
246
- def end_of_month
247
- #self - ((self.mday-1).days + self.seconds_since_midnight)
248
- last_day = ::Time.days_in_month(month, year)
249
- change(:day => last_day, :hour => 23, :min => 59, :sec => 59, :usec => 999999.999)
250
- end
251
- alias :at_end_of_month :end_of_month
252
-
253
- # Returns a new Time representing the start of the quarter (1st of january, april, july, october, 0:00)
254
- def beginning_of_quarter
255
- beginning_of_month.change(:month => [10, 7, 4, 1].detect { |m| m <= month })
256
- end
257
- alias :at_beginning_of_quarter :beginning_of_quarter
258
-
259
- # Returns a new Time representing the end of the quarter (end of the last day of march, june, september, december)
260
- def end_of_quarter
261
- beginning_of_month.change(:month => [3, 6, 9, 12].detect { |m| m >= month }).end_of_month
262
- end
263
- alias :at_end_of_quarter :end_of_quarter
264
-
265
- # Returns a new Time representing the start of the year (1st of january, 0:00)
266
- def beginning_of_year
267
- change(:month => 1, :day => 1, :hour => 0)
268
- end
269
- alias :at_beginning_of_year :beginning_of_year
270
-
271
- # Returns a new Time representing the end of the year (end of the 31st of december)
272
- def end_of_year
273
- change(:month => 12, :day => 31, :hour => 23, :min => 59, :sec => 59, :usec => 999999.999)
274
- end
275
- alias :at_end_of_year :end_of_year
276
-
277
- # Convenience method which returns a new Time representing the time 1 day ago
278
- def yesterday
279
- advance(:days => -1)
280
- end
281
-
282
- # Convenience method which returns a new Time representing the time 1 day since the instance time
283
- def tomorrow
284
- advance(:days => 1)
285
- end
286
-
287
- # Returns a Range representing the whole day of the current time.
288
- def all_day
289
- beginning_of_day..end_of_day
290
- end
291
-
292
- # Returns a Range representing the whole week of the current time. Week starts on start_day (default is :monday, i.e. end of Sunday).
293
- def all_week(start_day = :monday)
294
- beginning_of_week(start_day)..end_of_week(start_day)
295
- end
296
-
297
- # Returns a Range representing the whole month of the current time.
298
- def all_month
299
- beginning_of_month..end_of_month
300
- end
301
-
302
- # Returns a Range representing the whole quarter of the current time.
303
- def all_quarter
304
- beginning_of_quarter..end_of_quarter
305
- end
306
-
307
- # Returns a Range representing the whole year of the current time.
308
- def all_year
309
- beginning_of_year..end_of_year
310
- end
311
-
312
- def plus_with_duration(other) #:nodoc:
313
- if ActiveSupport::Duration === other
314
- other.since(self)
315
- else
316
- plus_without_duration(other)
317
- end
318
- end
319
- alias_method :plus_without_duration, :+
320
- alias_method :+, :plus_with_duration
321
-
322
- def minus_with_duration(other) #:nodoc:
323
- if ActiveSupport::Duration === other
324
- other.until(self)
325
- else
326
- minus_without_duration(other)
327
- end
328
- end
329
- alias_method :minus_without_duration, :-
330
- alias_method :-, :minus_with_duration
331
-
332
- # Time#- can also be used to determine the number of seconds between two Time instances.
333
- # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances
334
- # are coerced into values that Time#- will recognize
335
- def minus_with_coercion(other)
336
- other = other.comparable_time if other.respond_to?(:comparable_time)
337
- other.is_a?(DateTime) ? to_f - other.to_f : minus_without_coercion(other)
338
- end
339
- alias_method :minus_without_coercion, :-
340
- alias_method :-, :minus_with_coercion
341
-
342
- # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances
343
- # can be chronologically compared with a Time
344
- def compare_with_coercion(other)
345
- # we're avoiding Time#to_datetime cause it's expensive
346
- other.is_a?(Time) ? compare_without_coercion(other.to_time) : to_datetime <=> other
347
- end
348
- alias_method :compare_without_coercion, :<=>
349
- alias_method :<=>, :compare_with_coercion
350
-
351
- # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances
352
- # can be eql? to an equivalent Time
353
- def eql_with_coercion(other)
354
- # if other is an ActiveSupport::TimeWithZone, coerce a Time instance from it so we can do eql? comparison
355
- other = other.comparable_time if other.respond_to?(:comparable_time)
356
- eql_without_coercion(other)
357
- end
358
- alias_method :eql_without_coercion, :eql?
359
- alias_method :eql?, :eql_with_coercion
360
- end