drupid 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a929de2a2d0b7af58b9721bfbbcca432d7a4c89
4
- data.tar.gz: b34541cadc20ec1c9ec0fc56ae739c9350ccd67b
3
+ metadata.gz: 8030f123e42767835106890cb4607a65167fd13f
4
+ data.tar.gz: d77d020f6fdd540b8f25c04d657990ef5663f3d6
5
5
  SHA512:
6
- metadata.gz: 4f4b0a07712d7a4d42f812696392c09b4420b873f36efddbf9862bc85bd8455ffeacc5e205daa3f80fc03686faa624d83302d230ae11b47dd332f8acef5977ff
7
- data.tar.gz: 4a9445e9f04fb27f411e4ab4b990dfc735a7b3035a0a5e745816387d114e195da9da896800a29b97c0ecf44de3476df246c6677313adb0e230814fbf45f140f7
6
+ metadata.gz: e8638f29cc4a2b423328628e0f89ea723597d5bfe49e3ae2c4f710a7c40bafc8859e32903bb4b0dc1910897b0a9976742b11def87952d753d8116eaae880418b
7
+ data.tar.gz: 7f5563fa71d1ff292aa70069cd5a0823b086814e992bbe6795247bf03fb339dfecdb0ad011f94760bea276df8d0d7e384d6b545efc07dda9c27228424e1abc4f
data/.bundle/config ADDED
@@ -0,0 +1,3 @@
1
+ ---
2
+ BUNDLE_PATH: .bundle
3
+ BUNDLE_DISABLE_SHARED_GEMS: '1'
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ .DS_Store
2
+ Gemfile.lock
3
+ /pkg/drupid-*.gem
4
+ /.bundle/*
5
+ !/.bundle/config
6
+ /bin/*
7
+ !/bin/drupid
8
+ /doc/
9
+ /test/makefiles/*
10
+ !/test/makefiles/*.make
data/.rbenv-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0-p247
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org/'
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,56 @@
1
+ ## Drupid
2
+
3
+ _The not-so-smart Drupal updater that keeps your Drupal platform in sync with a Drush makefile!_
4
+
5
+ Drupid is a better replacement for [Drush](https://github.com/drush-ops/drush) `make`. Drupid does not only build a Drupal platform based on a makefile: it **synchronizes** a Drupal's platform with a makefile!
6
+
7
+ [![Gem Version](https://badge.fury.io/rb/drupid.png)](http://badge.fury.io/rb/drupid)
8
+
9
+
10
+ ### Release Notes ###
11
+
12
+ #### Version 1.1.2 (2013/9/1) ####
13
+
14
+ Clean up the gem packaging process and fix a broken dependency in Ruby 1.8.
15
+
16
+ #### Version 1.1.0 (2013/9/1) ####
17
+
18
+ - Drush is no more a required dependency. Drush is now used only for database-related operations, but Drupid will work even if Drush is not found. When Drush is not installed, downgrading a project always requires `--force`.
19
+ - Added a `--updatedb` option to automatically update Drupal's database after a successful synchronization. If Drush is not installed, this option has no effect.
20
+ - The logic of choosing the best candidate for an update has been changed. Instead of relying on Drush's “recommended” and “supported” releases, Drupid now implements its own method. In general, Drupid will always prefer stable releases (whose version does not contain any extra part) over anything else. So, for example, if a project has version 1.1 and version 2.0-rc1, Drupid will consider 1.1 better (i.e., more stable) than 2.0-rc1, even if 2.0-rc1 is the recommended release. One can always choose a specific version in the makefile, of course. See `Drupid::Version#better` for the details.
21
+ - Overall improvement of Drupid's output messages.
22
+ - Fixed bugs in parsing Drush output by using the YAML format (tested with Drush 6.0).
23
+ - Drupid should now always exit with exit code 1 upon failure.
24
+ - Lots of other bug fixes.
25
+
26
+
27
+ #### Version 1.0.2 (2013/8/26) ####
28
+
29
+ Tested compatibility with Ruby 2.0.
30
+
31
+ #### Version 1.0.1 (2012/11/5) ####
32
+
33
+ Fixed a bug causing a “Can't convert Pathname to String” error in some Ruby variants (e.g., 1.9.1-p243).
34
+
35
+ #### Version 1.0.0 ####
36
+
37
+ First public release.
38
+
39
+
40
+ ### How To Run The Tests ###
41
+
42
+ To run the whole test suite:
43
+
44
+ bundle exec rake test
45
+
46
+ To run a single test file:
47
+
48
+ bundle exec ruby -Itest -Ilib test/test_<name>.rb
49
+
50
+ or
51
+
52
+ bundle exec rake test TEST='test/test_<name>.rb'
53
+
54
+ To run a single test:
55
+
56
+ ruby -Itest -Ilib test/test_NAME.rb --name '<test method name>'
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'bundler/gem_tasks'
3
+ require 'rake/testtask'
4
+ begin; require 'rdoc/task'; rescue LoadError; end
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.verbose = false
8
+ t.warning = false # Set to true to turn on warnings *and* set $VERBOSE = true
9
+ t.libs << 'test'
10
+ t.pattern = 'test/**/test_*.rb'
11
+ end
12
+
13
+ # Documentation
14
+ begin
15
+ RDoc::Task.new(:rdoc => "doc", :clobber_rdoc => "doc:clean", :rerdoc => "doc:force") do |rd|
16
+ rd.rdoc_dir = 'doc'
17
+ rd.main = 'README.md'
18
+ rd.rdoc_files.include('README.md')
19
+ rd.rdoc_files.include('lib/**/*.rb')
20
+ rd.title = 'Drupid'
21
+ end
22
+ rescue
23
+ end
24
+
25
+ desc "Run tests"
26
+ task :default => :test
data/bin/drupid CHANGED
@@ -46,7 +46,6 @@ module Drupid
46
46
  end
