fanforce-plugin-factory 0.41.0 → 1.6.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,77 @@
|
|
1
|
+
class Fanforce::PluginFactory::CLI::Uranium
|
2
|
+
include Fanforce::PluginFactory::CLI::Utils
|
3
|
+
|
4
|
+
attr_reader :plugin
|
5
|
+
|
6
|
+
def initialize(plugin)
|
7
|
+
@plugin = plugin
|
8
|
+
end
|
9
|
+
|
10
|
+
def uranium
|
11
|
+
config[:uranium] || (error 'Uranium credentials were not found in config file')
|
12
|
+
end
|
13
|
+
|
14
|
+
def create
|
15
|
+
RestClient.get("http://#{Fanforce.uranium_domain}/plugins/#{plugin._id}") do |response|
|
16
|
+
if response.code == 404
|
17
|
+
setup(false)
|
18
|
+
elsif response.code < 300
|
19
|
+
confirm "\nThis plugin (#{plugin._id}) already exists in uranium. Proceeding will overwrite it.\n"+
|
20
|
+
'OVERWRITE EXISTING URANIUM VERSION?', true
|
21
|
+
setup(true)
|
22
|
+
else
|
23
|
+
raise response.to_s
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def setup(exists_in_uranium=true)
|
29
|
+
attrs = {
|
30
|
+
:_puid => plugin._id,
|
31
|
+
:developer_email => config[:uranium][:developer_email],
|
32
|
+
:developer_password => config[:uranium][:developer_password],
|
33
|
+
:update_if_exists => exists_in_uranium
|
34
|
+
}
|
35
|
+
url = "http://#{Fanforce.uranium_domain}/plugins"
|
36
|
+
RestClient.post(url, attrs) do |response|
|
37
|
+
raise "#{response}: curl -X POST -d '#{attrs.to_param}' #{url}" if response.code >= 300
|
38
|
+
response = MultiJson.load(response.body, symbolize_keys: true)
|
39
|
+
exists_in_uranium = true if response[:updated]
|
40
|
+
end
|
41
|
+
|
42
|
+
if exists_in_uranium
|
43
|
+
log "#{'Updated '.format(:green,:bold)}" + "#{plugin._id} in uranium"
|
44
|
+
else
|
45
|
+
log "#{'Added '.format(:green,:bold)}" + "#{plugin._id} to uranium"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def destroy
|
50
|
+
if plugin.config[:awaiting_uranium_setup]
|
51
|
+
return log "#{'Skipped '.format(:green,:bold)}" + 'since config.json was still awaiting uranium setup'
|
52
|
+
elsif plugin.config.size == 0
|
53
|
+
return log "#{'Missing '.format(:green,:bold)}" + "config.json so assuming #{plugin._id} was removed from uranium"
|
54
|
+
end
|
55
|
+
|
56
|
+
error 'Uranium credentials were not found in config file' if !config[:uranium]
|
57
|
+
error 'Your plugin\'s config.json is missing a _iuid field (delete config.json to skip)' if !plugin.config[:_iuid]
|
58
|
+
|
59
|
+
attrs = {
|
60
|
+
:developer_email => config[:uranium][:developer_email],
|
61
|
+
:developer_password => config[:uranium][:developer_password]
|
62
|
+
}
|
63
|
+
|
64
|
+
url = "http://#{Fanforce.uranium_domain}/plugins/#{plugin.config[:_iuid]}"
|
65
|
+
RestClient.delete(url, params: attrs) do |response|
|
66
|
+
if response.code == 404
|
67
|
+
return log "#{'Already Removed '.format(:green,:bold)}" + "#{plugin._id} from uranium"
|
68
|
+
elsif response.code >= 300
|
69
|
+
log "curl -X DELETE -d '#{attrs.to_param}' #{url}"
|
70
|
+
raise response.to_s
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
log "#{'Removed '.format(:green,:bold)}" + "#{plugin._id} from uranium"
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'pty'
|
2
|
+
require 'fanforce/cli'
|
3
|
+
|
4
|
+
module Fanforce::PluginFactory::CLI::Utils
|
5
|
+
extend self
|
6
|
+
def self.included(base) base.extend(self) end
|
7
|
+
|
8
|
+
include Fanforce::CLI::Utils
|
9
|
+
|
10
|
+
@@config = nil
|
11
|
+
|
12
|
+
def console_command(command, print_now=false)
|
13
|
+
output = []
|
14
|
+
PTY.spawn(command) do |stdin, stdout, pid|
|
15
|
+
stdin.each { |line| output << line; print line if print_now }
|
16
|
+
end
|
17
|
+
output.join("\n")
|
18
|
+
end
|
19
|
+
|
20
|
+
def silence_warnings
|
21
|
+
require 'stringio'
|
22
|
+
old_stderr = $stderr
|
23
|
+
$stderr = StringIO.new
|
24
|
+
yield
|
25
|
+
ensure
|
26
|
+
$stderr = old_stderr
|
27
|
+
end
|
28
|
+
|
29
|
+
def config_filepath
|
30
|
+
if Fanforce::CLI::TYPE == :directory_of_plugins
|
31
|
+
"#{Fanforce::CLI::DIR}/.fanforce-plugin-factory"
|
32
|
+
elsif Fanforce::CLI::TYPE == :single_plugin
|
33
|
+
"#{Fanforce::CLI::DIR}/../.fanforce-plugin-factory"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def config_relativepath
|
38
|
+
if Fanforce::CLI::TYPE == :directory_of_plugins
|
39
|
+
'.fanforce-plugin-factory'
|
40
|
+
elsif Fanforce::CLI::TYPE == :single_plugin
|
41
|
+
'../.fanforce-plugin-factory'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def config
|
46
|
+
return @@config if @@config
|
47
|
+
require 'yaml'
|
48
|
+
error "The required config file was not found: #{config_relativepath}" if !File.exists?(config_filepath)
|
49
|
+
@@config = format_config(YAML.load_file(config_filepath))
|
50
|
+
end
|
51
|
+
|
52
|
+
def format_config(hash)
|
53
|
+
hash.values.select{|v| v.is_a? Hash}.each{|h| format_config(h)}
|
54
|
+
hash.symbolize_keys!
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
class Fanforce::PluginFactory::CLI::Scripts
|
2
|
+
include Fanforce::PluginFactory::CLI::Utils
|
3
|
+
|
4
|
+
require_relative '../lib/scaffolding'
|
5
|
+
require_relative '../lib/bundler'
|
6
|
+
require_relative '../lib/pow'
|
7
|
+
require_relative '../lib/git'
|
8
|
+
require_relative '../lib/bitbucket'
|
9
|
+
require_relative '../lib/env'
|
10
|
+
require_relative '../lib/uranium'
|
11
|
+
|
12
|
+
######################################################################################################################
|
13
|
+
|
14
|
+
def create(plugin_id)
|
15
|
+
plugin_id || error('You must supply a valid PLUGIN_ID', :create)
|
16
|
+
plugin_dir = "#{Fanforce::CLI::DIR}/#{plugin_id}"
|
17
|
+
|
18
|
+
if File.exists?("#{plugin_dir}/config.ru")
|
19
|
+
error "#{plugin_id} already exists. You should run: " + "fanforce update #{plugin_id}".format(:green)
|
20
|
+
end
|
21
|
+
|
22
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
23
|
+
log 'CREATING FILES...'
|
24
|
+
Dir.mkdir(plugin_dir) if !File.directory?(plugin_dir)
|
25
|
+
Dir.chdir(plugin_dir)
|
26
|
+
log "#{'Created'.format(:bold, :green)} #{plugin_id}/"
|
27
|
+
plugin = Fanforce::CLI::Plugin.new(plugin_dir)
|
28
|
+
Fanforce::PluginFactory::CLI::Scaffolding.new(plugin).setup
|
29
|
+
|
30
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
31
|
+
log 'INSTALLING BUNDLER...'
|
32
|
+
Fanforce::PluginFactory::CLI::Bundler.new(plugin).setup
|
33
|
+
|
34
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
35
|
+
log 'CREATING POW DOMAINS...'
|
36
|
+
Fanforce::PluginFactory::CLI::Pow.new(plugin).setup
|
37
|
+
|
38
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
39
|
+
log 'CREATING LOCAL GIT REPOSITORY...'
|
40
|
+
Fanforce::PluginFactory::CLI::Git.new(plugin).setup
|
41
|
+
|
42
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
43
|
+
log 'CREATING BITBUCKET REPOSITORY...'
|
44
|
+
Fanforce::PluginFactory::CLI::Bitbucket.new(plugin).create
|
45
|
+
|
46
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
47
|
+
log 'CREATING ENV VARIABLES...'
|
48
|
+
Fanforce::PluginFactory::CLI::Env.new(plugin).setup(:development)
|
49
|
+
|
50
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
51
|
+
log 'RUNNING TOUCH TMP/RESTART.TXT...'
|
52
|
+
`touch tmp/restart.txt`
|
53
|
+
log 'Finished'.format(:green,:bold) + ' restarting'
|
54
|
+
|
55
|
+
log divider '+---------------------------------------------------------------------------------------------------'
|
56
|
+
log 'SETTING UP URANIUM...'
|
57
|
+
Fanforce::PluginFactory::CLI::Uranium.new(plugin).create
|
58
|
+
|
59
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
60
|
+
log 'SUCCESS!'.format(:bold,:green)
|
61
|
+
log divider '----------------------------------------------------------------------------------------------------++'
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
class Fanforce::PluginFactory::CLI::Scripts
|
2
|
+
include Fanforce::PluginFactory::CLI::Utils
|
3
|
+
|
4
|
+
require_relative '../lib/bitbucket'
|
5
|
+
require_relative '../lib/uranium'
|
6
|
+
require_relative '../lib/pow'
|
7
|
+
|
8
|
+
######################################################################################################################
|
9
|
+
|
10
|
+
def destroy(plugin_id)
|
11
|
+
plugin_id || error('You must supply a valid PLUGIN_ID', :delete)
|
12
|
+
plugin_dir = "#{Fanforce::CLI::DIR}/#{plugin_id}"
|
13
|
+
|
14
|
+
error "Directory was not found for plugin: #{plugin_dir}" if !File.directory?("#{plugin_dir}")
|
15
|
+
error 'Bitbucket credentials were not found in config file' if !config[:bitbucket]
|
16
|
+
plugin = Fanforce::CLI::Plugin.new(plugin_dir)
|
17
|
+
|
18
|
+
log divider '+-----'
|
19
|
+
confirm("You are about to delete both local and remote files for #{plugin_id}.\nARE YOU SURE?", true)
|
20
|
+
|
21
|
+
# puts "\n---------------------------------------------------------------------------------------------------------------"
|
22
|
+
# puts 'DELETING HEROKU APPS...'
|
23
|
+
# [:staging,:production].each do |environment|
|
24
|
+
# next if $Config[:heroku].blank? or $Config[:heroku][environment].blank?
|
25
|
+
# heroku = auth_heroku(environment)
|
26
|
+
# heroku_app_name = get_heroku_app_name(plugin, environment)
|
27
|
+
# begin
|
28
|
+
# heroku.delete_app(heroku_app_name)
|
29
|
+
# puts "#{'Removed '.format(:green,:bold)}" + " #{heroku_app_name}"
|
30
|
+
# rescue Exception => e
|
31
|
+
# puts "#{'Already Removed'.format(:green,:bold)}" + " #{heroku_app_name}"
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
|
35
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
36
|
+
log 'REMOVING BITBUCKET REPOSITORY...'
|
37
|
+
Fanforce::PluginFactory::CLI::Bitbucket.new(plugin).destroy
|
38
|
+
|
39
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
40
|
+
log 'REMOVING URANIUM RECORD...'
|
41
|
+
Fanforce::PluginFactory::CLI::Uranium.new(plugin).destroy
|
42
|
+
|
43
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
44
|
+
log 'REMOVING POW DOMAINS...'
|
45
|
+
Fanforce::PluginFactory::CLI::Pow.new(plugin).destroy
|
46
|
+
|
47
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
48
|
+
log 'REMOVING FILES...'
|
49
|
+
if File.directory?(plugin_dir)
|
50
|
+
FileUtils.rm_rf(plugin_dir)
|
51
|
+
log "#{'Removed'.format(:bold, :green)} #{plugin_dir}/"
|
52
|
+
else
|
53
|
+
log "#{'Already Removed'.format(:bold, :green)} #{plugin_dir}/"
|
54
|
+
end
|
55
|
+
|
56
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
57
|
+
log 'DONE! (note: iron workers were not deleted)'
|
58
|
+
log divider '+-----------------------------------------------------------------------------------------------------'
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
class Fanforce::PluginFactory::CLI::Scripts
|
2
|
+
include Fanforce::PluginFactory::CLI::Utils
|
3
|
+
|
4
|
+
require_relative '../lib/git'
|
5
|
+
require_relative '../lib/scaffolding'
|
6
|
+
|
7
|
+
######################################################################################################################
|
8
|
+
|
9
|
+
def diff(type, detail_level=nil)
|
10
|
+
type = type.to_sym
|
11
|
+
detail_level = (detail_level||'detailed').to_sym if type == :files
|
12
|
+
|
13
|
+
if [:all,:files].include?(type)
|
14
|
+
if Fanforce::CLI::TYPE == :directory_of_plugins
|
15
|
+
if detail_level == :detailed
|
16
|
+
directory_file_details(detail_level)
|
17
|
+
else
|
18
|
+
directory_file_overview
|
19
|
+
end
|
20
|
+
elsif Fanforce::CLI::TYPE == :single_plugin
|
21
|
+
plugin = Fanforce::CLI::Plugin.load(Fanforce::CLI::DIR)
|
22
|
+
plugin_file_details(plugin, detail_level)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if [:all,:git].include?(type)
|
27
|
+
if Fanforce::CLI::TYPE == :directory_of_plugins
|
28
|
+
git_overview
|
29
|
+
elsif Fanforce::CLI::TYPE == :single_plugin
|
30
|
+
git_details
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def directory_file_overview
|
36
|
+
log ''
|
37
|
+
log sprintf('%-12s %-50s %85s', 'FILE STATUS', 'PLUGIN NAME', 'STATS OVERVIEW').format(:bold)
|
38
|
+
log divider '======================================================================================================'
|
39
|
+
Fanforce::CLI::Plugins.each do |plugin, current_count, total|
|
40
|
+
missing = 0
|
41
|
+
diverged = 0
|
42
|
+
previous = 0
|
43
|
+
corrupted = 0
|
44
|
+
is_synced = true
|
45
|
+
Fanforce::PluginFactory::CLI::Scaffolding.new(plugin).metadata.each do |filepath, change|
|
46
|
+
if change[:status] == :missing
|
47
|
+
is_synced = false
|
48
|
+
next missing += 1
|
49
|
+
elsif change[:status] == :diverged
|
50
|
+
is_synced = false
|
51
|
+
next diverged += 1
|
52
|
+
elsif change[:status] == :previous
|
53
|
+
is_synced = false
|
54
|
+
next previous += 1
|
55
|
+
elsif change[:status] == :corrupted
|
56
|
+
is_synced = false
|
57
|
+
next corrupted += 1
|
58
|
+
end
|
59
|
+
end
|
60
|
+
changed_stats = [
|
61
|
+
"#{missing} files missing",
|
62
|
+
"#{previous} files previous",
|
63
|
+
"#{diverged} files diverged",
|
64
|
+
"#{corrupted} files corrupted"
|
65
|
+
]
|
66
|
+
puts sprintf("%s%-12s#{fmt_end} %-41s %23s %23s %23s %23s",
|
67
|
+
fmt_start(is_synced ? :green : :red),
|
68
|
+
(is_synced ? 'Synced' : 'Changed'),
|
69
|
+
plugin.name,
|
70
|
+
*changed_stats
|
71
|
+
)
|
72
|
+
log divider '---------------------------------------------------------------------------------------------------+'
|
73
|
+
end
|
74
|
+
puts ''
|
75
|
+
end
|
76
|
+
|
77
|
+
def directory_file_details(detail_level)
|
78
|
+
Fanforce::CLI::Plugins.each do |plugin, current_count, total|
|
79
|
+
log divider '+==================================================================================================='
|
80
|
+
has_files_to_update = false
|
81
|
+
Fanforce::PluginFactory::CLI::Scaffolding.new(plugin).metadata.each do |filepath, metadata|
|
82
|
+
next if ![:previous,:diverged,:missing,:corrupted].include?(metadata[:status])
|
83
|
+
has_files_to_update = true
|
84
|
+
filepath = filepath.gsub(Fanforce::CLI::DIR, '')
|
85
|
+
log sprintf "%s%-8s#{fmt_end} %-95s %22s %22s\n",
|
86
|
+
fmt_start([:previous,:diverged,:missing,:corrupted].include?(metadata[:status]) ? :red : :green),
|
87
|
+
metadata[:status].to_s.titleize,
|
88
|
+
filepath,
|
89
|
+
("#{metadata[:insertions]} insertions(+)" if metadata[:insertions].to_i > 0),
|
90
|
+
("#{metadata[:deletions]} deletions(-)" if metadata[:insertions].to_i > 0)
|
91
|
+
if detail_level == :detailed and metadata[:diff]
|
92
|
+
lines = ''
|
93
|
+
metadata[:diff].lines do |line|
|
94
|
+
line = line.format(:red) if line[0] == '-'
|
95
|
+
line = line.format(:green) if line[0] == '+'
|
96
|
+
line = (' '*3) + line
|
97
|
+
lines += line
|
98
|
+
end
|
99
|
+
log divider ' -----------------------------------------------------------------------------------------------'
|
100
|
+
log ' THE FOLLOWING CHANGES WILL OCCUR DURING UPDATE:'
|
101
|
+
log ' -----------------------------------------------'
|
102
|
+
log "\n" + lines + "\n"
|
103
|
+
end
|
104
|
+
log divider '---------------------------------------------------------------------------------------------------+'
|
105
|
+
end
|
106
|
+
log 'NO FILES TO UPDATE' if !has_files_to_update
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def plugin_file_details(plugin, detail_level)
|
111
|
+
log ''
|
112
|
+
log sprintf "%-30s %119s\n", "FILES (#{plugin.dir_name})", 'changes needed during update'
|
113
|
+
log divider '======================================================================================================'
|
114
|
+
Fanforce::PluginFactory::CLI::Scaffolding.new(plugin).metadata.each do |filepath, metadata|
|
115
|
+
filepath = filepath.gsub(Fanforce::CLI::DIR, '')
|
116
|
+
log sprintf "%s%-8s#{fmt_end} %-95s %22s %22s\n",
|
117
|
+
fmt_start([:previous,:diverged,:missing,:corrupted].include?(metadata[:status]) ? :red : :green),
|
118
|
+
metadata[:status].to_s.titleize,
|
119
|
+
filepath,
|
120
|
+
("#{metadata[:insertions]} insertions(+)" if metadata[:insertions].to_i > 0),
|
121
|
+
("#{metadata[:deletions]} deletions(-)" if metadata[:insertions].to_i > 0)
|
122
|
+
if detail_level == :detailed and metadata[:diff]
|
123
|
+
lines = ''
|
124
|
+
metadata[:diff].lines do |line|
|
125
|
+
line = line.format(:red) if line[0] == '-'
|
126
|
+
line = line.format(:green) if line[0] == '+'
|
127
|
+
line = (' '*3) + line
|
128
|
+
lines += line
|
129
|
+
end
|
130
|
+
log divider ' -----------------------------------------------------------------------------------------------'
|
131
|
+
log ' THE FOLLOWING CHANGES WILL OCCUR DURING UPDATE:'
|
132
|
+
log ' -----------------------------------------------'
|
133
|
+
log "\n" + lines + "\n"
|
134
|
+
end
|
135
|
+
log divider '---------------------------------------------------------------------------------------------------+'
|
136
|
+
end
|
137
|
+
puts ''
|
138
|
+
end
|
139
|
+
|
140
|
+
def git_overview
|
141
|
+
plugin_column_width = Fanforce::CLI::Plugins.dir_names.inject(0){|l,d| d.length>l ? d.length : l}
|
142
|
+
log Fanforce::PluginFactory::CLI::Git.status_table_header(plugin_column_width)
|
143
|
+
log divider '======================================================================================================'
|
144
|
+
Fanforce::CLI::Plugins.each do |plugin, current_count, total|
|
145
|
+
log Fanforce::PluginFactory::CLI::Git.new(plugin).status_row(plugin_column_width)
|
146
|
+
log divider '---------------------------------------------------------------------------------------------------+'
|
147
|
+
end
|
148
|
+
log ''
|
149
|
+
end
|
150
|
+
|
151
|
+
def git_details
|
152
|
+
exec 'git status'
|
153
|
+
log ''
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
class Fanforce::PluginFactory::CLI::Scripts
|
2
|
+
include Fanforce::PluginFactory::CLI::Utils
|
3
|
+
|
4
|
+
require_relative '../lib/env'
|
5
|
+
require_relative '../lib/iron'
|
6
|
+
require_relative '../lib/heroku'
|
7
|
+
|
8
|
+
######################################################################################################################
|
9
|
+
|
10
|
+
def push(environment, command)
|
11
|
+
environment = environment.to_sym
|
12
|
+
command = command.to_sym
|
13
|
+
plugin = Fanforce::CLI::Plugin.load(Fanforce::CLI::DIR)
|
14
|
+
|
15
|
+
if Fanforce::CLI::TYPE == :directory_of_plugins
|
16
|
+
confirm("\nYou are about to push iron works for #{Fanforce::CLI::Plugins.total_count} plugins in this directory.\n"+
|
17
|
+
'ARE YOU SURE?', true)
|
18
|
+
Fanforce::CLI::Plugins.each do |plugin, processed_count, total_count|
|
19
|
+
log divider '+-----------------------------------------------------------------------------------------------'
|
20
|
+
log "#{'PLUGIN'.format(:bold)} - #{plugin._id.upcase.gsub('-',' ').format(:bold)} (#{processed_count} of #{total_count})... "
|
21
|
+
push_plugin(plugin, environment, command)
|
22
|
+
end
|
23
|
+
elsif Fanforce::CLI::TYPE == :single_plugin
|
24
|
+
log divider '+---------------------------------------------------------------------------------------------------'
|
25
|
+
plugin = Fanforce::CLI::Plugin.load(Fanforce::CLI::DIR)
|
26
|
+
push_plugin(plugin, environment, command)
|
27
|
+
end
|
28
|
+
|
29
|
+
log divider '----------------------------------------------------------------------------------------------------++'
|
30
|
+
end
|
31
|
+
|
32
|
+
def push_plugin(plugin, environment, command)
|
33
|
+
if command.to_s.include?('.worker')
|
34
|
+
return push_plugin_worker(plugin, environment, command.to_s)
|
35
|
+
end
|
36
|
+
|
37
|
+
if [:all,:heroku].include?(command) and environment != :development
|
38
|
+
heroku = Fanforce::PluginFactory::CLI::Heroku.new(plugin)
|
39
|
+
heroku.ensure_heroku_app_exists(environment)
|
40
|
+
end
|
41
|
+
|
42
|
+
if [:all,:iron].include?(command)
|
43
|
+
push_plugin_workers(plugin, environment)
|
44
|
+
end
|
45
|
+
|
46
|
+
if [:all,:env].include?(command)
|
47
|
+
push_env(plugin, environment)
|
48
|
+
end
|
49
|
+
|
50
|
+
if [:all,:heroku].include?(command) and environment != :development
|
51
|
+
push_heroku(heroku, plugin, environment)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def push_plugin_worker(plugin, environment, filename)
|
56
|
+
Dir.chdir(plugin.dir) do
|
57
|
+
Fanforce::PluginFactory::CLI::Iron.new(plugin).upload(environment, filename)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def push_plugin_workers(plugin, environment)
|
62
|
+
Dir.chdir(plugin.dir) do
|
63
|
+
Fanforce::PluginFactory::CLI::Iron.new(plugin).upload(environment)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def push_env(plugin, environment)
|
68
|
+
Fanforce::PluginFactory::CLI::Env.new(plugin).setup(environment)
|
69
|
+
end
|
70
|
+
|
71
|
+
def push_heroku(heroku, plugin, environment)
|
72
|
+
case environment
|
73
|
+
when :staging then env = :stg
|
74
|
+
when :production then env = :prd
|
75
|
+
end
|
76
|
+
remote_name = "#{env}-heroku"
|
77
|
+
|
78
|
+
heroku.setup(environment) if !(`git remote`).split(/\r?\n/).include?(remote_name)
|
79
|
+
|
80
|
+
vars = Fanforce::PluginFactory::CLI::Env.new(plugin).vars(environment)
|
81
|
+
heroku.update_config(environment, vars)
|
82
|
+
log 'Updated ENV'.format(:green,:bold) + " on Heroku #{environment.to_s.titleize} (#{vars.size} variables)..."
|
83
|
+
|
84
|
+
puts "\n#{'Pushing '.format(:green,:bold)}" + "latest commit to Heroku #{environment.to_s.titleize} (#{remote_name})..."
|
85
|
+
console_command("git push #{remote_name} master", true)
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|