drupid 1.1.0 → 1.1.2

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.
Files changed (333) hide show
  1. checksums.yaml +4 -4
  2. data/.bundle/config +3 -0
  3. data/.gitignore +10 -0
  4. data/.rbenv-version +1 -0
  5. data/Gemfile +3 -0
  6. data/README.md +56 -0
  7. data/Rakefile +26 -0
  8. data/bin/drupid +1 -3
  9. data/drupid.gemspec +31 -0
  10. data/lib/drupid/project_version.rb +276 -0
  11. data/lib/drupid/utils.rb +1 -1
  12. data/lib/drupid/version.rb +3 -275
  13. data/lib/drupid.rb +2 -7
  14. data/test/fixtures/drupal-example.make +89 -0
  15. data/test/fixtures/drupal-fake-site/modules/aggregator/aggregator.info +14 -0
  16. data/test/fixtures/drupal-fake-site/modules/aggregator/aggregator.module +0 -0
  17. data/test/fixtures/drupal-fake-site/modules/aggregator/tests/aggregator_test.info +12 -0
  18. data/test/fixtures/drupal-fake-site/modules/aggregator/tests/aggregator_test.module +0 -0
  19. data/test/fixtures/drupal-fake-site/modules/block/block.info +13 -0
  20. data/test/fixtures/drupal-fake-site/modules/block/block.module +0 -0
  21. data/test/fixtures/drupal-fake-site/modules/block/tests/block_test.info +12 -0
  22. data/test/fixtures/drupal-fake-site/modules/block/tests/block_test.module +0 -0
  23. data/test/fixtures/drupal-fake-site/modules/blog/blog.info +12 -0
  24. data/test/fixtures/drupal-fake-site/modules/blog/blog.module +0 -0
  25. data/test/fixtures/drupal-fake-site/modules/book/book.info +14 -0
  26. data/test/fixtures/drupal-fake-site/modules/book/book.module +0 -0
  27. data/test/fixtures/drupal-fake-site/modules/color/color.info +12 -0
  28. data/test/fixtures/drupal-fake-site/modules/color/color.module +0 -0
  29. data/test/fixtures/drupal-fake-site/modules/comment/comment.info +16 -0
  30. data/test/fixtures/drupal-fake-site/modules/comment/comment.module +0 -0
  31. data/test/fixtures/drupal-fake-site/modules/contact/contact.info +13 -0
  32. data/test/fixtures/drupal-fake-site/modules/contact/contact.module +0 -0
  33. data/test/fixtures/drupal-fake-site/modules/contextual/contextual.info +11 -0
  34. data/test/fixtures/drupal-fake-site/modules/contextual/contextual.module +0 -0
  35. data/test/fixtures/drupal-fake-site/modules/dashboard/dashboard.info +14 -0
  36. data/test/fixtures/drupal-fake-site/modules/dashboard/dashboard.module +0 -0
  37. data/test/fixtures/drupal-fake-site/modules/dblog/dblog.info +12 -0
  38. data/test/fixtures/drupal-fake-site/modules/dblog/dblog.module +0 -0
  39. data/test/fixtures/drupal-fake-site/modules/field/field.info +17 -0
  40. data/test/fixtures/drupal-fake-site/modules/field/field.module +0 -0
  41. data/test/fixtures/drupal-fake-site/modules/field/modules/field_sql_storage/field_sql_storage.info +14 -0
  42. data/test/fixtures/drupal-fake-site/modules/field/modules/field_sql_storage/field_sql_storage.module +0 -0
  43. data/test/fixtures/drupal-fake-site/modules/field/modules/list/list.info +14 -0
  44. data/test/fixtures/drupal-fake-site/modules/field/modules/list/list.module +0 -0
  45. data/test/fixtures/drupal-fake-site/modules/field/modules/list/tests/list_test.info +12 -0
  46. data/test/fixtures/drupal-fake-site/modules/field/modules/list/tests/list_test.module +0 -0
  47. data/test/fixtures/drupal-fake-site/modules/field/modules/number/number.info +13 -0
  48. data/test/fixtures/drupal-fake-site/modules/field/modules/number/number.module +0 -0
  49. data/test/fixtures/drupal-fake-site/modules/field/modules/options/options.info +13 -0
  50. data/test/fixtures/drupal-fake-site/modules/field/modules/options/options.module +0 -0
  51. data/test/fixtures/drupal-fake-site/modules/field/modules/text/text.info +14 -0
  52. data/test/fixtures/drupal-fake-site/modules/field/modules/text/text.module +0 -0
  53. data/test/fixtures/drupal-fake-site/modules/field/tests/field_test.info +13 -0
  54. data/test/fixtures/drupal-fake-site/modules/field/tests/field_test.module +0 -0
  55. data/test/fixtures/drupal-fake-site/modules/field_ui/field_ui.info +13 -0
  56. data/test/fixtures/drupal-fake-site/modules/field_ui/field_ui.module +0 -0
  57. data/test/fixtures/drupal-fake-site/modules/file/file.info +13 -0
  58. data/test/fixtures/drupal-fake-site/modules/file/file.module +0 -0
  59. data/test/fixtures/drupal-fake-site/modules/file/tests/file_module_test.info +12 -0
  60. data/test/fixtures/drupal-fake-site/modules/file/tests/file_module_test.module +0 -0
  61. data/test/fixtures/drupal-fake-site/modules/filter/filter.info +14 -0
  62. data/test/fixtures/drupal-fake-site/modules/filter/filter.module +0 -0
  63. data/test/fixtures/drupal-fake-site/modules/forum/forum.info +16 -0
  64. data/test/fixtures/drupal-fake-site/modules/forum/forum.module +0 -0
  65. data/test/fixtures/drupal-fake-site/modules/help/help.info +12 -0
  66. data/test/fixtures/drupal-fake-site/modules/help/help.module +0 -0
  67. data/test/fixtures/drupal-fake-site/modules/image/image.info +14 -0
  68. data/test/fixtures/drupal-fake-site/modules/image/image.module +0 -0
  69. data/test/fixtures/drupal-fake-site/modules/image/tests/image_module_test.info +13 -0
  70. data/test/fixtures/drupal-fake-site/modules/image/tests/image_module_test.module +0 -0
  71. data/test/fixtures/drupal-fake-site/modules/locale/locale.info +13 -0
  72. data/test/fixtures/drupal-fake-site/modules/locale/locale.module +0 -0
  73. data/test/fixtures/drupal-fake-site/modules/locale/tests/locale_test.info +12 -0
  74. data/test/fixtures/drupal-fake-site/modules/locale/tests/locale_test.module +0 -0
  75. data/test/fixtures/drupal-fake-site/modules/menu/menu.info +13 -0
  76. data/test/fixtures/drupal-fake-site/modules/menu/menu.module +0 -0
  77. data/test/fixtures/drupal-fake-site/modules/node/node.info +16 -0
  78. data/test/fixtures/drupal-fake-site/modules/node/node.module +0 -0
  79. data/test/fixtures/drupal-fake-site/modules/node/tests/node_access_test.info +12 -0
  80. data/test/fixtures/drupal-fake-site/modules/node/tests/node_access_test.module +0 -0
  81. data/test/fixtures/drupal-fake-site/modules/node/tests/node_test.info +12 -0
  82. data/test/fixtures/drupal-fake-site/modules/node/tests/node_test.module +0 -0
  83. data/test/fixtures/drupal-fake-site/modules/node/tests/node_test_exception.info +12 -0
  84. data/test/fixtures/drupal-fake-site/modules/node/tests/node_test_exception.module +0 -0
  85. data/test/fixtures/drupal-fake-site/modules/openid/openid.info +12 -0
  86. data/test/fixtures/drupal-fake-site/modules/openid/openid.module +0 -0
  87. data/test/fixtures/drupal-fake-site/modules/openid/tests/openid_test.info +13 -0
  88. data/test/fixtures/drupal-fake-site/modules/openid/tests/openid_test.module +0 -0
  89. data/test/fixtures/drupal-fake-site/modules/overlay/overlay.info +11 -0
  90. data/test/fixtures/drupal-fake-site/modules/overlay/overlay.module +0 -0
  91. data/test/fixtures/drupal-fake-site/modules/path/path.info +13 -0
  92. data/test/fixtures/drupal-fake-site/modules/path/path.module +0 -0
  93. data/test/fixtures/drupal-fake-site/modules/php/php.info +12 -0
  94. data/test/fixtures/drupal-fake-site/modules/php/php.module +0 -0
  95. data/test/fixtures/drupal-fake-site/modules/poll/poll.info +13 -0
  96. data/test/fixtures/drupal-fake-site/modules/poll/poll.module +0 -0
  97. data/test/fixtures/drupal-fake-site/modules/profile/profile.info +18 -0
  98. data/test/fixtures/drupal-fake-site/modules/profile/profile.module +0 -0
  99. data/test/fixtures/drupal-fake-site/modules/rdf/rdf.info +12 -0
  100. data/test/fixtures/drupal-fake-site/modules/rdf/rdf.module +0 -0
  101. data/test/fixtures/drupal-fake-site/modules/rdf/tests/rdf_test.info +12 -0
  102. data/test/fixtures/drupal-fake-site/modules/rdf/tests/rdf_test.module +0 -0
  103. data/test/fixtures/drupal-fake-site/modules/search/search.info +15 -0
  104. data/test/fixtures/drupal-fake-site/modules/search/search.module +0 -0
  105. data/test/fixtures/drupal-fake-site/modules/search/tests/search_embedded_form.info +12 -0
  106. data/test/fixtures/drupal-fake-site/modules/search/tests/search_embedded_form.module +0 -0
  107. data/test/fixtures/drupal-fake-site/modules/search/tests/search_extra_type.info +12 -0
  108. data/test/fixtures/drupal-fake-site/modules/search/tests/search_extra_type.module +0 -0
  109. data/test/fixtures/drupal-fake-site/modules/shortcut/shortcut.info +13 -0
  110. data/test/fixtures/drupal-fake-site/modules/shortcut/shortcut.module +0 -0
  111. data/test/fixtures/drupal-fake-site/modules/simpletest/simpletest.info +56 -0
  112. data/test/fixtures/drupal-fake-site/modules/simpletest/simpletest.module +0 -0
  113. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/actions_loop_test.info +12 -0
  114. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/actions_loop_test.module +0 -0
  115. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/ajax_forms_test.info +12 -0
  116. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/ajax_forms_test.module +0 -0
  117. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/ajax_test.info +12 -0
  118. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/ajax_test.module +0 -0
  119. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/batch_test.info +12 -0
  120. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/batch_test.module +0 -0
  121. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/common_test.info +14 -0
  122. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/common_test.module +0 -0
  123. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/common_test_cron_helper.info +12 -0
  124. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/common_test_cron_helper.module +0 -0
  125. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/database_test.info +12 -0
  126. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/database_test.module +0 -0
  127. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info +12 -0
  128. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module +0 -0
  129. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info +12 -0
  130. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module +0 -0
  131. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/entity_cache_test.info +13 -0
  132. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/entity_cache_test.module +0 -0
  133. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/entity_cache_test_dependency.info +12 -0
  134. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/entity_cache_test_dependency.module +0 -0
  135. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/entity_crud_hook_test.info +12 -0
  136. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/entity_crud_hook_test.module +0 -0
  137. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/error_test.info +12 -0
  138. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/error_test.module +0 -0
  139. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/file_test.info +13 -0
  140. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/file_test.module +0 -0
  141. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/filter_test.info +12 -0
  142. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/filter_test.module +0 -0
  143. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/form_test.info +12 -0
  144. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/form_test.module +0 -0
  145. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/image_test.info +12 -0
  146. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/image_test.module +0 -0
  147. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/menu_test.info +12 -0
  148. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/menu_test.module +0 -0
  149. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/module_test.info +12 -0
  150. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/module_test.module +0 -0
  151. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/requirements1_test.info +12 -0
  152. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/requirements1_test.module +0 -0
  153. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/requirements2_test.info +14 -0
  154. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/requirements2_test.module +0 -0
  155. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/session_test.info +12 -0
  156. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/session_test.module +0 -0
  157. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_dependencies_test.info +13 -0
  158. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_dependencies_test.module +0 -0
  159. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info +13 -0
  160. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.module +0 -0
  161. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_core_version_test.info +12 -0
  162. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_core_version_test.module +0 -0
  163. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info +14 -0
  164. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.module +0 -0
  165. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_module_version_test.info +12 -0
  166. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_incompatible_module_version_test.module +0 -0
  167. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_test.info +13 -0
  168. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/system_test.module +0 -0
  169. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/taxonomy_test.info +13 -0
  170. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/taxonomy_test.module +0 -0
  171. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/theme_test.info +12 -0
  172. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/theme_test.module +0 -0
  173. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_script_test.info +12 -0
  174. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_script_test.module +0 -0
  175. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_test_1.info +12 -0
  176. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_test_1.module +0 -0
  177. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_test_2.info +12 -0
  178. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_test_2.module +0 -0
  179. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_test_3.info +12 -0
  180. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/update_test_3.module +0 -0
  181. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/url_alter_test.info +12 -0
  182. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/url_alter_test.module +0 -0
  183. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/xmlrpc_test.info +12 -0
  184. data/test/fixtures/drupal-fake-site/modules/simpletest/tests/xmlrpc_test.module +0 -0
  185. data/test/fixtures/drupal-fake-site/modules/statistics/statistics.info +13 -0
  186. data/test/fixtures/drupal-fake-site/modules/statistics/statistics.module +0 -0
  187. data/test/fixtures/drupal-fake-site/modules/syslog/syslog.info +12 -0
  188. data/test/fixtures/drupal-fake-site/modules/syslog/syslog.module +0 -0
  189. data/test/fixtures/drupal-fake-site/modules/system/system.info +19 -0
  190. data/test/fixtures/drupal-fake-site/modules/system/system.module +0 -0
  191. data/test/fixtures/drupal-fake-site/modules/taxonomy/taxonomy.info +15 -0
  192. data/test/fixtures/drupal-fake-site/modules/taxonomy/taxonomy.module +0 -0
  193. data/test/fixtures/drupal-fake-site/modules/toolbar/toolbar.info +11 -0
  194. data/test/fixtures/drupal-fake-site/modules/toolbar/toolbar.module +0 -0
  195. data/test/fixtures/drupal-fake-site/modules/tracker/tracker.info +13 -0
  196. data/test/fixtures/drupal-fake-site/modules/tracker/tracker.module +0 -0
  197. data/test/fixtures/drupal-fake-site/modules/translation/tests/translation_test.info +12 -0
  198. data/test/fixtures/drupal-fake-site/modules/translation/tests/translation_test.module +0 -0
  199. data/test/fixtures/drupal-fake-site/modules/translation/translation.info +13 -0
  200. data/test/fixtures/drupal-fake-site/modules/translation/translation.module +0 -0
  201. data/test/fixtures/drupal-fake-site/modules/trigger/tests/trigger_test.info +11 -0
  202. data/test/fixtures/drupal-fake-site/modules/trigger/tests/trigger_test.module +0 -0
  203. data/test/fixtures/drupal-fake-site/modules/trigger/trigger.info +13 -0
  204. data/test/fixtures/drupal-fake-site/modules/trigger/trigger.module +0 -0
  205. data/test/fixtures/drupal-fake-site/modules/update/tests/aaa_update_test.info +11 -0
  206. data/test/fixtures/drupal-fake-site/modules/update/tests/aaa_update_test.module +0 -0
  207. data/test/fixtures/drupal-fake-site/modules/update/tests/bbb_update_test.info +11 -0
  208. data/test/fixtures/drupal-fake-site/modules/update/tests/bbb_update_test.module +0 -0
  209. data/test/fixtures/drupal-fake-site/modules/update/tests/ccc_update_test.info +11 -0
  210. data/test/fixtures/drupal-fake-site/modules/update/tests/ccc_update_test.module +0 -0
  211. data/test/fixtures/drupal-fake-site/modules/update/tests/update_test.info +12 -0
  212. data/test/fixtures/drupal-fake-site/modules/update/tests/update_test.module +0 -0
  213. data/test/fixtures/drupal-fake-site/modules/update/update.info +13 -0
  214. data/test/fixtures/drupal-fake-site/modules/update/update.module +0 -0
  215. data/test/fixtures/drupal-fake-site/modules/user/tests/user_form_test.info +12 -0
  216. data/test/fixtures/drupal-fake-site/modules/user/tests/user_form_test.module +0 -0
  217. data/test/fixtures/drupal-fake-site/modules/user/user.info +16 -0
  218. data/test/fixtures/drupal-fake-site/modules/user/user.module +0 -0
  219. data/test/fixtures/drupal-fake-site/profiles/minimal/minimal.info +13 -0
  220. data/test/fixtures/drupal-fake-site/profiles/minimal/minimal.profile +0 -0
  221. data/test/fixtures/drupal-fake-site/profiles/openpublic/modules/custom/combineblocks/combineblocks.info +11 -0
  222. data/test/fixtures/drupal-fake-site/profiles/openpublic/modules/custom/openpublic_api/openpublic_api.info +12 -0
  223. data/test/fixtures/drupal-fake-site/profiles/openpublic/modules/custom/openpublic_splash/openpublic_splash.info +16 -0
  224. data/test/fixtures/drupal-fake-site/profiles/openpublic/modules/custom/phase2_blog/phase2_blog.info +32 -0
  225. data/test/fixtures/drupal-fake-site/profiles/openpublic/modules/custom/phase2_document/phase2_document.info +38 -0
  226. data/test/fixtures/drupal-fake-site/profiles/openpublic/modules/custom/phase2_profile/phase2_profile.info +45 -0
  227. data/test/fixtures/drupal-fake-site/profiles/openpublic/openpublic.info +137 -0
  228. data/test/fixtures/drupal-fake-site/profiles/openpublic/openpublic.make +149 -0
  229. data/test/fixtures/drupal-fake-site/profiles/openpublic/openpublic.profile +0 -0
  230. data/test/fixtures/drupal-fake-site/profiles/openpublic/themes/openomega/openomega.info +434 -0
  231. data/test/fixtures/drupal-fake-site/profiles/openpublic/themes/openpublic_theme/.project +11 -0
  232. data/test/fixtures/drupal-fake-site/profiles/openpublic/themes/openpublic_theme/openpublic_theme.info +51 -0
  233. data/test/fixtures/drupal-fake-site/profiles/openpublic/themes/spartan/spartan.info +434 -0
  234. data/test/fixtures/drupal-fake-site/profiles/standard/standard.info +32 -0
  235. data/test/fixtures/drupal-fake-site/profiles/standard/standard.profile +0 -0
  236. data/test/fixtures/drupal-fake-site/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info +12 -0
  237. data/test/fixtures/drupal-fake-site/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info +15 -0
  238. data/test/fixtures/drupal-fake-site/profiles/testing/testing.info +11 -0
  239. data/test/fixtures/drupal-fake-site/profiles/testing/testing.profile +0 -0
  240. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/entity.info +31 -0
  241. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/entity.module +0 -0
  242. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/entity_token.info +13 -0
  243. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/entity_token.module +0 -0
  244. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/tests/entity_feature.info +14 -0
  245. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/tests/entity_feature.module +0 -0
  246. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/tests/entity_test.info +15 -0
  247. data/test/fixtures/drupal-fake-site/sites/all/modules/entity/tests/entity_test.module +0 -0
  248. data/test/fixtures/drupal-fake-site/sites/all/modules/featured_news_feature/featured_news.info +23 -0
  249. data/test/fixtures/drupal-fake-site/sites/all/modules/featured_news_feature/featured_news.module +0 -0
  250. data/test/fixtures/drupal-fake-site/sites/all/modules/google_analytics/googleanalytics.info +13 -0
  251. data/test/fixtures/drupal-fake-site/sites/all/modules/google_analytics/googleanalytics.module +0 -0
  252. data/test/fixtures/drupal-fake-site/sites/all/modules/media/media.info +26 -0
  253. data/test/fixtures/drupal-fake-site/sites/all/modules/media/media.module +0 -0
  254. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate.info +47 -0
  255. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate.module +0 -0
  256. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate_example/migrate_example.info +27 -0
  257. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate_example/migrate_example.module +0 -0
  258. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate_example_baseball/migrate_example_baseball.info +32 -0
  259. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate_example_baseball/migrate_example_baseball.module +0 -0
  260. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate_ui/migrate_ui.info +15 -0
  261. data/test/fixtures/drupal-fake-site/sites/all/modules/migrate/migrate_ui/migrate_ui.module +0 -0
  262. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/bulk_export/bulk_export.info +12 -0
  263. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/bulk_export/bulk_export.module +0 -0
  264. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools.info +14 -0
  265. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools.module +0 -0
  266. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_access_ruleset/ctools_access_ruleset.info +12 -0
  267. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_access_ruleset/ctools_access_ruleset.module +0 -0
  268. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_ajax_sample/ctools_ajax_sample.info +12 -0
  269. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_ajax_sample/ctools_ajax_sample.module +0 -0
  270. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_custom_content/ctools_custom_content.info +12 -0
  271. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_custom_content/ctools_custom_content.module +0 -0
  272. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_plugin_example/ctools_plugin_example.info +15 -0
  273. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/ctools_plugin_example/ctools_plugin_example.module +0 -0
  274. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/page_manager/page_manager.info +12 -0
  275. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/page_manager/page_manager.module +0 -0
  276. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/stylizer/stylizer.info +13 -0
  277. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/stylizer/stylizer.module +0 -0
  278. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/tests/ctools_plugin_test.info +15 -0
  279. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/tests/ctools_plugin_test.module +0 -0
  280. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/views_content/views_content.info +17 -0
  281. data/test/fixtures/drupal-fake-site/sites/all/modules/subdir/ctools/views_content/views_content.module +0 -0
  282. data/test/fixtures/drupal-fake-site/sites/all/modules/views/tests/views_test.info +13 -0
  283. data/test/fixtures/drupal-fake-site/sites/all/modules/views/tests/views_test.module +0 -0
  284. data/test/fixtures/drupal-fake-site/sites/all/modules/views/views.info +297 -0
  285. data/test/fixtures/drupal-fake-site/sites/all/modules/views/views.module +0 -0
  286. data/test/fixtures/drupal-fake-site/sites/all/modules/views/views_ui.info +15 -0
  287. data/test/fixtures/drupal-fake-site/sites/all/modules/views/views_ui.module +0 -0
  288. data/test/fixtures/drupal-fake-site/sites/all/modules/wysiwyg/tests/wysiwyg_test.info +14 -0
  289. data/test/fixtures/drupal-fake-site/sites/all/modules/wysiwyg/tests/wysiwyg_test.module +0 -0
  290. data/test/fixtures/drupal-fake-site/sites/all/modules/wysiwyg/wysiwyg.info +17 -0
  291. data/test/fixtures/drupal-fake-site/sites/all/modules/wysiwyg/wysiwyg.module +0 -0
  292. data/test/fixtures/drupal-fake-site/sites/all/themes/fusion/fusion_core/fusion_core.info +102 -0
  293. data/test/fixtures/drupal-fake-site/sites/all/themes/fusion/fusion_starter/fusion_starter.info +190 -0
  294. data/test/fixtures/drupal-fake-site/sites/all/themes/fusion/fusion_starter_lite/fusion_starter_lite.info +170 -0
  295. data/test/fixtures/drupal-fake-site/sites/all/themes/subdir/mothership/.gitignore +3 -0
  296. data/test/fixtures/drupal-fake-site/sites/all/themes/subdir/mothership/NEWTHEME/NEWTHEME.info +124 -0
  297. data/test/fixtures/drupal-fake-site/sites/all/themes/subdir/mothership/mothership/mothership.info +126 -0
  298. data/test/fixtures/drupal-fake-site/sites/all/themes/subdir/mothership/mothershipstark/mothershipstark.info +15 -0
  299. data/test/fixtures/drupal-fake-site/sites/all/themes/subdir/mothership/tema/tema.info +58 -0
  300. data/test/fixtures/drupal-fake-site/sites/all/themes/tao/tao.info +49 -0
  301. data/test/fixtures/drupal-fake-site/sites/default/settings.php +0 -0
  302. data/test/fixtures/drupal-fake-site/sites/www.bar.org/settings.php +0 -0
  303. data/test/fixtures/drupal-fake-site/sites/www.foo.org/settings.php +0 -0
  304. data/test/fixtures/drupal-fake-site/themes/bartik/bartik.info +41 -0
  305. data/test/fixtures/drupal-fake-site/themes/garland/garland.info +14 -0
  306. data/test/fixtures/drupal-fake-site/themes/seven/seven.info +20 -0
  307. data/test/fixtures/drupal-fake-site/themes/stark/stark.info +12 -0
  308. data/test/fixtures/drupal-fake-site/themes/tests/block_test_theme/block_test_theme.info +20 -0
  309. data/test/fixtures/drupal-fake-site/themes/tests/test_theme/test_theme.info +22 -0
  310. data/test/fixtures/drupal-fake-site/themes/tests/update_test_basetheme/update_test_basetheme.info +10 -0
  311. data/test/fixtures/drupal-fake-site/themes/tests/update_test_subtheme/update_test_subtheme.info +11 -0
  312. data/test/fixtures/fake_library.tar.gz +0 -0
  313. data/test/fixtures/rootcandy/rootcandy.info +52 -0
  314. data/test/fixtures/views-info.diff +11 -0
  315. data/test/fixtures/views.tar.gz +0 -0
  316. data/test/helper.rb +7 -0
  317. data/test/makefiles/test1.make +20 -0
  318. data/test/makefiles/test2.make +14 -0
  319. data/test/makefiles/test3.make +8 -0
  320. data/test/test_drupid_component.rb +120 -0
  321. data/test/test_drupid_download_strategy.rb +112 -0
  322. data/test/test_drupid_drush.rb +32 -0
  323. data/test/test_drupid_extend_pathname.rb +33 -0
  324. data/test/test_drupid_library.rb +62 -0
  325. data/test/test_drupid_makefile.rb +181 -0
  326. data/test/test_drupid_patch.rb +53 -0
  327. data/test/test_drupid_platform.rb +207 -0
  328. data/test/test_drupid_platform_project.rb +206 -0
  329. data/test/test_drupid_project.rb +650 -0
  330. data/test/test_drupid_updater.rb +76 -0
  331. data/test/test_drupid_version.rb +295 -0
  332. data/test/test_pathname.rb +67 -0
  333. metadata +696 -5
