nanoc-filesystem-i18n 0.1.0.pre2 → 0.1.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -43
- data/lib/nanoc3/data_sources/filesystem_i18n.rb +10 -6
- data/lib/nanoc3/data_sources/filesystem_i18n/version.rb +1 -1
- metadata +17 -4
data/Rakefile
CHANGED
@@ -1,50 +1,21 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + '/lib/nanoc3/data_sources/filesystem_i18n/version'
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
4
3
|
|
5
|
-
|
6
|
-
require 'jeweler'
|
7
|
-
Jeweler::Tasks.new do |gem|
|
8
|
-
gem.name = 'nanoc-filesystem-i18n'
|
9
|
-
gem.version = Nanoc3::DataSources::FilesystemI18n::Version
|
10
|
-
gem.summary = %Q{I18n filesystem based data source for nanoc}
|
11
|
-
gem.description = %Q{I18n filesystem based data source for nanoc. Compatible with nanoc 3 and default filesystem based data source.}
|
12
|
-
gem.email = 'yann.lugrin@sans-savoir.net'
|
13
|
-
gem.homepage = 'http://github.com/yannlugrin/nanoc-filesystem-i18n'
|
14
|
-
gem.authors = ['Yann Lugrin']
|
15
|
-
gem.add_dependency 'nanoc', '>= 3.1.2'
|
16
|
-
gem.add_dependency 'i18n', '>= 0'
|
17
|
-
gem.add_development_dependency 'minitest', '>= 0'
|
18
|
-
gem.add_development_dependency 'yard', '>= 0'
|
19
|
-
gem.files.exclude '.gitignore', '.document', 'nanoc-filesystem-i18n.gemspec'
|
20
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
21
|
-
end
|
22
|
-
Jeweler::GemcutterTasks.new
|
23
|
-
rescue LoadError
|
24
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
25
|
-
end
|
4
|
+
require 'nanoc3'
|
26
5
|
|
27
|
-
require '
|
28
|
-
Rake::TestTask.new(:test) do |test|
|
29
|
-
test.libs << 'lib' << 'test'
|
30
|
-
test.pattern = 'test/**/test_*.rb'
|
31
|
-
test.verbose = true
|
32
|
-
end
|
6
|
+
require 'minitest/unit'
|
33
7
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
test.libs << 'test'
|
38
|
-
test.pattern = 'test/**/test_*.rb'
|
39
|
-
test.verbose = true
|
40
|
-
end
|
41
|
-
rescue LoadError
|
42
|
-
task :rcov do
|
43
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
44
|
-
end
|
45
|
-
end
|
8
|
+
desc 'Run all tests'
|
9
|
+
task :test do
|
10
|
+
ENV['QUIET'] ||= 'true'
|
46
11
|
|
47
|
-
|
12
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/test'))
|
13
|
+
|
14
|
+
MiniTest::Unit.autorun
|
15
|
+
|
16
|
+
test_files = Dir['test/**/*_spec.rb'] + Dir['test/**/test_*.rb']
|
17
|
+
test_files.each { |f| require f }
|
18
|
+
end
|
48
19
|
|
49
20
|
task :default => :test
|
50
21
|
|
@@ -158,13 +158,17 @@ module Nanoc3::DataSources
|
|
158
158
|
(is_locale ? I18n.available_locales : [I18n.default_locale]).map do |locale|
|
159
159
|
I18n.locale = locale # Set current locale
|
160
160
|
|
161
|
-
#
|
162
|
-
# loaded)
|
163
|
-
meta, content_or_filename = parse(content_filename, meta_filename, kind, (is_binary && klass == Nanoc3::Item)) if is_locale
|
164
|
-
|
165
|
-
# merge meta for current locale, default locale meta used by
|
166
|
-
# default is meta don't have key
|
161
|
+
# Process for localized files
|
167
162
|
if is_locale
|
163
|
+
# Get filenames for localized content
|
164
|
+
meta_filename = filename_for(base_filename, meta_ext)
|
165
|
+
content_filename = filename_for(base_filename, content_ext)
|
166
|
+
|
167
|
+
# Read content and metadata for localized content
|
168
|
+
meta, content_or_filename = parse(content_filename, meta_filename, kind, (is_binary && klass == Nanoc3::Item))
|
169
|
+
|
170
|
+
# merge meta for current locale, default locale meta used by
|
171
|
+
# default is meta don't have key
|
168
172
|
meta_locale = meta.delete('locale') {|el| Hash.new }
|
169
173
|
meta = (meta_locale[I18n.default_locale] || Hash.new).merge(meta)
|
170
174
|
meta.merge!(meta_locale[locale.to_s] || Hash.new)
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-filesystem-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: -1876988169
|
4
5
|
prerelease: true
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
9
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.1.0.
|
10
|
+
- pre4
|
11
|
+
version: 0.1.0.pre4
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Yann Lugrin
|
@@ -15,16 +16,18 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-
|
19
|
+
date: 2010-10-18 00:00:00 +02:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
23
|
name: nanoc
|
23
24
|
prerelease: false
|
24
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
25
27
|
requirements:
|
26
28
|
- - ">="
|
27
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 7
|
28
31
|
segments:
|
29
32
|
- 3
|
30
33
|
- 1
|
@@ -36,9 +39,11 @@ dependencies:
|
|
36
39
|
name: i18n
|
37
40
|
prerelease: false
|
38
41
|
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
39
43
|
requirements:
|
40
44
|
- - ">="
|
41
45
|
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
42
47
|
segments:
|
43
48
|
- 0
|
44
49
|
version: "0"
|
@@ -48,9 +53,11 @@ dependencies:
|
|
48
53
|
name: minitest
|
49
54
|
prerelease: false
|
50
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
51
57
|
requirements:
|
52
58
|
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
54
61
|
segments:
|
55
62
|
- 0
|
56
63
|
version: "0"
|
@@ -60,9 +67,11 @@ dependencies:
|
|
60
67
|
name: yard
|
61
68
|
prerelease: false
|
62
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
63
71
|
requirements:
|
64
72
|
- - ">="
|
65
73
|
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
66
75
|
segments:
|
67
76
|
- 0
|
68
77
|
version: "0"
|
@@ -99,16 +108,20 @@ rdoc_options:
|
|
99
108
|
require_paths:
|
100
109
|
- lib
|
101
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
102
112
|
requirements:
|
103
113
|
- - ">="
|
104
114
|
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
105
116
|
segments:
|
106
117
|
- 0
|
107
118
|
version: "0"
|
108
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
109
121
|
requirements:
|
110
122
|
- - ">"
|
111
123
|
- !ruby/object:Gem::Version
|
124
|
+
hash: 25
|
112
125
|
segments:
|
113
126
|
- 1
|
114
127
|
- 3
|
@@ -117,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
130
|
requirements: []
|
118
131
|
|
119
132
|
rubyforge_project:
|
120
|
-
rubygems_version: 1.3.
|
133
|
+
rubygems_version: 1.3.7
|
121
134
|
signing_key:
|
122
135
|
specification_version: 3
|
123
136
|
summary: I18n filesystem based data source for nanoc
|