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.
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/.yardopts +5 -0
- data/.yardopts.rb +1 -0
- data/Gemfile +9 -0
- data/README.md +40 -75
- data/Rakefile +61 -4
- data/fanforce-plugin-factory.gemspec +21 -21
- data/lib/fanforce/plugin_factory.rb +16 -58
- data/lib/fanforce/plugin_factory/Rakefile +51 -0
- data/lib/fanforce/plugin_factory/Routes.rb +33 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_bootstrap.scss +2 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_common.scss +1 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_directives.scss +7 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_font-awesome.scss +1 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_ui-select.scss +3 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common → asset_framework/plugin_factory/bootstrap}/_bootstrap-overrides.scss +2 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/css → asset_framework/plugin_factory/bootstrap}/bootstrap.css +2 -2
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/js → asset_framework/plugin_factory/bootstrap}/bootstrap.js +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/bootstrap.min.css +7 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/js → asset_framework/plugin_factory/bootstrap}/bootstrap.min.js +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.svg +229 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib → asset_framework/plugin_factory}/common/_mixins.scss +2 -1
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives.coffee +1 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/error/_error.scss +6 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-error → asset_framework/plugin_factory/directives/error}/arrow-left.png +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-error → asset_framework/plugin_factory/directives/error}/icon-error.png +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/initiative-footer/_initiative-footer.coffee +16 -0
- 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
- data/lib/fanforce/plugin_factory/{assets/lib/common/_module-initiative-searcher.scss → asset_framework/plugin_factory/directives/initiative-searcher/_initiative-searcher.scss} +14 -13
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/icon-search.png +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/spinner.gif +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/sprite-arrows.png +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/loading/_loading.coffee +4 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/loading/_loading.scss +4 -0
- 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
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/saving-to-server/_saving-to-server.scss +6 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-saving-initiative → asset_framework/plugin_factory/directives/saving-to-server}/spinner.gif +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/start-arrow/_start-arrow.coffee +8 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/_module-start-here.scss → asset_framework/plugin_factory/directives/start-arrow/_start-arrow.scss} +5 -4
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-start-here → asset_framework/plugin_factory/directives/start-arrow}/arrow.png +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/common/_module-video-thumbnail.scss → asset_framework/plugin_factory/directives/video-thumbnail/_video-thumbnail.scss} +4 -4
- data/lib/fanforce/plugin_factory/{assets/lib/common/module-video-thumbnail → asset_framework/plugin_factory/directives/video-thumbnail}/icon-play.png +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/font-awesome.coffee +1 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/FontAwesome.otf +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/css → asset_framework/plugin_factory/font-awesome}/font-awesome.css +2 -2
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/css → asset_framework/plugin_factory/font-awesome}/font-awesome.min.css +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.eot +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.svg +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.ttf +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.woff +0 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib.coffee +1 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib/ng-focus-blur.js +68 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib/ng-visible.js +7 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select.coffee +1 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select.css +171 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select.js +1281 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select_override.scss +1 -0
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/selectize.default.css +443 -0
- data/lib/fanforce/plugin_factory/cli.rb +5 -0
- data/lib/fanforce/plugin_factory/cli/lib/bitbucket.rb +77 -0
- data/lib/fanforce/plugin_factory/cli/lib/bundler.rb +21 -0
- data/lib/fanforce/plugin_factory/cli/lib/env.rb +96 -0
- data/lib/fanforce/plugin_factory/cli/lib/git.rb +59 -0
- data/lib/fanforce/plugin_factory/cli/lib/heroku.rb +94 -0
- data/lib/fanforce/plugin_factory/cli/lib/iron.rb +71 -0
- data/lib/fanforce/plugin_factory/cli/lib/pow.rb +46 -0
- data/lib/fanforce/plugin_factory/cli/lib/scaffolding.rb +74 -0
- data/lib/fanforce/plugin_factory/cli/lib/scaffolding_file.rb +510 -0
- data/lib/fanforce/plugin_factory/cli/lib/uranium.rb +77 -0
- data/lib/fanforce/plugin_factory/cli/lib/utils.rb +57 -0
- data/lib/fanforce/plugin_factory/cli/scripts/config.rb +9 -0
- data/lib/fanforce/plugin_factory/cli/scripts/create.rb +64 -0
- data/lib/fanforce/plugin_factory/cli/scripts/destroy.rb +61 -0
- data/lib/fanforce/plugin_factory/cli/scripts/diff.rb +156 -0
- data/lib/fanforce/plugin_factory/cli/scripts/push.rb +88 -0
- data/lib/fanforce/plugin_factory/cli/scripts/restart.rb +41 -0
- data/lib/fanforce/plugin_factory/cli/scripts/setup.rb +70 -0
- data/lib/fanforce/plugin_factory/cli/scripts/update.rb +132 -0
- data/lib/fanforce/plugin_factory/cli_directory_of_plugins.rb +51 -0
- data/lib/fanforce/plugin_factory/cli_single_plugin.rb +52 -0
- data/lib/fanforce/plugin_factory/controllers/base_controller.rb +15 -0
- data/lib/fanforce/plugin_factory/core_config.rb +94 -0
- data/lib/fanforce/plugin_factory/directive_views/initiative-footer.haml +8 -0
- data/lib/fanforce/plugin_factory/load.rb +7 -0
- data/lib/fanforce/plugin_factory/load_iron_worker.rb +2 -0
- data/lib/fanforce/plugin_factory/load_sprockets.rb +2 -0
- data/lib/fanforce/plugin_factory/plugin.rb +60 -0
- data/lib/fanforce/plugin_factory/scaffolding/._.gitignore.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/._Gemfile.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/._Rakefile.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/._config.json.registry +2 -0
- data/lib/fanforce/plugin_factory/scaffolding/._config.ru.registry +4 -0
- data/lib/fanforce/plugin_factory/scaffolding/._favicon.ico.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/._robots.txt.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/.gitignore +27 -0
- data/lib/fanforce/plugin_factory/scaffolding/Gemfile +9 -0
- data/lib/fanforce/plugin_factory/scaffolding/Rakefile +7 -0
- data/lib/fanforce/plugin_factory/scaffolding/Routes.rb +67 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/css/._fembedded.scss.registry +4 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/css/._promotional.scss.registry +4 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/css/._visitor.scss.registry +4 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/css/fembedded.scss +24 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/css/promotional.scss +33 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/css/visitor.scss +61 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-16.png.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-32.png.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-42.png.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/._marketplace.png.registry +1 -0
- data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-16.png +0 -0
- data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-32.png +0 -0
- data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-42.png +0 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/marketplace.png +0 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._fanforce_bg.png.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._icon-42.png.registry +1 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._icon-plus.png.registry +1 -0
- data/lib/fanforce/plugin_factory/{assets/lib → scaffolding/assets/img}/promotional/fanforce_bg.png +0 -0
- data/lib/fanforce/plugin_factory/{assets/lib → scaffolding/assets/img}/promotional/icon-42.png +0 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/icon-plus.png +0 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded-app.coffee.registry +5 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded.js.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/._promotional.js.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/fembedded-app.coffee +11 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/fembedded.js +12 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._cookie.coffee.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._filters.coffee.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._utils.coffee.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/cookie.coffee +24 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee +9 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/utils.coffee +40 -0
- data/lib/fanforce/plugin_factory/scaffolding/assets/js/promotional.js +4 -0
- data/lib/fanforce/plugin_factory/scaffolding/config.json +24 -0
- data/lib/fanforce/plugin_factory/scaffolding/config.ru +8 -0
- data/lib/fanforce/plugin_factory/{public → scaffolding}/favicon.ico +0 -0
- data/lib/fanforce/plugin_factory/scaffolding/layouts/._fembedded.haml.registry +4 -0
- data/lib/fanforce/plugin_factory/scaffolding/layouts/._promotional.haml.registry +2 -0
- data/lib/fanforce/plugin_factory/scaffolding/layouts/._visitor.haml.registry +6 -0
- data/lib/fanforce/plugin_factory/scaffolding/layouts/fembedded.haml +26 -0
- data/lib/fanforce/plugin_factory/{layouts → scaffolding/layouts}/promotional.haml +6 -6
- data/lib/fanforce/plugin_factory/{layouts/engage.haml → scaffolding/layouts/visitor.haml} +10 -7
- data/lib/fanforce/plugin_factory/scaffolding/robots.txt +7 -0
- data/lib/fanforce/plugin_factory/scaffolding/views/._index.haml.registry +3 -0
- data/lib/fanforce/plugin_factory/{views → scaffolding/views}/index.haml +13 -7
- data/lib/fanforce/plugin_factory/sinatra/_load.rb +87 -0
- data/lib/fanforce/plugin_factory/sinatra/error_handling.rb +48 -0
- data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_behavior.rb +19 -0
- data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_broadcaster.rb +7 -0
- data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_connector.rb +11 -0
- data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_identifier.rb +3 -0
- data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_js_widget.rb +8 -0
- data/lib/fanforce/plugin_factory/sinatra/helper_routes/plugin.rb +50 -0
- data/lib/fanforce/plugin_factory/sinatra/helpers/assets.rb +23 -0
- data/lib/fanforce/plugin_factory/sinatra/helpers/css_frameworks.rb +70 -0
- data/lib/fanforce/plugin_factory/sinatra/helpers/fanforce.rb +18 -0
- data/lib/fanforce/plugin_factory/{config → sinatra}/helpers/json.rb +2 -2
- data/lib/fanforce/plugin_factory/sinatra/helpers/ractive.rb +45 -0
- data/lib/fanforce/plugin_factory/sprockets/compiler.rb +5 -11
- data/lib/fanforce/plugin_factory/sprockets/hacks.rb +2 -2
- data/lib/fanforce/plugin_factory/version.rb +2 -2
- metadata +201 -195
- data/.rbenv-gemsets +0 -1
- data/.rbenv-version +0 -1
- data/lib/fanforce/plugin_factory.rake +0 -72
- data/lib/fanforce/plugin_factory/_init_sinatra.rb +0 -54
- data/lib/fanforce/plugin_factory/assets/css/add_edit_initiative.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/css/add_source.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/css/convert_pending_initiative.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/css/engage.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/css/new_message.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/css/promotional.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/css/source_details.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/js/add_edit_initiative.js +0 -1
- data/lib/fanforce/plugin_factory/assets/js/add_source.js +0 -1
- data/lib/fanforce/plugin_factory/assets/js/convert_pending_initiative.js +0 -1
- data/lib/fanforce/plugin_factory/assets/js/engage.js +0 -1
- data/lib/fanforce/plugin_factory/assets/js/new_message.js +0 -1
- data/lib/fanforce/plugin_factory/assets/js/promotional.js +0 -2
- data/lib/fanforce/plugin_factory/assets/js/source_details.js +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/common/_module-error.scss +0 -11
- data/lib/fanforce/plugin_factory/assets/lib/common/_module-page-loading.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/lib/common/_module-saving-initiative.scss +0 -6
- data/lib/fanforce/plugin_factory/assets/lib/common/_tags.scss +0 -1
- data/lib/fanforce/plugin_factory/assets/lib/common/_variables.scss +0 -27
- data/lib/fanforce/plugin_factory/assets/lib/common/broadcaster-divider-arrow.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/common/icons/dropdown-arrow.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/common/icons/initiative.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_add_edit_initiative.scss +0 -27
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_add_source.scss +0 -18
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_convert_pending_initiative.scss +0 -27
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_engage.scss +0 -78
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_new_message.scss +0 -24
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_promotional.scss +0 -27
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_source_details.scss +0 -17
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/add_edit_initiative.js +0 -6
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/add_source.js +0 -6
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/convert_pending_initiative.js +0 -6
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/engage.js +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/new_message.js +0 -5
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/promotional.js +0 -1
- data/lib/fanforce/plugin_factory/assets/lib/common/layouts/source_details.js +0 -5
- data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-behavior.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-broadcaster.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-data-connector.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-data-processor.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-identifier.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-datepicker/datepicker.css +0 -7
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-datepicker/datepicker.js +0 -454
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-timepicker/timepicker.css +0 -82
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-timepicker/timepicker.js +0 -803
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/css/bootstrap.min.css +0 -7
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.eot +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.svg +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.ttf +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.woff +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/_chosen_override.scss +0 -6
- data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen-sprite.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen-sprite@2x.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen.jquery.js +0 -1166
- data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen.scss +0 -434
- data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery-1.10.2.js +0 -9789
- data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery.inputHint.js +0 -154
- data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery.tmpl.debug.js +0 -484
- data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.custom-handlers.coffee +0 -155
- data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.debug.js +0 -4469
- data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.min.js +0 -96
- data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/_select2_override.scss +0 -47
- data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2-spinner.gif +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2.scss +0 -617
- data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2_modified.js +0 -3225
- data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2x2.png +0 -0
- data/lib/fanforce/plugin_factory/assets/lib/vendors/underscore/underscore.debug.js +0 -999
- data/lib/fanforce/plugin_factory/config/_error_handling.rb +0 -27
- data/lib/fanforce/plugin_factory/config/core_config.rb +0 -92
- data/lib/fanforce/plugin_factory/config/helpers/assets.rb +0 -72
- data/lib/fanforce/plugin_factory/config/helpers/fanforce.rb +0 -19
- data/lib/fanforce/plugin_factory/layouts/add_edit_initiative.haml +0 -19
- data/lib/fanforce/plugin_factory/layouts/add_source.haml +0 -19
- data/lib/fanforce/plugin_factory/layouts/convert_pending_initiative.haml +0 -19
- data/lib/fanforce/plugin_factory/layouts/new_message.haml +0 -19
- data/lib/fanforce/plugin_factory/layouts/source_details.haml +0 -19
- data/lib/fanforce/plugin_factory/public/robots.txt +0 -2
- data/lib/fanforce/plugin_factory/routes.rb +0 -48
- data/lib/fanforce/plugin_factory/routes_behavior.rb +0 -34
- data/lib/fanforce/plugin_factory/routes_broadcaster.rb +0 -9
- data/lib/fanforce/plugin_factory/routes_data_connector.rb +0 -21
- data/lib/fanforce/plugin_factory/routes_identifier.rb +0 -3
- data/lib/fanforce/plugin_factory/views/add_initiative.haml +0 -1
- data/lib/fanforce/plugin_factory/views/add_source.haml +0 -1
- data/lib/fanforce/plugin_factory/views/close_popup.haml +0 -8
- data/lib/fanforce/plugin_factory/views/convert_pending_initiative.haml +0 -1
- data/lib/fanforce/plugin_factory/views/edit_initiative.haml +0 -1
- data/lib/fanforce/plugin_factory/views/engage.haml +0 -1
- data/lib/fanforce/plugin_factory/views/new_message.haml +0 -1
- data/lib/fanforce/plugin_factory/views/source_details.haml +0 -1
- data/lib/fanforce/plugin_factory/views/widget_tmpls.haml +0 -1
- 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
|