47
47
 
48
48
  def preflight_dependencies
49
- odie 'Drupid requires Ruby 1.8.7 or later' if RUBY_VERSION < '1.8.7'
50
49
  ['diff','curl','git','mktemp','patch','rsync'].each do |cmd|
51
50
  if `which #{cmd} 2>/dev/null`.chomp.empty?
52
51
  odie "Drupid requires '#{cmd}', but '#{cmd}' was not found in your PATH."
@@ -86,7 +85,6 @@ module Drupid
86
85
  o.on('-g', '--graph', 'Generate a dependency graph and exit.') { @options[:command] = :graph }
87
86
  o.on('-h', '--help', 'Print help and exit.') {
88
87
  puts o
89
- puts "\nGleefully brought to you by Lifepillar! http://lifepillar.com"
90
88
  exit 0
91
89
  }
92
90
  o.on('-l', '--no-libs', 'Do not synchronize libraries.') { @options[:nolibs] = true }
@@ -100,7 +98,7 @@ module Drupid
100
98
  '(For multi-site platforms.)') { |s| @options[:site] = s }
101
99
  o.on('-u', '--updatedb', "Update Drupal's database after a successful sync.") { @options[:updatedb] = true }
102
100
  o.on('-v', '--verbose', 'Be verbose.') { $VERBOSE = true }
103
- o.on('-V', '--version', 'Print version and exit.') { puts DRUPID_USER_AGENT; exit 0 }
101
+ o.on('-V', '--version', 'Print version and exit.') { puts USER_AGENT; exit 0 }
104
102
  o.parse!
105
103
  end
106
104
  rescue OptionParser::InvalidOption, OptionParser::AmbiguousOption => ex
data/drupid.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'drupid/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'drupid'
8
+ gem.required_ruby_version = '>= 1.8.7'
9
+ gem.version = Drupid::VERSION
10
+ gem.license = 'MIT'
11
+ gem.authors = ['Lifepillar']
12
+ gem.email = 'lifepillar@lifepillar.com'
13
+ gem.description = 'Drupid keeps a Drush makefile in sync with a Drupal distribution.'
14
+ gem.summary = 'The not-so-smart Drupal bundler!'
15
+ gem.date = Time.now.strftime('%Y-%m-%d')
16
+ gem.homepage = 'http://lifepillar.com'
17
+
18
+ gem.files = `git ls-files`.split($/)
19
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
+ gem.require_paths = ['lib']
22
+ gem.has_rdoc = true
23
+ gem.rdoc_options << '--title' << 'Drupid' << '--line-numbers'
24
+
25
+ # Dependencies
26
+ gem.add_runtime_dependency 'rgl', ['>= 0.4.0']
27
+ nokogiri_version = (RUBY_VERSION < '1.9') ? '= 1.5.9' : '>= 1.6.0'
28
+ gem.add_runtime_dependency 'nokogiri', [nokogiri_version]
29
+ gem.add_development_dependency 'minitest', ['>= 5.0.6']
30
+ gem.add_development_dependency 'rdoc', ['>= 0']
31
+ end
@@ -0,0 +1,276 @@
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
+ module Drupid
24
+
25
+ class NotDrupalVersionError < RuntimeError
26
+ end
27
+
28
+ # Represents the core attribute of a version object (e.g., '7.x').
29
+ # A VersionCore object can be initialized from a number, a string,
30
+ # a Drupid::VersionCore object or a Drupid::Version object.
31
+ #
32
+ # Examples:
33
+ # core = Drupid::VersionCore.new '8.x'
34
+ # core = Drupid::VersionCore.new '8'
35
+ # core = Drupid::VersionCore.new '8.x-1.0'
36
+ # core = Drupid::VersionCore.new 8
37
+ # core = Drupid::VersionCore.new(Drupid::Version.new(8, '1.0'))
38
+ class VersionCore
39
+ include Comparable
40
+
41
+ attr :core
42
+
43
+ def initialize spec
44
+ if spec.is_a?(String)
45
+ spec.strip.match(/^(\d+)(\.x)?($|-)/)
46
+ raise NotDrupalVersionError, "Wrong core specification: #{core}" unless $1
47
+ @core = $1.to_i
48
+ elsif spec.is_a?(Version)
49
+ @core = spec.core.to_i
50
+ elsif spec.is_a?(VersionCore)
51
+ @core = spec.to_i
52
+ elsif spec.is_a?(Numeric)
53
+ @core = spec.to_i # to_i truncates a Float object (so that 7.9 correctly becomes 7)
54
+ else
55
+ raise NotDrupalVersionError, "Wrong core specification: #{core}"
56
+ end
57
+ end
58
+
59
+ # Returns the core number as a string, e.g., '8.x'.
60
+ def to_s
61
+ @core.to_s + '.x'
62
+ end
63
+
64
+ # Returns the core number as a Fixnum object.
65
+ def to_i
66
+ @core
67
+ end
68
+
69
+ def <=>(other)
70
+ @core <=> other.core
71
+ end
72
+ end
73
+
74
+ # Represents a project's version. A version has the form:
75
+ # <core>.x-<major>.<patch level>[-<extra>]
76
+ # Examples of versions include: '7.x-1.0', '7.x-1.2-beta2', '8.x-1.x-dev'.
77
+ #
78
+ # See also: http://drupal.org/node/467026
79
+ class Version
80
+ include Comparable
81
+ # The core number, e.g., in 7.x-3.2.beta1, it is 7.
82
+ attr :core
83
+ # The major version number, e.g., in 7.x-3.2-beta1, it is 3 (Fixnum).
84
+ attr :major
85
+ # The patch level, e.g., in 7.x-3.2-beta1, it is 2 (Fixnum).
86
+ attr :patchlevel
87
+ # The project's type, which is one of the constants UNSTABLE,
88
+ # ALPHA, BETA, RC, DEVELOPMENT, EMPTY or UNKNOWN.
89
+ # For example, for 7.x-3.2-beta1, it is BETA.
90
+ attr :extra_type
91
+ # The numeric part of the extra description, e.g., 7.x-3.2-beta1, it is 1 (Fixnum).
92
+ attr :extra_num
93
+
94
+ UNKNOWN = -1
95
+ DEVELOPMENT = 1
96
+ UNSTABLE = 2
97
+ ALPHA = 4
98
+ BETA = 8
99
+ RC = 16
100
+ EMPTY = 32
101
+
102
+ def initialize(core_num, v)
103
+ raise 'Drupal version is not a string.' unless v.is_a?(String)
104
+ @core = Drupid::VersionCore.new(core_num)
105
+ @major = v.match(/^(\d+)/)[1].to_i
106
+ @patchlevel = $~.post_match.match(/\.(\d+|x)/)[1]
107
+ @patchlevel = @patchlevel.to_i if 'x' != @patchlevel
108
+ @extra_string = ''
109
+ encode_extra($~.post_match) # Initialize @extra_type and @extra_num
110
+ end
111
+
112
+ # Builds a Drupid::Version object from a string, e.g., '8.x-2.0rc1'.
113
+ def self.from_s v
114
+ if v.match(/^(\d+)\.x-(\d+.+)$/)
115
+ Version.new($1.to_i, $2)
116
+ else
117
+ raise NotDrupalVersionError, "Cannot build a version from this string: #{v}"
118
+ end
119
+ end
120
+
121
+ # Returns true if this version represents a development snapshot;
122
+ # returns false otherwise.
123
+ def development_snapshot?
124
+ 'x' == @patchlevel or DEVELOPMENT == @extra_type
125
+ end
126
+
127
+ # Returns true if this a stable version (e.g., '8.x-1.0').
128
+ def stable?
129
+ EMPTY == @extra_type and 'x' != @patchlevel
130
+ end
131
+
132
+ # Returns true if this is a release candidate (e.g., '8.x-1.0-rc1').
133
+ def release_candidate?
134
+ RC == @extra_type
135
+ end
136
+
137
+ # Returns true if this is an alpha release (e.g., '8.x-1.0-alpha1').
138
+ def alpha?
139
+ ALPHA == @extra_type
140
+ end
141
+
142
+ # Returns true if this is a beta release (e.g., '8.x-1.0-beta1').
143
+ def beta?
144
+ BETA == @extra_type
145
+ end
146
+
147
+ # A synonym for self.short.
148
+ def to_s
149
+ short
150
+ end
151
+
152
+ # Returns a short textual representation of this version, e.g., '3.2'.
153
+ def short
154
+ xtr = extra()
155
+ xtr = '-' + xtr if '' != xtr
156
+ @major.to_s + '.' + @patchlevel.to_s + xtr
157
+ end
158
+
159
+ # Returns the full textual representation of this version, e.g., '7.x-3.2'.
160
+ def long
161
+ xtr = extra()
162
+ xtr = '-' + xtr if '' != xtr
163
+ @core.to_s + '-' + @major.to_s + '.' + @patchlevel.to_s + xtr
164
+ end
165
+
166
+ # In Ruby 1.8.7, some equality tests fail with the following message:
167
+ # No visible difference.
168
+ # You should look at your implementation of ==.
169
+ # if only <=> is defined. This is why we define == explicitly.
170
+ def ==(other)
171
+ @core == other.core and
172
+ @major == other.major and
173
+ @patchlevel == other.patchlevel and
174
+ @extra_type == other.extra_type and
175
+ @extra_num == other.extra_num
176
+ end
177
+
178
+ # Compares two versions according the their "natural" ordering.
179
+ #
180
+ # According to this ordering, '1.x-dev' < '1.0-unstable6' <
181
+ # '1.0-alpha4' < '1.0-beta0' < '1.0-rc1' < '1.0' <'2.x-dev'.
182
+ def <=>(w)
183
+ c = @core <=> w.core
184
+ if 0 == c
185
+ c = @major <=> w.major
186
+ if 0 == c
187
+ c = @patchlevel <=> w.patchlevel
188
+ case c
189
+ when nil # e.g., 1 vs 'x'
190
+ c = ('x' == @patchlevel) ? -1 : 1
191
+ when 0
192
+ c = @extra_type <=> w.extra_type
193
+ if 0 == c
194
+ c = @extra_num <=> w.extra_num
195
+ end
196
+ end
197
+ end
198
+ end
199
+ c
200
+ end
201
+
202
+ # Compares two versions to determine which is "better".
203
+ # Returns -1 if self is better than w, 0 when they are
204
+ # the same equivalent, 1 when w is better than w.
205
+ #
206
+ # By our own definitions, stable versions (e.g., '1.0') are
207
+ # better than release candidates (e.g., ('1.1-rc1'), which are
208
+ # better than beta releases (e.g., '1.2-beta2'), which are better than
209
+ # alpha releases (e.g., '1.3-alpha1'), which are better than
210
+ # unstable releases (e.g., '1.4-unstable10'), which are better
211
+ # than development snapshots (e.g., '2.x-dev'), which are better
212
+ # than anything else (e.g., '3.x').
213
+ def better(w)
214
+ if ('x' == @patchlevel and EMPTY == @extra_type) or (EMPTY == w.extra_type and 'x' == w.patchlevel)
215
+ c = (self <=> w)
216
+ else
217
+ c = @extra_type <=> w.extra_type
218
+ if 0 == c
219
+ c = (self <=> w)
220
+ end
221
+ end
222
+ c
223
+ end
224
+
225
+ def extra
226
+ case @extra_type
227
+ when EMPTY then t = ''
228
+ when UNSTABLE then t = 'unstable'
229
+ when ALPHA then t = 'alpha'
230
+ when BETA then t = 'beta'
231
+ when RC then t = 'rc'
232
+ when DEVELOPMENT then t = 'dev'
233
+ else # unknown
234
+ t = @extra_string
235
+ end
236
+ if UNKNOWN == @extra_num
237
+ t
238
+ else
239
+ t + @extra_num.to_s
240
+ end
241
+ end
242
+
243
+ private
244
+
245
+ def encode_extra(e)
246
+ @extra_string = e.start_with?('-') ? e.sub(/-/, '') : e
247
+ if e.match(/dev(\d*)$/)
248
+ @extra_type = DEVELOPMENT
249
+ @extra_num = ($~[1] == '') ? UNKNOWN : $~[1].to_i
250
+ return
251
+ end
252
+ e.match(/^-{0,1}([A-z]*)(\d*)$/)
253
+ if nil != $~
254
+ t = $~[1]
255
+ n = $~[2]
256
+ case t
257
+ when /^$/ then @extra_type = EMPTY
258
+ when /dev/ then @extra_type = DEVELOPMENT
259
+ when /unstable/ then @extra_type = UNSTABLE
260
+ when /alpha/ then @extra_type = ALPHA
261
+ when /beta/ then @extra_type = BETA
262
+ when /rc/ then @extra_type = RC
263
+ else
264
+ @extra_type = UNKNOWN
265
+ end
266
+ @extra_num = ('' != n) ? n.to_i : UNKNOWN
267
+ else
268
+ @extra_type = UNKNOWN
269
+ @extra_num = UNKNOWN
270
+ end
271
+ return
272
+ end
273
+
274
+ end # class Version
275
+
276
+ end # Drupid
data/lib/drupid/utils.rb CHANGED
@@ -153,7 +153,7 @@ module Drupid
153
153
 
154
154
  def curl *args
155
155
  curl = Pathname.new(which 'curl')
156
- args = ['-qf#LA', DRUPID_USER_AGENT, *args]
156
+ args = ['-qf#LA', USER_AGENT, *args]
157
157
  args << "--insecure" #if MacOS.version < 10.6
158
158
  args << "--silent" unless $VERBOSE
159
159