nanoc3 3.1.9 → 3.2.0a1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/NEWS.md +0 -50
- data/README.md +3 -15
- data/bin/nanoc3 +2 -0
- data/lib/nanoc3/base/checksummer.rb +40 -0
- data/lib/nanoc3/base/code_snippet.rb +30 -12
- data/lib/nanoc3/base/compiled_content_cache.rb +86 -0
- data/lib/nanoc3/base/compiler.rb +134 -95
- data/lib/nanoc3/base/compiler_dsl.rb +12 -11
- data/lib/nanoc3/base/core_ext/string.rb +2 -2
- data/lib/nanoc3/base/data_source.rb +17 -16
- data/lib/nanoc3/base/dependency_tracker.rb +102 -121
- data/lib/nanoc3/base/directed_graph.rb +65 -3
- data/lib/nanoc3/base/errors.rb +20 -16
- data/lib/nanoc3/base/item.rb +58 -50
- data/lib/nanoc3/base/item_rep.rb +177 -150
- data/lib/nanoc3/base/layout.rb +51 -18
- data/lib/nanoc3/base/notification_center.rb +8 -8
- data/lib/nanoc3/base/plugin_registry.rb +9 -9
- data/lib/nanoc3/base/rule.rb +18 -9
- data/lib/nanoc3/base/rule_context.rb +5 -5
- data/lib/nanoc3/base/site.rb +135 -47
- data/lib/nanoc3/base.rb +21 -19
- data/lib/nanoc3/cli/base.rb +51 -74
- data/lib/nanoc3/cli/commands/autocompile.rb +3 -0
- data/lib/nanoc3/cli/commands/compile.rb +35 -74
- data/lib/nanoc3/cli/commands/create_site.rb +17 -5
- data/lib/nanoc3/cli/commands/debug.rb +11 -4
- data/lib/nanoc3/cli/commands/view.rb +0 -1
- data/lib/nanoc3/cli/commands/watch.rb +148 -0
- data/lib/nanoc3/cli/commands.rb +1 -0
- data/lib/nanoc3/cli/logger.rb +15 -21
- data/lib/nanoc3/data_sources/deprecated/twitter.rb +0 -1
- data/lib/nanoc3/data_sources/filesystem.rb +11 -40
- data/lib/nanoc3/data_sources/filesystem_unified.rb +22 -22
- data/lib/nanoc3/extra/auto_compiler.rb +1 -1
- data/lib/nanoc3/extra/chick.rb +8 -8
- data/lib/nanoc3/extra/deployers/rsync.rb +2 -3
- data/lib/nanoc3/extra/validators/links.rb +32 -51
- data/lib/nanoc3/extra/validators/w3c.rb +2 -2
- data/lib/nanoc3/extra/vcs.rb +1 -1
- data/lib/nanoc3/filters/colorize_syntax.rb +15 -19
- data/lib/nanoc3/filters/erb.rb +1 -5
- data/lib/nanoc3/filters/erubis.rb +1 -5
- data/lib/nanoc3/filters/haml.rb +1 -2
- data/lib/nanoc3/filters/less.rb +2 -51
- data/lib/nanoc3/filters/mustache.rb +21 -0
- data/lib/nanoc3/filters/rdiscount.rb +1 -2
- data/lib/nanoc3/filters/relativize_paths.rb +3 -2
- data/lib/nanoc3/filters/sass.rb +50 -56
- data/lib/nanoc3/filters.rb +2 -0
- data/lib/nanoc3/helpers/blogging.rb +22 -29
- data/lib/nanoc3/helpers/breadcrumbs.rb +1 -1
- data/lib/nanoc3/helpers/capturing.rb +1 -1
- data/lib/nanoc3/helpers/filtering.rb +1 -1
- data/lib/nanoc3/helpers/link_to.rb +10 -21
- data/lib/nanoc3/helpers/rendering.rb +5 -24
- data/lib/nanoc3/helpers/tagging.rb +6 -6
- data/lib/nanoc3/helpers/text.rb +2 -2
- data/lib/nanoc3.rb +1 -1
- metadata +35 -93
- data/.gemtest +0 -0
- data/doc/yardoc_templates/default/layout/html/footer.erb +0 -10
- data/nanoc3.gemspec +0 -41
- data/tasks/clean.rake +0 -11
- data/tasks/doc.rake +0 -14
- data/tasks/gem.rake +0 -13
- data/tasks/test.rake +0 -38
- data/test/base/core_ext/array_spec.rb +0 -23
- data/test/base/core_ext/hash_spec.rb +0 -41
- data/test/base/core_ext/string_spec.rb +0 -27
- data/test/base/test_code_snippet.rb +0 -33
- data/test/base/test_compiler.rb +0 -410
- data/test/base/test_compiler_dsl.rb +0 -121
- data/test/base/test_context.rb +0 -33
- data/test/base/test_data_source.rb +0 -48
- data/test/base/test_dependency_tracker.rb +0 -510
- data/test/base/test_directed_graph.rb +0 -91
- data/test/base/test_filter.rb +0 -85
- data/test/base/test_item.rb +0 -141
- data/test/base/test_item_rep.rb +0 -953
- data/test/base/test_layout.rb +0 -44
- data/test/base/test_notification_center.rb +0 -36
- data/test/base/test_plugin.rb +0 -32
- data/test/base/test_rule.rb +0 -21
- data/test/base/test_rule_context.rb +0 -63
- data/test/base/test_site.rb +0 -366
- data/test/cli/commands/test_compile.rb +0 -12
- data/test/cli/commands/test_create_item.rb +0 -12
- data/test/cli/commands/test_create_layout.rb +0 -28
- data/test/cli/commands/test_create_site.rb +0 -24
- data/test/cli/commands/test_help.rb +0 -12
- data/test/cli/commands/test_info.rb +0 -12
- data/test/cli/commands/test_update.rb +0 -12
- data/test/cli/test_logger.rb +0 -12
- data/test/data_sources/test_filesystem.rb +0 -420
- data/test/data_sources/test_filesystem_unified.rb +0 -538
- data/test/data_sources/test_filesystem_verbose.rb +0 -359
- data/test/extra/core_ext/test_enumerable.rb +0 -32
- data/test/extra/core_ext/test_time.rb +0 -17
- data/test/extra/deployers/test_rsync.rb +0 -234
- data/test/extra/test_auto_compiler.rb +0 -482
- data/test/extra/test_file_proxy.rb +0 -21
- data/test/extra/test_vcs.rb +0 -24
- data/test/extra/validators/test_links.rb +0 -53
- data/test/extra/validators/test_w3c.rb +0 -49
- data/test/filters/test_bluecloth.rb +0 -20
- data/test/filters/test_coderay.rb +0 -46
- data/test/filters/test_colorize_syntax.rb +0 -84
- data/test/filters/test_erb.rb +0 -72
- data/test/filters/test_erubis.rb +0 -72
- data/test/filters/test_haml.rb +0 -98
- data/test/filters/test_kramdown.rb +0 -20
- data/test/filters/test_less.rb +0 -118
- data/test/filters/test_markaby.rb +0 -26
- data/test/filters/test_maruku.rb +0 -20
- data/test/filters/test_rainpress.rb +0 -31
- data/test/filters/test_rdiscount.rb +0 -33
- data/test/filters/test_rdoc.rb +0 -18
- data/test/filters/test_redcloth.rb +0 -20
- data/test/filters/test_relativize_paths.rb +0 -231
- data/test/filters/test_rubypants.rb +0 -20
- data/test/filters/test_sass.rb +0 -235
- data/test/gem_loader.rb +0 -11
- data/test/helper.rb +0 -99
- data/test/helpers/test_blogging.rb +0 -808
- data/test/helpers/test_breadcrumbs.rb +0 -83
- data/test/helpers/test_capturing.rb +0 -42
- data/test/helpers/test_filtering.rb +0 -108
- data/test/helpers/test_html_escape.rb +0 -18
- data/test/helpers/test_link_to.rb +0 -251
- data/test/helpers/test_rendering.rb +0 -109
- data/test/helpers/test_tagging.rb +0 -89
- data/test/helpers/test_text.rb +0 -26
- data/test/helpers/test_xml_sitemap.rb +0 -69
- data/test/tasks/test_clean.rb +0 -71
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 3
|
7
|
+
- 2
|
8
|
+
- 0a1
|
9
|
+
version: 3.2.0a1
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Denis Defreyne
|
@@ -10,17 +14,21 @@ autorequire:
|
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date:
|
17
|
+
date: 2010-04-16 00:00:00 +02:00
|
18
|
+
default_executable: nanoc3
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: cri
|
17
22
|
prerelease: false
|
18
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
24
|
requirements:
|
21
|
-
- -
|
25
|
+
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
23
|
-
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 0
|
30
|
+
- 0
|
31
|
+
version: 1.0.0
|
24
32
|
type: :runtime
|
25
33
|
version_requirements: *id001
|
26
34
|
description:
|
@@ -40,9 +48,9 @@ files:
|
|
40
48
|
- NEWS.md
|
41
49
|
- Rakefile
|
42
50
|
- README.md
|
43
|
-
-
|
44
|
-
- bin/nanoc3
|
51
|
+
- lib/nanoc3/base/checksummer.rb
|
45
52
|
- lib/nanoc3/base/code_snippet.rb
|
53
|
+
- lib/nanoc3/base/compiled_content_cache.rb
|
46
54
|
- lib/nanoc3/base/compiler.rb
|
47
55
|
- lib/nanoc3/base/compiler_dsl.rb
|
48
56
|
- lib/nanoc3/base/context.rb
|
@@ -76,6 +84,7 @@ files:
|
|
76
84
|
- lib/nanoc3/cli/commands/info.rb
|
77
85
|
- lib/nanoc3/cli/commands/update.rb
|
78
86
|
- lib/nanoc3/cli/commands/view.rb
|
87
|
+
- lib/nanoc3/cli/commands/watch.rb
|
79
88
|
- lib/nanoc3/cli/commands.rb
|
80
89
|
- lib/nanoc3/cli/logger.rb
|
81
90
|
- lib/nanoc3/cli.rb
|
@@ -115,6 +124,7 @@ files:
|
|
115
124
|
- lib/nanoc3/filters/less.rb
|
116
125
|
- lib/nanoc3/filters/markaby.rb
|
117
126
|
- lib/nanoc3/filters/maruku.rb
|
127
|
+
- lib/nanoc3/filters/mustache.rb
|
118
128
|
- lib/nanoc3/filters/rainpress.rb
|
119
129
|
- lib/nanoc3/filters/rdiscount.rb
|
120
130
|
- lib/nanoc3/filters/rdoc.rb
|
@@ -140,94 +150,22 @@ files:
|
|
140
150
|
- lib/nanoc3/tasks/validate.rake
|
141
151
|
- lib/nanoc3/tasks.rb
|
142
152
|
- lib/nanoc3.rb
|
143
|
-
|
144
|
-
- tasks/doc.rake
|
145
|
-
- tasks/gem.rake
|
146
|
-
- tasks/test.rake
|
147
|
-
- test/base/core_ext/array_spec.rb
|
148
|
-
- test/base/core_ext/hash_spec.rb
|
149
|
-
- test/base/core_ext/string_spec.rb
|
150
|
-
- test/base/test_code_snippet.rb
|
151
|
-
- test/base/test_compiler.rb
|
152
|
-
- test/base/test_compiler_dsl.rb
|
153
|
-
- test/base/test_context.rb
|
154
|
-
- test/base/test_data_source.rb
|
155
|
-
- test/base/test_dependency_tracker.rb
|
156
|
-
- test/base/test_directed_graph.rb
|
157
|
-
- test/base/test_filter.rb
|
158
|
-
- test/base/test_item.rb
|
159
|
-
- test/base/test_item_rep.rb
|
160
|
-
- test/base/test_layout.rb
|
161
|
-
- test/base/test_notification_center.rb
|
162
|
-
- test/base/test_plugin.rb
|
163
|
-
- test/base/test_rule.rb
|
164
|
-
- test/base/test_rule_context.rb
|
165
|
-
- test/base/test_site.rb
|
166
|
-
- test/cli/commands/test_compile.rb
|
167
|
-
- test/cli/commands/test_create_item.rb
|
168
|
-
- test/cli/commands/test_create_layout.rb
|
169
|
-
- test/cli/commands/test_create_site.rb
|
170
|
-
- test/cli/commands/test_help.rb
|
171
|
-
- test/cli/commands/test_info.rb
|
172
|
-
- test/cli/commands/test_update.rb
|
173
|
-
- test/cli/test_logger.rb
|
174
|
-
- test/data_sources/test_filesystem.rb
|
175
|
-
- test/data_sources/test_filesystem_unified.rb
|
176
|
-
- test/data_sources/test_filesystem_verbose.rb
|
177
|
-
- test/extra/core_ext/test_enumerable.rb
|
178
|
-
- test/extra/core_ext/test_time.rb
|
179
|
-
- test/extra/deployers/test_rsync.rb
|
180
|
-
- test/extra/test_auto_compiler.rb
|
181
|
-
- test/extra/test_file_proxy.rb
|
182
|
-
- test/extra/test_vcs.rb
|
183
|
-
- test/extra/validators/test_links.rb
|
184
|
-
- test/extra/validators/test_w3c.rb
|
185
|
-
- test/filters/test_bluecloth.rb
|
186
|
-
- test/filters/test_coderay.rb
|
187
|
-
- test/filters/test_colorize_syntax.rb
|
188
|
-
- test/filters/test_erb.rb
|
189
|
-
- test/filters/test_erubis.rb
|
190
|
-
- test/filters/test_haml.rb
|
191
|
-
- test/filters/test_kramdown.rb
|
192
|
-
- test/filters/test_less.rb
|
193
|
-
- test/filters/test_markaby.rb
|
194
|
-
- test/filters/test_maruku.rb
|
195
|
-
- test/filters/test_rainpress.rb
|
196
|
-
- test/filters/test_rdiscount.rb
|
197
|
-
- test/filters/test_rdoc.rb
|
198
|
-
- test/filters/test_redcloth.rb
|
199
|
-
- test/filters/test_relativize_paths.rb
|
200
|
-
- test/filters/test_rubypants.rb
|
201
|
-
- test/filters/test_sass.rb
|
202
|
-
- test/gem_loader.rb
|
203
|
-
- test/helper.rb
|
204
|
-
- test/helpers/test_blogging.rb
|
205
|
-
- test/helpers/test_breadcrumbs.rb
|
206
|
-
- test/helpers/test_capturing.rb
|
207
|
-
- test/helpers/test_filtering.rb
|
208
|
-
- test/helpers/test_html_escape.rb
|
209
|
-
- test/helpers/test_link_to.rb
|
210
|
-
- test/helpers/test_rendering.rb
|
211
|
-
- test/helpers/test_tagging.rb
|
212
|
-
- test/helpers/test_text.rb
|
213
|
-
- test/helpers/test_xml_sitemap.rb
|
214
|
-
- test/tasks/test_clean.rb
|
215
|
-
- nanoc3.gemspec
|
216
|
-
- .gemtest
|
153
|
+
has_rdoc: yard
|
217
154
|
homepage: http://nanoc.stoneship.org/
|
218
155
|
licenses: []
|
219
156
|
|
220
157
|
post_install_message: |
|
221
158
|
------------------------------------------------------------------------------
|
222
|
-
Thanks for installing nanoc 3.
|
159
|
+
Thanks for installing nanoc 3.2! Here are some resources to help you get
|
223
160
|
started:
|
224
161
|
|
225
|
-
* The
|
226
|
-
* The
|
227
|
-
* The
|
162
|
+
* The web site at <http://nanoc.stoneship.org/>
|
163
|
+
* The tutorial at <http://nanoc.stoneship.org/docs/3-getting-started/>
|
164
|
+
* The manual at <http://nanoc.stoneship.org/docs/4-basic-concepts/>
|
228
165
|
|
229
|
-
|
230
|
-
|
166
|
+
If you have questions, issues or simply want to share ideas, join the
|
167
|
+
discussion at <http://groups.google.com/group/nanoc> or stop by in the IRC
|
168
|
+
channel on irc.freenode.net, channel #nanoc. See you there!
|
231
169
|
|
232
170
|
Enjoy!
|
233
171
|
------------------------------------------------------------------------------
|
@@ -238,21 +176,25 @@ rdoc_options:
|
|
238
176
|
require_paths:
|
239
177
|
- lib
|
240
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
179
|
requirements:
|
243
180
|
- - ">="
|
244
181
|
- !ruby/object:Gem::Version
|
182
|
+
segments:
|
183
|
+
- 0
|
245
184
|
version: "0"
|
246
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
|
-
none: false
|
248
186
|
requirements:
|
249
|
-
- - "
|
187
|
+
- - ">"
|
250
188
|
- !ruby/object:Gem::Version
|
251
|
-
|
189
|
+
segments:
|
190
|
+
- 1
|
191
|
+
- 3
|
192
|
+
- 1
|
193
|
+
version: 1.3.1
|
252
194
|
requirements: []
|
253
195
|
|
254
196
|
rubyforge_project:
|
255
|
-
rubygems_version: 1.
|
197
|
+
rubygems_version: 1.3.6
|
256
198
|
signing_key:
|
257
199
|
specification_version: 3
|
258
200
|
summary: a web publishing system written in Ruby for building small to medium-sized websites.
|
data/.gemtest
DELETED
File without changes
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<%= superb %>
|
2
|
-
<script type="text/javascript">
|
3
|
-
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
4
|
-
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
5
|
-
</script>
|
6
|
-
<script type="text/javascript">
|
7
|
-
try {
|
8
|
-
var pageTracker = _gat._getTracker("UA-15639968-1");
|
9
|
-
pageTracker._trackPageview();
|
10
|
-
} catch(err) {}</script>
|
data/nanoc3.gemspec
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(File.expand_path('../lib/', __FILE__))
|
4
|
-
require 'nanoc3'
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = 'nanoc3'
|
8
|
-
s.version = Nanoc3::VERSION
|
9
|
-
s.summary = 'a web publishing system written in Ruby for building small to medium-sized websites.'
|
10
|
-
s.homepage = 'http://nanoc.stoneship.org/'
|
11
|
-
|
12
|
-
s.authors = 'Denis Defreyne'
|
13
|
-
s.email = 'denis.defreyne@stoneship.org'
|
14
|
-
|
15
|
-
s.files = Dir['[A-Z]*'] +
|
16
|
-
Dir['doc/yardoc_templates/**/*'] +
|
17
|
-
Dir['{bin,lib,tasks,test}/**/*'] +
|
18
|
-
[ 'nanoc3.gemspec', '.gemtest' ]
|
19
|
-
s.executables = [ 'nanoc3' ]
|
20
|
-
s.require_paths = [ 'lib' ]
|
21
|
-
|
22
|
-
s.rdoc_options = [ '--main', 'README.md' ]
|
23
|
-
s.extra_rdoc_files = [ 'ChangeLog', 'LICENSE', 'README.md', 'NEWS.md' ]
|
24
|
-
|
25
|
-
s.add_runtime_dependency('cri', '~> 1.0')
|
26
|
-
|
27
|
-
s.post_install_message = %q{------------------------------------------------------------------------------
|
28
|
-
Thanks for installing nanoc 3.1! Here are some resources to help you get
|
29
|
-
started:
|
30
|
-
|
31
|
-
* The tutorial at <http://nanoc.stoneship.org/tutorial/>
|
32
|
-
* The manual at <http://nanoc.stoneship.org/manual/>
|
33
|
-
* The discussion group at <http://groups.google.com/group/nanoc>
|
34
|
-
|
35
|
-
Because nanoc 3.1 has quite a few new features, be sure to check out the nanoc
|
36
|
-
blog at <http://nanoc.stoneship.org/blog/> for details about this release.
|
37
|
-
|
38
|
-
Enjoy!
|
39
|
-
------------------------------------------------------------------------------
|
40
|
-
}
|
41
|
-
end
|
data/tasks/clean.rake
DELETED
data/tasks/doc.rake
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'yard'
|
4
|
-
|
5
|
-
YARD::Rake::YardocTask.new(:doc) do |yard|
|
6
|
-
yard.files = Dir['lib/**/*.rb']
|
7
|
-
yard.options = [
|
8
|
-
'--markup', 'markdown',
|
9
|
-
'--readme', 'README.md',
|
10
|
-
'--files', 'NEWS.md,LICENSE',
|
11
|
-
'--output-dir', 'doc/yardoc',
|
12
|
-
'--template-path', 'doc/yardoc_templates'
|
13
|
-
]
|
14
|
-
end
|
data/tasks/gem.rake
DELETED
data/tasks/test.rake
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'minitest/unit'
|
4
|
-
|
5
|
-
test = namespace :test do
|
6
|
-
|
7
|
-
# test:all
|
8
|
-
desc 'Run all tests'
|
9
|
-
task :all do
|
10
|
-
ENV['QUIET'] ||= 'true'
|
11
|
-
|
12
|
-
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))
|
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
|
19
|
-
|
20
|
-
# test:...
|
21
|
-
%w( base cli data_sources extra filters helpers tasks ).each do |dir|
|
22
|
-
desc "Run all #{dir} tests"
|
23
|
-
task dir.to_sym do |task|
|
24
|
-
ENV['QUIET'] ||= 'true'
|
25
|
-
|
26
|
-
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))
|
27
|
-
|
28
|
-
MiniTest::Unit.autorun
|
29
|
-
|
30
|
-
test_files = Dir["test/#{dir}/**/*_spec.rb"] + Dir["test/#{dir}/**/test_*.rb"]
|
31
|
-
test_files.each { |f| require f }
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
desc 'Alias for test:all'
|
38
|
-
task :test => [ :'test:all' ]
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'test/helper'
|
4
|
-
|
5
|
-
describe 'Array#symbolize_keys' do
|
6
|
-
|
7
|
-
it 'should convert keys to symbols' do
|
8
|
-
array_old = [ :abc, 'xyz', { 'foo' => 'bar', :baz => :qux } ]
|
9
|
-
array_new = [ :abc, 'xyz', { :foo => 'bar', :baz => :qux } ]
|
10
|
-
array_old.symbolize_keys.must_equal array_new
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
describe 'Array#stringify_keys' do
|
16
|
-
|
17
|
-
it 'should convert keys to strings' do
|
18
|
-
array_old = [ :abc, 'xyz', { :foo => 'bar', 'baz' => :qux } ]
|
19
|
-
array_new = [ :abc, 'xyz', { 'foo' => 'bar', 'baz' => :qux } ]
|
20
|
-
array_old.stringify_keys.must_equal array_new
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'test/helper'
|
4
|
-
|
5
|
-
describe 'Hash#symbolize_keys' do
|
6
|
-
|
7
|
-
it 'should convert keys to symbols' do
|
8
|
-
hash_old = { 'foo' => 'bar' }
|
9
|
-
hash_new = { :foo => 'bar' }
|
10
|
-
hash_old.symbolize_keys.must_equal hash_new
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
describe 'Hash#stringify_keys' do
|
16
|
-
|
17
|
-
it 'should leave strings as strings' do
|
18
|
-
hash_old = { 'foo' => 'bar' }
|
19
|
-
hash_new = { 'foo' => 'bar' }
|
20
|
-
hash_old.stringify_keys.must_equal hash_new
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should convert symbols to strings' do
|
24
|
-
hash_old = { :foo => 'bar' }
|
25
|
-
hash_new = { 'foo' => 'bar' }
|
26
|
-
hash_old.stringify_keys.must_equal hash_new
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should convert integers to strings' do
|
30
|
-
hash_old = { 123 => 'bar' }
|
31
|
-
hash_new = { '123' => 'bar' }
|
32
|
-
hash_old.stringify_keys.must_equal hash_new
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should convert nil to an empty string' do
|
36
|
-
hash_old = { nil => 'bar' }
|
37
|
-
hash_new = { '' => 'bar' }
|
38
|
-
hash_old.stringify_keys.must_equal hash_new
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'test/helper'
|
4
|
-
|
5
|
-
describe 'String#cleaned_identifier' do
|
6
|
-
|
7
|
-
it 'should not convert already clean paths' do
|
8
|
-
'/foo/bar/'.cleaned_identifier.must_equal '/foo/bar/'
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should prepend slash if necessary' do
|
12
|
-
'foo/bar/'.cleaned_identifier.must_equal '/foo/bar/'
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should append slash if necessary' do
|
16
|
-
'/foo/bar'.cleaned_identifier.must_equal '/foo/bar/'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should remove double slashes at start' do
|
20
|
-
'//foo/bar/'.cleaned_identifier.must_equal '/foo/bar/'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should remove double slashes at end' do
|
24
|
-
'/foo/bar//'.cleaned_identifier.must_equal '/foo/bar/'
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'test/helper'
|
4
|
-
|
5
|
-
class Nanoc3::CodeSnippetTest < MiniTest::Unit::TestCase
|
6
|
-
|
7
|
-
include Nanoc3::TestHelpers
|
8
|
-
|
9
|
-
def test_load
|
10
|
-
# Initialize
|
11
|
-
$complete_insane_parrot = 'meow'
|
12
|
-
|
13
|
-
# Create code and load it
|
14
|
-
code_snippet = Nanoc3::CodeSnippet.new("$complete_insane_parrot = 'woof'", 'parrot.rb')
|
15
|
-
code_snippet.load
|
16
|
-
|
17
|
-
# Ensure code is loaded
|
18
|
-
assert_equal('woof', $complete_insane_parrot)
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_load_with_toplevel_binding
|
22
|
-
# Initialize
|
23
|
-
@foo = 'meow'
|
24
|
-
|
25
|
-
# Create code and load it
|
26
|
-
code_snippet = Nanoc3::CodeSnippet.new("@foo = 'woof'", 'dog.rb')
|
27
|
-
code_snippet.load
|
28
|
-
|
29
|
-
# Ensure binding is correct
|
30
|
-
assert_equal('meow', @foo)
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|