folder_template 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/folder_template.gemspec +4 -3
- data/lib/folder_template/template_folder_entry.rb +7 -2
- data/lib/folder_template/template_registry.rb +2 -2
- data/lib/folder_template/version.rb +1 -1
- data/rakefile.rb +2 -2
- data/templates/rubyclass/template/lib/{>>{{project_name}}.rb → {{__append__}}{{project_name}}.rb} +0 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0ae1bd8197fb030159fc72f9a9dd489e7e9ebfb
|
4
|
+
data.tar.gz: ea8f2a81568ea13a7f7ab68ec65fa19213ed0eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d4a88e07c2785c87ab96b5a43d174f89c226037b47881776b29fbb121ffd51228e9c972699651d88b6ab7a962f65f1d8bf718bed0ea9dae6fd718f78fd391a
|
7
|
+
data.tar.gz: 88c13c1f316eaef29e7a8268b911241bf35c07753dab9bebb4c871eb98efcc0c72dcee33cc965cded920f9174f4e98a0e3dea28b16c1a14b9e7b19b614260ae0
|
data/README.md
CHANGED
@@ -20,7 +20,9 @@ and can optionally append content to existing files.
|
|
20
20
|
- Variables are surrounded with double curly: `{{variable}}`
|
21
21
|
- Variables can be part of filenames, folder names, and file content
|
22
22
|
- Template filename with a `>>` prefix will append their content to an existing file
|
23
|
-
|
23
|
+
- New in 1.0.1
|
24
|
+
- `{{__append__}}` prefix is also supported (to circumvent windows filesystem
|
25
|
+
limitations). Built-in 'rubyclass' template is using it.
|
24
26
|
|
25
27
|
## Usage
|
26
28
|
|
data/folder_template.gemspec
CHANGED
@@ -13,15 +13,16 @@ require_relative 'lib/folder_template/version.rb'
|
|
13
13
|
Gem::Specification.new do |spec|
|
14
14
|
spec.name = 'folder_template'
|
15
15
|
spec.version = FolderTemplate::VERSION
|
16
|
-
spec.authors = [
|
17
|
-
spec.email = [
|
16
|
+
spec.authors = ['Marc-Antoine Argenton']
|
17
|
+
spec.email = ['maargenton.dev@gmail.com']
|
18
18
|
spec.summary = "Simple and generic folder structure template engine"
|
19
19
|
spec.description = %q{ FolderTemplate is a minimalistic template engine that generates files and
|
20
20
|
folders structure from a template folder layout. It includes a simple variable
|
21
21
|
expansion syntax, automatically injects variables for filename and basename,
|
22
22
|
and can optionally append content to existing files.
|
23
23
|
}.gsub( /\s+/, ' ').strip
|
24
|
-
spec.homepage =
|
24
|
+
spec.homepage = 'https://github.com/marcus999/folder_template'
|
25
|
+
spec.metadata = { 'source_code_uri' => 'https://github.com/marcus999/folder_template'}
|
25
26
|
|
26
27
|
spec.files = Dir['[A-Z]*', 'rakefile.rb', '*.gemspec'].reject { |f| f =~ /.lock/ }
|
27
28
|
spec.files += Dir['bin/**', 'lib/**/*.rb', 'test/**/*.rb', 'spec/**/*.rb', 'features/**/*.rb']
|
@@ -51,8 +51,13 @@ module FolderTemplate
|
|
51
51
|
basename = File.basename( filename )
|
52
52
|
dirname = File.dirname( filename )
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
if basename.start_with?( ">>" )
|
55
|
+
return true, File.join( dirname, basename[2..-1] )
|
56
|
+
elsif basename.start_with?( "{{__append__}}" )
|
57
|
+
return true, File.join( dirname, basename[14..-1] )
|
58
|
+
end
|
59
|
+
|
60
|
+
return false, filename
|
56
61
|
end
|
57
62
|
end # class TemplateFolderEntry
|
58
63
|
|
data/rakefile.rb
CHANGED
@@ -91,12 +91,12 @@ PROJECT_CONTEXT = {
|
|
91
91
|
begin
|
92
92
|
require_relative 'lib/folder_template'
|
93
93
|
|
94
|
-
task :add_class, :class_name do |
|
94
|
+
task :add_class, :class_name do |_t, args|
|
95
95
|
context = PROJECT_CONTEXT.merge( name:args[:class_name])
|
96
96
|
FolderTemplate::SetupFolderCmd.run( '.', 'rubyclass', context )
|
97
97
|
end
|
98
98
|
rescue LoadError
|
99
|
-
task :add_class, :class_name do |
|
99
|
+
task :add_class, :class_name do |_t, _args|
|
100
100
|
puts
|
101
101
|
puts "'rake add_class[class_name]' task requires the folder_template gem to be available"
|
102
102
|
puts
|
data/templates/rubyclass/template/lib/{>>{{project_name}}.rb → {{__append__}}{{project_name}}.rb}
RENAMED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: folder_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc-Antoine Argenton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
@@ -135,7 +135,7 @@ files:
|
|
135
135
|
- lib/folder_template/version.rb
|
136
136
|
- rakefile.rb
|
137
137
|
- templates/rubyclass/context.rb
|
138
|
-
- templates/rubyclass/template/lib
|
138
|
+
- templates/rubyclass/template/lib/{{__append__}}{{project_name}}.rb
|
139
139
|
- templates/rubyclass/template/lib/{{project_name}}/{{class_filename}}.rb
|
140
140
|
- templates/rubyclass/template/test/test_{{class_filename}}.rb
|
141
141
|
- templates/rubygem/context.rb
|
@@ -199,9 +199,10 @@ files:
|
|
199
199
|
- test_data/rubygem/template_definition/template/{{_}}.rubocop.yml
|
200
200
|
- test_data/rubygem/template_definition/template/{{_}}.travis.yml
|
201
201
|
- test_data/rubygem/template_definition/template/{{project_name}}.gemspec
|
202
|
-
homepage:
|
202
|
+
homepage: https://github.com/marcus999/folder_template
|
203
203
|
licenses: []
|
204
|
-
metadata:
|
204
|
+
metadata:
|
205
|
+
source_code_uri: https://github.com/marcus999/folder_template
|
205
206
|
post_install_message:
|
206
207
|
rdoc_options: []
|
207
208
|
require_paths:
|