homeostasis 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +0 -2
  2. data/lib/homeostasis.rb +10 -2
  3. data/lib/version.rb +3 -0
  4. metadata +2 -1
data/README.md CHANGED
@@ -161,9 +161,7 @@ slashes to URLs.
161
161
  TODO
162
162
  ====
163
163
 
164
- * fix links, images, etc... in RSS
165
164
  * make each plugin optional
166
- * single version endpoint
167
165
 
168
166
  License
169
167
  =======
data/lib/homeostasis.rb CHANGED
@@ -4,10 +4,9 @@ require 'digest/sha1'
4
4
  require 'bluecloth'
5
5
  require 'yaml'
6
6
  require 'cgi'
7
+ require 'uri'
7
8
 
8
9
  module Homeostasis
9
- VERSION = '0.0.14'
10
-
11
10
  module Helpers
12
11
  private
13
12
  def ignore?(path)
@@ -98,13 +97,20 @@ module Homeostasis
98
97
  end
99
98
 
100
99
  # read contents of each file, search/replace assets with stamps
100
+ front_site = Homeostasis::Front._front_site
101
+ inverted = @@mapping.invert
101
102
  Dir.glob("#{@stasis.destination}/**/*").each do |file|
102
103
  next if file !~ @@replace_matcher || File.directory?(file)
103
104
  contents = File.read(file)
105
+ front = front_site[inverted[file.sub("#{@stasis.destination}/", "")]]
104
106
  assets.each do |old, new|
105
107
  old = Regexp.escape(old)
106
108
  contents.gsub!(/([^a-zA-Z0-9\.\-_])#{old}/, "\\1#{new}")
107
109
  contents.gsub!(/^#{old}/, new)
110
+ if front && front[:body] # for RSS feed
111
+ front[:body].gsub!(/([^a-zA-Z0-9\.\-_])#{old}/, "\\1#{new}")
112
+ front[:body].gsub!(/^#{old}/, new)
113
+ end
108
114
  end
109
115
  File.open(file, 'w') { |f| f.print(contents) }
110
116
  end
@@ -348,6 +354,8 @@ module Homeostasis
348
354
  rss += " <link>#{h @@url}/</link>\n" if @@url
349
355
  rss += " <description>#{h @@desc}</description>\n" if @@desc
350
356
  blog_posts[0..5].each do |post|
357
+ body = post[:body]
358
+ body.gsub!(/(href|src)=('|")\//, "\\1=\\2#{@@url}/")
351
359
  rss += " <item>\n"
352
360
  rss += " <title>#{h post[:title]}</title>\n"
353
361
  rss += " <link>#{h(File.join(@@url, post[:path]))}</link>\n"
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Homeostasis
2
+ VERSION = '0.0.15'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homeostasis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -21,6 +21,7 @@ extra_rdoc_files: []
21
21
  files:
22
22
  - LICENSE.md
23
23
  - README.md
24
+ - lib/version.rb
24
25
  - lib/homeostasis.rb
25
26
  homepage: https://github.com/hughbien/homeostasis
26
27
  licenses: []