aptible-rails 0.3.2 → 0.3.3

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: 7bedece438efef08d383ca8934a4ac8b5eba9c9a
4
- data.tar.gz: de3005acca106a6367146199741f2a54ef9e1a97
3
+ metadata.gz: f1ce86f107ca7e84482a8448f394e8b135c8c35e
4
+ data.tar.gz: 3fd7be09ad266238abaab36355f53bfcc222a912
5
5
  SHA512:
6
- metadata.gz: 52b49e260842abce4b9f72c785258a77d601c75136b5f97cd041454dffdb7edbbba301b54f4974d9f7a53243b4ec86760219252f8286cab72d6c874cf5f6916d
7
- data.tar.gz: 3f84c5b183c18e6265eb22b36f27e9510080da55bf034fd6ead6181563144eab8b90a9a212623de26bece3d1dfb72efec148a057d74f68c332048e4807aeaa79
6
+ metadata.gz: 75de1a55ddec9d4e12f3c37805965314d9ba41e069c1755474b5dbe0575bbd007281b42d4640103fcaa6fdb611c094cb1d9e1bf9c183906086a6be9f2e6f1668
7
+ data.tar.gz: 61a2cfe8049a4a6cd0b58420901bcb4bd165e22f316a403942bb4548f9127340a5b19b9093d69f7a6a865dba5f3d5f755211e4b8704c40c5dd5b3a9a615125c2
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.version = Aptible::Rails::VERSION
11
11
  spec.authors = ['Frank Macreery']
12
12
  spec.email = ['frank@macreery.com']
13
- spec.description = %q(Rails helpers for Aptible service applications)
14
- spec.summary = %q(Rails helpers for Aptible service applications)
13
+ spec.description = 'Rails helpers for Aptible service applications'
14
+ spec.summary = 'Rails helpers for Aptible service applications'
15
15
  spec.homepage = 'https://github.com/aptible/aptible-rails'
16
16
  spec.license = 'MIT'
17
17
 
@@ -8,9 +8,9 @@ module Aptible
8
8
 
9
9
  included do
10
10
  helper_method :auth, :api, :current_aptible_user,
11
- :current_organization, :subscribed?,
12
- :has_acccount?, :email_verified?,
13
- :subscribed_and_verified?
11
+ :current_organization, :subscribed?, :has_acccount?,
12
+ :email_verified?, :subscribed_and_verified?, :user_url,
13
+ :organization_url
14
14
  end
15
15
 
16
16
  def auth
@@ -106,6 +106,14 @@ module Aptible
106
106
  rescue
107
107
  token.serialize
108
108
  end
109
+
110
+ def organization_url(id)
111
+ "#{dashboard_url}/organizations/#{id}"
112
+ end
113
+
114
+ def user_url(id = current_aptible_user.id)
115
+ "#{dashboard_url}/users/#{id}"
116
+ end
109
117
  end
110
118
  end
111
119
  end
@@ -1,5 +1,6 @@
1
1
  require 'aptible/rails/controller'
2
2
  require 'aptible/rails/url_helper'
3
+ require 'aptible/rails/view_helper'
3
4
 
4
5
  module Aptible
5
6
  module Rails
@@ -26,6 +27,10 @@ module Aptible
26
27
  initializer 'aptible.rails.routes_helper' do
27
28
  ActionController::Base.send :include, Aptible::Rails::UrlHelper
28
29
  end
30
+
31
+ initializer 'aptible.rails.view_helpers' do
32
+ ActionView::Base.send :include, Aptible::Rails::ViewHelpers
33
+ end
29
34
  end
30
35
  end
31
36
  end
@@ -15,15 +15,21 @@ module Aptible
15
15
 
16
16
  register_url :about_url,
17
17
  aptible_config.marketing_root_url + '/about'
18
+ register_url :apps_url,
19
+ aptible_config.dashboard_root_url + '/apps'
18
20
  register_url :audits_url,
19
21
  aptible_config.marketing_root_url + '/stressfree'
20
22
  # Tumblr doesn't support HTTPS w/ our own domain
21
23
  register_url :blog_url, 'http://blog.aptible.com'
22
24
  register_url :compliance_url,
23
25
  aptible_config.dashboard_root_url + '/compliance'
26
+ register_url :contact_support_url,
27
+ aptible_config.marketing_root_url + '/support'
24
28
  register_url :contact_url,
25
29
  aptible_config.marketing_root_url + '/contact'
26
30
  register_url :dashboard_url, aptible_config.dashboard_root_url
31
+ register_url :databases_url,
32
+ aptible_config.dashboard_root_url + '/databases'
27
33
  register_url :docs_url, aptible_config.marketing_root_url + '/docs'
28
34
  register_url :edit_organization_url,
29
35
  aptible_config.dashboard_root_url + '/organization'
@@ -34,11 +40,16 @@ module Aptible
34
40
  register_url :legal_url, aptible_config.marketing_root_url + '/legal'
35
41
  register_url :logout_url, aptible_config.dashboard_root_url + '/logout'
36
42
  register_url :marketing_url, aptible_config.marketing_root_url
43
+ register_url :organizations_url,
44
+ aptible_config.dashboard_root_url + '/organizations'
37
45
  register_url :policy_url, aptible_config.policy_root_url
38
46
  register_url :pricing_url,
39
47
  aptible_config.marketing_root_url + '/pricing'
40
48
  register_url :privacy_url,
41
49
  aptible_config.marketing_root_url + '/privacy'
50
+ register_url :responsible_disclosure_url,
51
+ aptible_config.marketing_root_url +
52
+ '/legal/responsible_disclosure.html'
42
53
  register_url :risk_url, aptible_config.risk_root_url
43
54
  register_url :roles_url, aptible_config.dashboard_root_url + '/roles'
44
55
  register_url :security_url, aptible_config.security_root_url
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Rails
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
@@ -0,0 +1,26 @@
1
+ module Aptible
2
+ module Rails
3
+ module ViewHelpers
4
+ def unix_to_formatted_date(unix_timestamp, format = '%m/%d/%Y')
5
+ Time.at(unix_timestamp).to_datetime.strftime(format)
6
+ end
7
+
8
+ def gravatar_url(email, size = 80)
9
+ digest = Digest::MD5.hexdigest(email.downcase)
10
+ "https://secure.gravatar.com/avatar/#{digest}?s=#{size}"
11
+ end
12
+
13
+ def auth_url(path = '/')
14
+ URI.join Aptible::Auth.configuration.root_url, path
15
+ end
16
+
17
+ def controller?(*controller)
18
+ controller.include?(params[:controller])
19
+ end
20
+
21
+ def action?(*action)
22
+ action.include?(params[:action])
23
+ end
24
+ end
25
+ end
26
+ 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.3.2
4
+ version: 0.3.3
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-06-13 00:00:00.000000000 Z
11
+ date: 2014-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config
@@ -142,6 +142,7 @@ files:
142
142
  - lib/aptible/rails/railtie.rb
143
143
  - lib/aptible/rails/url_helper.rb
144
144
  - lib/aptible/rails/version.rb
145
+ - lib/aptible/rails/view_helper.rb
145
146
  - spec/spec_helper.rb
146
147
  homepage: https://github.com/aptible/aptible-rails
147
148
  licenses: