wagons 0.4.8 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +5 -5
  2. data/README.rdoc +22 -23
  3. data/Rakefile +10 -1
  4. data/lib/tasks/wagons.rake +11 -3
  5. data/lib/wagons/extensions/application.rb +2 -1
  6. data/lib/wagons/extensions/migration.rb +18 -5
  7. data/lib/wagons/extensions/require_optional.rb +1 -1
  8. data/lib/wagons/version.rb +1 -1
  9. data/lib/wagons/wagon.rb +15 -5
  10. data/test/ci/{rails32.gemfile → rails42.gemfile} +2 -1
  11. data/test/ci/rails42.gemfile.lock +127 -0
  12. data/test/ci/{rails40.gemfile → rails50.gemfile} +2 -1
  13. data/test/ci/rails50.gemfile.lock +134 -0
  14. data/test/dummy/Gemfile +3 -0
  15. data/test/dummy/Gemfile.lock +121 -95
  16. data/test/dummy/db/development.sqlite3 +0 -0
  17. data/test/dummy/db/migrate/20120606125104_create_people.rb +2 -1
  18. data/test/dummy/db/test.sqlite3 +0 -0
  19. data/test/dummy/log/development.log +1751 -1400
  20. data/test/dummy/log/test.log +21032 -40895
  21. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  22. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  23. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  24. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  25. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  26. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  27. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3O/3Ozj42ApBuxlOFClnLVzPTVANpal8rRTgimRskqSu9A.cache +0 -0
  28. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5W/5WPVRZEWijO8sFv_O-ybW9H-kPX4jTLA4TtBOPOHZHY.cache +1 -0
  29. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5X/5X8IJB_AePrJJ7-ivQe6Yx-9yVIbWIUJC09sn8gks4Q.cache +1 -0
  30. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7-/7-7HtSWxaVCNztU-cQOVQrmV8cwfTWN3P7Nn1N4zLl8.cache +0 -0
  31. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9A/9Ac7xpxkR5dsc26NWay0KUhoujg2SWVdUUt7fy2jVmY.cache +1 -0
  32. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9h/9h_QDxrjvEr932ffxkSXmueH8Tu6UklyqXTNpJodMYs.cache +0 -0
  33. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/Fw9pwnM3h_BU06vzbayrirtvOPvafBpDntUrVWweiJU.cache → sprockets/v3.0/Aw/Aw-GclqWrASyDZSt9V30TCC54ya0oOtqJ1LfYA6BHvo.cache} +0 -0
  34. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Bb/BblMwl-MfVx0NRaTrU_z4bB5ThvZmtL_td9c5J0rgvk.cache +1 -0
  35. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/N5F3Vj7Q0Rnf4yF3FuckBe127oo5Tlkxs0m_gFEz6ic.cache → sprockets/v3.0/CD/CDHhnf8bkBWd8u0KBaP9gj19-N1X3PEgOnLoSRs9BV4.cache} +0 -0
  36. data/test/dummy/tmp/cache/assets/sprockets/v3.0/D7/D7oB91vLIuIoXc3ze5hI3FZ2Azs-y2rR5pn1CqjIhFA.cache +1 -0
  37. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Db/DbmLC3wtG7ztEvkzmVAubW8vf37XdD0bT3Kh73oed1A.cache +0 -0
  38. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Dj/DjkHbsFWfFxtOZDqBBBEpBoTBHnf0HmmzyyuC494kTA.cache +0 -0
  39. data/test/dummy/tmp/cache/assets/sprockets/v3.0/EG/EGkthgx-3ERWu46T56D_TqB-C7MGNJfssrSACFRieiY.cache +1 -0
  40. data/test/dummy/tmp/cache/assets/sprockets/v3.0/EU/EUOMl2HxcsTkkg-UHgKplu6l1Au78s8-lO6FtuSHeGM.cache +1 -0
  41. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ek/EkvEjR75Ft3eI70y5FqqVZ2oFzgz2qYhcI8pE1Gi2Gs.cache +1 -0
  42. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/J17-1cw4l8J1sJphj0egt3Or377G81YyXyN5bPYYa-s.cache → sprockets/v3.0/IY/IYA0wigyrlL1DR6nSvOL0gdfU5RMPrHjgyrFuZr3afQ.cache} +0 -0
  43. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/2lwT75Cg7x5Vd67ZbwVQvC4kTNZFdEQ6kto1rMNLUDw.cache → sprockets/v3.0/K4/K4rNS0j9bLKG6ti_i3DYpV0_TH3Lvb4PLfT8vjqiQFQ.cache} +0 -0
  44. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Tg/TgTcVvqf5KTGti25aDSVdPzdEFSzFCA7TIgv36nVcSw.cache +0 -0
  45. data/test/dummy/tmp/cache/assets/sprockets/v3.0/UA/UAXjZVRyzvA00I4VRwLgJlGYuhHv-JLQPorF9L84a0M.cache +1 -0
  46. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vd/VdB3rRyqaY-iuOEWJV9Uehypi9JZAGBx5zZqDGJlJ20.cache +0 -0
  47. data/test/dummy/tmp/cache/assets/sprockets/v3.0/X3/X3m0ICdQsAzAjT__yuU_b7JmB5XR3Q9je_4Jz8pq7V8.cache +0 -0
  48. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZP/ZPBWrOLDOu-NpS--iHhBJvOJCAB_8RSFHk8uVEu-FhQ.cache +1 -0
  49. data/test/dummy/tmp/cache/assets/sprockets/v3.0/aR/aRHoU0w2GWt4Ed-_Fd4LcznUXPpuh5UkZgpTuH4gtFE.cache +1 -0
  50. data/test/dummy/tmp/cache/assets/sprockets/v3.0/af/afFutPcjXtaGD8YXvbW166-XZwPm1npBJiwynk9zcx4.cache +1 -0
  51. data/test/dummy/tmp/cache/assets/sprockets/v3.0/b5/b5XAYmcWnIrTHCYZOsIhoOzChIUkyDjE83FS__vxBPA.cache +0 -0
  52. data/test/dummy/tmp/cache/assets/sprockets/v3.0/b7/b7lBpkBxQaCxHBBRf-QF0CiQKnRE8kYGLUzgAPTjf_k.cache +0 -0
  53. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bk/bk7kxHlQj_KqeERAr_oZmXi1dL8ExD0kE_8zqRblRZU.cache +1 -0
  54. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ga/ga3GH-sLwI6OFNGwKt6aRfATJ22Hb5V9fwDnIIVfMAw.cache +0 -0
  55. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/Ju_Em909fs1FMMXDugQpdPt2CMvXMDc6525ONXahQMA.cache → sprockets/v3.0/hF/hFagey905AkQKzK-LgKZYz5uwkRfZlbFneB5sfyatVY.cache} +0 -0
  56. data/test/dummy/tmp/cache/assets/sprockets/v3.0/l_/l_tJ9WwBL9Q8XjxQN56nGuGtCrP7kGBvE8e76g8tRC0.cache +0 -0
  57. data/test/dummy/tmp/cache/assets/sprockets/v3.0/le/leHzMzAXsEKyvlJmOgHaYZ-LZscYXOrZ1iyhcZZpAnQ.cache +0 -0
  58. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lg/lgbAXqTVV0csF3CIFI-LOii9PZgGNIt2bkma5Kr6H9s.cache +1 -0
  59. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/1N0pl9TchBaOQaF0AhTeP9aBkz8wt6q_3m0RgBkDhgM.cache → sprockets/v3.0/oK/oKdQTNFghQL76Znos_5Gl3zKlJvXmlVGyjG94JGm9fE.cache} +0 -0
  60. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qf/qfAcVVR58gpd7pbe9fsHRvbhUBNzQiliZc_5-L3jzAs.cache +1 -0
  61. data/test/dummy/tmp/cache/assets/sprockets/v3.0/r1/r134k3FIZRxf-MmM1f9AtnHuazK-sDzIauS290hG88U.cache +0 -0
  62. data/test/dummy/tmp/cache/assets/{test/sprockets/v3.0/9nyywgMCbjp3eG-6Of9h7utciGQIfxrBzGQ0-an_sbw.cache → sprockets/v3.0/r2/r2_nJSrpIqAYxlSHNCf7WM3S0Wd4wJFZtygBkx2-bFQ.cache} +0 -0
  63. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ts/tsjGobLze0DF5HAz7vSBSTkY70PKcceQmRDq2LCagDM.cache +0 -0
  64. data/test/dummy/tmp/cache/assets/sprockets/v3.0/w8/w88Enmk002DS__R9VXL3zF4wYSM2ZY7WSPEhEAl9_bQ.cache +0 -0
  65. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xA/xA6u7RVgjpfnN-LOSPa64Jy_vOtlVpYU5KhC97sh8js.cache +0 -0
  66. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yQ/yQaMtLns38LF8M5TPwGJjY13IqTjGFTtvUM8dl_OLhs.cache +1 -0
  67. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  68. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  69. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  70. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  71. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  72. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  73. data/test/dummy/vendor/wagons/superliner/Gemfile.lock +116 -90
  74. data/test/dummy/vendor/wagons/superliner/db/migrate/20120606125058_create_cities.rb +2 -1
  75. data/test/dummy/vendor/wagons/superliner/test/controllers/people_controller_test.rb +6 -6
  76. data/test/wagons_installer_test.rb +18 -18
  77. metadata +171 -143
  78. data/test/ci/rails32.gemfile.lock +0 -108
  79. data/test/ci/rails40.gemfile.lock +0 -101
  80. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/8KMSB4nULx3HD4OIvwhzZl0WGf7xAUtFneCeyIXuZmM.cache +0 -1
  81. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/A8jDhJxSHDAuo_zFvLiqtHV1q85gikrZIflYohzOGYQ.cache +0 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DbmLC3wtG7ztEvkzmVAubW8vf37XdD0bT3Kh73oed1A.cache +0 -2
  83. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DxStlU_WNi_56hoHpYamDxaV_MrDbLLfwWUHPD6pBOY.cache +0 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GDkqmAIbFW1xtiIWw3goyQZZ-lyGtj2AN4USqOjypu0.cache +0 -3
  85. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/HHh-VH_N4dbzT_z1SG0Q_9DfE_t-uUYY19gWI66mw5A.cache +0 -3
  86. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IJamKeUVR7OeXqDs0_7085gJwwheZ1nBh693j3oZYRs.cache +0 -2
  87. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IgzTqUXqni79z21VpjTJTXo-3NDS71UnIWt33_B7trk.cache +0 -1
  88. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KPXhN4fOVXSTJHCN65wHc7uZfC6sjYt8DlXdJ7rSNyk.cache +0 -1
  89. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/M6CLZDog67Unvr3QX-4aePu9nSfzQ5a81IbTRqrBZuE.cache +0 -2
  90. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Qh-PTAy0TWtEDwCfYSzUJDJSj8JKM3I1TI9ROTVOCx0.cache +0 -1
  91. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Rbwsp3nlV3YlAGjcRaZCI66GW-NTiPeftUul2HhSVN0.cache +0 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TgTcVvqf5KTGti25aDSVdPzdEFSzFCA7TIgv36nVcSw.cache +0 -3
  93. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/V5f0ylSlfsr_kU3dCzY7myOLB6Ta8d1oEfTxFnYSngc.cache +0 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/W_kV5jdSA0o0ax0Qx8x_uZ7DnEaA5iPzsPCyUrog7c4.cache +0 -1
  95. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/b7lBpkBxQaCxHBBRf-QF0CiQKnRE8kYGLUzgAPTjf_k.cache +0 -3
  96. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ewpJ8lPdGhtzlEL7X_FnafKY7Md-EjYoWicLlhGoDW4.cache +0 -1
  97. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fFhUtKUnI1qwA2ci6aNshI6k45g1zeJNK4fKJwUwf-4.cache +0 -1
  98. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kM91Vu2ioELErj7VdB8xXpKEh2IVT0-0fqyWswvw75o.cache +0 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/l_tJ9WwBL9Q8XjxQN56nGuGtCrP7kGBvE8e76g8tRC0.cache +0 -2
  100. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nYsiXzpgr13IN7stPoSJb4D8Kpya2liQkKBIUZ3Yb-Q.cache +0 -1
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/q1BFcF4m7Fh2TqwEZioRz5opSgGQGEbr_UWQIDs442U.cache +0 -1
  102. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tWU60Um-QUw6vr_POtxrJDo8OCEZgFF5TsQWkTZdOQA.cache +0 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/umHl2-IS9hns60Oq24M_KecepNV1A1wVPxwQwv9B30o.cache +0 -2
  104. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yvHPdWsvfKDfou_ZskLF6Cv5uc2W-xuCt7byJblOeRU.cache +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0b6c8cb21326db0821afc717b112c85a4a1e73d5
4
- data.tar.gz: 136bbe1dccb094e74c6edc7ebec433531c16cd62
2
+ SHA256:
3
+ metadata.gz: 77ad6e032983bebf58125a39ac88e3979933ce023f4d764de8f4c5e0481a7408
4
+ data.tar.gz: 9d43e8b0c92ea4eecb432a5ffba1c4b975e59af87e8b0a9147337c33747a2ec8
5
5
  SHA512:
6
- metadata.gz: 76ab5f4966bc17a5a91fdf6cb66d1855a881fc8695f481288430f7f932361e252c6ac2679b2f584acd31fecd4c914446dbc2eebd3d0923ca59a7808c6ed0c830
7
- data.tar.gz: 5eec41373b65fe5fd34844d06861d218d296545ab4b16b444c19f837fb2c169a5333f9f8d4ad0e08f8a9fec2dc0c1be1e2e51db75eaa639499970f55a1547d4e
6
+ metadata.gz: 1d5fd33f45e525195cd60b3ad0cadc279801400f2c9ea7698cf57a2652015d74aabd8519e9c800374483127c9e4978258964229472676241a83c51447e5832e6
7
+ data.tar.gz: 874710b14255e36237d347c279317c29e0245d82247b1cc3c5fff080781d97e544d8e32bf5ec5cd40d87d3423c0870592117eb99aa4310c0533b2070647e1a1a
@@ -1,11 +1,13 @@
1
1
  = Here Be Wagons
