by_star 2.1.0.beta2 → 2.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/.gitignore +5 -4
  2. data/.travis.yml +35 -25
  3. data/CHANGELOG.md +21 -0
  4. data/Gemfile +25 -4
  5. data/MIT-LICENSE +20 -20
  6. data/{README.markdown → README.md} +414 -348
  7. data/Rakefile +18 -2
  8. data/UPGRADING +10 -0
  9. data/by_star.gemspec +32 -31
  10. data/cleaner.rb +24 -24
  11. data/lib/by_star.rb +15 -71
  12. data/lib/by_star/base.rb +53 -0
  13. data/lib/by_star/between.rb +80 -0
  14. data/lib/by_star/directional.rb +21 -0
  15. data/lib/by_star/kernel.rb +41 -0
  16. data/lib/by_star/normalization.rb +118 -0
  17. data/lib/by_star/orm/active_record/by_star.rb +52 -0
  18. data/lib/by_star/orm/mongoid/by_star.rb +59 -0
  19. data/lib/by_star/version.rb +3 -3
  20. data/spec/database.yml +15 -15
  21. data/spec/fixtures/active_record/models.rb +6 -13
  22. data/spec/fixtures/active_record/schema.rb +11 -36
  23. data/spec/fixtures/mongoid/models.rb +15 -65
  24. data/spec/fixtures/shared/seeds.rb +16 -35
  25. data/spec/integration/active_record/active_record_spec.rb +50 -0
  26. data/spec/integration/mongoid/mongoid_spec.rb +43 -0
  27. data/spec/integration/shared/by_calendar_month.rb +55 -0
  28. data/spec/integration/shared/by_day.rb +84 -0
  29. data/spec/integration/shared/by_direction.rb +55 -0
  30. data/spec/integration/shared/by_fortnight.rb +48 -0
  31. data/spec/integration/shared/by_month.rb +50 -0
  32. data/spec/integration/shared/by_quarter.rb +49 -0
  33. data/spec/integration/shared/by_week.rb +54 -0
  34. data/spec/integration/shared/by_weekend.rb +49 -0
  35. data/spec/integration/shared/by_year.rb +48 -0
  36. data/spec/integration/shared/offset_parameter.rb +31 -0
  37. data/spec/spec_helper.rb +29 -35
  38. data/spec/unit/kernel_time_spec.rb +57 -0
  39. data/spec/unit/normalization_spec.rb +255 -0
  40. metadata +131 -56
  41. data/Gemfile.lock +0 -94
  42. data/lib/by_star/by_day.rb +0 -34
  43. data/lib/by_star/by_direction.rb +0 -52
  44. data/lib/by_star/by_fortnight.rb +0 -58
  45. data/lib/by_star/by_month.rb +0 -47
  46. data/lib/by_star/by_quarter.rb +0 -32
  47. data/lib/by_star/by_week.rb +0 -32
  48. data/lib/by_star/by_weekend.rb +0 -20
  49. data/lib/by_star/by_year.rb +0 -62
  50. data/lib/by_star/instance_methods.rb +0 -13
  51. data/lib/by_star/time_ext.rb +0 -21
  52. data/lib/mongoid/by_star.rb +0 -83
  53. data/spec/by_star/active_record/active_record_spec.rb +0 -50
  54. data/spec/by_star/mongoid/mongoid_spec.rb +0 -44
  55. data/spec/by_star/shared/by_day.rb +0 -62
  56. data/spec/by_star/shared/by_direction.rb +0 -85
  57. data/spec/by_star/shared/by_fortnight.rb +0 -47
  58. data/spec/by_star/shared/by_month.rb +0 -109
  59. data/spec/by_star/shared/by_quarter.rb +0 -33
  60. data/spec/by_star/shared/by_week.rb +0 -41
  61. data/spec/by_star/shared/by_weekend.rb +0 -13
  62. data/spec/by_star/shared/by_year.rb +0 -54
  63. data/spec/time_ext_spec.rb +0 -10
@@ -1,10 +0,0 @@
1
- require 'spec_helper'
2
- describe Time do
3
- it "should work out the beginning of a weekend (Friday 3pm)" do
4
- Time.now.beginning_of_weekend.strftime("%A %I:%M%p").should eql("Friday 03:00PM")
5
- end
6
-
7
- it "should work out the end of a weekend (Monday 3am)" do
8
- Time.now.end_of_weekend.strftime("%A %I:%M%p").should eql("Monday 03:00AM")
9
- end
10
- end