Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d601f08
Showing
60 changed files
with
10,229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
lib/directory_template.rb a000e825d25d7ebcfb70e8e380a953a5ab5d6c76 | ||
lib/directory_template/version.rb af43574b42af7007deb8e568a3ad9bd5bd58936f | ||
lib/directory_template/processor.rb c21c5e0b876721dcd0961f60b961a94e655bdcb0 | ||
lib/directory_template/blank_slate.rb 61aef13b5f6f639598c25ff88c2446b2c7957a2b | ||
lib/directory_template/process_data.rb 7ae2170b073b512cefd959a825810552d183fac0 | ||
lib/directory_template/register/erb.rb c84c860ea6428f82fbbd466c54f7690b8f4d348e | ||
lib/directory_template/erb_template.rb 1aad02d371680dc0d45a03be4c49027ad2a2e715 | ||
lib/directory_template/register_all.rb a40bcfc088189582cc488174c7fa911f73a2072d | ||
lib/directory_template/processor/erb.rb b3c7376632ace06ea77fad4b4582b4c716484f1a |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
README | ||
====== | ||
|
||
|
||
Summary | ||
------- | ||
Create directories from templates, optionally preprocessing paths and contents. | ||
|
||
|
||
Installation | ||
------------ | ||
`gem install directory_template` | ||
|
||
|
||
Usage | ||
----- | ||
|
||
Create a template from an existing structure and materialize it (create directories & | ||
files). | ||
require 'directory_template/register_all' # load all processors | ||
variables = { | ||
namespace: 'Namespace', | ||
version: '1.2.3', | ||
gem_name: 'gem-name', | ||
require_name: 'require_name', | ||
description: "The description", | ||
summary: "The summary" | ||
} | ||
template = DirectoryTemplate.directory('examples/dir_gem_template') | ||
template.materialize('new_project', variables: variables) | ||
|
||
Create a template from a YAML file: | ||
require 'directory_template/register_all' # load all processors | ||
variables = { | ||
namespace: 'Namespace', | ||
version: '1.2.3', | ||
gem_name: 'gem-name', | ||
require_name: 'require_name', | ||
description: "The description", | ||
summary: "The summary" | ||
} | ||
template = DirectoryTemplate.directory('examples/yaml_gem_template.yaml') | ||
template.materialize('new_project', variables: variables) | ||
|
||
|
||
Description | ||
----------- | ||
Create directories from templates. | ||
Existing directory structures, yaml files and ruby datastructures can all serve as | ||
sources of a template. | ||
Can preprocess pathnames and content. | ||
Path- and ContentProcessors are exchangeable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$LOAD_PATH.unshift(File.expand_path('../rake/lib', __FILE__)) | ||
Dir.glob(File.expand_path('../rake/tasks/**/*.{rake,task,rb}', __FILE__)) do |task_file| | ||
begin | ||
import task_file | ||
rescue LoadError => e | ||
warn "Failed to load task file #{task_file}" | ||
warn " #{e.class} #{e.message}" | ||
warn " #{e.backtrace.first}" | ||
end | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
* Add tests | ||
* Add documentation | ||
* Integrate with travis | ||
* Make directory\_template/register\_all be aware of plugin-gems | ||
* Come up with a better scaling way to determine processors for a file, potentially | ||
exploiting the fact that most probably match the last or last-two suffixes of the | ||
filename. | ||
* Ponder whether a processor can be ran more than once on a file. | ||
* Figure how to detect an infinite processing loop | ||
* Add a .html.markdown processor | ||
* Add a .pdf.html processor | ||
* Add a .{png,svg,pdf}.dot processor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# encoding: utf-8 | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "directory_template" | ||
s.version = "0.0.1" | ||
s.authors = "Stefan Rusterholz" | ||
s.description = <<-DESCRIPTION.gsub(/^ /, '').chomp | ||
Create directories from templates. | ||
Existing directory structures, yaml files and ruby datastructures can all serve as | ||
sources of a template. | ||
Can preprocess pathnames and content. | ||
Path- and ContentProcessors are exchangeable. | ||
DESCRIPTION | ||
s.summary = <<-SUMMARY.gsub(/^ /, '').chomp | ||
Create directories from templates, optionally preprocessing paths and contents. | ||
SUMMARY | ||
s.email = "stefan.rusterholz@gmail.com" | ||
|
||
s.files = | ||
Dir['bin/**/*'] + | ||
Dir['lib/**/*'] + | ||
Dir['rake/**/*'] + | ||
Dir['test/**/*'] + | ||
Dir['*.gemspec'] + | ||
%w[ | ||
Rakefile | ||
README.markdown | ||
] | ||
|
||
if File.directory?('bin') then | ||
executables = Dir.chdir('bin') { Dir.glob('**/*').select { |f| File.executable?(f) } } | ||
s.executables = executables unless executables.empty? | ||
end | ||
|
||
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") | ||
s.rubygems_version = "1.3.1" | ||
s.specification_version = 3 | ||
end |
Oops, something went wrong.