troy 0.0.26 → 0.0.27

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: fcdde7c1107d467ef1bc2bc5eaf05f7625ff64b5
4
- data.tar.gz: 0ab8fc967d3e05721bf1aefeea97ee15ca848acf
3
+ metadata.gz: ae49b3d1bb9929e3e0fbe33cb5f6d0a164ae64a9
4
+ data.tar.gz: 56354ad5a4e11baa96dd3c93f47cbd6bbd7986a7
5
5
  SHA512:
6
- metadata.gz: f377576cd51facac5c7230de05b43b70367a8212c0732d1bf25a0bf35d68da190bb7043640ef04c99b7504a9f6832010e2082856962777fb293755bbeb8520c4
7
- data.tar.gz: a2e63f64f1a163e3397334ab1dac5b6fe3af771b4fd6e5e7993174482b49458efa77594d3cb49263888649a97448b49a0125211f8bf1c6cd25eda89d943b4187
6
+ metadata.gz: ef165b8ef929a9ed79d267bb728c61bd1649e491373ce7b0a1283ceb7615034979e45b429da78758e6012b1740ae9ec5684d5556dacfc36f49e6657ac559b91d
7
+ data.tar.gz: ea2326adf7b378c50ac180af20ffa0d9159d62beb6eb16c005be9f37286762db62025d5340f5030bd8235aa39a90eff37eccb742d65f46dde1840fe02a1f5988
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- troy (0.0.26)
4
+ troy (0.0.27)
5
5
  builder
6
6
  html_press
7
7
  i18n
@@ -40,7 +40,7 @@ GEM
40
40
  rake (10.4.2)
41
41
  redcarpet (3.2.2)
42
42
  rouge (1.7.7)
43
- sass (3.4.10)
43
+ sass (3.4.11)
44
44
  sass-globbing (1.1.1)
45
45
  sass (>= 3.1)
46
46
  sprockets (2.12.3)
data/lib/troy/helpers.rb CHANGED
@@ -4,9 +4,15 @@ module Troy
4
4
  CGI.escapeHTML(content)
5
5
  end
6
6
 
7
+ def t(*args)
8
+ I18n.t(*args)
9
+ end
10
+
7
11
  def partial(name, locals = {})
8
12
  path = site.root.join("partials/_#{name}.erb")
9
13
  EmbeddedRuby.new(path.read, locals.merge(site: site)).render
14
+ rescue Exception, StandardError => error
15
+ raise "Unable to render #{path}; #{error.message}"
10
16
  end
11
17
 
12
18
  def inline_file(path)
data/lib/troy/page.rb CHANGED
@@ -116,7 +116,11 @@ module Troy
116
116
  # Save current page to the specified path.
117
117
  #
118
118
  def save_to(path)
119
- File.open(path, "w") {|file| file << render }
119
+ File.open(path, "w") do |file|
120
+ I18n.with_locale(meta.locale) do
121
+ file << render
122
+ end
123
+ end
120
124
  end
121
125
 
122
126
  #
data/lib/troy/site.rb CHANGED
@@ -22,6 +22,7 @@ module Troy
22
22
  #
23
23
  def set_locale
24
24
  I18n.load_path += config.i18n.load_path
25
+ I18n.default_locale = config.i18n.locale
25
26
  I18n.locale = config.i18n.locale
26
27
  end
27
28
 
data/lib/troy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Troy
2
- VERSION = "0.0.26"
2
+ VERSION = "0.0.27"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: troy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n