fanforce-app-factory 2.0.0.rc5 → 2.0.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Rakefile +54 -3
- data/apps.json +8 -8
- data/lib/fanforce/app_factory.rb +19 -16
- data/lib/fanforce/app_factory/Rakefile +6 -14
- data/lib/fanforce/app_factory/Routes.rb +2 -2
- data/lib/fanforce/app_factory/app.rb +19 -8
- data/lib/fanforce/app_factory/cli.rb +5 -0
- data/lib/fanforce/app_factory/cli/bitbucket.rb +70 -0
- data/lib/fanforce/app_factory/cli/bundler.rb +21 -0
- data/lib/fanforce/app_factory/cli/env.rb +99 -0
- data/lib/fanforce/app_factory/cli/git.rb +58 -0
- data/lib/fanforce/app_factory/cli/iron.rb +61 -0
- data/lib/fanforce/app_factory/cli/pow.rb +46 -0
- data/lib/fanforce/app_factory/cli/scaffolding.rb +74 -0
- data/lib/fanforce/app_factory/cli/scaffolding_file.rb +510 -0
- data/lib/fanforce/app_factory/cli/scripts/config.rb +9 -0
- data/lib/fanforce/app_factory/cli/scripts/create.rb +64 -0
- data/lib/fanforce/app_factory/cli/scripts/destroy.rb +61 -0
- data/lib/fanforce/app_factory/cli/scripts/push.rb +70 -0
- data/lib/fanforce/app_factory/cli/scripts/restart.rb +40 -0
- data/lib/fanforce/app_factory/cli/scripts/setup.rb +70 -0
- data/lib/fanforce/app_factory/cli/scripts/status.rb +120 -0
- data/lib/fanforce/app_factory/cli/scripts/update.rb +41 -0
- data/lib/fanforce/app_factory/cli/uranium.rb +77 -0
- data/lib/fanforce/app_factory/cli/utils.rb +39 -0
- data/lib/fanforce/app_factory/cli_directory_of_apps.rb +50 -0
- data/lib/fanforce/app_factory/cli_single_app.rb +49 -0
- data/lib/fanforce/app_factory/controllers/base_controller.rb +0 -4
- data/lib/fanforce/app_factory/core_config.rb +25 -26
- data/lib/fanforce/app_factory/load.rb +8 -0
- data/lib/fanforce/app_factory/load_iron_worker.rb +2 -0
- data/lib/fanforce/app_factory/load_sprockets.rb +2 -0
- data/lib/fanforce/app_factory/scaffolding/._.gitignore.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/._Gemfile.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/._Rakefile.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/._config.json.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/._config.ru.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/._favicon.ico.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/._robots.txt.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/.gitignore +27 -0
- data/lib/fanforce/app_factory/scaffolding/Gemfile +9 -0
- data/lib/fanforce/app_factory/scaffolding/Rakefile +7 -0
- data/lib/fanforce/app_factory/{scafolding → scaffolding}/Routes.rb +5 -1
- data/lib/fanforce/app_factory/scaffolding/assets/css/._engagement.scss.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/css/._fembedded.scss.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/css/._promotional.scss.registry +3 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/css/engagement.scss +8 -5
- data/lib/fanforce/app_factory/scaffolding/assets/css/fembedded.scss +22 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/css/promotional.scss +9 -4
- data/lib/fanforce/app_factory/scaffolding/assets/img/._icon-16.png.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/assets/img/._icon-32.png.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/assets/img/._icon-42.png.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/assets/img/._marketplace.png.registry +1 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/icon-16.png +0 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/icon-32.png +0 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/icon-42.png +0 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/marketplace.png +0 -0
- data/lib/fanforce/app_factory/scaffolding/assets/img/promotional/._fanforce_bg.png.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/assets/img/promotional/._icon-42.png.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/assets/img/promotional/._icon-plus.png.registry +1 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/promotional/fanforce_bg.png +0 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/promotional/icon-42.png +0 -0
- data/lib/fanforce/app_factory/{scafolding/scafolding_assets → scaffolding/assets}/img/promotional/icon-plus.png +0 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/._fembedded-app.coffee.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/._fembedded.js.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/._promotional.js.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/fembedded-app.coffee +11 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/fembedded.js +12 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/lib/._cookie.coffee.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/lib/._filters.coffee.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/lib/._utils.coffee.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/lib/cookie.coffee +24 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/lib/filters.coffee +9 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/lib/utils.coffee +40 -0
- data/lib/fanforce/app_factory/scaffolding/assets/js/promotional.js +4 -0
- data/lib/fanforce/app_factory/scaffolding/config.json +24 -0
- data/lib/fanforce/app_factory/scaffolding/config.ru +8 -0
- data/lib/fanforce/app_factory/{scafolding/public → scaffolding}/favicon.ico +0 -0
- data/lib/fanforce/app_factory/scaffolding/layouts/._engagement.haml.registry +1 -0
- data/lib/fanforce/app_factory/scaffolding/layouts/._fembedded.haml.registry +2 -0
- data/lib/fanforce/app_factory/scaffolding/layouts/._promotional.haml.registry +1 -0
- data/lib/fanforce/app_factory/{scafolding → scaffolding}/layouts/engagement.haml +5 -4
- data/lib/fanforce/app_factory/scaffolding/layouts/fembedded.haml +26 -0
- data/lib/fanforce/app_factory/scaffolding/layouts/promotional.haml +19 -0
- data/lib/fanforce/app_factory/scaffolding/robots.txt +7 -0
- data/lib/fanforce/app_factory/scaffolding/views/._index.haml.registry +1 -0
- data/lib/fanforce/app_factory/{scafolding → scaffolding}/views/index.haml +13 -7
- data/lib/fanforce/app_factory/sinatra/_load.rb +7 -7
- data/lib/fanforce/app_factory/sinatra/helper_routes/app.rb +2 -2
- data/lib/fanforce/app_factory/sinatra/helper_routes/com_behavior.rb +2 -2
- data/lib/fanforce/app_factory/sinatra/helper_routes/com_broadcaster.rb +1 -1
- data/lib/fanforce/app_factory/sinatra/helper_routes/com_connector.rb +2 -2
- data/lib/fanforce/app_factory/sprockets/compiler.rb +0 -1
- data/lib/fanforce/app_factory/version.rb +1 -1
- data/workers.json +8 -8
- metadata +80 -38
- data/lib/fanforce/app_factory/asset_framework/app_factory/directives/internal-iframe/internal-iframe.scss +0 -1
- data/lib/fanforce/app_factory/asset_framework/app_factory/lib/cookie.coffee +0 -16
- data/lib/fanforce/app_factory/asset_framework/app_factory/lib/url.coffee +0 -20
- data/lib/fanforce/app_factory/asset_framework/app_factory/lib/utils.coffee +0 -11
- data/lib/fanforce/app_factory/asset_framework/app_factory/scafolding/_engagement.scss +0 -1
- data/lib/fanforce/app_factory/asset_framework/app_factory/scafolding/_promotional.scss +0 -1
- data/lib/fanforce/app_factory/asset_framework/app_factory/scafolding/_standard.scss +0 -1
- data/lib/fanforce/app_factory/asset_framework/app_factory/scafolding/promotional.coffee +0 -0
- data/lib/fanforce/app_factory/cli/_cleanorgs.rb +0 -54
- data/lib/fanforce/app_factory/scafolding/public/robots.txt +0 -2
- data/lib/fanforce/app_factory/scafolding/scafolding_assets/css/standard.scss +0 -10
- data/lib/fanforce/app_factory/scafolding/scafolding_assets/img/marketplace.psd +0 -0
- data/lib/fanforce/app_factory/scafolding/views/add_initiative.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/add_source.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/close_popup.haml +0 -8
- data/lib/fanforce/app_factory/scafolding/views/config.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/convert_initiative.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/dashboard.haml +0 -38
- data/lib/fanforce/app_factory/scafolding/views/edit_initiative.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/engage.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/new_message.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/source_details.haml +0 -1
- data/lib/fanforce/app_factory/scafolding/views/widget_templates.haml +0 -1
- data/lib/fanforce/app_factory/sprockets/_all.rb +0 -2
@@ -0,0 +1,77 @@
|
|
1
|
+
class Fanforce::AppFactory::CLI::Uranium
|
2
|
+
include Fanforce::AppFactory::CLI::Utils
|
3
|
+
|
4
|
+
attr_reader :app
|
5
|
+
|
6
|
+
def initialize(app)
|
7
|
+
@app = app
|
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}/apps/#{app._id}") do |response|
|
16
|
+
if response.code == 404
|
17
|
+
setup(false)
|
18
|
+
elsif response.code < 300
|
19
|
+
confirm "\nThis app (#{app_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 => app._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}/apps"
|
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)}" + "#{app._id} in uranium"
|
44
|
+
else
|
45
|
+
log "#{'Added '.format(:green,:bold)}" + "#{app._id} to uranium"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def destroy
|
50
|
+
if app.config[:awaiting_uranium_setup]
|
51
|
+
return log "#{'Skipped '.format(:green,:bold)}" + 'since config.json was still awaiting uranium setup'
|
52
|
+
elsif app.config.size == 0
|
53
|
+
return log "#{'Missing '.format(:green,:bold)}" + "config.json so assuming #{app._id} was removed from uranium"
|
54
|
+
end
|
55
|
+
|
56
|
+
error 'Uranium credentials were not found in config file' if !config[:uranium]
|
57
|
+
error 'Your app\'s config.json is missing a _iuid field (delete config.json to skip)' if !app.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}/apps/#{app.config[:_iuid]}"
|
65
|
+
RestClient.delete(url, params: attrs) do |response|
|
66
|
+
if response.code == 404
|
67
|
+
return log "#{'Already Removed '.format(:green,:bold)}" + "#{app._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)}" + "#{app._id} from uranium"
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'pty'
|
2
|
+
require 'fanforce/cli'
|
3
|
+
|
4
|
+
module Fanforce::AppFactory::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=true)
|
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 config
|
21
|
+
return @@config if @@config
|
22
|
+
require 'yaml'
|
23
|
+
if Fanforce::CLI::TYPE == :directory_of_apps
|
24
|
+
config_path = "#{Fanforce::CLI::DIR}/.fanforce-app-factory"
|
25
|
+
config_filename = '.fanforce-app-factory'
|
26
|
+
elsif Fanforce::CLI::TYPE == :single_app
|
27
|
+
config_path = "#{Fanforce::CLI::DIR}/../.fanforce-app-factory"
|
28
|
+
config_filename = '../.fanforce-app-factory'
|
29
|
+
end
|
30
|
+
error "The required config file was not found: #{config_filename}" if !File.exists?(config_path)
|
31
|
+
@@config = format_config(YAML.load_file(config_path))
|
32
|
+
end
|
33
|
+
|
34
|
+
def format_config(hash)
|
35
|
+
hash.values.select{|v| v.is_a? Hash}.each{|h| format_config(h)}
|
36
|
+
hash.symbolize_keys!
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require_relative 'cli'
|
2
|
+
|
3
|
+
class Fanforce::AppFactory::CLI::Scripts
|
4
|
+
|
5
|
+
########################################################################################################################
|
6
|
+
|
7
|
+
Fanforce::CLI.register(self, :create,
|
8
|
+
['APP_ID', 'Create new app folder, files, and push to bitbucket']
|
9
|
+
) { require_relative 'cli/scripts/create' }
|
10
|
+
|
11
|
+
########################################################################################################################
|
12
|
+
|
13
|
+
Fanforce::CLI.register(self, :destroy,
|
14
|
+
['APP_ID', 'Destroys the app folder, related files, and bitbucket repository']
|
15
|
+
) { require_relative 'cli/scripts/destroy' }
|
16
|
+
|
17
|
+
########################################################################################################################
|
18
|
+
|
19
|
+
Fanforce::CLI.register(self, :status,
|
20
|
+
['all/TYPE', 'Check the status of files, git, and gems'],
|
21
|
+
['files', 'Check for file diffs between app_factory scaffolding'],
|
22
|
+
['git', 'Check the status of git commit'],
|
23
|
+
['gems', 'Check the gem versions being used across apps']
|
24
|
+
) { require_relative 'cli/scripts/status' }
|
25
|
+
|
26
|
+
########################################################################################################################
|
27
|
+
|
28
|
+
Fanforce::CLI.register(self, :update,
|
29
|
+
['all/TYPE', 'Update all app files and env variables'],
|
30
|
+
['files', 'Copy the latest scaffolding files from fanforce-app-factory'],
|
31
|
+
['env', 'Create ENV variables from your local .env folder']
|
32
|
+
) { require_relative 'cli/scripts/update' }
|
33
|
+
|
34
|
+
########################################################################################################################
|
35
|
+
|
36
|
+
Fanforce::CLI.register(self, :push,
|
37
|
+
['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
|
38
|
+
# ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
|
39
|
+
# ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
|
40
|
+
['RACK_ENV iron', 'Upload iron workers to selected environment']
|
41
|
+
) { require_relative 'cli/scripts/push' }
|
42
|
+
|
43
|
+
########################################################################################################################
|
44
|
+
|
45
|
+
Fanforce::CLI.register(self, :restart,
|
46
|
+
#['*development/RACK_ENV/all', 'Runs `touch tmp/restart` if development or else `heroku restart`']
|
47
|
+
['*development', 'Runs `touch tmp/restart` if development or else `heroku restart`']
|
48
|
+
) { require_relative 'cli/scripts/restart' }
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'cli'
|
2
|
+
|
3
|
+
class Fanforce::AppFactory::CLI::Scripts
|
4
|
+
|
5
|
+
########################################################################################################################
|
6
|
+
|
7
|
+
Fanforce::CLI.register(self, :status,
|
8
|
+
['all/TYPE', 'Check the status of files, git, and gems'],
|
9
|
+
['files *overview/diff', 'Check for file diffs between app_factory scaffolding'],
|
10
|
+
['git', 'Check the status of git commit'],
|
11
|
+
# ['gems', 'Check if the gem versions are behind other apps']
|
12
|
+
) { require_relative 'cli/scripts/status' }
|
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
|
+
['env', 'Create ENV variables from local .env folder'],
|
22
|
+
['uranium', 'Register config.json with uranium and add environ']
|
23
|
+
) { require_relative 'cli/scripts/setup' }
|
24
|
+
|
25
|
+
########################################################################################################################
|
26
|
+
|
27
|
+
Fanforce::CLI.register(self, :update,
|
28
|
+
['all/TYPE', 'Update all app files and env variables'],
|
29
|
+
['files', 'Copy the latest scaffolding files from fanforce-app-factory'],
|
30
|
+
['env', 'Create ENV variables from your local .env folder']
|
31
|
+
) { require_relative 'cli/scripts/update' }
|
32
|
+
|
33
|
+
########################################################################################################################
|
34
|
+
|
35
|
+
Fanforce::CLI.register(self, :push,
|
36
|
+
['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
|
37
|
+
# ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
|
38
|
+
# ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
|
39
|
+
['RACK_ENV iron', 'Upload iron workers to selected environment']
|
40
|
+
) { require_relative 'cli/scripts/push' }
|
41
|
+
|
42
|
+
########################################################################################################################
|
43
|
+
|
44
|
+
Fanforce::CLI.register(self, :restart,
|
45
|
+
#['*development/RACK_ENV/all', 'Runs `touch tmp/restart` if development or else `heroku restart`']
|
46
|
+
['*development', 'Runs `touch tmp/restart` if development or else `heroku restart`']
|
47
|
+
) { require_relative 'cli/scripts/restart' }
|
48
|
+
|
49
|
+
end
|
@@ -3,23 +3,22 @@ class Fanforce::App::CoreConfig
|
|
3
3
|
attr_reader :show_error_details, :is_bugsnag_enabled
|
4
4
|
attr_writer :redis_url
|
5
5
|
|
6
|
-
def initialize(
|
7
|
-
@
|
8
|
-
@factory_dir = File.expand_path '../', __FILE__
|
6
|
+
def initialize(base_dir)
|
7
|
+
@base_dir = base_dir
|
9
8
|
@show_error_details = false
|
10
9
|
@bugsnag = (ENV['BUGSNAG_API_KEY'].present?) ? {api_key: ENV['BUGSNAG_API_KEY']} : nil
|
11
10
|
end
|
12
11
|
|
13
12
|
def _id
|
14
|
-
raw_config[:_id] || (raise '
|
13
|
+
raw_config[:_id] || (raise 'base_dir is missing')
|
15
14
|
end
|
16
15
|
|
17
|
-
def
|
18
|
-
@
|
16
|
+
def base_dir
|
17
|
+
@base_dir || (raise 'base_dir is missing')
|
19
18
|
end
|
20
19
|
|
21
20
|
def factory_dir
|
22
|
-
|
21
|
+
Fanforce::AppFactory.base_dir || (raise 'factory_dir is missing')
|
23
22
|
end
|
24
23
|
|
25
24
|
def show_error_details=(opt)
|
@@ -33,12 +32,12 @@ class Fanforce::App::CoreConfig
|
|
33
32
|
######################################################################################################################
|
34
33
|
|
35
34
|
def raw_config
|
36
|
-
@raw_config ||= validate_config_file(MultiJson.load(File.open("#{@
|
35
|
+
@raw_config ||= validate_config_file(MultiJson.load(File.open("#{@base_dir}/config.json").read, symbolize_keys: true))
|
37
36
|
end
|
38
37
|
|
39
38
|
def validate_config_file(raw_config)
|
40
|
-
raw_config.is_a?(Hash) || (raise "#{@
|
41
|
-
raw_config[:_id].present? || (raise '#{@
|
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')
|
42
41
|
return raw_config
|
43
42
|
end
|
44
43
|
|
@@ -52,31 +51,31 @@ class Fanforce::App::CoreConfig
|
|
52
51
|
config.notify_release_stages = @bugsnag[:notify_release_stages] || ['development','staging','production']
|
53
52
|
config.release_stage = @bugsnag[:release_stage] || ENV['RACK_ENV']
|
54
53
|
config.app_version = @bugsnag[:app_version] || "fanforce-app-factory-#{Fanforce::AppFactory::VERSION}"
|
55
|
-
config.project_root = @
|
54
|
+
config.project_root = @base_dir
|
56
55
|
end
|
57
56
|
@is_bugsnag_enabled = true
|
58
57
|
end
|
59
58
|
|
60
59
|
def load_routes
|
61
|
-
$: << File.join(@
|
62
|
-
$: << @
|
63
|
-
|
64
|
-
require "#{
|
65
|
-
require "#{
|
66
|
-
require "#{
|
67
|
-
require "#{
|
68
|
-
require "#{
|
69
|
-
require "#{
|
70
|
-
|
71
|
-
Dir["#{@
|
72
|
-
require "#{
|
73
|
-
require "#{@
|
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/app"
|
64
|
+
require "#{factory_dir}/sinatra/helper_routes/com_connector"
|
65
|
+
require "#{factory_dir}/sinatra/helper_routes/com_broadcaster"
|
66
|
+
require "#{factory_dir}/sinatra/helper_routes/com_identifier"
|
67
|
+
require "#{factory_dir}/sinatra/helper_routes/com_behavior"
|
68
|
+
require "#{factory_dir}/sinatra/helper_routes/com_js_widget"
|
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"
|
74
73
|
end
|
75
74
|
|
76
75
|
def load_env
|
77
76
|
if (!ENV['RACK_ENV'] or ENV['RACK_ENV'] == 'development')
|
78
|
-
load_env_from_file("#{@
|
79
|
-
load_env_from_file("#{@
|
77
|
+
load_env_from_file("#{@base_dir}/.powenv") if File.exists?("#{@base_dir}/.powenv")
|
78
|
+
load_env_from_file("#{@base_dir}/.appenv") if File.exists?("#{@base_dir}/.appenv")
|
80
79
|
end
|
81
80
|
end
|
82
81
|
|
@@ -0,0 +1 @@
|
|
1
|
+
fanforce-app-factory-2.0.0.rc6:{"ADD": ["*.gem", "*.rbc", ".bundle", ".config", "coverage", "InstalledFiles", "lib/bundler/man", "pkg", "rdoc", "spec/reports", "test/tmp", "test/version_tmp", "tmp", ".idea/", ".sass-cache/", ".DS_STORE", ".powenv", ".appenv", ".widgetenv", ".*env.rb", ".yardoc", "_yardoc", "doc/", ".pluginenv", ".env/"]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
fanforce-app-factory-2.0.0.rc6:{"ADD": {"_id": null, "name": null, "description": null, "callback_urls": {"install": "http://{{APP_DOMAIN}}/install", "uninstall": "http://{{APP_DOMAIN}}/uninstall"}, "fanforce_version_dependency": "1.5", "created_with_app_factory_version": null}}
|
2
|
+
fanforce-app-factory-2.0.0.rc6:{"OPT": {"public_urls": {}, "com_behaviors": [], "com_broadcasters": [], "com_connectors": [], "com_js_finders": [], "com_js_trackers": [], "iron_workers": []}}
|
@@ -0,0 +1 @@
|
|
1
|
+
fanforce-app-factory-2.0.0.rc6:11e7043a9066756655711247c28736cf4b5ca91a
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# AppFactoryScaffolding : ITEMS
|
2
|
+
########################################################################################################################
|
3
|
+
*.gem
|
4
|
+
*.rbc
|
5
|
+
.bundle
|
6
|
+
.config
|
7
|
+
coverage
|
8
|
+
InstalledFiles
|
9
|
+
lib/bundler/man
|
10
|
+
pkg
|
11
|
+
rdoc
|
12
|
+
spec/reports
|
13
|
+
test/tmp
|
14
|
+
test/version_tmp
|
15
|
+
tmp
|
16
|
+
.idea/
|
17
|
+
.sass-cache/
|
18
|
+
.DS_STORE
|
19
|
+
.powenv
|
20
|
+
.appenv
|
21
|
+
.widgetenv
|
22
|
+
.*env.rb
|
23
|
+
.yardoc
|
24
|
+
_yardoc
|
25
|
+
doc/
|
26
|
+
.pluginenv
|
27
|
+
.env/
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# AppFactoryScaffolding : PARTIAL
|
2
|
+
########################################################################################################################
|
3
|
+
|
4
|
+
source 'https://rubygems.org'
|
5
|
+
ruby '1.9.3'
|
6
|
+
|
7
|
+
gem FANFORCE-APP-FACTORY
|
8
|
+
|
9
|
+
# END PARTIAL ##########################################################################################################
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# AppFactoryScaffolding : PARTIAL
|
2
|
+
########################################################################################################################
|
3
|
+
|
4
|
+
require 'bundler'; Bundler.setup
|
5
|
+
require 'fanforce/app_factory'
|
6
|
+
|
7
|
+
# END PARTIAL ##########################################################################################################
|
@@ -1,13 +1,17 @@
|
|
1
|
+
# AppFactoryScaffolding : SKIPPED
|
2
|
+
########################################################################################################################
|
3
|
+
|
1
4
|
class App::Sinatra
|
2
5
|
|
3
6
|
######################################################################################################################
|
4
7
|
# APP
|
5
8
|
|
6
|
-
get '/ping
|
9
|
+
get '/ping' do route_ping_callback end
|
7
10
|
post '/install' do route_install_callback end
|
8
11
|
post '/uninstall' do route_uninstall_callback end
|
9
12
|
|
10
13
|
static '/' do route_index_ui end
|
14
|
+
|
11
15
|
#static '/config.html' do route_config_ui end
|
12
16
|
#static '/close_popup.html' do route_close_popup_ui end
|
13
17
|
|