aptible-rails 0.1.9 → 0.1.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80b6d016eb1d4fddbaaf7864c87ff5362d449f13
4
- data.tar.gz: 04913481f71fed1a2e4cdd20901a5bbe1b166c4f
3
+ metadata.gz: 4c0d7980f17ca2b8ec71a4e20b0975f0ce6b683d
4
+ data.tar.gz: 7cb040954ab3dfc1de0e20c7e80dc362393ea9a3
5
5
  SHA512:
6
- metadata.gz: c7bb3bebd2a50287dbe0df396752c06baa8d980f04133aaf26a5cb6643c548dfdf8dc7678b9e50d462cffa343857f6385342dbf9e41130b5b3c0b6bf27d6b03e
7
- data.tar.gz: 477b1e8c821687955aa96d781cb5f49b5e209f29ad7dabb5469ac15124dcf5cc19a89a5357910944c94775174b4544e4407c83c755cfa6ed7260a89caae3346e
6
+ metadata.gz: ba53ab58cdf3f164a2c295029d09111e8d284841497ecc8f84654c0fb474fc2c529a24fbf49f4038c8b93357e7349fe3eafc358609179e53327e5277283d25c9
7
+ data.tar.gz: e766f29817099336254ed838bc7cba4521f079d6f339a1d49abf4425e0ce045cf474d1185cae484391a07a40e664499b9740202547febed6ff774f9aa741f2a0
data/lib/aptible/rails.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'aptible/rails/version'
2
- require 'aptible/rails/railtie' if defined?(::Rails)
3
2
 
4
3
  require 'gem_config'
5
4
 
@@ -7,14 +6,33 @@ module Aptible
7
6
  module Rails
8
7
  include GemConfig::Base
9
8
 
9
+ default_dashboard_root_url = ENV['APTIBLE_DASHBOARD_ROOT_URL'] ||
10
+ 'https://dashboard.aptible.com'
11
+ default_marketing_root_url = ENV['APTIBLE_MARKETING_ROOT_URL'] ||
12
+ 'https://www.aptible.com'
13
+ default_risk_root_url = ENV['APTIBLE_RISK_ROOT_URL'] ||
14
+ 'https://risk.aptible.com'
15
+ default_policy_root_url = ENV['APTIBLE_policy_ROOT_URL'] ||
16
+ 'https://policy.aptible.com'
17
+
10
18
  with_configuration do
11
19
  # Where users will be redirected on
12
- has :login_url, classes: [String],
13
- default: "#{ENV['APTIBLE_DASHBOARD_ROOT_URL']}/login"
14
20
  has :client_id, classes: [String, NilClass],
15
21
  default: ENV['CLIENT_ID']
16
22
  has :client_secret, classes: [String, NilClass],
17
23
  default: ENV['CLIENT_SECRET']
24
+ has :dashboard_root_url, classes: [String],
25
+ default: default_dashboard_root_url
26
+ has :login_url, classes: [String],
27
+ default: "#{default_dashboard_root_url}/login"
28
+ has :marketing_root_url, classes: [String],
29
+ default: default_marketing_root_url
30
+ has :policy_root_url, classes: [String],
31
+ default: default_policy_root_url
32
+ has :risk_root_url, classes: [String],
33
+ default: default_risk_root_url
18
34
  end
19
35
  end
20
36
  end
37
+
38
+ require 'aptible/rails/railtie' if defined?(::Rails)
@@ -1,5 +1,5 @@
1
1
  require 'aptible/rails/controller'
2
- require 'aptible/rails/routes_helper'
2
+ require 'aptible/rails/url_helper'
3
3
 
4
4
  module Aptible
5
5
  module Rails
@@ -24,7 +24,7 @@ module Aptible
24
24
  end
25
25
 
26
26
  initializer 'aptible.rails.routes_helper' do
27
- ApplicationHelper.send :include, Aptible::Rails::RoutesHelper
27
+ ActionController::Base.send :include, Aptible::Rails::UrlHelper
28
28
  end
29
29
  end
30
30
  end
