noe 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +36 -1
- data/Gemfile.lock +40 -0
- data/Manifest.txt +15 -0
- data/README.md +10 -9
- data/Rakefile +3 -2
- data/lib/noe.rb +1 -1
- data/lib/noe/ext/array.rb +0 -4
- data/lib/noe/ext/hash.rb +1 -1
- data/lib/noe/loader.rb +3 -67
- data/lib/noe/main.rb +1 -0
- data/noe.gemspec +4 -3
- data/noe.noespec +44 -0
- data/tasks/debug_mail.rake +77 -0
- data/tasks/debug_mail.txt +13 -0
- data/tasks/gem.rake +30 -6
- data/tasks/spec_test.rake +34 -16
- data/tasks/unit_test.rake +26 -6
- data/tasks/yard.rake +24 -9
- data/templates/ruby/CHANGELOG.md +18 -2
- data/templates/ruby/noespec.yaml +110 -4
- data/templates/ruby/short.yaml +25 -4
- data/templates/ruby/src/Manifest.txt +3 -0
- data/templates/ruby/src/Rakefile +3 -2
- data/templates/ruby/src/__lower__.gemspec +1 -1
- data/templates/ruby/src/lib/__lower__.rb +1 -1
- data/templates/ruby/src/lib/__lower__/loader.rb +1 -65
- data/templates/ruby/src/tasks/debug_mail.rake +77 -0
- data/templates/ruby/src/tasks/debug_mail.txt +13 -0
- data/templates/ruby/src/tasks/gem.rake +32 -8
- data/templates/ruby/src/tasks/spec_test.rake +39 -21
- data/templates/ruby/src/tasks/unit_test.rake +31 -11
- data/templates/ruby/src/tasks/yard.rake +24 -9
- metadata +39 -200
@@ -0,0 +1,77 @@
|
|
1
|
+
# Installs a rake task for debuging the announcement mail.
|
2
|
+
#
|
3
|
+
# This file installs the 'rake debug_mail' that flushes an announcement mail
|
4
|
+
# for your library on the standard output. It is automatically generated
|
5
|
+
# by Noe from your .noespec file, and should therefore be configured there,
|
6
|
+
# under the variables/rake_tasks/debug_mail entry, as illustrated below:
|
7
|
+
#
|
8
|
+
# variables:
|
9
|
+
# rake_tasks:
|
10
|
+
# debug_mail:
|
11
|
+
# rx_changelog_sections: /^#/
|
12
|
+
# nb_changelog_sections: 1
|
13
|
+
# ...
|
14
|
+
#
|
15
|
+
# If you have specific needs requiring manual intervention on this file,
|
16
|
+
# don't forget to set safe-override to false in your noe specification:
|
17
|
+
#
|
18
|
+
# template-info:
|
19
|
+
# manifest:
|
20
|
+
# tasks/debug_mail.rake:
|
21
|
+
# safe-override: false
|
22
|
+
#
|
23
|
+
# The mail template used can be found in debug_mail.txt. That file may be
|
24
|
+
# changed to tune the mail you want to send. If you do so, don't forget to
|
25
|
+
# add a manifest entry in your .noespec file to avoid overriding you
|
26
|
+
# changes. The mail template uses wlang, with parentheses for block
|
27
|
+
# delimiters.
|
28
|
+
#
|
29
|
+
# template-info:
|
30
|
+
# manifest:
|
31
|
+
# tasks/debug_mail.txt:
|
32
|
+
# safe-override: false
|
33
|
+
#
|
34
|
+
begin
|
35
|
+
require 'wlang'
|
36
|
+
require 'yaml'
|
37
|
+
|
38
|
+
task :debug_mail do
|
39
|
+
# Check that a .noespec file exists
|
40
|
+
noespec_file = File.expand_path('../../!{lower}.noespec', __FILE__)
|
41
|
+
unless File.exists?(noespec_file)
|
42
|
+
raise "Unable to find .noespec project file, sorry."
|
43
|
+
end
|
44
|
+
|
45
|
+
# Load it as well as variables and options
|
46
|
+
noespec = YAML::load(File.read(noespec_file))
|
47
|
+
vars = noespec['variables'] || {}
|
48
|
+
|
49
|
+
# Changes are taken from CHANGELOG
|
50
|
+
logs = Dir[File.expand_path("../../CHANGELOG.*", __FILE__)]
|
51
|
+
unless logs.size == 1
|
52
|
+
abort "Unable to find a changelog file"
|
53
|
+
end
|
54
|
+
|
55
|
+
# Load interesting changesets
|
56
|
+
changes, end_found = [], 0
|
57
|
+
File.readlines(logs.first).select{|line|
|
58
|
+
if line =~ !{rake_tasks.debug_mail.rx_changelog_sections}
|
59
|
+
break if end_found >= +{rake_tasks.debug_mail.nb_changelog_sections}
|
60
|
+
end_found += 1
|
61
|
+
end
|
62
|
+
changes << line
|
63
|
+
}
|
64
|
+
vars['changes'] = changes.join
|
65
|
+
|
66
|
+
# WLang template
|
67
|
+
template = File.expand_path('../debug_mail.txt', __FILE__)
|
68
|
+
|
69
|
+
# Let's go!
|
70
|
+
$stdout << WLang::file_instantiate(template, vars, "wlang/active-text")
|
71
|
+
end
|
72
|
+
|
73
|
+
rescue LoadError
|
74
|
+
task :debug_mail do
|
75
|
+
abort "wlang is not available. Try 'gem install wlang'"
|
76
|
+
end
|
77
|
+
end
|
@@ -1,4 +1,28 @@
|
|
1
|
-
#
|
1
|
+
# Installs rake tasks for gemming and packaging
|
2
|
+
#
|
3
|
+
# This file installs the 'rake package', 'rake gem' tasks and associates
|
4
|
+
# (clobber_package, repackage, ...). It is automatically generated by Noe
|
5
|
+
# from your .noespec file, and should therefore be configured there, under
|
6
|
+
# the variables/rake_tasks/gem entry, as illustrated below:
|
7
|
+
#
|
8
|
+
# variables:
|
9
|
+
# rake_tasks:
|
10
|
+
# gem:
|
11
|
+
# package_dir: pkg
|
12
|
+
# need_tar: false
|
13
|
+
# need_tar_gz: false
|
14
|
+
# need_tar_bz2: false
|
15
|
+
# need_zip: false
|
16
|
+
# ...
|
17
|
+
#
|
18
|
+
# If you have specific needs requiring manual intervention on this file,
|
19
|
+
# don't forget to set safe-override to false in your noe specification:
|
20
|
+
#
|
21
|
+
# template-info:
|
22
|
+
# manifest:
|
23
|
+
# tasks/gem.rake:
|
24
|
+
# safe-override: false
|
25
|
+
#
|
2
26
|
begin
|
3
27
|
require 'rubygems/package_task'
|
4
28
|
Gem::PackageTask.new($gemspec) do |t|
|
@@ -10,28 +34,28 @@ begin
|
|
10
34
|
t.version = $gemspec.version
|
11
35
|
|
12
36
|
# Directory used to store the package files
|
13
|
-
t.package_dir =
|
37
|
+
t.package_dir = +{rake_tasks.gem.package_dir}
|
14
38
|
|
15
39
|
# True if a gzipped tar file (tgz) should be produced
|
16
|
-
t.need_tar =
|
40
|
+
t.need_tar = +{rake_tasks.gem.need_tar}
|
17
41
|
|
18
42
|
# True if a gzipped tar file (tar.gz) should be produced
|
19
|
-
t.need_tar_gz =
|
43
|
+
t.need_tar_gz = +{rake_tasks.gem.need_tar_gz}
|
20
44
|
|
21
45
|
# True if a bzip2'd tar file (tar.bz2) should be produced
|
22
|
-
t.need_tar_bz2 =
|
46
|
+
t.need_tar_bz2 = +{rake_tasks.gem.need_tar_bz2}
|
23
47
|
|
24
48
|
# True if a zip file should be produced (default is false)
|
25
|
-
t.need_zip =
|
49
|
+
t.need_zip = +{rake_tasks.gem.need_zip}
|
26
50
|
|
27
51
|
# List of files to be included in the package.
|
28
52
|
t.package_files = $gemspec.files
|
29
53
|
|
30
54
|
# Tar command for gzipped or bzip2ed archives.
|
31
|
-
t.tar_command =
|
55
|
+
t.tar_command = +{rake_tasks.gem.tar_command}
|
32
56
|
|
33
57
|
# Zip command for zipped archives.
|
34
|
-
t.zip_command =
|
58
|
+
t.zip_command = +{rake_tasks.gem.zip_command}
|
35
59
|
|
36
60
|
end
|
37
61
|
rescue LoadError
|
@@ -1,55 +1,73 @@
|
|
1
|
+
# Installs a rake task for for running examples written using rspec.
|
1
2
|
#
|
2
|
-
#
|
3
|
+
# This file installs the 'rake spec_test' (aliased as 'rake spec') as well as
|
4
|
+
# extends 'rake test' to run spec tests, if any. It is automatically generated
|
5
|
+
# by Noe from your .noespec file, and should therefore be configured there,
|
6
|
+
# under the variables/rake_tasks/spec_test entry, as illustrated below:
|
3
7
|
#
|
4
|
-
#
|
5
|
-
#
|
8
|
+
# variables:
|
9
|
+
# rake_tasks:
|
10
|
+
# spec_test:
|
11
|
+
# pattern: spec/**/*_spec.rb
|
12
|
+
# verbose: true
|
13
|
+
# rspec_opts: [--color, --backtrace]
|
14
|
+
# ...
|
15
|
+
#
|
16
|
+
# If you have specific needs requiring manual intervention on this file,
|
17
|
+
# don't forget to set safe-override to false in your noe specification:
|
18
|
+
#
|
19
|
+
# template-info:
|
20
|
+
# manifest:
|
21
|
+
# tasks/spec_test.rake:
|
22
|
+
# safe-override: false
|
23
|
+
#
|
24
|
+
# This file has been written to conform to RSpec v2.4.0. More information about
|
25
|
+
# rspec and options of the rake task defined below can be found on
|
26
|
+
# http://relishapp.com/rspec
|
6
27
|
#
|
7
28
|
begin
|
8
29
|
require "rspec/core/rake_task"
|
9
30
|
desc "Run RSpec code examples"
|
10
31
|
RSpec::Core::RakeTask.new(:spec_test) do |t|
|
11
32
|
# Glob pattern to match files.
|
12
|
-
t.pattern =
|
33
|
+
t.pattern = +{rake_tasks.spec_test.pattern}
|
13
34
|
|
14
35
|
# By default, if there is a Gemfile, the generated command will include
|
15
36
|
# 'bundle exec'. Set this to true to ignore the presence of a Gemfile,
|
16
37
|
# and not add 'bundle exec' to the command.
|
17
|
-
t.skip_bundler =
|
38
|
+
t.skip_bundler = +{rake_tasks.spec_test.skip_bundler}
|
18
39
|
|
19
40
|
# Name of Gemfile to use
|
20
|
-
t.gemfile =
|
41
|
+
t.gemfile = +{rake_tasks.spec_test.gemfile}
|
21
42
|
|
22
43
|
# Whether or not to fail Rake when an error occurs (typically when
|
23
44
|
# examples fail).
|
24
|
-
t.fail_on_error =
|
45
|
+
t.fail_on_error = +{rake_tasks.spec_test.fail_on_error}
|
25
46
|
|
26
47
|
# A message to print to stderr when there are failures.
|
27
|
-
t.failure_message =
|
48
|
+
t.failure_message = +{rake_tasks.spec_test.failure_message}
|
28
49
|
|
29
50
|
# Use verbose output. If this is set to true, the task will print the
|
30
51
|
# executed spec command to stdout.
|
31
|
-
t.verbose =
|
52
|
+
t.verbose = +{rake_tasks.spec_test.verbose}
|
32
53
|
|
33
54
|
# Use rcov for code coverage?
|
34
|
-
t.rcov =
|
55
|
+
t.rcov = +{rake_tasks.spec_test.rcov}
|
35
56
|
|
36
57
|
# Path to rcov.
|
37
|
-
t.rcov_path =
|
58
|
+
t.rcov_path = +{rake_tasks.spec_test.rcov_path}
|
38
59
|
|
39
|
-
# Command line options to pass to rcov.
|
40
|
-
|
41
|
-
t.rcov_opts = %w{}
|
60
|
+
# Command line options to pass to rcov. See 'rcov --help' about this
|
61
|
+
t.rcov_opts = +{rake_tasks.spec_test.rcov_opts}
|
42
62
|
|
43
|
-
# Command line options to pass to ruby.
|
44
|
-
|
45
|
-
t.ruby_opts = %w{}
|
63
|
+
# Command line options to pass to ruby. See 'ruby --help' about this
|
64
|
+
t.ruby_opts = +{rake_tasks.spec_test.ruby_opts}
|
46
65
|
|
47
66
|
# Path to rspec
|
48
|
-
t.rspec_path =
|
67
|
+
t.rspec_path = +{rake_tasks.spec_test.rspec_path}
|
49
68
|
|
50
|
-
# Command line options to pass to rspec.
|
51
|
-
|
52
|
-
t.rspec_opts = %w{--color --backtrace}
|
69
|
+
# Command line options to pass to rspec. See 'rspec --help' about this
|
70
|
+
t.rspec_opts = +{rake_tasks.spec_test.rspec_opts}
|
53
71
|
end
|
54
72
|
rescue LoadError => ex
|
55
73
|
task :spec_test do
|
@@ -1,8 +1,28 @@
|
|
1
|
+
# Installs a rake task for for running unit tests.
|
1
2
|
#
|
2
|
-
#
|
3
|
+
# This file installs the 'rake unit_test' and extends 'rake test' to run unit
|
4
|
+
# tests, if any. It is automatically generated by Noe from your .noespec file,
|
5
|
+
# and should therefore be configured there, under the variables/rake_tasks/unit_test
|
6
|
+
# entry, as illustrated below:
|
3
7
|
#
|
4
|
-
#
|
5
|
-
#
|
8
|
+
# variables:
|
9
|
+
# rake_tasks:
|
10
|
+
# unit_test:
|
11
|
+
# pattern: test/test*.rb
|
12
|
+
# verbose: false
|
13
|
+
# warning: false
|
14
|
+
# ...
|
15
|
+
#
|
16
|
+
# If you have specific needs requiring manual intervention on this file,
|
17
|
+
# don't forget to set safe-override to false in your noe specification:
|
18
|
+
#
|
19
|
+
# template-info:
|
20
|
+
# manifest:
|
21
|
+
# tasks/unit_test.rake:
|
22
|
+
# safe-override: false
|
23
|
+
#
|
24
|
+
# More info about the TestTask and its options can be found on
|
25
|
+
# http://rake.rubyforge.org/classes/Rake/TestTask.html
|
6
26
|
#
|
7
27
|
begin
|
8
28
|
desc "Lauches unit tests"
|
@@ -11,21 +31,21 @@ begin
|
|
11
31
|
|
12
32
|
# List of directories to added to $LOAD_PATH before running the
|
13
33
|
# tests. (default is 'lib')
|
14
|
-
t.libs =
|
34
|
+
t.libs = +{rake_tasks.unit_test.libs}
|
15
35
|
|
16
36
|
# True if verbose test output desired. (default is false)
|
17
|
-
t.verbose =
|
37
|
+
t.verbose = +{rake_tasks.unit_test.verbose}
|
18
38
|
|
19
39
|
# Test options passed to the test suite. An explicit TESTOPTS=opts
|
20
40
|
# on the command line will override this. (default is NONE)
|
21
|
-
t.options =
|
41
|
+
t.options = +{rake_tasks.unit_test.options}
|
22
42
|
|
23
43
|
# Request that the tests be run with the warning flag set.
|
24
44
|
# E.g. warning=true implies "ruby -w" used to run the tests.
|
25
|
-
t.warning =
|
45
|
+
t.warning = +{rake_tasks.unit_test.warning}
|
26
46
|
|
27
47
|
# Glob pattern to match test files. (default is 'test/test*.rb')
|
28
|
-
t.pattern =
|
48
|
+
t.pattern = +{rake_tasks.unit_test.pattern}
|
29
49
|
|
30
50
|
# Style of test loader to use. Options are:
|
31
51
|
#
|
@@ -33,17 +53,17 @@ begin
|
|
33
53
|
# * :testrb -- Ruby provided test loading script.
|
34
54
|
# * :direct -- Load tests using command line loader.
|
35
55
|
#
|
36
|
-
t.loader =
|
56
|
+
t.loader = +{rake_tasks.unit_test.loader}
|
37
57
|
|
38
58
|
# Array of commandline options to pass to ruby when running test
|
39
59
|
# loader.
|
40
|
-
t.ruby_opts =
|
60
|
+
t.ruby_opts = +{rake_tasks.unit_test.ruby_opts}
|
41
61
|
|
42
62
|
# Explicitly define the list of test files to be included in a
|
43
63
|
# test. +list+ is expected to be an array of file names (a
|
44
64
|
# FileList is acceptable). If both +pattern+ and +test_files+ are
|
45
65
|
# used, then the list of test files is the union of the two.
|
46
|
-
t.test_files =
|
66
|
+
t.test_files = +{rake_tasks.unit_test.test_files}
|
47
67
|
|
48
68
|
end
|
49
69
|
rescue LoadError => ex
|
@@ -1,22 +1,37 @@
|
|
1
|
+
# Installs a rake task to generate API documentation using yard.
|
2
|
+
#
|
3
|
+
# This file installs the 'rake yard' task. It is automatically generated by Noe from
|
4
|
+
# your .noespec file, and should therefore be configured there, under the
|
5
|
+
# variables/rake_tasks/yard entry, as illustrated below:
|
6
|
+
#
|
7
|
+
# variables:
|
8
|
+
# rake_tasks:
|
9
|
+
# yard:
|
10
|
+
# files: lib/**/*.rb
|
11
|
+
# options: []
|
12
|
+
# ...
|
13
|
+
#
|
14
|
+
# If you have specific needs requiring manual intervention on this file,
|
15
|
+
# don't forget to set safe-override to false in your noe specification:
|
1
16
|
#
|
2
|
-
#
|
3
|
-
#
|
17
|
+
# template-info:
|
18
|
+
# manifest:
|
19
|
+
# tasks/yard.rake:
|
20
|
+
# safe-override: false
|
4
21
|
#
|
5
|
-
# More information about
|
6
|
-
#
|
22
|
+
# This file has been written to conform to yard v0.6.4. More information about
|
23
|
+
# yard and the rake task installed below can be found on http://yardoc.org/
|
7
24
|
#
|
8
|
-
# About project documentation
|
9
25
|
begin
|
10
26
|
require "yard"
|
11
27
|
desc "Generate yard documentation"
|
12
28
|
YARD::Rake::YardocTask.new(:yard) do |t|
|
13
|
-
# Array of options passed to
|
14
|
-
|
15
|
-
t.options = %w{--output-dir doc/api - README.md CHANGELOG.md LICENCE.md}
|
29
|
+
# Array of options passed to yardoc commandline. See 'yardoc --help' about this
|
30
|
+
t.options = +{rake_tasks.yard.options}
|
16
31
|
|
17
32
|
# Array of ruby source files (and any extra documentation files
|
18
33
|
# separated by '-')
|
19
|
-
t.files =
|
34
|
+
t.files = +{rake_tasks.yard.files}
|
20
35
|
|
21
36
|
# A proc to call before running the task
|
22
37
|
# t.before = proc{ }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bernard Lambeau
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-17 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -100,24 +100,40 @@ dependencies:
|
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
prerelease: false
|
102
102
|
name: wlang
|
103
|
-
type: :
|
103
|
+
type: :development
|
104
104
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
109
|
+
hash: 53
|
110
110
|
segments:
|
111
111
|
- 0
|
112
112
|
- 10
|
113
|
-
-
|
114
|
-
version: 0.10.
|
113
|
+
- 1
|
114
|
+
version: 0.10.1
|
115
115
|
requirement: *id006
|
116
116
|
- !ruby/object:Gem::Dependency
|
117
117
|
prerelease: false
|
118
|
-
name:
|
118
|
+
name: wlang
|
119
119
|
type: :runtime
|
120
120
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
hash: 53
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
- 10
|
129
|
+
- 1
|
130
|
+
version: 0.10.1
|
131
|
+
requirement: *id007
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
prerelease: false
|
134
|
+
name: quickl
|
135
|
+
type: :runtime
|
136
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
121
137
|
none: false
|
122
138
|
requirements:
|
123
139
|
- - ~>
|
@@ -128,12 +144,12 @@ dependencies:
|
|
128
144
|
- 2
|
129
145
|
- 0
|
130
146
|
version: 0.2.0
|
131
|
-
requirement: *
|
147
|
+
requirement: *id008
|
132
148
|
- !ruby/object:Gem::Dependency
|
133
149
|
prerelease: false
|
134
150
|
name: highline
|
135
151
|
type: :runtime
|
136
|
-
version_requirements: &
|
152
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
137
153
|
none: false
|
138
154
|
requirements:
|
139
155
|
- - ~>
|
@@ -144,192 +160,8 @@ dependencies:
|
|
144
160
|
- 6
|
145
161
|
- 0
|
146
162
|
version: 1.6.0
|
147
|
-
requirement: *
|
148
|
-
description:
|
149
|
-
# Noe - A simple and extensible project generator
|
150
|
-
|
151
|
-
Noe is a tool that generates projects from predefined skeletons (aka project/application
|
152
|
-
templates). Skeletons are designed for building specific products (a ruby library, a static
|
153
|
-
or dynamic web site, ...). Noe instantiates them and helps you maintaining your product
|
154
|
-
via meta-information provided by a .noespec yaml file.
|
155
|
-
|
156
|
-
Noe comes bundled with a skeleton for creating and maintaining a ruby gem. This skeleton
|
157
|
-
is written and maintained to follow ruby best practices and may also be tuned for your own
|
158
|
-
needs. Read more about it and related projects as well as the underlying philosophy in the
|
159
|
-
sections below.
|
160
|
-
|
161
|
-
## Getting started
|
162
|
-
|
163
|
-
[sudo] gem install noe
|
164
|
-
[noe --help]
|
165
|
-
[noe help install]
|
166
|
-
noe install
|
167
|
-
|
168
|
-
Have a loot at ~/.noerc and ~/.noe for configuration and a default ruby template. To
|
169
|
-
instantiate a ruby project simply execute the following commands in turn:
|
170
|
-
|
171
|
-
# Given a template ruby under ~/.noe/ruby, install by default
|
172
|
-
noe prepare --template=ruby foo
|
173
|
-
cd foo
|
174
|
-
|
175
|
-
# Edit the template configuration foo/foo.noespec
|
176
|
-
edit foo/foo.noespec
|
177
|
-
|
178
|
-
# Launch template instantiation
|
179
|
-
noe go
|
180
|
-
|
181
|
-
That's it! But also have a look at 'noe help prepare' and 'not help go' for additional
|
182
|
-
options.
|
183
|
-
|
184
|
-
## Philosophy
|
185
|
-
|
186
|
-
Noe is designed to follow a certain number of good principles and helps you following
|
187
|
-
them as well.
|
188
|
-
|
189
|
-
### Separation of concerns
|
190
|
-
|
191
|
-
Noe maintains a strong separation of concerns. In particular one has to make the distinction
|
192
|
-
between a) Noe itself, b) a skeleton and c) an instantiated product. This fact has two
|
193
|
-
main consequences:
|
194
|
-
|
195
|
-
* Noe itself **is not dedicated to specific products** (like a ruby library). Even if Noe
|
196
|
-
comes bundled with a default skeleton for ruby projects, writing skeletons for something
|
197
|
-
else should not be a problem. In other words, Noe itself is agnostic: the semantics of
|
198
|
-
generated products is the secret of the skeleton, under the responsibility of it's
|
199
|
-
maintainer.
|
200
|
-
|
201
|
-
* Noe **should not be a runtime dependency** of the product. Good skeletons maintain this
|
202
|
-
separation. As an example the default ruby skeleton is strictly independent of Noe itself.
|
203
|
-
Principles discussed below explain why this is important.
|
204
|
-
|
205
|
-
### Master the tools YOU use
|
206
|
-
|
207
|
-
The separation of concerns described previously also drives what you have to learn and what
|
208
|
-
tools you have to master:
|
209
|
-
|
210
|
-
* As an ordinary Noe user (vs. skeleton maintainer) and because Noe itself (unlike skeletons
|
211
|
-
is project agnostic, you only have to know **basic Noe commands** (see 'noe --help') and
|
212
|
-
should never have to study Noe's API and internals. In contrast, you have to **master the
|
213
|
-
tools and best practices of your product's ecosystem**. A good skeleton should help you
|
214
|
-
along this task. As an example, the default ruby skeleton is fully documented to help you
|
215
|
-
gaining understanding of ***rake*, *spec*, *yard*, *bundler*** and so on but **not noe
|
216
|
-
itself**.
|
217
|
-
|
218
|
-
* This explains why Noe itself is not a runtime dependency. Using a particular skeleton
|
219
|
-
already means learning a lot, at least in the long run (see the section about Magic below).
|
220
|
-
Noe avoids interfering with generated products to avoid making the learning curve even
|
221
|
-
worse.
|
222
|
-
|
223
|
-
* Being a skeleton creator/maintainer is another story of course. To write a skeleton you'll
|
224
|
-
also have to learn **Noe's API and internals**. To write a good/reusable one, you'll
|
225
|
-
certainly have to **master the full ecosystem and best practices of the targetted product**,
|
226
|
-
which is a good opportunity for learning and sharing it!
|
227
|
-
|
228
|
-
### Magic Only If Flexible
|
229
|
-
|
230
|
-
"Don't Repeat Yourself" and "Convention over Configuration" are certainly good principles.
|
231
|
-
However tuning, configuration and options exist, are useful and should certainly not be
|
232
|
-
hidden to the user. Instead configuration and options should come with default values,
|
233
|
-
and should be fully documented. Providing magic is great if there is a user-centric way
|
234
|
-
(in contrast to a developer one) of understanding and controlling the magic and underlying
|
235
|
-
assumptions.
|
236
|
-
|
237
|
-
As an example, the default ruby template comes with some magic: you can create a project
|
238
|
-
and immediately invoke 'rake test', 'rake yard', ... and not investigating further. You
|
239
|
-
can also have a look at the _tasks_ folder to understand and control the rake tasks that
|
240
|
-
your project will use... In fact, you **must** investigate: the generated product is yours,
|
241
|
-
not mine and YOU have to master your build chain!
|
242
|
-
|
243
|
-
## Ruby skeleton and Related projects
|
244
|
-
|
245
|
-
Noe is inspired by existing projects, mostly from the ruby community. In particular, the
|
246
|
-
default ruby template has been heavily influenced by the projects below as well as feedback
|
247
|
-
of their authors:
|
248
|
-
|
249
|
-
* [hoe](http://seattlerb.rubyforge.org/hoe/), Ryan Davis and Eric Hodel
|
250
|
-
* [echoe](https://github.com/fauna/echoe), Evan Weaver
|
251
|
-
* [bones](https://github.com/TwP/bones), Tim Pease
|
252
|
-
|
253
|
-
These projects help you generating and maintaining ruby projects (generally gem libraries,
|
254
|
-
in fact). All provide powerful tools that supports you along the different steps of your
|
255
|
-
ruby software lifecycle (creating, testing, releasing, announcing, and so on.). They mostly
|
256
|
-
differ in the way you can tune/configure the generated project for specific needs.
|
257
|
-
|
258
|
-
These projects differ from the Ruby skeleton proposed by Noe in that they use a control
|
259
|
-
approach (rake tasks installed in your project via a development/runtime dependency) while
|
260
|
-
Noe uses a generative approach (the generated ruby project and rake tasks do not depend on
|
261
|
-
Noe at all).
|
262
|
-
|
263
|
-
You'll find more information about the Noe's ruby skeleton in it's own
|
264
|
-
[README](https://github.com/blambeau/noe/blob/master/templates/ruby/README.md).
|
265
|
-
|
266
|
-
## Short guide for template maintainers
|
267
|
-
|
268
|
-
Under ~/.noe, a valid template folder (say xxx) has the following structure
|
269
|
-
|
270
|
-
xxx # Template name
|
271
|
-
README(.md|.txt|...) # Information about the template and it's usage
|
272
|
-
CHANGELOG(.md|.txt|...) # Change information
|
273
|
-
noespec.yaml # Template specification
|
274
|
-
src # Source folder, contains files to be instantiated
|
275
|
-
... # [everything that will be instantiated]
|
276
|
-
|
277
|
-
### noespec.yaml
|
278
|
-
|
279
|
-
The noespec.yaml file of a template is used to formally describe the template. When a
|
280
|
-
project (say foo) is created (see 'noe prepare') using a template (say ruby) the file
|
281
|
-
~/.noe/ruby/noespec.yaml is used to generate foo/foo.noespec. The later is then used
|
282
|
-
by 'noe go' to instantiate the project.
|
283
|
-
|
284
|
-
The noespec.yaml file should ressemble something like this:
|
285
|
-
|
286
|
-
# DO NOT TOUCH 'name' entry and specify the other
|
287
|
-
template-info:
|
288
|
-
name: !{template_name}
|
289
|
-
summary: ...
|
290
|
-
description: ...
|
291
|
-
version: ...
|
292
|
-
author: ...
|
293
|
-
|
294
|
-
#
|
295
|
-
# The following is a hash of template-related variables. They are
|
296
|
-
# used to provide dynamic file names and instantiate file contents.
|
297
|
-
#
|
298
|
-
# Current version of Noe only supports variable names matching /[a-z]+/
|
299
|
-
#
|
300
|
-
variables:
|
301
|
-
...
|
302
|
-
|
303
|
-
Have a look at ~/.noe/ruby/noespec.yaml and ~/.noe/ruby/src for an example.
|
304
|
-
|
305
|
-
### Instantiation process
|
306
|
-
|
307
|
-
The instantiation process is really simple. Given the variables described in the
|
308
|
-
noespec.yaml file (for which values are specified in your .noespec file) templates
|
309
|
-
can use the following meta-constructions:
|
310
|
-
|
311
|
-
* Template files and directories containing `__variable__` in their name are automatically
|
312
|
-
renamed (`__variable__` is replaced by the corresponding value).
|
313
|
-
* All template files are instantiated by [wlang](https://github.com/blambeau/wlang). You
|
314
|
-
don't have to know wlang in depth. You simply have to know that `!{ruby_expression}` in
|
315
|
-
a file is replaced by the expression evaluation. Variables are automatically in scope
|
316
|
-
of such expressions, so that `!{variable}` is replaced by its value.
|
317
|
-
|
318
|
-
## Contributing
|
319
|
-
|
320
|
-
Fork Noe on github! I'm particularly interested in the following enhancements:
|
321
|
-
|
322
|
-
* Extend test coverage, which is ugly so far.
|
323
|
-
* Enhance the default ruby template, but remember "documentation matters, not magic!"
|
324
|
-
* Add support for other generators than _wlang_
|
325
|
-
* Add support for multi-generated files from arrays in .noespec files
|
326
|
-
* ...
|
327
|
-
|
328
|
-
If you think that your template is worth considering for (ruby, rails, js, latex, or
|
329
|
-
anything else) please let me known and I'll add it to the list below.
|
330
|
-
|
331
|
-
* ...
|
332
|
-
|
163
|
+
requirement: *id009
|
164
|
+
description: Noe is a tool that generates project skeletons from predefined templates. A template is designed for a specific product (a ruby library, a static or dynamic web site, ...). Noe instantiates templates and helps you maintaining your product via meta-information provided by a .noespec yaml file. In contrast to other tools, Noe is not specific to certain kinds of products. Writing your own template is possible and even simple!
|
333
165
|
email:
|
334
166
|
- blambeau@gmail.com
|
335
167
|
executables:
|
@@ -341,10 +173,10 @@ extra_rdoc_files:
|
|
341
173
|
- CHANGELOG.md
|
342
174
|
- LICENCE.md
|
343
175
|
files:
|
344
|
-
- ./noe
|
176
|
+
- ./bin/noe
|
345
177
|
- ./CHANGELOG.md
|
346
178
|
- ./Gemfile
|
347
|
-
- ./
|
179
|
+
- ./Gemfile.lock
|
348
180
|
- ./lib/noe/commons.rb
|
349
181
|
- ./lib/noe/config.rb
|
350
182
|
- ./lib/noe/config.yaml
|
@@ -361,6 +193,9 @@ files:
|
|
361
193
|
- ./lib/noe/template.rb
|
362
194
|
- ./lib/noe.rb
|
363
195
|
- ./LICENCE.md
|
196
|
+
- ./Manifest.txt
|
197
|
+
- ./noe.gemspec
|
198
|
+
- ./noe.noespec
|
364
199
|
- ./Rakefile
|
365
200
|
- ./README.md
|
366
201
|
- ./spec/ext/hash/methodize_spec.rb
|
@@ -369,6 +204,8 @@ files:
|
|
369
204
|
- ./spec/template/entry/infer_wlang_dialect_spec.rb
|
370
205
|
- ./spec/template/entry/relocate_spec.rb
|
371
206
|
- ./spec/template/entry/rename_one_spec.rb
|
207
|
+
- ./tasks/debug_mail.rake
|
208
|
+
- ./tasks/debug_mail.txt
|
372
209
|
- ./tasks/gem.rake
|
373
210
|
- ./tasks/spec_test.rake
|
374
211
|
- ./tasks/unit_test.rake
|
@@ -388,6 +225,8 @@ files:
|
|
388
225
|
- ./templates/ruby/src/README.md
|
389
226
|
- ./templates/ruby/src/spec/__lower___spec.rb
|
390
227
|
- ./templates/ruby/src/spec/spec_helper.rb
|
228
|
+
- ./templates/ruby/src/tasks/debug_mail.rake
|
229
|
+
- ./templates/ruby/src/tasks/debug_mail.txt
|
391
230
|
- ./templates/ruby/src/tasks/gem.rake
|
392
231
|
- ./templates/ruby/src/tasks/spec_test.rake
|
393
232
|
- ./templates/ruby/src/tasks/unit_test.rake
|
@@ -443,7 +282,7 @@ rubyforge_project:
|
|
443
282
|
rubygems_version: 1.4.2
|
444
283
|
signing_key:
|
445
284
|
specification_version: 3
|
446
|
-
summary: Noe is a
|
285
|
+
summary: Noe is a simple, general-purpose and extensible skeleton generator from project templates
|
447
286
|
test_files:
|
448
287
|
- spec/ext/hash/methodize_spec.rb
|
449
288
|
- spec/noe_spec.rb
|