qbrick 2.6.6 → 2.6.7

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: 07709344b66a8a6c269525b679d6c2a493c274ed
4
- data.tar.gz: e1ced749e13c4246ad3d2ee96812bf301669bc1d
3
+ metadata.gz: bd6273ff52cc6d56eb6939f28ecaca4ca075e4ba
4
+ data.tar.gz: 2f9a48e9174a7618e6ef5f1f33c23eb9f0866732
5
5
  SHA512:
6
- metadata.gz: a5af40147b920523cfdf5a55a273537fce4264db38e50d3a7cdcbcd518fa447de70314db9eaae620af063dac970a2a715a982ad73e8e6572641b2e5498b01eb0
7
- data.tar.gz: 81dae619a52d47d8cb08d4209f399e3a93e63847896c5c14c7fc0dd4f0d353c574bb44a2e2ac58bf8e49192705fe8ee5d9a9a1d7c085ece1cf8d079215f6bf64
6
+ metadata.gz: 3c3525b5ffa1a44d30375ffe1b2a13edbc692cd29d4b9091338e5506d3683db46b4337321ed425d2165ca653eb379eafb74fe2ff466c432d9b7f702a645c5b41
7
+ data.tar.gz: 7f51a9cf74dc215329bd0c4ea102647763c46ef00c9195a605a0e1d08a3852a7e526664d8be8d3243a28b61b3c27235aca1ac86a9056c5511409793ff6b6af71
@@ -171,6 +171,12 @@ module Qbrick
171
171
  "/#{locale}#{send self.class.attr_name_for_locale(:path, locale)}"
172
172
  end
173
173
 
174
+ def url
175
+ URI::HTTP.build([nil, Qbrick::Engine.host, Qbrick::Engine.port, path_with_prefixed_locale, nil, nil]).tap do |url|
176
+ url.scheme = Qbrick::Engine.scheme
177
+ end
178
+ end
179
+
174
180
  def create_path
175
181
  opts = { locale: I18n.locale }
176
182
  path = path_segments.join '/'
@@ -9,6 +9,8 @@ class LocalizePublishColumn < ActiveRecord::Migration
9
9
  end
10
10
 
11
11
  new_translations = Qbrick::Page.translated_columns_for(:published) - %w(published_en)
12
+ new_translations << 'published_de' unless new_translations.include? 'published_de'
13
+
12
14
  Qbrick::Page.all.each do |page|
13
15
  page.update_columns Hash[new_translations.zip([page.published_en] * new_translations.count)]
14
16
  end
@@ -24,10 +24,33 @@ module Qbrick
24
24
  ActionView::DependencyTracker.register_tracker :haml, ActionView::DependencyTracker::ERBTracker
25
25
  end
26
26
 
27
+ def app_config
28
+ Rails.application.config
29
+ end
30
+
27
31
  def hosts
28
32
  [Socket.gethostname].tap do |result|
29
- result.concat [Rails.application.config.hosts].flatten if Rails.application.config.respond_to? :hosts
33
+ result.concat [app_config.hosts].flatten if app_config.respond_to? :hosts
34
+ result.concat [app_config.host].flatten if app_config.respond_to? :host
30
35
  end
31
36
  end
37
+
38
+ def host
39
+ return hosts.first unless app_config.respond_to? :host
40
+
41
+ app_config.host
42
+ end
43
+
44
+ def scheme
45
+ return 'http' unless app_config.respond_to? :scheme
46
+
47
+ app_config.scheme
48
+ end
49
+
50
+ def port
51
+ return 80 unless app_config.respond_to? :port
52
+
53
+ app_config.port
54
+ end
32
55
  end
33
56
  end
@@ -1,3 +1,3 @@
1
1
  module Qbrick
2
- VERSION = '2.6.6'
2
+ VERSION = '2.6.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qbrick
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.6
4
+ version: 2.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Immanuel Häussermann
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-06-26 00:00:00.000000000 Z
15
+ date: 2015-06-30 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec-rails
@@ -886,7 +886,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
886
886
  version: '0'
887
887
  requirements: []
888
888
  rubyforge_project: qbrick
889
- rubygems_version: 2.2.2
889
+ rubygems_version: 2.4.5
890
890
  signing_key:
891
891
  specification_version: 4
892
892
  summary: A tool that helps you to manage your content within your app.