smithycms 0.5.99 → 0.5.99.1

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: 50a9ee949cfb2971b60f14b209dd95c3beec69de
4
- data.tar.gz: a200f12370e77bb8bea791e11869d87bfd3f6d79
3
+ metadata.gz: 6aa6991d1a7a02eb63f32a65fd22084a89d4b9ac
4
+ data.tar.gz: 3a578a8ce850fa4f192290918e0fb0791049fb58
5
5
  SHA512:
6
- metadata.gz: 06d59457aabae1d90fa979d84a88a1b0f906928b0ee812c5d911443519a51acd0c0d383bd58c55bb595ac24a08abb6adf81037c1996cf3f0db9f5bfc5a8303a1
7
- data.tar.gz: c9a7ab5481b04448a95180de110624c45a364bf5b9a073a828750251bba8789767b9d125020c5c05262cf0d74ef4d4a95624931618a3a92a43dcd066526f7199
6
+ metadata.gz: b4f8f24794428b031d516e8e7a3a8d05da81840d2a436479d669b8a736ad808fdec1ec93c5ed0280e7c7a008aa247aa099e740c15e0ac84c450ec28f18ec4874
7
+ data.tar.gz: efb6655edd7625a0a2376207a9045158bcbda560373c9cd913b3fa3548b1b6b8a73f0966b59d2a86a615b8428008f915a3c180e4ac3b7f2a58d071c93e841210
@@ -19,7 +19,7 @@ module Smithy
19
19
  def to_liquid
20
20
  {
21
21
  'id' => self.id,
22
- 'content' => self.content,
22
+ 'content' => Smithy::AssetLink.fix(self.content),
23
23
  'formatted_content' => self.formatted_content
24
24
  }
25
25
  end
@@ -17,7 +17,7 @@ module Smithy
17
17
 
18
18
  private
19
19
  def content_with_fixed_asset_links
20
- content.gsub(/\/smithy\/assets\/([0-9]+)/) { Smithy::Asset.find($1).url }
20
+ Smithy::AssetLink.fix(self.content)
21
21
  end
22
22
 
23
23
  def touch_page_contents
@@ -31,7 +31,7 @@ module Smithy
31
31
  end
32
32
 
33
33
  def content_with_fixed_asset_links
34
- content.gsub(/\/smithy\/assets\/([0-9]+)/) { Smithy::Asset.find($1).url }
34
+ Smithy::AssetLink.fix(self.content)
35
35
  end
36
36
 
37
37
  private
@@ -0,0 +1,7 @@
1
+ module Smithy
2
+ class AssetLink
3
+ def self.fix(content)
4
+ content.gsub(/\/smithy\/assets\/([0-9]+)/) { Smithy::Asset.find($1).url }
5
+ end
6
+ end
7
+ end
@@ -7,7 +7,7 @@ module Smithy
7
7
 
8
8
  private
9
9
  def fix_asset_links
10
- @current = @current.gsub(/\/smithy\/assets\/([0-9]+)/) { Smithy::Asset.find($1).url }
10
+ @current = Smithy::AssetLink.fix(@current)
11
11
  self
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module Smithy
2
- VERSION = "0.5.99"
2
+ VERSION = "0.5.99.1"
3
3
  end
data/lib/smithy.rb CHANGED
@@ -6,6 +6,7 @@ require 'smithy/logger'
6
6
  require 'smithy/dragonfly'
7
7
  require 'smithy/liquid'
8
8
  # content formatting
9
+ require 'smithy/asset_link'
9
10
  require 'smithy/formatter'
10
11
  #
11
12
  require 'smithy/content_blocks'
@@ -1,3 +1,6 @@
1
+ require 'smithycms'
2
+ require 'smithy/content'
3
+ require 'smithy/template'
1
4
  namespace :smithy do
2
5
  desc "Track down any usage of linking directly to Smithy Assets. Use /smithy/assets/1 instead"
3
6
  task :find_direct_asset_links do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smithycms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.99
4
+ version: 0.5.99.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Glen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -794,6 +794,7 @@ files:
794
794
  - db/migrate/20131223145710_add_position_to_smithy_template_containers.rb
795
795
  - db/migrate/20141113220013_change_page_keywords_to_text.rb
796
796
  - lib/smithy.rb
797
+ - lib/smithy/asset_link.rb
797
798
  - lib/smithy/content_blocks.rb
798
799
  - lib/smithy/content_blocks/model.rb
799
800
  - lib/smithy/content_blocks/registry.rb