fanforce-plugin-factory 2.0.0.rc6 → 2.0.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1beb5dcb8bd95c0458027304019549ee872eae2e
|
4
|
+
data.tar.gz: 5a32072e43ea141974347a08dc62ce4d5e22a088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30effcb53f8985fb8c59c5404b7f12eeddc7395b66046a8d98e9b560ae6fe80af49a4dfb272635b75a840653a7916ace8655991a7d880d5c34386967f3d0620e
|
7
|
+
data.tar.gz: a9574836d6a5dbb4c50410937b45999c40acbf7f14ca437cbf155daf734e7ee6758260b4d960e5d8cb475bedf3b3c622a09f6c2395ee35d989419ea5f804003a
|
@@ -62,33 +62,38 @@ class Fanforce::PluginFactory::CLI::Heroku
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def ensure_app_exists
|
65
|
-
|
66
|
-
|
65
|
+
if app_exists?
|
66
|
+
puts "#{'Found '.format(:green,:bold)}" + "#{environment} app on heroku (#{app_name})"
|
67
|
+
ensure_domains_exist
|
68
|
+
else
|
69
|
+
create_app
|
70
|
+
ensure_domains_exist
|
71
|
+
end
|
67
72
|
end
|
68
73
|
|
69
74
|
def create_app
|
70
75
|
heroku.post_app(name: app_name)
|
71
76
|
puts "#{'Created '.format(:green,:bold)}" + "#{environment} on heroku (#{app_name})"
|
77
|
+
end
|
72
78
|
|
79
|
+
def ensure_domains_exist
|
73
80
|
# Setup standard app domain
|
74
|
-
|
75
|
-
domain_found = heroku.get_domains(app_name).body.inject(false) {|result, d| d['domain'] == domain ? (break true) : false }
|
76
|
-
if domain_found
|
77
|
-
puts "#{'Found '.format(:green,:bold)}" + "#{domain} domain on #{environment}"
|
78
|
-
else
|
79
|
-
heroku.post_domain(app_name, domain)
|
80
|
-
puts "#{'Added '.format(:green,:bold)}" + "#{domain} domain to #{environment}"
|
81
|
-
end
|
81
|
+
add_domain("#{plugin._id}.#{Fanforce::Base::DomainEnvironments.method(environment).call[:plugins_base]}")
|
82
82
|
|
83
83
|
# Setup default short domain
|
84
|
-
|
85
|
-
|
84
|
+
add_domain("#{plugin._id}.#{Fanforce::Base::DomainEnvironments.method(environment).call[:default_short_domain]}")
|
85
|
+
end
|
86
|
+
|
87
|
+
def add_domain(domain_name)
|
88
|
+
domain_found = heroku.get_domains(app_name).body.inject(false) {|result, d| d['domain'] == domain_name ? (break true) : false }
|
86
89
|
if domain_found
|
87
|
-
puts "#{'Found '.format(:green,:bold)}" + "#{
|
90
|
+
puts "#{'Found '.format(:green,:bold)}" + "#{domain_name} domain on #{environment}"
|
88
91
|
else
|
89
|
-
heroku.post_domain(app_name,
|
90
|
-
puts "#{'Added '.format(:green,:bold)}" + "#{
|
92
|
+
heroku.post_domain(app_name, domain_name)
|
93
|
+
puts "#{'Added '.format(:green,:bold)}" + "#{domain_name} domain to #{environment}"
|
91
94
|
end
|
95
|
+
rescue
|
96
|
+
puts "#{'Error '.format(:red,:bold)}" + "adding #{domain_name} domain on #{environment}"
|
92
97
|
end
|
93
98
|
|
94
99
|
def update_config(vars)
|
@@ -75,8 +75,8 @@ class Fanforce::PluginFactory::CLI::Scripts
|
|
75
75
|
heroku.update_config(vars)
|
76
76
|
log 'Updated ENV'.format(:green,:bold) + " on Heroku #{environment.to_s.titleize} (#{vars.size} variables)..."
|
77
77
|
|
78
|
-
puts "\n#{'Pushing '.format(:green,:bold)}" + "latest commit to Heroku #{environment.to_s.titleize} (#{heroku.git_remote_name})..."
|
79
|
-
console_command("git push #{heroku.git_remote_name} master", true)
|
78
|
+
puts "\n#{'Pushing '.format(:green,:bold)}" + "latest commit to Heroku #{environment.to_s.titleize} (#{heroku.git_remote_name} #{environment}:master)..."
|
79
|
+
console_command("git push #{heroku.git_remote_name} #{environment}:master", true)
|
80
80
|
end
|
81
81
|
|
82
82
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'redis'
|
2
|
+
require 'sass'
|
2
3
|
require 'fileutils'
|
3
4
|
require 'rack/jsonr'
|
4
5
|
require 'rack/jquery-params'
|
@@ -49,6 +50,8 @@ class Fanforce::Plugin
|
|
49
50
|
|
50
51
|
# Method for use in config.ru files (i.e., run Fanforce::Plugin)
|
51
52
|
def self.call(env)
|
53
|
+
Sass::Plugin.options[:cache_location] = './tmp/sass-cache'
|
54
|
+
|
52
55
|
if ENV['RACK_ENV'] == 'development' and env['PATH_INFO'] =~ /^\/assets\//
|
53
56
|
env['PATH_INFO'] = env['PATH_INFO'].gsub(/^\/assets/, '')
|
54
57
|
sprockets = SprocketsCompiler.setup(base_dir)
|
@@ -58,8 +61,6 @@ class Fanforce::Plugin
|
|
58
61
|
|
59
62
|
require_relative 'sinatra/_load'
|
60
63
|
request = Rack::Request.new(env)
|
61
|
-
Sass::Plugin.options[:cache_location] = './tmp/sass-cache'
|
62
|
-
sass_options = {:cache_location => "path\to\tmp\sass-cache"}
|
63
64
|
Rack::JSONR.intercept_method_override(env, request, request.params, :all)
|
64
65
|
Rack::JQueryParams.fix(env, :all)
|
65
66
|
Sinatra.new.call(env)
|