@@ -0,0 +1,54 @@
1
+ module Aptible
2
+ module Rails
3
+ module UrlHelper
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ def self.register_url(name, url)
8
+ define_method(name) { url }
9
+ helper_method name
10
+ end
11
+
12
+ def self.aptible_config
13
+ Aptible::Rails.configuration
14
+ end
15
+
16
+ register_url :about_url,
17
+ aptible_config.marketing_root_url + '/about'
18
+ register_url :audits_url,
19
+ aptible_config.marketing_root_url + '/stressfree'
20
+ # Tumblr doesn't support HTTPS w/ our own domain
21
+ register_url :blog_url, 'http://blog.aptible.com'
22
+ register_url :compliance_url,
23
+ aptible_config.dashboard_root_url + '/compliance'
24
+ register_url :contact_url,
25
+ aptible_config.marketing_root_url + '/contact'
26
+ register_url :dashboard_url, aptible_config.dashboard_root_url
27
+ register_url :docs_url, aptible_config.marketing_root_url + '/docs'
28
+ register_url :edit_organization_url,
29
+ aptible_config.dashboard_root_url + '/organization'
30
+ register_url :edit_user_url,
31
+ aptible_config.dashboard_root_url + '/settings'
32
+ register_url :enterprise_url,
33
+ aptible_config.marketing_root_url + '/enterprise'
34
+ register_url :legal_url, aptible_config.marketing_root_url + '/legal'
35
+ register_url :logout_url, aptible_config.dashboard_root_url + '/logout'
36
+ register_url :marketing_url, aptible_config.marketing_root_url
37
+ register_url :pricing_url,
38
+ aptible_config.marketing_root_url + '/pricing'
39
+ register_url :privacy_url,
40
+ aptible_config.marketing_root_url + '/privacy'
41
+ register_url :roles_url, aptible_config.dashboard_root_url + '/roles'
42
+ register_url :security_url,
43
+ aptible_config.marketing_root_url + '/security'
44
+ # Statuspage.io requires a business-tier plan for SSL
45
+ register_url :status_url, 'http://status.aptible.com/'
46
+ # Groove doesn't support HTTPS w/ our own domain
47
+ register_url :support_url, 'http://help.aptible.com'
48
+ register_url :terms_url, aptible_config.marketing_root_url + '/terms'
49
+ register_url :training_url,
50
+ aptible_config.marketing_root_url + '/training'
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Rails
3
- VERSION = '0.1.9'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-07 00:00:00.000000000 Z
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config
@@ -140,7 +140,7 @@ files:
140
140
  - lib/aptible/rails.rb
141
141
  - lib/aptible/rails/controller.rb
142
142
  - lib/aptible/rails/railtie.rb
143
- - lib/aptible/rails/routes_helper.rb
143
+ - lib/aptible/rails/url_helper.rb
144
144
  - lib/aptible/rails/version.rb
145
145
  - spec/spec_helper.rb
146
146
  homepage: https://github.com/aptible/aptible-rails
@@ -1,100 +0,0 @@
1
- module Aptible
2
- module Rails
3
- module RoutesHelper
4
- def marketing_url
5
- 'https://www.aptible.com'
6
- end
7
-
8
- def about_url
9
- marketing_url + '/about'
10
- end
11
-
12
- def audits_url
13
- marketing_url + '/stressfree'
14
- end
15
-
16
- # Tumblr doesn't support HTTPS w/ our own domain
17
- def blog_url
18
- 'http://blog.aptible.com'
19
- end
20
-
21
- def compliance_url
22
- ENV['APTIBLE_DASHBOARD_ROOT_URL'] + '/compliance'
23
- end
24
-
25
- def contact_url
26
- marketing_url + '/contact'
27
- end
28
-
29
- def dashboard_url
30
- ENV['APTIBLE_DASHBOARD_ROOT_URL']
31
- end
32
-
33
- def docs_url
34
- marketing_url + '/docs'
35
- end
36
-
37
- def edit_organization_url
38
- ENV['APTIBLE_DASHBOARD_ROOT_URL'] + '/organization'
39
- end
40
-
41
- def edit_user_url
42
- ENV['APTIBLE_DASHBOARD_ROOT_URL'] + '/settings'
43
- end
44
-
45
- def enterprise_url
46
- marketing_url + '/enterprise'
47
- end
48
-
49
- def legal_url
50
- marketing_url + '/legal'
51
- end
52
-
53
- def logout_url
54
- ENV['APTIBLE_DASHBOARD_ROOT_URL'] + '/logout'
55
- end
56
-
57
- def policy_url
58
- ENV['APTIBLE_POLICY_ROOT_URL']
59
- end
60
-
61
- def pricing_url
62
- marketing_url + '/pricing'
63
- end
64
-
65
- def privacy_url
66
- marketing_url + '/privacy'
67
- end
68
-
69
- def security_url
70
- marketing_url + '/security'
71
- end
72
-
73
- # Groove doesn't support HTTPS w/ our own domain
74
- def support_url
75
- 'http://help.aptible.com'
76
- end
77
-
78
- # Statuspage.io requires a business-tier plan for SSL
79
- def status_url
80
- 'http://status.aptible.com/'
81
- end
82
-
83
- def risk_url
84
- ENV['APTIBLE_RISK_ROOT_URL']
85
- end
86
-
87
- def roles_url
88
- ENV['APTIBLE_DASHBOARD_ROOT_URL'] + '/roles'
89
- end
90
-
91
- def terms_url
92
- marketing_url + '/terms'
93
- end
94
-
95
- def training_url
96
- marketing_url + '/training'
97
- end
98
- end
99
- end
100
- end