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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 626ca58b9e4faf9f2cb6ba96da02cba05864bfbd
4
- data.tar.gz: 52f57ef1f7d0fbd8e093af2576baa9d4aaf3f17f
3
+ metadata.gz: b0ae1bd8197fb030159fc72f9a9dd489e7e9ebfb
4
+ data.tar.gz: ea8f2a81568ea13a7f7ab68ec65fa19213ed0eda
5
5
  SHA512:
6
- metadata.gz: 04bb836061c35a0664cca5e46146e5232b6c148706b9f74faa1f1dd976b8e93760e1e127f1487dc330e297b3c39bfacfa9962bec4e7ed8282d7cb080bb94fca4
7
- data.tar.gz: 38e9911a5d5dd67d83ef891d4cc22c260eecd05652b80f5b83035b6c3f22cd8998173f9f80b80b81072969bbd71f3e1d5e17bebb094e96dea0b3a74542e7c63d
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
 
@@ -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 = ["Marc-Antoine Argenton"]
17
- spec.email = ["maargenton.dev@gmail.com"]
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
- return false, filename if !basename.start_with?( ">>" )
55
- return true, File.join( dirname, basename[2..-1] )
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
 
@@ -25,8 +25,8 @@ module FolderTemplate
25
25
  r
26
26
  end
27
27
 
28
- def scan_location( path )
29
- _list_template_folders( path ).each do |path|
28
+ def scan_location( base_path )
29
+ _list_template_folders( base_path ).each do |path|
30
30
  _register_template_path( path )
31
31
  end
32
32
  self
@@ -8,5 +8,5 @@
8
8
  # =============================================================================
9
9
 
10
10
  module FolderTemplate
11
- VERSION = '1.0.0'
11
+ VERSION = '1.0.1'
12
12
  end
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 |t, args|
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 |t, args|
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
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.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: 2016-11-15 00:00:00.000000000 Z
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/>>{{project_name}}.rb
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: