fanforce-plugin-factory 0.41.0 → 1.6.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. data/.gitignore +1 -0
  2. data/.ruby-version +1 -0
  3. data/.yardopts +5 -0
  4. data/.yardopts.rb +1 -0
  5. data/Gemfile +9 -0
  6. data/README.md +40 -75
  7. data/Rakefile +61 -4
  8. data/fanforce-plugin-factory.gemspec +21 -21
  9. data/lib/fanforce/plugin_factory.rb +16 -58
  10. data/lib/fanforce/plugin_factory/Rakefile +51 -0
  11. data/lib/fanforce/plugin_factory/Routes.rb +33 -0
  12. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_bootstrap.scss +2 -0
  13. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_common.scss +1 -0
  14. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_directives.scss +7 -0
  15. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_font-awesome.scss +1 -0
  16. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_ui-select.scss +3 -0
  17. data/lib/fanforce/plugin_factory/{assets/lib/common → asset_framework/plugin_factory/bootstrap}/_bootstrap-overrides.scss +2 -0
  18. data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/css → asset_framework/plugin_factory/bootstrap}/bootstrap.css +2 -2
  19. data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/js → asset_framework/plugin_factory/bootstrap}/bootstrap.js +0 -0
  20. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/bootstrap.min.css +7 -0
  21. data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/js → asset_framework/plugin_factory/bootstrap}/bootstrap.min.js +0 -0
  22. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.eot +0 -0
  23. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.svg +229 -0
  24. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  25. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.woff +0 -0
  26. data/lib/fanforce/plugin_factory/{assets/lib → asset_framework/plugin_factory}/common/_mixins.scss +2 -1
  27. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives.coffee +1 -0
  28. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/error/_error.scss +6 -0
  29. data/lib/fanforce/plugin_factory/{assets/lib/common/module-error → asset_framework/plugin_factory/directives/error}/arrow-left.png +0 -0
  30. data/lib/fanforce/plugin_factory/{assets/lib/common/module-error → asset_framework/plugin_factory/directives/error}/icon-error.png +0 -0
  31. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/initiative-footer/_initiative-footer.coffee +16 -0
  32. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-add-initiative-footer.scss → asset_framework/plugin_factory/directives/initiative-footer/_initiative-footer.scss} +4 -1
  33. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-initiative-searcher.scss → asset_framework/plugin_factory/directives/initiative-searcher/_initiative-searcher.scss} +14 -13
  34. data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/icon-search.png +0 -0
  35. data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/spinner.gif +0 -0
  36. data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/sprite-arrows.png +0 -0
  37. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/loading/_loading.coffee +4 -0
  38. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/loading/_loading.scss +4 -0
  39. data/lib/fanforce/plugin_factory/{assets/js/add_source_popup.js → asset_framework/plugin_factory/directives/saving-to-server/_saving-to-server.coffee} +0 -0
  40. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/saving-to-server/_saving-to-server.scss +6 -0
  41. data/lib/fanforce/plugin_factory/{assets/lib/common/module-saving-initiative → asset_framework/plugin_factory/directives/saving-to-server}/spinner.gif +0 -0
  42. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/start-arrow/_start-arrow.coffee +8 -0
  43. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-start-here.scss → asset_framework/plugin_factory/directives/start-arrow/_start-arrow.scss} +5 -4
  44. data/lib/fanforce/plugin_factory/{assets/lib/common/module-start-here → asset_framework/plugin_factory/directives/start-arrow}/arrow.png +0 -0
  45. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-video-thumbnail.scss → asset_framework/plugin_factory/directives/video-thumbnail/_video-thumbnail.scss} +4 -4
  46. data/lib/fanforce/plugin_factory/{assets/lib/common/module-video-thumbnail → asset_framework/plugin_factory/directives/video-thumbnail}/icon-play.png +0 -0
  47. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/font-awesome.coffee +1 -0
  48. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/FontAwesome.otf +0 -0
  49. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/css → asset_framework/plugin_factory/font-awesome}/font-awesome.css +2 -2
  50. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/css → asset_framework/plugin_factory/font-awesome}/font-awesome.min.css +0 -0
  51. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.eot +0 -0
  52. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.svg +0 -0
  53. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.ttf +0 -0
  54. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.woff +0 -0
  55. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib.coffee +1 -0
  56. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib/ng-focus-blur.js +68 -0
  57. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib/ng-visible.js +7 -0
  58. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select.coffee +1 -0
  59. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select.css +171 -0
  60. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select.js +1281 -0
  61. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select_override.scss +1 -0
  62. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/selectize.default.css +443 -0
  63. data/lib/fanforce/plugin_factory/cli.rb +5 -0
  64. data/lib/fanforce/plugin_factory/cli/lib/bitbucket.rb +77 -0
  65. data/lib/fanforce/plugin_factory/cli/lib/bundler.rb +21 -0
  66. data/lib/fanforce/plugin_factory/cli/lib/env.rb +96 -0
  67. data/lib/fanforce/plugin_factory/cli/lib/git.rb +59 -0
  68. data/lib/fanforce/plugin_factory/cli/lib/heroku.rb +94 -0
  69. data/lib/fanforce/plugin_factory/cli/lib/iron.rb +71 -0
  70. data/lib/fanforce/plugin_factory/cli/lib/pow.rb +46 -0
  71. data/lib/fanforce/plugin_factory/cli/lib/scaffolding.rb +74 -0
  72. data/lib/fanforce/plugin_factory/cli/lib/scaffolding_file.rb +510 -0
  73. data/lib/fanforce/plugin_factory/cli/lib/uranium.rb +77 -0
  74. data/lib/fanforce/plugin_factory/cli/lib/utils.rb +57 -0
  75. data/lib/fanforce/plugin_factory/cli/scripts/config.rb +9 -0
  76. data/lib/fanforce/plugin_factory/cli/scripts/create.rb +64 -0
  77. data/lib/fanforce/plugin_factory/cli/scripts/destroy.rb +61 -0
  78. data/lib/fanforce/plugin_factory/cli/scripts/diff.rb +156 -0
  79. data/lib/fanforce/plugin_factory/cli/scripts/push.rb +88 -0
  80. data/lib/fanforce/plugin_factory/cli/scripts/restart.rb +41 -0
  81. data/lib/fanforce/plugin_factory/cli/scripts/setup.rb +70 -0
  82. data/lib/fanforce/plugin_factory/cli/scripts/update.rb +132 -0
  83. data/lib/fanforce/plugin_factory/cli_directory_of_plugins.rb +51 -0
  84. data/lib/fanforce/plugin_factory/cli_single_plugin.rb +52 -0
  85. data/lib/fanforce/plugin_factory/controllers/base_controller.rb +15 -0
  86. data/lib/fanforce/plugin_factory/core_config.rb +94 -0
  87. data/lib/fanforce/plugin_factory/directive_views/initiative-footer.haml +8 -0
  88. data/lib/fanforce/plugin_factory/load.rb +7 -0
  89. data/lib/fanforce/plugin_factory/load_iron_worker.rb +2 -0
  90. data/lib/fanforce/plugin_factory/load_sprockets.rb +2 -0
  91. data/lib/fanforce/plugin_factory/plugin.rb +60 -0
  92. data/lib/fanforce/plugin_factory/scaffolding/._.gitignore.registry +1 -0
  93. data/lib/fanforce/plugin_factory/scaffolding/._Gemfile.registry +3 -0
  94. data/lib/fanforce/plugin_factory/scaffolding/._Rakefile.registry +3 -0
  95. data/lib/fanforce/plugin_factory/scaffolding/._config.json.registry +2 -0
  96. data/lib/fanforce/plugin_factory/scaffolding/._config.ru.registry +4 -0
  97. data/lib/fanforce/plugin_factory/scaffolding/._favicon.ico.registry +1 -0
  98. data/lib/fanforce/plugin_factory/scaffolding/._robots.txt.registry +3 -0
  99. data/lib/fanforce/plugin_factory/scaffolding/.gitignore +27 -0
  100. data/lib/fanforce/plugin_factory/scaffolding/Gemfile +9 -0
  101. data/lib/fanforce/plugin_factory/scaffolding/Rakefile +7 -0
  102. data/lib/fanforce/plugin_factory/scaffolding/Routes.rb +67 -0
  103. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._fembedded.scss.registry +4 -0
  104. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._promotional.scss.registry +4 -0
  105. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._visitor.scss.registry +4 -0
  106. data/lib/fanforce/plugin_factory/scaffolding/assets/css/fembedded.scss +24 -0
  107. data/lib/fanforce/plugin_factory/scaffolding/assets/css/promotional.scss +33 -0
  108. data/lib/fanforce/plugin_factory/scaffolding/assets/css/visitor.scss +61 -0
  109. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-16.png.registry +1 -0
  110. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-32.png.registry +1 -0
  111. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-42.png.registry +1 -0
  112. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._marketplace.png.registry +1 -0
  113. data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-16.png +0 -0
  114. data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-32.png +0 -0
  115. data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-42.png +0 -0
  116. data/lib/fanforce/plugin_factory/scaffolding/assets/img/marketplace.png +0 -0
  117. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._fanforce_bg.png.registry +1 -0
  118. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._icon-42.png.registry +1 -0
  119. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._icon-plus.png.registry +1 -0
  120. data/lib/fanforce/plugin_factory/{assets/lib → scaffolding/assets/img}/promotional/fanforce_bg.png +0 -0
  121. data/lib/fanforce/plugin_factory/{assets/lib → scaffolding/assets/img}/promotional/icon-42.png +0 -0
  122. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/icon-plus.png +0 -0
  123. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded-app.coffee.registry +5 -0
  124. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded.js.registry +3 -0
  125. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._promotional.js.registry +3 -0
  126. data/lib/fanforce/plugin_factory/scaffolding/assets/js/fembedded-app.coffee +11 -0
  127. data/lib/fanforce/plugin_factory/scaffolding/assets/js/fembedded.js +12 -0
  128. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._cookie.coffee.registry +3 -0
  129. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._filters.coffee.registry +3 -0
  130. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._utils.coffee.registry +3 -0
  131. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/cookie.coffee +24 -0
  132. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee +9 -0
  133. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/utils.coffee +40 -0
  134. data/lib/fanforce/plugin_factory/scaffolding/assets/js/promotional.js +4 -0
  135. data/lib/fanforce/plugin_factory/scaffolding/config.json +24 -0
  136. data/lib/fanforce/plugin_factory/scaffolding/config.ru +8 -0
  137. data/lib/fanforce/plugin_factory/{public → scaffolding}/favicon.ico +0 -0
  138. data/lib/fanforce/plugin_factory/scaffolding/layouts/._fembedded.haml.registry +4 -0
  139. data/lib/fanforce/plugin_factory/scaffolding/layouts/._promotional.haml.registry +2 -0
  140. data/lib/fanforce/plugin_factory/scaffolding/layouts/._visitor.haml.registry +6 -0
  141. data/lib/fanforce/plugin_factory/scaffolding/layouts/fembedded.haml +26 -0
  142. data/lib/fanforce/plugin_factory/{layouts → scaffolding/layouts}/promotional.haml +6 -6
  143. data/lib/fanforce/plugin_factory/{layouts/engage.haml → scaffolding/layouts/visitor.haml} +10 -7
  144. data/lib/fanforce/plugin_factory/scaffolding/robots.txt +7 -0
  145. data/lib/fanforce/plugin_factory/scaffolding/views/._index.haml.registry +3 -0
  146. data/lib/fanforce/plugin_factory/{views → scaffolding/views}/index.haml +13 -7
  147. data/lib/fanforce/plugin_factory/sinatra/_load.rb +87 -0
  148. data/lib/fanforce/plugin_factory/sinatra/error_handling.rb +48 -0
  149. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_behavior.rb +19 -0
  150. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_broadcaster.rb +7 -0
  151. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_connector.rb +11 -0
  152. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_identifier.rb +3 -0
  153. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_js_widget.rb +8 -0
  154. data/lib/fanforce/plugin_factory/sinatra/helper_routes/plugin.rb +50 -0
  155. data/lib/fanforce/plugin_factory/sinatra/helpers/assets.rb +23 -0
  156. data/lib/fanforce/plugin_factory/sinatra/helpers/css_frameworks.rb +70 -0
  157. data/lib/fanforce/plugin_factory/sinatra/helpers/fanforce.rb +18 -0
  158. data/lib/fanforce/plugin_factory/{config → sinatra}/helpers/json.rb +2 -2
  159. data/lib/fanforce/plugin_factory/sinatra/helpers/ractive.rb +45 -0
  160. data/lib/fanforce/plugin_factory/sprockets/compiler.rb +5 -11
  161. data/lib/fanforce/plugin_factory/sprockets/hacks.rb +2 -2
  162. data/lib/fanforce/plugin_factory/version.rb +2 -2
  163. metadata +201 -195
  164. data/.rbenv-gemsets +0 -1
  165. data/.rbenv-version +0 -1
  166. data/lib/fanforce/plugin_factory.rake +0 -72
  167. data/lib/fanforce/plugin_factory/_init_sinatra.rb +0 -54
  168. data/lib/fanforce/plugin_factory/assets/css/add_edit_initiative.scss +0 -1
  169. data/lib/fanforce/plugin_factory/assets/css/add_source.scss +0 -1
  170. data/lib/fanforce/plugin_factory/assets/css/convert_pending_initiative.scss +0 -1
  171. data/lib/fanforce/plugin_factory/assets/css/engage.scss +0 -1
  172. data/lib/fanforce/plugin_factory/assets/css/new_message.scss +0 -1
  173. data/lib/fanforce/plugin_factory/assets/css/promotional.scss +0 -1
  174. data/lib/fanforce/plugin_factory/assets/css/source_details.scss +0 -1
  175. data/lib/fanforce/plugin_factory/assets/js/add_edit_initiative.js +0 -1
  176. data/lib/fanforce/plugin_factory/assets/js/add_source.js +0 -1
  177. data/lib/fanforce/plugin_factory/assets/js/convert_pending_initiative.js +0 -1
  178. data/lib/fanforce/plugin_factory/assets/js/engage.js +0 -1
  179. data/lib/fanforce/plugin_factory/assets/js/new_message.js +0 -1
  180. data/lib/fanforce/plugin_factory/assets/js/promotional.js +0 -2
  181. data/lib/fanforce/plugin_factory/assets/js/source_details.js +0 -0
  182. data/lib/fanforce/plugin_factory/assets/lib/common/_module-error.scss +0 -11
  183. data/lib/fanforce/plugin_factory/assets/lib/common/_module-page-loading.scss +0 -1
  184. data/lib/fanforce/plugin_factory/assets/lib/common/_module-saving-initiative.scss +0 -6
  185. data/lib/fanforce/plugin_factory/assets/lib/common/_tags.scss +0 -1
  186. data/lib/fanforce/plugin_factory/assets/lib/common/_variables.scss +0 -27
  187. data/lib/fanforce/plugin_factory/assets/lib/common/broadcaster-divider-arrow.png +0 -0
  188. data/lib/fanforce/plugin_factory/assets/lib/common/icons/dropdown-arrow.png +0 -0
  189. data/lib/fanforce/plugin_factory/assets/lib/common/icons/initiative.png +0 -0
  190. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_add_edit_initiative.scss +0 -27
  191. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_add_source.scss +0 -18
  192. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_convert_pending_initiative.scss +0 -27
  193. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_engage.scss +0 -78
  194. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_new_message.scss +0 -24
  195. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_promotional.scss +0 -27
  196. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_source_details.scss +0 -17
  197. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/add_edit_initiative.js +0 -6
  198. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/add_source.js +0 -6
  199. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/convert_pending_initiative.js +0 -6
  200. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/engage.js +0 -0
  201. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/new_message.js +0 -5
  202. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/promotional.js +0 -1
  203. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/source_details.js +0 -5
  204. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-behavior.png +0 -0
  205. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-broadcaster.png +0 -0
  206. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-data-connector.png +0 -0
  207. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-data-processor.png +0 -0
  208. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-identifier.png +0 -0
  209. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-datepicker/datepicker.css +0 -7
  210. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-datepicker/datepicker.js +0 -454
  211. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-timepicker/timepicker.css +0 -82
  212. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-timepicker/timepicker.js +0 -803
  213. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/css/bootstrap.min.css +0 -7
  214. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.eot +0 -0
  215. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.svg +0 -0
  216. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.ttf +0 -0
  217. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.woff +0 -0
  218. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/_chosen_override.scss +0 -6
  219. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen-sprite.png +0 -0
  220. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen-sprite@2x.png +0 -0
  221. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen.jquery.js +0 -1166
  222. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen.scss +0 -434
  223. data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery-1.10.2.js +0 -9789
  224. data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery.inputHint.js +0 -154
  225. data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery.tmpl.debug.js +0 -484
  226. data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.custom-handlers.coffee +0 -155
  227. data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.debug.js +0 -4469
  228. data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.min.js +0 -96
  229. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/_select2_override.scss +0 -47
  230. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2-spinner.gif +0 -0
  231. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2.png +0 -0
  232. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2.scss +0 -617
  233. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2_modified.js +0 -3225
  234. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2x2.png +0 -0
  235. data/lib/fanforce/plugin_factory/assets/lib/vendors/underscore/underscore.debug.js +0 -999
  236. data/lib/fanforce/plugin_factory/config/_error_handling.rb +0 -27
  237. data/lib/fanforce/plugin_factory/config/core_config.rb +0 -92
  238. data/lib/fanforce/plugin_factory/config/helpers/assets.rb +0 -72
  239. data/lib/fanforce/plugin_factory/config/helpers/fanforce.rb +0 -19
  240. data/lib/fanforce/plugin_factory/layouts/add_edit_initiative.haml +0 -19
  241. data/lib/fanforce/plugin_factory/layouts/add_source.haml +0 -19
  242. data/lib/fanforce/plugin_factory/layouts/convert_pending_initiative.haml +0 -19
  243. data/lib/fanforce/plugin_factory/layouts/new_message.haml +0 -19
  244. data/lib/fanforce/plugin_factory/layouts/source_details.haml +0 -19
  245. data/lib/fanforce/plugin_factory/public/robots.txt +0 -2
  246. data/lib/fanforce/plugin_factory/routes.rb +0 -48
  247. data/lib/fanforce/plugin_factory/routes_behavior.rb +0 -34
  248. data/lib/fanforce/plugin_factory/routes_broadcaster.rb +0 -9
  249. data/lib/fanforce/plugin_factory/routes_data_connector.rb +0 -21
  250. data/lib/fanforce/plugin_factory/routes_identifier.rb +0 -3
  251. data/lib/fanforce/plugin_factory/views/add_initiative.haml +0 -1
  252. data/lib/fanforce/plugin_factory/views/add_source.haml +0 -1
  253. data/lib/fanforce/plugin_factory/views/close_popup.haml +0 -8
  254. data/lib/fanforce/plugin_factory/views/convert_pending_initiative.haml +0 -1
  255. data/lib/fanforce/plugin_factory/views/edit_initiative.haml +0 -1
  256. data/lib/fanforce/plugin_factory/views/engage.haml +0 -1
  257. data/lib/fanforce/plugin_factory/views/new_message.haml +0 -1
  258. data/lib/fanforce/plugin_factory/views/source_details.haml +0 -1
  259. data/lib/fanforce/plugin_factory/views/widget_tmpls.haml +0 -1
  260. data/lib/fanforce/plugin_factory_workers.rb +0 -2
@@ -0,0 +1,41 @@
1
+ class Fanforce::PluginFactory::CLI::Scripts
2
+ include Fanforce::PluginFactory::CLI::Utils
3
+
4
+ ######################################################################################################################
5
+
6
+ def restart(environment=:development)
7
+ environment = environment.to_sym
8
+
9
+ if Fanforce::CLI::TYPE == :directory_of_plugins
10
+ Fanforce::CLI::Plugins.each do |plugin, current_count, total|
11
+ restart_plugin(plugin, environment)
12
+ end
13
+ else
14
+ restart_plugin(Fanforce::CLI::Plugin.load(Fanforce::CLI::DIR), environment)
15
+ end
16
+ log divider '----------------------------------------------------------------------------------------------------++'
17
+ end
18
+
19
+ def restart_plugin(plugin, environment)
20
+ log divider '------------------------------------------------------------------------------------------------------'
21
+ environments = environment==:all ? [:development,:staging,:production] : [environment]
22
+ Dir.chdir(plugin.dir) do
23
+ environments.each do |environment|
24
+ if environment == :development
25
+ FileUtils.mkdir("#{plugin.dir}/tmp") if !File.directory?("#{plugin.dir}/tmp")
26
+ FileUtils.touch("#{plugin.dir}/tmp/restart.txt")
27
+ elsif [:production, :staging].include?(environment)
28
+ error 'Production and Staging are not working'
29
+ if config[:heroku].blank? or config[:heroku][environment].blank?
30
+ puts "#{'OOPS...'.format(:red,:bold)} #{environment} has not been setup on heroku"
31
+ next
32
+ end
33
+ heroku = auth_heroku(environment)
34
+ heroku.post_ps_restart get_heroku_app_name(plugin, environment)
35
+ end
36
+ log "#{"Restarted #{environment}".format(:bold,:green)} #{plugin.dir_name}"
37
+ end
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,70 @@
1
+ class Fanforce::PluginFactory::CLI::Scripts
2
+ include Fanforce::PluginFactory::CLI::Utils
3
+
4
+ require_relative '../lib/bundler'
5
+ require_relative '../lib/pow'
6
+ require_relative '../lib/git'
7
+ require_relative '../lib/bitbucket'
8
+ require_relative '../lib/env'
9
+ require_relative '../lib/uranium'
10
+
11
+ ######################################################################################################################
12
+
13
+ def setup(type=:all)
14
+ plugin = Fanforce::CLI::Plugin.new(Fanforce::CLI::DIR)
15
+ type = type.to_s.downcase.to_sym
16
+ error 'Unknown setup type', :setup if ![:all,:bundler,:pow,:git,:bitbucket,:env,:uranium].include?(type)
17
+
18
+ if !File.exists?("#{plugin.dir}/config.ru")
19
+ error "This does not seem to be a valid plugin directory since it's missing config.ru"
20
+ end
21
+
22
+ if [:all,:bundler].include?(type)
23
+ log divider '+---------------------------------------------------------------------------------------------------'
24
+ log 'SETTING UP BUNDLER...'
25
+ Fanforce::PluginFactory::CLI::Bundler.new(plugin).setup
26
+ end
27
+
28
+ if [:all,:pow].include?(type)
29
+ log divider '+---------------------------------------------------------------------------------------------------'
30
+ log 'SETTING UP POW DOMAINS...'
31
+ Fanforce::PluginFactory::CLI::Pow.new(plugin).setup
32
+ end
33
+
34
+ if [:all,:git].include?(type)
35
+ log divider '+---------------------------------------------------------------------------------------------------'
36
+ log 'SETTING UP GIT...'
37
+ Fanforce::PluginFactory::CLI::Git.new(plugin).setup
38
+ end
39
+
40
+ if [:all,:bitbucket].include?(type)
41
+ log divider '+---------------------------------------------------------------------------------------------------'
42
+ log 'SETTING UP BITBUCKET...'
43
+ Fanforce::PluginFactory::CLI::Bitbucket.new(plugin).setup
44
+ end
45
+
46
+ if [:all,:env].include?(type)
47
+ log divider '+---------------------------------------------------------------------------------------------------'
48
+ log 'SETTING UP ENV...'
49
+ Fanforce::PluginFactory::CLI::Env.new(plugin).setup(:development)
50
+ end
51
+
52
+ if [:all,:uranium].include?(type)
53
+ log divider '+---------------------------------------------------------------------------------------------------'
54
+ log 'RUNNING TOUCH TMP/RESTART.TXT...'
55
+ `touch tmp/restart.txt`
56
+ log 'Finished'.format(:green,:bold) + ' restarting'
57
+ end
58
+
59
+ if [:all,:uranium].include?(type)
60
+ log divider '+---------------------------------------------------------------------------------------------------'
61
+ log 'SETTING UP URANIUM...'
62
+ Fanforce::PluginFactory::CLI::Uranium.new(plugin).setup
63
+ end
64
+
65
+ log divider '+-----------------------------------------------------------------------------------------------------'
66
+ log 'SUCCESS!'.format(:bold,:green)
67
+ log divider '----------------------------------------------------------------------------------------------------++'
68
+ end
69
+
70
+ end
@@ -0,0 +1,132 @@
1
+ class Fanforce::PluginFactory::CLI::Scripts
2
+ include Fanforce::PluginFactory::CLI::Utils
3
+
4
+ require_relative '../lib/env'
5
+ require_relative '../lib/scaffolding'
6
+ require_relative '../lib/bundler'
7
+
8
+ ######################################################################################################################
9
+
10
+ def update(type)
11
+ type = type.to_sym
12
+
13
+ return update_factory if type == :factory
14
+
15
+ if Fanforce::CLI::TYPE == :directory_of_plugins
16
+ confirm("\nYou are about to update #{Fanforce::CLI::Plugins.total_count} plugins in this directory. This cannot be undone.\n"+
17
+ 'ARE YOU SURE?', true)
18
+
19
+ Fanforce::CLI::Plugins.each do |plugin, processed_count, total_count|
20
+ log divider '+-------------------------------------------------------------------------------------------------'
21
+ log "#{'PLUGIN'.format(:bold)} - #{plugin._id.upcase.gsub('-',' ').format(:bold)} (#{processed_count} of #{total_count})... "
22
+ update_plugin(plugin, type)
23
+ end
24
+ elsif Fanforce::CLI::TYPE == :single_plugin
25
+ plugin = Fanforce::CLI::Plugin.load(Fanforce::CLI::DIR)
26
+ confirm("\nYou are about to update #{plugin.name}. This cannot be undone.\n" +
27
+ 'ARE YOU SURE?', true)
28
+ update_plugin(plugin, type)
29
+ end
30
+ puts ''
31
+ end
32
+
33
+ def update_plugin(plugin, type)
34
+ if [:all,:files].include?(type)
35
+ if !Fanforce::PluginFactory::CLI::Scaffolding.new(plugin).update
36
+ log 'NO FILES NEED UPDATING'
37
+ end
38
+ end
39
+ if [:all,:env].include?(type)
40
+ Fanforce::PluginFactory::CLI::Env.new(plugin).setup(:development)
41
+ end
42
+ end
43
+
44
+ def update_factory
45
+ require_gem 'rest-client', 'rest_client'
46
+ require_gem 'multi_json', 'multi_json'
47
+
48
+ log divider '+--------------------------------------------------------------------------------------------------+'
49
+ print 'CHECKING RUBYGEMS... '
50
+ response = RestClient::Request.execute(:method => :get, :url => 'https://rubygems.org/api/v1/versions/fanforce-plugin-factory.json', :ssl_version => 'SSLv23').body
51
+ rubygems_version = MultiJson.load(response, symbolize_keys: true).first[:number]
52
+ current_version = config[:plugin_factory_gem][:version].match(/(\S+)\s*$/)[1] if config[:plugin_factory_gem][:version]
53
+
54
+ local_path = '/Fanforce/gems/fanforce-plugin-factory'
55
+ if File.directory?(local_path)
56
+ silence_warnings do require "#{local_path}/lib/fanforce/plugin_factory/version" end
57
+ local_version = Fanforce::PluginFactory::VERSION
58
+ end
59
+
60
+ if current_version and (rubygems_version != current_version or local_version)
61
+ i = 0
62
+ options = {}
63
+ log "\n\nWe found multiple gem versions. Select the one you want used:"
64
+
65
+ if local_version or config[:plugin_factory_gem][:path]
66
+ if config[:plugin_factory_gem][:path]
67
+ log " #{i+=1}. #{local_version} (found in .fanforce-plugin-factory / locally)"
68
+ else
69
+ log " #{i+=1}. #{local_version} (found locally)"
70
+ end
71
+ options[i] = :local
72
+ end
73
+
74
+ log " #{i+=1}. #{rubygems_version} (found in rubygems)"
75
+ options[i] = :rubygems
76
+
77
+ if !local_version
78
+ log " #{i+=1}. #{current_version} (found in .fanforce-plugin-factory)"
79
+ options[i] = :current
80
+ end
81
+
82
+ num_selected = prompt('> ').to_i
83
+ if options[num_selected] == :local
84
+ version = local_version
85
+ config[:plugin_factory_gem][:path] = local_path
86
+ elsif options[num_selected] == :rubygems
87
+ version = rubygems_version
88
+ config[:plugin_factory_gem].delete(:path)
89
+ local_path = nil
90
+ elsif options[num_selected] == :current
91
+ version = current_version
92
+ local_path = nil
93
+ else
94
+ error "Error: must enter a valid number [1-#{i}]"
95
+ end
96
+
97
+ File.open(config_filepath,'w') do |f|
98
+ config[:plugin_factory_gem][:version] = version
99
+ f.write config.to_yaml
100
+ end
101
+ else
102
+ log 'DONE'
103
+ version = rubygems_version
104
+ end
105
+ log divider '---------------------------------------------------------------------------------------------------+'
106
+
107
+
108
+ local_path ? install_local_factory_gem(version, local_path) : install_remote_factory_gem(version)
109
+ puts ''
110
+ end
111
+
112
+ def install_remote_factory_gem(version)
113
+ system "gem install fanforce-plugin-factory -v #{version}"
114
+ end
115
+
116
+ def install_local_factory_gem(version, local_gem_path)
117
+ return if !local_gem_path
118
+ gem_filepath = nil
119
+ Dir.chdir(local_gem_path) do
120
+ system 'git add -A'
121
+ system 'rake build'
122
+ Dir.glob("#{local_gem_path}/pkg/*.gem").each do |file|
123
+ break gem_filepath = file if file.include?(version)
124
+ end
125
+ end
126
+ Dir.chdir(Fanforce::CLI::DIR) do
127
+ log "INSTALLING #{gem_filepath}..."
128
+ system "gem install #{gem_filepath}"
129
+ end
130
+ end
131
+
132
+ end
@@ -0,0 +1,51 @@
1
+ require_relative 'cli'
2
+
3
+ class Fanforce::PluginFactory::CLI::Scripts
4
+
5
+ ########################################################################################################################
6
+
7
+ Fanforce::CLI.register(self, :create,
8
+ ['PLUGIN_ID', 'Create new plugin folder, files, and push to bitbucket']
9
+ ) { require_relative 'cli/scripts/create' }
10
+
11
+ ########################################################################################################################
12
+
13
+ Fanforce::CLI.register(self, :destroy,
14
+ ['PLUGIN_ID', 'Destroys the plugin folder, related files, and bitbucket repository']
15
+ ) { require_relative 'cli/scripts/destroy' }
16
+
17
+ ########################################################################################################################
18
+
19
+ Fanforce::CLI.register(self, :diff,
20
+ ['all/TYPE', 'Check the status of files, git, and gems'],
21
+ ['files *detailed/overview','Check for file diffs between plugin_factory scaffolding'],
22
+ ['git', 'Check the status of git commit'],
23
+ ['gems', 'Check the gem versions being used across plugins']
24
+ ) { require_relative 'cli/scripts/diff' }
25
+
26
+ ########################################################################################################################
27
+
28
+ Fanforce::CLI.register(self, :update,
29
+ ['all/TYPE', 'Update all plugin files and env variables'],
30
+ ['files', 'Copy the latest scaffolding files from fanforce-plugin-factory'],
31
+ ['env', 'Create ENV variables from your local .env folder'],
32
+ ['factory', 'Update fanforce-plugin-factory gem in Gemfile and run bundle']
33
+ ) { require_relative 'cli/scripts/update' }
34
+
35
+ ########################################################################################################################
36
+
37
+ Fanforce::CLI.register(self, :push,
38
+ ['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
39
+ ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
40
+ ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
41
+ ['RACK_ENV iron', 'Upload iron workers to selected environment']
42
+ ) { require_relative 'cli/scripts/push' }
43
+
44
+ ########################################################################################################################
45
+
46
+ Fanforce::CLI.register(self, :restart,
47
+ #['*development/RACK_ENV/all', 'Runs `touch tmp/restart` if development or else `heroku restart`']
48
+ ['*development', 'Runs `touch tmp/restart` if development or else `heroku restart`']
49
+ ) { require_relative 'cli/scripts/restart' }
50
+
51
+ end
@@ -0,0 +1,52 @@
1
+ require_relative 'cli'
2
+
3
+ class Fanforce::PluginFactory::CLI::Scripts
4
+
5
+ ########################################################################################################################
6
+
7
+ Fanforce::CLI.register(self, :diff,
8
+ ['all/TYPE', 'Check the status of files, git, and gems'],
9
+ ['files *detailed/overview', 'Check for file diffs between plugin_factory scaffolding'],
10
+ ['git', 'Check the status of git commit'],
11
+ # ['gems', 'Check if the gem versions are behind other plugins']
12
+ ) { require_relative 'cli/scripts/diff' }
13
+
14
+ ########################################################################################################################
15
+
16
+ Fanforce::CLI.register(self, :setup,
17
+ ['*all/TYPE', 'Setup bundle, pow, git, and env variables'],
18
+ ['bundler', 'Ensure bundler is installed then run bundle'],
19
+ ['pow', 'Ensure pow domains are setup correctly'],
20
+ ['git', 'Ensure git repository is initialized'],
21
+ ['bitbucket', 'Setup remote repository on bitbucket'],
22
+ ['env', 'Create ENV variables from local .env folder'],
23
+ ['uranium', 'Register config.json with uranium and add environ']
24
+ ) { require_relative 'cli/scripts/setup' }
25
+
26
+ ########################################################################################################################
27
+
28
+ Fanforce::CLI.register(self, :update,
29
+ ['all/TYPE', 'Update all plugin files and env variables'],
30
+ ['files', 'Copy the latest scaffolding files from fanforce-plugin-factory'],
31
+ ['env', 'Create ENV variables from your local .env folder'],
32
+ ['factory', 'Update fanforce-plugin-factory gem in Gemfile and run bundle']
33
+ ) { require_relative 'cli/scripts/update' }
34
+
35
+ ########################################################################################################################
36
+
37
+ Fanforce::CLI.register(self, :push,
38
+ ['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
39
+ ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
40
+ ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
41
+ ['RACK_ENV iron', 'Upload iron workers to selected environment'],
42
+ ['RACK_ENV FILENAME.worker', 'Upload single iron worker to selected environment']
43
+ ) { require_relative 'cli/scripts/push' }
44
+
45
+ ########################################################################################################################
46
+
47
+ Fanforce::CLI.register(self, :restart,
48
+ #['*development/RACK_ENV/all', 'Runs `touch tmp/restart` if development or else `heroku restart`']
49
+ ['*development', 'Runs `touch tmp/restart` if development or else `heroku restart`']
50
+ ) { require_relative 'cli/scripts/restart' }
51
+
52
+ end
@@ -0,0 +1,15 @@
1
+ class Fanforce::Plugin::BaseController
2
+
3
+ def initialize(plugin)
4
+ @plugin = plugin
5
+ end
6
+
7
+ def plugin; @plugin end
8
+ def params; @plugin.params end
9
+ def ff; @plugin.ff end
10
+ def json(*args) @plugin.json(*args) end
11
+ def page(*args) @plugin.page(*args) end
12
+ def redirect(*args) @plugin.redirect(*args) end
13
+ def request; @plugin.request end
14
+
15
+ end
@@ -0,0 +1,94 @@
1
+ class Fanforce::Plugin::CoreConfig
2
+ attr_accessor :bugsnag
3
+ attr_reader :show_error_details, :is_bugsnag_enabled
4
+ attr_writer :redis_url
5
+
6
+ def initialize(base_dir)
7
+ @base_dir = base_dir
8
+ @show_error_details = (ENV['RACK_ENV']=='development') ? true : false
9
+ @bugsnag = (ENV['BUGSNAG_API_KEY'].present?) ? {api_key: ENV['BUGSNAG_API_KEY']} : nil
10
+ end
11
+
12
+ def _id
13
+ raw_config[:_id] || (raise 'base_dir is missing')
14
+ end
15
+
16
+ def base_dir
17
+ @base_dir || (raise 'base_dir is missing')
18
+ end
19
+
20
+ def factory_dir
21
+ Fanforce::PluginFactory.base_dir || (raise 'factory_dir is missing')
22
+ end
23
+
24
+ def show_error_details=(opt)
25
+ @show_error_details = ['1','text'].include?(opt.to_s) ? opt.to_s : false
26
+ end
27
+
28
+ def redis_url
29
+ @redis_url || ENV['REDIS_URL'] || 'redis://localhost:6379'
30
+ end
31
+
32
+ ######################################################################################################################
33
+
34
+ def raw_config
35
+ @raw_config ||= validate_config_file(MultiJson.load(File.open("#{@base_dir}/config.json").read, symbolize_keys: true))
36
+ end
37
+
38
+ def validate_config_file(raw_config)
39
+ raw_config.is_a?(Hash) || (raise "#{@base_dir}/config.json must contain a json object (not a #{raw_config.class})")
40
+ raw_config[:_id].present? || (raise '#{@base_dir}/config.json must include an _id field')
41
+ return raw_config
42
+ end
43
+
44
+ ######################################################################################################################
45
+
46
+ def load_bugsnag
47
+ return if !@bugsnag.is_a?(Hash) or ENV['RACK_ENV'] == 'test'
48
+ require 'bugsnag'
49
+ Bugsnag.configure do |config|
50
+ config.api_key = ENV['BUGSNAG_API_KEY'] || @bugsnag[:api_key]
51
+ config.notify_release_stages = @bugsnag[:notify_release_stages] || ['development','staging','production']
52
+ config.release_stage = @bugsnag[:release_stage] || ENV['RACK_ENV']
53
+ config.app_version = @bugsnag[:app_version] || "fanforce-plugin-factory-#{Fanforce::PluginFactory::VERSION}"
54
+ config.project_root = @base_dir
55
+ end
56
+ @is_bugsnag_enabled = true
57
+ end
58
+
59
+ def load_routes
60
+ $: << File.join(@base_dir,'lib') if File.directory?("#{@base_dir}/lib")
61
+ $: << @base_dir if File.directory?("#{@base_dir}")
62
+
63
+ require "#{factory_dir}/sinatra/helper_routes/com_behavior"
64
+ require "#{factory_dir}/sinatra/helper_routes/com_broadcaster"
65
+ require "#{factory_dir}/sinatra/helper_routes/com_connector"
66
+ require "#{factory_dir}/sinatra/helper_routes/com_identifier"
67
+ require "#{factory_dir}/sinatra/helper_routes/com_js_widget"
68
+ require "#{factory_dir}/sinatra/helper_routes/plugin"
69
+
70
+ Dir["#{@base_dir}/initializers/*.rb"].each {|f| require f } if File.directory?("#{@base_dir}/initializers")
71
+ require "#{factory_dir}/Routes"
72
+ require "#{@base_dir}/Routes"
73
+ end
74
+
75
+ def load_env
76
+ if (!ENV['RACK_ENV'] or ENV['RACK_ENV'] == 'development')
77
+ load_env_from_file("#{@base_dir}/.powenv") if File.exists?("#{@base_dir}/.powenv")
78
+ load_env_from_file("#{@base_dir}/.pluginenv") if File.exists?("#{@base_dir}/.pluginenv")
79
+ end
80
+ end
81
+
82
+ def load_env_from_file(file)
83
+ File.open(file, 'rb') do |file|
84
+ contents = file.read
85
+ lines = contents.gsub('export ', '').split(/\n\r?/).reject{|line| line.blank?}
86
+ lines.each do |line|
87
+ keyValue = line.split("=", 2)
88
+ next unless keyValue.count == 2
89
+ ENV[keyValue.first] = keyValue.last.gsub("'",'').gsub('"','')
90
+ end
91
+ end
92
+ end
93
+
94
+ end