2
2
 
3
- Wagons are extensions to your application train running on Rails. You can see them as plugins that
4
- extend the behavior of your specific Rails application. This framework makes it easy to create and
3
+ {<img src="https://secure.travis-ci.org/codez/wagons.png" />}[http://travis-ci.org/codez/wagons]
4
+
5
+ Wagons are extensions to your application train running on Rails. You can see them as plugins that
6
+ extend the behavior of your specific Rails application. This framework makes it easy to create and
5
7
  manage them.
6
8
 
7
- First of all, wagons are basically {Rails Engines}[http://api.rubyonrails.org/classes/Rails/Engine.html],
8
- so make sure you are familiar with them. Wagons provide a handful of additions so your wagon
9
+ First of all, wagons are basically {Rails Engines}[http://api.rubyonrails.org/classes/Rails/Engine.html],
10
+ so make sure you are familiar with them. Wagons provide a handful of additions so your wagon
9
11
  engines actually know your application.
10
12
 
11
13
  Wagons differ from engines in a few points:
@@ -28,15 +30,15 @@ This creates the structure of your wagon in <tt>vendor/wagons/[name]</tt>. In th
28
30
  which defines the <tt>Rails::Engine</tt> and includes the +Wagon+ module. Here, you may also extend your application
29
31
  classes in a +config.to_prepare+ block.
30
32
 
31
- In order to load wagons with the application, an entry in the +Gemfile+ would be sufficient.
33
+ In order to load wagons with the application, an entry in the +Gemfile+ would be sufficient.
32
34
  To keep things flexible, wagons come with an additional file +Wagonfile+. Generate one for development purposes with:
33
35
 
34
36
  rake wagon:file
35
37
 
36
- This will include all wagons found in +vendor/wagons+ in development mode.
38
+ This will include all wagons found in +vendor/wagons+ in development mode.
37
39
  Do not check +Wagonfile+ into source control. In your deployments, you might want to have different entries in there.
38
40
 
39
- Once your wagon is ready to ship, a gem can be built with <tt>rake build</tt>. The name of a wagon gem must always start
41
+ Once your wagon is ready to ship, a gem can be built with <tt>rake build</tt>. The name of a wagon gem must always start
40
42
  with the application name, followed with an underscore and the actual name of the wagon. In production, you may
41
43
  simply install the wagon gem and explicitly add a declaration to your +Wagonfile+.
42
44
 
@@ -54,7 +56,7 @@ Ruby and Rails provide all the magic required to extend your application from wi
54
56
 
55
57
  To add new models, controllers or views, simply create them in the +app+ directory of your wagon, as you would in a regular engine.
56
58
 
57
- To extend existing models and controllers, you may create modules with the required functionality.
59
+ To extend existing models and controllers, you may create modules with the required functionality.
58
60
  Include them into your application classes in a +config.to_prepare+ block in <tt>lib/[wagon_name]/wagon.rb</tt>.
59
61
 
60
62
  To extend views, wagons provides a simple view helper that looks for partials in all view paths. Any template that
@@ -68,7 +70,7 @@ Any partials living in an equally named subfolder as the calling template and st
68
70
  == Wagon dependencies
69
71
 
70
72
  Wagons may depend on each other and/or have certain requirements on their load order. To make sure something
71
- is loaded before the current wagon, add a <tt>require '[app_name]_[other_wagon]'</tt> on top of the
73
+ is loaded before the current wagon, add a <tt>require '[app_name]_[other_wagon]'</tt> on top of the
72
74
  <tt>lib/[app_name]_[current_wagon].rb</tt> file. For development dependencies, there is an extra +require_optional+
73
75
  method that will not raise a +LoadError+ if the dependency is not found.
74
76
 
@@ -90,7 +92,7 @@ The syntax follows the Ruby gem version and requirements.
90
92
  Wagons integrates {Seed Fu}[https://github.com/mbleigh/seed-fu] for seed data. All seed data from the application
91
93
  is also available in wagon tests, as long as no fixture files overwrite the corresponding tables.
92
94
 
93
- Wagons may come with their own seed data as well. Simply put it into <tt>db/fixtures[/environment]</tt>. To allow for
95
+ Wagons may come with their own seed data as well. Simply put it into <tt>db/fixtures[/environment]</tt>. To allow for
94
96
  an automatic removal of wagons, {Seed Fu-ndo}[https://github.com/codez/seed-fu-ndo] is able to record
95
97
  seed file instructions and destroy all entries that exist in the database. Just make sure that you only use
96
98
  the +seed+ and +seed_once+ methods in these files, or the unseed may not work correctly.
@@ -102,24 +104,24 @@ There are a few other things that work differently with wagons:
102
104
 
103
105
  === Schema & Migrations
104
106
 
105
- Wagons are extensions to your application that may vary between various installations. Wagon tables are added
106
- and removed as wagons are installed or uninstalled. After you have added a wagon's gem to your production
107
- +Wagonfile+, run <tt>rake wagon:setup</tt> to run the migrations and load the seed data. Before you remove them
107
+ Wagons are extensions to your application that may vary between various installations. Wagon tables are added
108
+ and removed as wagons are installed or uninstalled. After you have added a wagon's gem to your production
109
+ +Wagonfile+, run <tt>rake wagon:setup</tt> to run the migrations and load the seed data. Before you remove them
108
110
  from +Wagonfile+, run <tt>rake wagon:remove WAGON=to_remove</tt> to eliminate the artifacts from the database first.
109
111
 
110
- In this way, the +schema.rb+ file must only contain the tables of the application, not of all wagons.
111
- When you have migrations for your main application and wagons loaded, the schema will not be dumped on
112
+ In this way, the +schema.rb+ file must only contain the tables of the application, not of all wagons.
113
+ When you have migrations for your main application and wagons loaded, the schema will not be dumped on
112
114
  <tt>db:migrate</tt>. You need to either remove the wagons or reset the database before the schema may be dumped.
113
115
  This is (currently) the cost for having arbitrary pluggable application extensions.
114
116
 
115
117
  === Tests
116
118
 
117
119
  Wagons use your application for tests. This is also true for your application's test database. To get the
118
- correct setup, <tt>app:db:test:prepare</tt> is extended to run the migration of the current wagon and all its
120
+ correct setup, <tt>app:db:test:prepare</tt> is extended to run the migration of the current wagon and all its
119
121
  dependencies, as well as their seed data. Once the database is set up, single tests may be run with
120
122
  the usual <tt>ruby -I test test/my_test.rb</tt> command.
121
123
 
122
- The +test_helper.rb+ of the main application is included in all wagon tests. Any additions in
124
+ The +test_helper.rb+ of the main application is included in all wagon tests. Any additions in
123
125
  this file are available in wagon tests as well. The only thing wagons need to do is reseting the
124
126
  fixture path to the wagon's test fixtures.
125
127
 
@@ -136,12 +138,9 @@ the same as for the application. <tt>rake wagon:bundle:update</tt> is here to he
136
138
  We recommend to NOT check in the Wagon's <tt>Gemfile.lock</tt> file into source control.
137
139
 
138
140
  Unfortunately, adding wagon gems to the +Wagonfile+ in production also breaks with Bundler's approach
139
- of locking down application gems. Because of that, the <tt>--deployment</tt> option cannot be used
141
+ of locking down application gems. Because of that, the <tt>--deployment</tt> option cannot be used
140
142
  with wagons. If you install your gems from <tt>vendor/cache</tt> into <tt>vendor/bundle</tt> or so,
141
- you still get most of the benefits of using Bundler, including the guarantee for the very same gem
143
+ you still get most of the benefits of using Bundler, including the guarantee for the very same gem
142
144
  versions as used in development.
143
145
 
144
- Contributions to this or any other issues are very welcome.
145
-
146
-
147
- {<img src="https://secure.travis-ci.org/codez/wagons.png" />}[http://travis-ci.org/codez/wagons]
146
+ Contributions to this or any other issues are very welcome.
data/Rakefile CHANGED
@@ -38,7 +38,16 @@ task :test => :set_rails_version do
38
38
 
39
39
  begin
40
40
  in_dummy 'rm -rf Gemfile.lock'
41
- in_dummy 'rails g wagon test_wagon'
41
+ if ENV['ROOT_BUNDLE_PATH'] # used by travis-ci
42
+ in_dummy 'mkdir -p .bundle'
43
+ in_dummy 'echo "---\nBUNDLE_PATH: \"$ROOT_BUNDLE_PATH\"\n" > .bundle/config'
44
+ in_dummy 'cat .bundle/config'
45
+ in_dummy 'mkdir -p vendor/wagons/test_wagon/.bundle'
46
+ in_dummy 'echo -e "---\nBUNDLE_PATH: \"$ROOT_BUNDLE_PATH\"\n" > vendor/wagons/test_wagon/.bundle/config'
47
+ in_dummy 'mkdir -p vendor/wagons/superliner/.bundle'
48
+ in_dummy 'echo -e "---\nBUNDLE_PATH: \"$ROOT_BUNDLE_PATH\"\n" > vendor/wagons/superliner/.bundle/config'
49
+ end
50
+ in_dummy 'bundle exec rails g wagon test_wagon'
42
51
  in_dummy 'bundle exec rake wagon:bundle:update'
43
52
  in_dummy "bundle exec rake db:migrate test #{'-t' if Rake.application.options.trace}"
44
53
  in_dummy "bundle exec rake wagon:test #{'-t' if Rake.application.options.trace}"
@@ -180,9 +180,17 @@ namespace :db do
180
180
  Rake::Task[:'db:_dump'].clear_actions
181
181
 
182
182
  task :_dump do
183
- migrations = ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_paths)
184
- migrated = Set.new(ActiveRecord::Migrator.get_all_versions)
185
- if migrated.size > migrations.size
183
+ wagon_migrations =
184
+ if defined?(ActiveRecord::MigrationContext)
185
+ context = ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths)
186
+ migrated = Set.new(context.get_all_versions)
187
+ migrated.size > context.migrations.size
188
+ else
189
+ migrations = ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_paths)
190
+ migrated = Set.new(ActiveRecord::Migrator.get_all_versions)
191
+ migrated.size > migrations.size
192
+ end
193
+ if wagon_migrations
186
194
  puts "The database schema will not be dumped when there are loaded wagon migrations."
187
195
  puts "To dump the application schema, please 'rake wagon:remove WAGON=ALL' wagons beforehand or reset the database."
188
196
  else
@@ -15,7 +15,8 @@ module Rails
15
15
  end
16
16
  end
17
17
  end
18
- alias_method_chain :ordered_railties, :wagons
18
+ alias ordered_railties_without_wagons ordered_railties
19
+ alias ordered_railties ordered_railties_with_wagons
19
20
 
20
21
  private
21
22
 
@@ -13,7 +13,8 @@ module ActiveRecord
13
13
  end
14
14
  end
15
15
  end
16
- alias_method_chain :maintain_test_schema!, :wagons
16
+ alias maintain_test_schema_without_wagons! maintain_test_schema!
17
+ alias maintain_test_schema! maintain_test_schema_with_wagons!
17
18
 
18
19
  private
19
20
 
@@ -35,28 +36,40 @@ module ActiveRecord
35
36
  if Tasks::DatabaseTasks.respond_to?(:load_schema_for)
36
37
  Tasks::DatabaseTasks.load_schema_for(config)
37
38
  else
38
- Tasks::DatabaseTasks.load_schema
39
+ Tasks::DatabaseTasks.load_schema(config)
39
40
  end
40
41
  check_pending!
41
42
  end
42
43
 
43
44
  def app_needs_migration?
44
45
  Wagons.current_wagon ||
45
- defined_app_migration_versions != migration_versions_in_db
46
+ defined_app_migration_versions != migration_versions_in_db
46
47
  end
47
48
 
48
49
  def defined_app_migration_versions
49
- Migrator.migrations(Migrator.migrations_paths).collect(&:version).to_set
50
+ if defined?(MigrationContext)
51
+ migration_context.migrations.collect(&:version).to_set
52
+ else
53
+ Migrator.migrations(Migrator.migrations_paths).collect(&:version).to_set
54
+ end
50
55
  end
51
56
 
52
57
  def migration_versions_in_db
53
58
  if Base.connection.table_exists?(SchemaMigration.table_name)
54
- Migrator.get_all_versions.to_set
59
+ if defined?(MigrationContext)
60
+ migration_context.get_all_versions.to_set
61
+ else
62
+ Migrator.get_all_versions.to_set
63
+ end
55
64
  else
56
65
  [].to_set
57
66
  end
58
67
  end
59
68
 
69
+ def migration_context
70
+ MigrationContext.new(Migrator.migrations_paths)
71
+ end
72
+
60
73
  end
61
74
  end
62
75
  end
@@ -1,7 +1,7 @@
1
1
  class Object
2
2
  # Requires the specified argument but silently ignores any LoadErrors.
3
3
  def require_optional(*args)
4
- require *args
4
+ require(*args)
5
5
  rescue LoadError
6
6
  # that's fine, it's an optional require
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module Wagons
2
- VERSION = '0.4.8'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -59,12 +59,12 @@ module Wagons
59
59
 
60
60
  # Run the migrations.
61
61
  def migrate(version = nil)
62
- ActiveRecord::Migrator.migrate(migrations_paths, version)
62
+ migrate_to(version)
63
63
  end
64
64
 
65
65
  # Revert the migrations.
66
66
  def revert
67
- ActiveRecord::Migrator.migrate(migrations_paths, 0)
67
+ migrate_to(0)
68
68
  end
69
69
 
70
70
  # Load seed data in db/fixtures.
@@ -79,9 +79,7 @@ module Wagons
79
79
 
80
80
  # Hash of the seed models to their existing records.
81
81
  def existing_seeds
82
- silence_stream(STDOUT) do
83
- SeedFuNdo.existing_seeds seed_fixtures
84
- end
82
+ SeedFuNdo.existing_seeds seed_fixtures
85
83
  end
86
84
 
87
85
  # Loads the migrations and seeds of this wagon and its dependencies.
@@ -128,6 +126,18 @@ module Wagons
128
126
  ENV['NO_ENV'] ? [fixtures] : [fixtures, File.join(fixtures, Rails.env)]
129
127
  end
130
128
 
129
+ def migrate_to(version)
130
+ if defined?(ActiveRecord::MigrationContext)
131
+ migration_context.migrate(version)
132
+ else
133
+ ActiveRecord::Migrator.migrate(migrations_paths, version)
134
+ end
135
+ end
136
+
137
+ def migration_context
138
+ ActiveRecord::MigrationContext.new(migrations_paths)
139
+ end
140
+
131
141
  module ClassMethods
132
142
  # Get or set a version requirement for the main application.
133
143
  # Set the application version in config/initializers/wagon_app_version.rb.
@@ -2,10 +2,11 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec :path => '../..'
4
4
 
5
- gem 'rails', '~> 3.2.0'
5
+ gem 'rails', '~> 4.2.0'
6
6
 
7
7
  gem 'seed-fu-ndo', '>= 0.0.2'
8
8
 
9
9
  group :test do
10
10
  gem 'mocha', :require => false
11
+ gem 'rails-controller-testing'
11
12
  end
@@ -0,0 +1,127 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ wagons (0.4.8)
5
+ bundler (>= 1.1)
6
+ rails (>= 4.2)
7
+ seed-fu-ndo (>= 0.0.3)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionmailer (4.2.10)
13
+ actionpack (= 4.2.10)
14
+ actionview (= 4.2.10)
15
+ activejob (= 4.2.10)
16
+ mail (~> 2.5, >= 2.5.4)
17
+ rails-dom-testing (~> 1.0, >= 1.0.5)
18
+ actionpack (4.2.10)
19
+ actionview (= 4.2.10)
20
+ activesupport (= 4.2.10)
21
+ rack (~> 1.6)
22
+ rack-test (~> 0.6.2)
23
+ rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
25
+ actionview (4.2.10)
26
+ activesupport (= 4.2.10)
27
+ builder (~> 3.1)
28
+ erubis (~> 2.7.0)
29
+ rails-dom-testing (~> 1.0, >= 1.0.5)
30
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
31
+ activejob (4.2.10)
32
+ activesupport (= 4.2.10)
33
+ globalid (>= 0.3.0)
34
+ activemodel (4.2.10)
35
+ activesupport (= 4.2.10)
36
+ builder (~> 3.1)
37
+ activerecord (4.2.10)
38
+ activemodel (= 4.2.10)
39
+ activesupport (= 4.2.10)
40
+ arel (~> 6.0)
41
+ activesupport (4.2.10)
42
+ i18n (~> 0.7)
43
+ minitest (~> 5.1)
44
+ thread_safe (~> 0.3, >= 0.3.4)
45
+ tzinfo (~> 1.1)
46
+ arel (6.0.4)
47
+ builder (3.2.3)
48
+ concurrent-ruby (1.0.5)
49
+ crass (1.0.4)
50
+ erubis (2.7.0)
51
+ globalid (0.4.1)
52
+ activesupport (>= 4.2.0)
53
+ i18n (0.9.5)
54
+ concurrent-ruby (~> 1.0)
55
+ loofah (2.2.2)
56
+ crass (~> 1.0.2)
57
+ nokogiri (>= 1.5.9)
58
+ mail (2.7.0)
59
+ mini_mime (>= 0.1.1)
60
+ metaclass (0.0.4)
61
+ mini_mime (1.0.0)
62
+ mini_portile2 (2.3.0)
63
+ minitest (5.11.3)
64
+ mocha (1.5.0)
65
+ metaclass (~> 0.0.1)
66
+ nokogiri (1.8.2)
67
+ mini_portile2 (~> 2.3.0)
68
+ open4 (1.3.4)
69
+ rack (1.6.10)
70
+ rack-test (0.6.3)
71
+ rack (>= 1.0)
72
+ rails (4.2.10)
73
+ actionmailer (= 4.2.10)
74
+ actionpack (= 4.2.10)
75
+ actionview (= 4.2.10)
76
+ activejob (= 4.2.10)
77
+ activemodel (= 4.2.10)
78
+ activerecord (= 4.2.10)
79
+ activesupport (= 4.2.10)
80
+ bundler (>= 1.3.0, < 2.0)
81
+ railties (= 4.2.10)
82
+ sprockets-rails
83
+ rails-deprecated_sanitizer (1.0.3)
84
+ activesupport (>= 4.2.0.alpha)
85
+ rails-dom-testing (1.0.9)
86
+ activesupport (>= 4.2.0, < 5.0)
87
+ nokogiri (~> 1.6)
88
+ rails-deprecated_sanitizer (>= 1.0.1)
89
+ rails-html-sanitizer (1.0.4)
90
+ loofah (~> 2.2, >= 2.2.2)
91
+ railties (4.2.10)
92
+ actionpack (= 4.2.10)
93
+ activesupport (= 4.2.10)
94
+ rake (>= 0.8.7)
95
+ thor (>= 0.18.1, < 2.0)
96
+ rake (12.3.1)
97
+ seed-fu (2.3.9)
98
+ activerecord (>= 3.1)
99
+ activesupport (>= 3.1)
100
+ seed-fu-ndo (0.0.3)
101
+ seed-fu (>= 2.2.0)
102
+ sprockets (3.7.1)
103
+ concurrent-ruby (~> 1.0)
104
+ rack (> 1, < 3)
105
+ sprockets-rails (3.2.1)
106
+ actionpack (>= 4.0)
107
+ activesupport (>= 4.0)
108
+ sprockets (>= 3.0.0)
109
+ sqlite3 (1.3.13)
110
+ thor (0.20.0)
111
+ thread_safe (0.3.6)
112
+ tzinfo (1.2.5)
113
+ thread_safe (~> 0.1)
114
+
115
+ PLATFORMS
116
+ ruby
117
+
118
+ DEPENDENCIES
119
+ mocha
120
+ open4
121
+ rails (~> 4.2.0)
122
+ seed-fu-ndo (>= 0.0.2)
123
+ sqlite3
124
+ wagons!
125
+
126
+ BUNDLED WITH
127
+ 1.16.1
@@ -2,10 +2,11 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec :path => '../..'
4
4
 
5
- gem 'rails', '~> 4.0.0'
5
+ gem 'rails', '~> 5.0.0'
6
6
 
7
7
  gem 'seed-fu-ndo', '>= 0.0.2'
8
8
 
9
9
  group :test do
10
10
  gem 'mocha', :require => false
11
+ gem 'rails-controller-testing'
11
12
  end
@@ -0,0 +1,134 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ wagons (0.4.8)
5
+ bundler (>= 1.1)
6
+ rails (>= 4.2)
7
+ seed-fu-ndo (>= 0.0.3)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.0.4)
13
+ actionpack (= 5.0.4)
14
+ nio4r (>= 1.2, < 3.0)
15
+ websocket-driver (~> 0.6.1)
16
+ actionmailer (5.0.4)
17
+ actionpack (= 5.0.4)
18
+ actionview (= 5.0.4)
19
+ activejob (= 5.0.4)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.0.4)
23
+ actionview (= 5.0.4)
24
+ activesupport (= 5.0.4)
25
+ rack (~> 2.0)
26
+ rack-test (~> 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.0.4)
30
+ activesupport (= 5.0.4)
31
+ builder (~> 3.1)
32
+ erubis (~> 2.7.0)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ activejob (5.0.4)
36
+ activesupport (= 5.0.4)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.0.4)
39
+ activesupport (= 5.0.4)
40
+ activerecord (5.0.4)
41
+ activemodel (= 5.0.4)
42
+ activesupport (= 5.0.4)
43
+ arel (~> 7.0)
44
+ activesupport (5.0.4)
45
+ concurrent-ruby (~> 1.0, >= 1.0.2)
46
+ i18n (~> 0.7)
47
+ minitest (~> 5.1)
48
+ tzinfo (~> 1.1)
49
+ arel (7.1.4)
50
+ builder (3.2.3)
51
+ concurrent-ruby (1.0.5)
52
+ crass (1.0.4)
53
+ erubis (2.7.0)
54
+ globalid (0.4.1)
55
+ activesupport (>= 4.2.0)
56
+ i18n (0.9.5)
57
+ concurrent-ruby (~> 1.0)
58
+ loofah (2.2.2)
59
+ crass (~> 1.0.2)
60
+ nokogiri (>= 1.5.9)
61
+ mail (2.7.0)
62
+ mini_mime (>= 0.1.1)
63
+ metaclass (0.0.4)
64
+ method_source (0.9.0)
65
+ mini_mime (1.0.0)
66
+ mini_portile2 (2.3.0)
67
+ minitest (5.11.3)
68
+ mocha (1.5.0)
69
+ metaclass (~> 0.0.1)
70
+ nio4r (2.3.1)
71
+ nokogiri (1.8.2)
72
+ mini_portile2 (~> 2.3.0)
73
+ open4 (1.3.4)
74
+ rack (2.0.5)
75
+ rack-test (0.6.3)
76
+ rack (>= 1.0)
77
+ rails (5.0.4)
78
+ actioncable (= 5.0.4)
79
+ actionmailer (= 5.0.4)
80
+ actionpack (= 5.0.4)
81
+ actionview (= 5.0.4)
82
+ activejob (= 5.0.4)
83
+ activemodel (= 5.0.4)
84
+ activerecord (= 5.0.4)
85
+ activesupport (= 5.0.4)
86
+ bundler (>= 1.3.0, < 2.0)
87
+ railties (= 5.0.4)
88
+ sprockets-rails (>= 2.0.0)
89
+ rails-dom-testing (2.0.3)
90
+ activesupport (>= 4.2.0)
91
+ nokogiri (>= 1.6)
92
+ rails-html-sanitizer (1.0.4)
93
+ loofah (~> 2.2, >= 2.2.2)
94
+ railties (5.0.4)
95
+ actionpack (= 5.0.4)
96
+ activesupport (= 5.0.4)
97
+ method_source
98
+ rake (>= 0.8.7)
99
+ thor (>= 0.18.1, < 2.0)
100
+ rake (12.3.1)
101
+ seed-fu (2.3.9)
102
+ activerecord (>= 3.1)
103
+ activesupport (>= 3.1)
104
+ seed-fu-ndo (0.0.3)
105
+ seed-fu (>= 2.2.0)
106
+ sprockets (3.7.1)
107
+ concurrent-ruby (~> 1.0)
108
+ rack (> 1, < 3)
109
+ sprockets-rails (3.2.1)
110
+ actionpack (>= 4.0)
111
+ activesupport (>= 4.0)
112
+ sprockets (>= 3.0.0)
113
+ sqlite3 (1.3.13)
114
+ thor (0.20.0)
115
+ thread_safe (0.3.6)
116
+ tzinfo (1.2.5)
117
+ thread_safe (~> 0.1)
118
+ websocket-driver (0.6.5)
119
+ websocket-extensions (>= 0.1.0)
120
+ websocket-extensions (0.1.3)
121
+
122
+ PLATFORMS
123
+ ruby
124
+
125
+ DEPENDENCIES
126
+ mocha
127
+ open4
128
+ rails (~> 5.0.0)
129
+ seed-fu-ndo (>= 0.0.2)
130
+ sqlite3
131
+ wagons!
132
+
133
+ BUNDLED WITH
134
+ 1.16.1