@@ -0,0 +1,112 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Copyright (c) 2012-2013 Lifepillar
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'helper'
24
+
25
+ class TestDrupidDownloadStrategyCurl < Minitest::Test
26
+
27
+ def setup
28
+ @temp_dir = FIXTURES + 'templib'
29
+ @temp_dir.mkpath
30
+ end
31
+
32
+ def teardown
33
+ @temp_dir.rmtree
34
+ end
35
+
36
+ def test_fetch_using_local_url
37
+ url = "file://#{FIXTURES + 'fake_library.tar.gz'}"
38
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir
39
+ downloader.fetch
40
+ assert((@temp_dir+'fake_library.tar.gz').exist?, 'Archive not fetched')
41
+ end
42
+
43
+ def test_fetch_using_local_url_and_name
44
+ url = "file://#{FIXTURES + 'fake_library.tar.gz'}"
45
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir, 'foobar'
46
+ downloader.fetch
47
+ assert((@temp_dir+'foobar.tar.gz').exist?, 'Archive not fetched or name not correct')
48
+ end
49
+
50
+ def test_fetch_cannot_be_used_with_local_path
51
+ url = FIXTURES+'fake_library.tar.gz'
52
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir
53
+ assert_raises Drupid::DownloadStrategy::CurlError do
54
+ downloader.fetch
55
+ end
56
+ end
57
+
58
+ def test_stage
59
+ url = "file://#{FIXTURES + 'fake_library.tar.gz'}"
60
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir
61
+ assert_equal url, downloader.url, 'URL incorrect'
62
+ assert_equal @temp_dir, downloader.dest, 'dest incorrect'
63
+ assert_equal nil, downloader.name, 'name incorrect'
64
+ downloader.fetch
65
+ downloader.stage
66
+ assert_equal @temp_dir+'fake_library', downloader.staged_path, 'Incorrect staged_path'
67
+ assert((@temp_dir+'fake_library.tar.gz').exist?, 'Archive not fetched')
68
+ assert((@temp_dir+'fake_library').exist?, 'Archive not staged')
69
+ assert((@temp_dir+'fake_library').directory?, 'Staged archive is not a directory')
70
+ end
71
+
72
+ def test_stage_with_custom_name
73
+ url = "file://#{FIXTURES+ 'fake_library.tar.gz'}"
74
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir, 'custom-name'
75
+ assert_equal url, downloader.url, 'URL incorrect'
76
+ assert_equal @temp_dir, downloader.dest, 'dest incorrect'
77
+ assert_equal 'custom-name', downloader.name, 'name incorrect'
78
+ downloader.fetch
79
+ downloader.stage
80
+ assert_equal @temp_dir+'custom-name', downloader.staged_path, 'Incorrect staged_path'
81
+ assert((@temp_dir+'custom-name.tar.gz').exist?, 'Archive not fetched')
82
+ assert((@temp_dir+'custom-name').exist?, 'Archive not staged')
83
+ assert((@temp_dir+'custom-name').directory?, 'Staged archive is not a directory')
84
+ end
85
+
86
+ def test_fetch_and_stage_text_file
87
+ url = "file://#{FIXTURES + 'drupal-example.make'}"
88
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir
89
+ downloader.fetch
90
+ assert((@temp_dir+'drupal-example.make').exist?, 'Text file not fetched')
91
+ downloader.stage
92
+ assert_equal @temp_dir+'drupal-example.make', downloader.staged_path, 'Incorrect staged_path'
93
+ assert((@temp_dir+'drupal-example.make').exist?, 'Text file not staged correctly')
94
+ assert_equal 1, @temp_dir.children.size, 'The working dir should not contain other files'
95
+ end
96
+
97
+ def test_fetch_and_stage_text_file_with_custom_name
98
+ url = "file://#{FIXTURES + 'drupal-example.make'}"
99
+ downloader = Drupid::DownloadStrategy::Curl.new url, @temp_dir, 'foo.make'
100
+ assert_equal url, downloader.url, 'URL incorrect'
101
+ assert_equal @temp_dir, downloader.dest, 'dest incorrect'
102
+ assert_equal 'foo.make', downloader.name, 'name incorrect'
103
+ downloader.fetch
104
+ assert((@temp_dir+'foo.make').exist?, 'Text file not fetched')
105
+ refute((@temp_dir+'drupal-example.make').exist?, 'Spurious file')
106
+ downloader.stage
107
+ assert_equal @temp_dir+'foo.make', downloader.staged_path, 'Incorrect staged_path'
108
+ assert((@temp_dir+'foo.make').exist?, 'Text file not staged correctly')
109
+ assert_equal 1, @temp_dir.children.size, 'The working dir should not contain other files'
110
+ end
111
+
112
+ end # TestDrupidDownloadStrategyCurl
@@ -0,0 +1,32 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Copyright (c) 2012-2013 Lifepillar
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'helper'
24
+
25
+ class TestDrupidDrush < Minitest::Test
26
+
27
+ def test_bootstrapped
28
+ res = Drupid::Drush.bootstrapped?(TESTSITE.to_s)
29
+ refute res, 'Drupal should not be bootstrapped'
30
+ end
31
+
32
+ end # TestDrupidDrush
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Copyright (c) 2012-2013 Lifepillar
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'helper'
24
+
25
+ class TestDrupidExtendPathname < Minitest::Test
26
+
27
+ def test_compression_type
28
+ path = FIXTURES + 'fake_library.tar.gz'
29
+ assert_respond_to Pathname.new('.'), 'compression_type', 'Pathname#compression_type missing'
30
+ assert_equal path.compression_type, :gzip, 'Compression type not recognized'
31
+ end
32
+
33
+ end # TestDrupidCurlDownloadStrategy
@@ -0,0 +1,62 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Copyright (c) 2012-2013 Lifepillar
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'helper'
24
+
25
+ class TestDrupidLibrary < Minitest::Test
26
+
27
+ def test_create_library
28
+ ml = Drupid::Library.new 'MyLibrary'
29
+ assert_equal 'MyLibrary', ml.name, 'Wrong name'
30
+ assert_equal 'file', ml.download_type, 'Default download type should be \'file\''
31
+ assert_equal ml.name, ml.directory_name
32
+ assert_instance_of Pathname, ml.subdir
33
+ assert_equal '.', ml.subdir.to_s
34
+ assert_instance_of Pathname, ml.destination, 'Destination should be a Pathname'
35
+ assert_equal 'libraries', ml.destination.to_s, 'Destination should be \'libraries\''
36
+ assert_respond_to ml, 'directory_name=', 'Directory name should be mutable'
37
+ assert_respond_to ml, 'subdir=', 'Subdir should be mutable'
38
+ assert_respond_to ml, 'destination=', 'Destination should be mutable'
39
+ end
40
+
41
+ def test_cached_paths
42
+ ml = Drupid::Library.new 'MyLibrary'
43
+ assert_equal Drupid.cache_path+'Library/MyLibrary/file/MyLibrary', ml.cached_location
44
+ assert_equal Drupid.cache_path+'Library/MyLibrary/file/__patches/MyLibrary', ml.patched_location
45
+ end
46
+
47
+ def test_target_path
48
+ l = Drupid::Library.new 'MyLibrary'
49
+ assert_instance_of Pathname, l.target_path
50
+ assert_equal 'libraries/MyLibrary', l.target_path.to_s
51
+ l.subdir = 'contrib'
52
+ assert_instance_of Pathname, l.target_path
53
+ assert_equal 'libraries/contrib/MyLibrary', l.target_path.to_s
54
+ l.destination = 'modules/mymodule'
55
+ assert_instance_of Pathname, l.target_path
56
+ assert_equal 'modules/mymodule/contrib/MyLibrary', l.target_path.to_s
57
+ l.directory_name = 'my_library'
58
+ assert_instance_of Pathname, l.target_path
59
+ assert_equal 'modules/mymodule/contrib/my_library', l.target_path.to_s
60
+ end
61
+
62
+ end # TestDrupidLibrary
@@ -0,0 +1,181 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Copyright (c) 2012-2013 Lifepillar
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'helper'
24
+
25
+ class TestDrupidMakefile < Minitest::Test
26
+
27
+ def setup
28
+ @makefile = Drupid::Makefile.new(FIXTURES+'drupal-example.make')
29
+ end
30
+
31
+ def test_load_makefile
32
+ assert_equal '7.x', @makefile.core
33
+ assert_equal '2', @makefile.api
34
+ assert_instance_of Drupid::Project, @makefile.get_project('wysiwyg')
35
+ assert_instance_of Drupid::Version, @makefile.get_project('wysiwyg').version
36
+ assert_instance_of Drupid::Project, @makefile.get_project('foobar')
37
+ assert_instance_of Drupid::Library, @makefile.get_library('foolib')
38
+ assert_nil @makefile.get_project('views').version
39
+ assert_equal 'views', @makefile.get_project('views').name
40
+ assert_equal '7.x-2.1', @makefile.get_project('wysiwyg').version.long
41
+ assert_instance_of Drupid::Version, @makefile.get_project('ctools').version
42
+ assert_equal '7.x-1.0-rc1', @makefile.get_project('ctools').version.long
43
+ assert_equal 'contrib', @makefile.get_project('cck').subdir.to_s
44
+ assert_equal 'git', @makefile.get_project('tao').download_type
45
+ assert_equal 'git://github.com/developmentseed/tao.git', @makefile.get_project('tao').download_url
46
+ assert_equal 'e4876228f449cb0c37ffa0f2142', @makefile.get_project('calendar').get_patch('rfc-fixes').md5
47
+ assert_equal 'http://path/to/some-patch.diff', @makefile.get_project('jquery_ui').get_patch('some-patch.diff').url
48
+ assert_instance_of Drupid::Project, @makefile.get_project('drupal')
49
+ assert @makefile.get_project('drupal').drupal?
50
+ assert_equal 'drupal', @makefile.get_project('drupal').name
51
+ assert_equal '7.8', @makefile.get_project('drupal').version.short
52
+ assert_equal '7.x-7.8', @makefile.get_project('drupal').version.long
53
+ end
54
+
55
+ # Version constraints are not supported yet, but they should not break Drupid.
56
+ def test_version_constraints
57
+ assert_instance_of Drupid::Project, @makefile.get_project('file_entity')
58
+ assert_instance_of Drupid::Project, @makefile.get_project('patterns')
59
+ assert_instance_of Drupid::Project, @makefile.get_project('imce')
60
+ assert_instance_of Drupid::Project, @makefile.get_project('insert')
61
+ assert_equal 'file_entity-7.x', @makefile.get_project('file_entity').extended_name
62
+ assert_equal 'patterns-7.x', @makefile.get_project('patterns').extended_name
63
+ assert_equal 'imce-7.x', @makefile.get_project('imce').extended_name
64
+ assert_equal 'insert-7.x', @makefile.get_project('insert').extended_name
65
+ end
66
+
67
+ def test_makefile_project_types
68
+ assert_equal 'theme', @makefile.get_project('tao').proj_type
69
+ end
70
+
71
+ def test_makefile_local_urls
72
+ assert_equal "file://#{FIXTURES}/mymodules/foobar.zip", @makefile.get_project('foobar').download_url
73
+ assert_equal "file://#{FIXTURES}/foolib.tar.gz", @makefile.get_library('foolib').download_url
74
+ end
75
+
76
+ def test_makefile_save
77
+ @makefile.save(@makefile.path.sub_ext('.test'))
78
+ assert File.exist?(@makefile.path.sub_ext('.test')), 'Makefile not saved'
79
+ FileUtils.rm_f @makefile.path.sub_ext('.test')
80
+ end
81
+
82
+ def test_each_project
83
+ l = []
84
+ @makefile.each_project { |p| l << p.name }
85
+ refute l.include?('drupal')
86
+ assert l.include?('tao')
87
+ assert l.include?('calendar')
88
+ end
89
+
90
+ def test_project_names
91
+ projects = @makefile.project_names
92
+ assert_equal 14, projects.size
93
+ refute projects.include?('drupal')
94
+ assert projects.include?('views')
95
+ assert projects.include?('ctools')
96
+ assert projects.include?('wysiwyg')
97
+ assert projects.include?('cck')
98
+ assert projects.include?('tao')
99
+ assert projects.include?('respond')
100
+ assert projects.include?('date')
101
+ assert projects.include?('calendar')
102
+ assert projects.include?('jquery_ui')
103
+ assert projects.include?('foobar')
104
+ assert projects.include?('file_entity')
105
+ assert projects.include?('imce')
106
+ assert projects.include?('insert')
107
+ assert projects.include?('patterns')
108
+ end
109
+
110
+ def test_libraries
111
+ assert_instance_of Drupid::Library, @makefile.get_library('profiler')
112
+ assert_equal 'get', @makefile.get_library('profiler').download_type
113
+ assert_equal 'http://ftp.drupal.org/files/projects/profiler-7.x-2.0-beta1.tar.gz', @makefile.get_library('profiler').download_url
114
+ assert_instance_of Drupid::Library, @makefile.get_library('jquery_ui')
115
+ assert_equal 'modules/contrib/jquery_ui', @makefile.get_library('jquery_ui').destination.to_s
116
+ end
117
+
118
+ def test_makefile_to_s
119
+ mf = <<EOS
120
+ core = 7.x
121
+ api = 2
122
+ projects[drupal][version] = "7.8"
123
+
124
+ projects[calendar][patch][rfc-fixes][url] = "http://drupal.org/files/issues/cal-760316-rfc-fixes-2.diff"
125
+ projects[calendar][patch][rfc-fixes][md5] = "e4876228f449cb0c37ffa0f2142"
126
+ projects[cck][subdir] = "contrib"
127
+ projects[ctools][version] = "1.0-rc1"
128
+ projects[] = "date"
129
+ projects[] = "file_entity"
130
+ projects[foobar][download][url] = "mymodules/foobar.zip"
131
+ projects[] = "imce"
132
+ projects[] = "insert"
133
+ projects[jquery_ui][patch][some-patch.diff][url] = "http://path/to/some-patch.diff"
134
+ projects[] = "patterns"
135
+ projects[] = "respond"
136
+ projects[tao][type] = "theme"
137
+ projects[tao][location] = "http://code.developmentseed.com/fserver"
138
+ projects[tao][download][type] = "git"
139
+ projects[tao][download][url] = "git://github.com/developmentseed/tao.git"
140
+ projects[] = "views"
141
+ projects[wysiwyg][version] = "2.1"
142
+
143
+ libraries[foolib][download][type] = "file"
144
+ libraries[foolib][download][url] = "foolib.tar.gz"
145
+ libraries[foolib][destination] = "libraries"
146
+ libraries[foolib][directory_name] = "foolib"
147
+ libraries[jquery_ui][download][type] = "file"
148
+ libraries[jquery_ui][download][url] = "http://jquery-ui.googlecode.com/files/jquery.ui-1.6.zip"
149
+ libraries[jquery_ui][download][md5] = "c177d38bc7af59d696b2efd7dda5c605"
150
+ libraries[jquery_ui][destination] = "modules/contrib/jquery_ui"
151
+ libraries[jquery_ui][directory_name] = "jquery_ui"
152
+ libraries[profiler][download][type] = "get"
153
+ libraries[profiler][download][url] = "http://ftp.drupal.org/files/projects/profiler-7.x-2.0-beta1.tar.gz"
154
+ libraries[profiler][destination] = "libraries"
155
+ libraries[profiler][directory_name] = "profiler"
156
+ libraries[shadowbox][download][type] = "post"
157
+ libraries[shadowbox][download][url] = "http://www.shadowbox-js.com/download"
158
+ libraries[shadowbox][download][file_type] = "tar.gz"
159
+ libraries[shadowbox][download][post_data] = "format=tar&adapter=jquery&players[]=img&players[]=iframe&players[]=html&players[]=swf&players[]=flv&players[]=qt&players[]=wmp&language=en&css_support=on"
160
+ libraries[shadowbox][destination] = "libraries"
161
+ libraries[shadowbox][directory_name] = "shadowbox"
162
+ EOS
163
+ assert_equal mf, @makefile.to_s
164
+ end
165
+
166
+ def test_patches
167
+ p = @makefile.get_project('calendar')
168
+ assert p.has_patches?
169
+ p.each_patch do |pa| # There only one patch
170
+ assert_equal 'rfc-fixes', pa.descr
171
+ assert_equal 'http://drupal.org/files/issues/cal-760316-rfc-fixes-2.diff', pa.url
172
+ assert_equal 'e4876228f449cb0c37ffa0f2142', pa.md5
173
+ end
174
+ end
175
+
176
+ def test_subdir
177
+ p = @makefile.get_project('cck')
178
+ assert_equal 'contrib', p.subdir.to_s
179
+ end
180
+
181
+ end # TestDrupidMakefile
@@ -0,0 +1,53 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Copyright (c) 2012-2013 Lifepillar
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'helper'
24
+
25
+ class TestDrupidPatch < Minitest::Test
26
+
27
+ def setup
28
+ @temp_dir = FIXTURES + 'templib'
29
+ @temp_dir.mkpath
30
+ (TESTSITE+'sites/all/modules/views').ditto @temp_dir+'views'
31
+ @views = @temp_dir+'views'
32
+ end
33
+
34
+ def teardown
35
+ @temp_dir.rmtree
36
+ end
37
+
38
+ def test_apply_patch
39
+ assert((@views.exist? and @views.directory?), 'Temporary views dir not created')
40
+ patch = Drupid::Patch.new "file://#{FIXTURES+'views-info.diff'}", 'test patch'
41
+ assert_equal "file://#{FIXTURES+'views-info.diff'}", patch.url, 'Incorrect patch url'
42
+ @temp_dir.cd do
43
+ patch.fetch
44
+ end
45
+ assert_equal @temp_dir+'views-info.diff', patch.cached_location, 'Wrong cached location'
46
+ assert((@temp_dir+'views-info.diff').exist?, 'Patch not downloaded')
47
+ @views.cd do
48
+ res = patch.apply
49
+ assert res, 'Patch not applied'
50
+ end
51
+ end
52
+
53
+ end # TestDrupidPatch