falsework 0.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{lib/falsework/templates/naive/Gemfile.erb → Gemfile} +1 -1
- data/Gemfile.lock +12 -0
- data/README.rdoc +45 -21
- data/Rakefile +5 -5
- data/bin/falsework +64 -28
- data/doc/NEWS.rdoc +37 -10
- data/doc/README.rdoc +45 -21
- data/doc/TODO.org +13 -0
- data/doc/template-tutorial.rdoc +113 -0
- data/etc/falsework.yaml +1 -1
- data/lib/falsework/meta.rb +3 -2
- data/lib/falsework/mould.rb +267 -146
- data/lib/falsework/templates/c-glib/#config.yaml +18 -0
- data/lib/falsework/templates/c-glib/README +24 -0
- data/lib/falsework/templates/c-glib/doc/#doc.ascii +46 -0
- data/lib/falsework/templates/c-glib/doc/%%@project%%.1.asciidoc +46 -0
- data/lib/falsework/templates/{naive/doc/LICENSE.erb → c-glib/doc/LICENSE} +1 -1
- data/lib/falsework/templates/c-glib/doc/Makefile +17 -0
- data/lib/falsework/templates/c-glib/src/#exe.c +23 -0
- data/lib/falsework/templates/c-glib/src/#exe.h +8 -0
- data/lib/falsework/templates/c-glib/src/%%@project%%.c +23 -0
- data/lib/falsework/templates/c-glib/src/%%@project%%.h +26 -0
- data/lib/falsework/templates/c-glib/src/Makefile +28 -0
- data/lib/falsework/templates/c-glib/src/untest.c +9 -0
- data/lib/falsework/templates/c-glib/src/untest.h +14 -0
- data/lib/falsework/templates/c-glib/src/utils.c +232 -0
- data/lib/falsework/templates/c-glib/src/utils.h +45 -0
- data/lib/falsework/templates/c-glib/test/#test.c +48 -0
- data/lib/falsework/templates/c-glib/test/Makefile +78 -0
- data/lib/falsework/templates/c-glib/test/Makefile.test.mk +72 -0
- data/lib/falsework/templates/c-glib/test/mycat.c +8 -0
- data/{test/templates/.keep_me → lib/falsework/templates/c-glib/test/semis/text/empty.txt} +0 -0
- data/lib/falsework/templates/c-glib/test/test_utils.c +134 -0
- data/lib/falsework/templates/ruby-naive/#config.yaml +15 -0
- data/lib/falsework/templates/{naive/.gitignore.erb → ruby-naive/.gitignore.#erb} +0 -0
- data/lib/falsework/templates/ruby-naive/Gemfile +4 -0
- data/lib/falsework/templates/{naive/doc/README.rdoc.erb → ruby-naive/README.rdoc} +2 -2
- data/lib/falsework/templates/{naive/Rakefile.erb → ruby-naive/Rakefile} +1 -1
- data/lib/falsework/templates/{naive/bin/%%@project%%.erb → ruby-naive/bin/%%@project%%} +5 -5
- data/lib/falsework/templates/{naive/doc/#util.rdoc.erb → ruby-naive/doc/#doc.rdoc} +6 -6
- data/lib/falsework/templates/ruby-naive/doc/LICENSE +22 -0
- data/lib/falsework/templates/{naive/doc/NEWS.rdoc.erb → ruby-naive/doc/NEWS.rdoc} +0 -0
- data/lib/falsework/templates/{naive/README.rdoc.erb → ruby-naive/doc/README.rdoc} +2 -2
- data/lib/falsework/templates/{naive/etc/%%@project%%.yaml.erb → ruby-naive/etc/%%@project%%.yaml} +0 -0
- data/lib/falsework/templates/{naive/lib/%%@project%%/meta.rb.erb → ruby-naive/lib/%%@project%%/meta.rb} +3 -2
- data/lib/falsework/templates/{naive/lib/%%@project%%/trestle.rb.erb → ruby-naive/lib/%%@project%%/trestle.rb} +22 -14
- data/lib/falsework/templates/{naive/test/helper.rb.erb → ruby-naive/test/helper.rb} +0 -0
- data/lib/falsework/templates/{naive/test/helper_trestle.rb.erb → ruby-naive/test/helper_trestle.rb} +2 -2
- data/lib/falsework/templates/{naive/test/rake_git.rb.erb → ruby-naive/test/rake_git.rb} +1 -1
- data/lib/falsework/templates/{naive/test/test_%%@project%%.rb.erb → ruby-naive/test/test_%%@project%%.rb} +1 -1
- data/lib/falsework/trestle.rb +17 -9
- data/test/rake_erb_templates.rb +4 -4
- data/test/templates/config-01.yaml +2 -0
- data/test/test_cl.rb +29 -0
- data/test/test_exe.rb +61 -30
- data/test/test_mould.rb +80 -0
- metadata +86 -60
- data/doc/TODO.rdoc +0 -7
data/Gemfile.lock
ADDED
data/README.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
=Name
|
2
2
|
|
3
|
-
falsework--A primitive scaffold generator for writing CLI programs
|
4
|
-
Ruby.
|
3
|
+
falsework--A primitive scaffold generator for writing CLI programs.
|
5
4
|
|
6
5
|
|
7
6
|
==Synopsis
|
@@ -11,14 +10,28 @@ Ruby.
|
|
11
10
|
|
12
11
|
==Description
|
13
12
|
|
14
|
-
The falsework utility
|
13
|
+
The falsework utility ships with 2 templates: <tt>ruby-naive</tt> and
|
14
|
+
<tt>c-glib</tt>.
|
15
|
+
|
16
|
+
Initially the template spec was designed only for Ruby projects but
|
17
|
+
later (from version 1.3.0) hard-coded Ruby staff was removed which added
|
18
|
+
more flexibility.
|
19
|
+
|
20
|
+
The generated project <b>is not dependent</b> on falsework. The utility
|
21
|
+
can also add skeletons for tests end executables <i>after</i> the
|
22
|
+
project generation.
|
23
|
+
|
24
|
+
|
25
|
+
==Ruby Template
|
26
|
+
|
27
|
+
... is default. It generates a scaffold which have:
|
15
28
|
|
16
29
|
* auto-created git (but not github) project;
|
17
30
|
|
18
|
-
* <tt>gem</tt> (a file list is pulled from the git repository, no more
|
19
|
-
missing files in gems
|
31
|
+
* <tt>gem</tt> (a file list is pulled from the git repository, <b>no more
|
32
|
+
missing files in gems!</b>), <tt>doc</tt>, <tt>test</tt> targets;
|
20
33
|
|
21
|
-
* easy to use
|
34
|
+
* easy to use configuration parser/loader. This includes scanning for:
|
22
35
|
|
23
36
|
* env variable(s);
|
24
37
|
* the flat YAML configuration file;
|
@@ -26,10 +39,11 @@ The falsework utility generates a scaffold which have:
|
|
26
39
|
|
27
40
|
* an ability to pick up a user name & an email for a github project.
|
28
41
|
|
29
|
-
|
42
|
+
Version & name of your project can be located at generated
|
43
|
+
<tt>myproject/lib/myproject/meta.rb</tt> file.
|
44
|
+
|
30
45
|
|
31
|
-
|
32
|
-
<i>after</i> the project generation.
|
46
|
+
==Options
|
33
47
|
|
34
48
|
The commands:
|
35
49
|
|
@@ -37,21 +51,29 @@ list:: Do nothing except listing all available
|
|
37
51
|
templates. You can add your own templates in
|
38
52
|
<tt>~/.falsework/templates</tt> directory.
|
39
53
|
|
54
|
+
listdirs:: Do nothing except listing all available
|
55
|
+
templates directories. You can add another
|
56
|
+
directory, modifying <tt>tdir</tt> option in
|
57
|
+
the config file. (<tt>tdir</tt> is an array).
|
58
|
+
|
40
59
|
new NAME:: Create a new project. It creates a directory
|
41
60
|
<i>NAME</i> and populates it with files.
|
42
61
|
|
43
62
|
The following commands works only from the root project directory:
|
44
63
|
|
45
64
|
exe NAME:: Add a new executable to an existing
|
46
|
-
project and a corresponding
|
47
|
-
|
65
|
+
project and a corresponding doc in
|
66
|
+
<tt>doc</tt> sub-directory.
|
48
67
|
|
49
|
-
|
68
|
+
doc NAME:: Add a new doc file in
|
69
|
+
<tt>doc</tt> sub-directory.
|
70
|
+
|
71
|
+
test NAME:: Add a new test in
|
72
|
+
<tt>test</tt> sub-directory.
|
50
73
|
|
51
74
|
upgrade:: 'Inject' or upgrade some vital files from the
|
52
|
-
|
53
|
-
|
54
|
-
from version 0.2.2 and (hopefully) above.)
|
75
|
+
template into the project. Currently only
|
76
|
+
'ruby-naive' template supports this.
|
55
77
|
|
56
78
|
The options are as follows:
|
57
79
|
|
@@ -59,6 +81,9 @@ The options are as follows:
|
|
59
81
|
|
60
82
|
-b:: A batch mode. (No questions asked.)
|
61
83
|
|
84
|
+
--no-git:: Don't create a Git repository. Don't use
|
85
|
+
this for 'ruby-naive' template.
|
86
|
+
|
62
87
|
--config-dirs:: List all possible locations for the
|
63
88
|
configuration file. The first found wins.
|
64
89
|
|
@@ -72,11 +97,6 @@ The options are as follows:
|
|
72
97
|
times, viz. <tt>-vv</tt> dumps even more
|
73
98
|
debug info.
|
74
99
|
|
75
|
-
==Meta
|
76
|
-
|
77
|
-
Version & name of your project can be located at generated
|
78
|
-
<tt>myproject/lib/myproject/meta.rb</tt> file.
|
79
|
-
|
80
100
|
|
81
101
|
==Examples
|
82
102
|
|
@@ -98,13 +118,17 @@ Add another test file:
|
|
98
118
|
|
99
119
|
(It will appear in <tt>test/</tt> sub-directory.)
|
100
120
|
|
121
|
+
Create a project from another template:
|
122
|
+
|
123
|
+
% falsework -t c-glib -v new foo-bar
|
124
|
+
|
101
125
|
|
102
126
|
==Bugs
|
103
127
|
|
104
128
|
While falsework supports symlinks in templates, rubygems replaces
|
105
129
|
symlinks with its corresponding source files. That is why you'll get 2
|
106
130
|
<tt>README.rdoc</tt> files in generated project when it was intended to
|
107
|
-
have 1 in <tt>doc</tt>
|
131
|
+
have 1 in <tt>doc</tt> sub-directory and the symlink to it in the root
|
108
132
|
project directory.
|
109
133
|
|
110
134
|
If you think that this is pathetic, then just grab the source of
|
data/Rakefile
CHANGED
@@ -18,14 +18,14 @@ require_relative 'test/rake_git'
|
|
18
18
|
#
|
19
19
|
require_relative 'test/rake_erb_templates'
|
20
20
|
|
21
|
-
ERB_DYN_SKELETON = erb_skeletons(Meta::NAME, 'naive')
|
21
|
+
ERB_DYN_SKELETON = erb_skeletons(Meta::NAME, 'ruby-naive')
|
22
22
|
ERB_DYN_SKELETON.each {|k, v|
|
23
23
|
file k => [v] do |t|
|
24
|
-
erb_make(Meta::NAME, 'naive', t.name, t.prerequisites[0])
|
24
|
+
erb_make(Meta::NAME, 'ruby-naive', t.name, t.prerequisites[0])
|
25
25
|
end
|
26
26
|
}
|
27
27
|
|
28
|
-
desc "Generate some erb templates for naive template"
|
28
|
+
desc "Generate some erb templates for ruby-naive template"
|
29
29
|
task naive: ERB_DYN_SKELETON.keys
|
30
30
|
|
31
31
|
CLOBBER.concat ERB_DYN_SKELETON.keys
|
@@ -57,7 +57,7 @@ spec = Gem::Specification.new {|i|
|
|
57
57
|
i.extra_rdoc_files = FileList['doc/*']
|
58
58
|
|
59
59
|
i.add_dependency('git', '>= 1.2.5')
|
60
|
-
i.add_dependency('open4', '>= 1.
|
60
|
+
i.add_dependency('open4', '>= 1.2.0')
|
61
61
|
}
|
62
62
|
|
63
63
|
Gem::PackageTask.new(spec).define
|
@@ -67,7 +67,7 @@ task default: [:naive, :repackage]
|
|
67
67
|
RDoc::Task.new('html') do |i|
|
68
68
|
i.main = 'doc/README.rdoc'
|
69
69
|
i.rdoc_files = FileList['doc/*', 'lib/**/*.rb']
|
70
|
-
i.rdoc_files.exclude("lib/**/templates")
|
70
|
+
i.rdoc_files.exclude("lib/**/templates/**/*")
|
71
71
|
end
|
72
72
|
|
73
73
|
Rake::TestTask.new do |i|
|
data/bin/falsework
CHANGED
@@ -6,28 +6,46 @@ require_relative '../lib/falsework/mould'
|
|
6
6
|
include Falsework
|
7
7
|
|
8
8
|
$conf = Hash.new
|
9
|
-
|
9
|
+
$t = Trestle.new($conf)
|
10
10
|
|
11
11
|
$conf[:banner] = <<EOF
|
12
12
|
Usage: #{File.basename($0)} [options] command ...
|
13
|
-
Available commands: list,
|
13
|
+
Available commands: list, listdirs, (new|exe|doc|test) NAME, upgrade.
|
14
14
|
EOF
|
15
15
|
$conf[:user] = nil
|
16
16
|
$conf[:gecos] = nil
|
17
17
|
$conf[:email] = nil
|
18
18
|
$conf[:template] = nil
|
19
19
|
$conf[:batch] = false
|
20
|
+
$conf[:git] = true
|
21
|
+
|
22
|
+
def add_files(mode, files)
|
23
|
+
r = true
|
24
|
+
m = Mould.new(File.basename(Dir.pwd), $conf[:template],
|
25
|
+
$conf[:user], $conf[:email], $conf[:gecos])
|
26
|
+
files.each {|i|
|
27
|
+
created = m.add(mode, i) rescue Trestle.errx(1, $!.to_s)
|
28
|
+
if created.size > 0
|
29
|
+
created.each {|idx| $t.veputs(1, idx) }
|
30
|
+
else
|
31
|
+
r = false
|
32
|
+
end
|
33
|
+
}
|
34
|
+
|
35
|
+
r
|
36
|
+
end
|
20
37
|
|
21
38
|
# --[ main ]------------------------------------------------------------
|
22
39
|
|
23
|
-
|
24
|
-
o =
|
25
|
-
o.on('--user STR', 'Github user') {|i| $conf[:user] = i}
|
26
|
-
o.on('--gecos STR', 'A gecos-like string') {|i| $conf[:gecos] = i}
|
40
|
+
$t.config_parse([]) {|src|
|
41
|
+
o = $t.cl_parse(src) # create an OptionParser object
|
42
|
+
o.on('--user STR', 'Github user.') {|i| $conf[:user] = i}
|
43
|
+
o.on('--gecos STR', 'A gecos-like string.') {|i| $conf[:gecos] = i}
|
27
44
|
o.on('--email STR') {|i| $conf[:email] = i}
|
28
|
-
o.on('-
|
29
|
-
o.on('-
|
30
|
-
|
45
|
+
o.on('--no-git', "Don't create a git repo. (Will break 'ruby-naive'.)") {|i| $conf[:git] = false }
|
46
|
+
o.on('-t NAME', 'A template name.') {|i| $conf[:template] = i}
|
47
|
+
o.on('-b', 'Run in a batch mode, don\'t ask any questions.') { $conf[:batch] = true}
|
48
|
+
$t.cl_parse(src, o) # run cl parser
|
31
49
|
}
|
32
50
|
|
33
51
|
Trestle.errx(1, $conf[:banner]) if (ARGV.size < 2 && ARGV[0] !~ /list|upgrade/)
|
@@ -38,40 +56,58 @@ if $conf[:verbose] >= 2
|
|
38
56
|
pp $conf
|
39
57
|
end
|
40
58
|
|
59
|
+
# modify a list of available template directories
|
60
|
+
Mould.template_dirs_add $conf[:tdir]
|
61
|
+
|
41
62
|
case ARGV[0]
|
42
63
|
when 'list'
|
43
|
-
Mould.templates.
|
44
|
-
|
45
|
-
|
46
|
-
ARGV[1..-1].each {|i|
|
47
|
-
u.veputs(1, "Generating #{i}... __NNL__")
|
48
|
-
# u.veputs(1, m.create($conf[:template], ARGV[0], i) + '... __NNL__')
|
49
|
-
m.add($conf[:template], ARGV[0], i)
|
50
|
-
u.veputs(1, 'OK')
|
64
|
+
Mould.templates.each {|name, loc|
|
65
|
+
loc = '(system)' if loc == Mould.class_variable_get(:@@template_dirs)[0] +'/'+ name
|
66
|
+
puts "%-30s %s" % [name, loc]
|
51
67
|
}
|
68
|
+
|
69
|
+
when 'listdirs'
|
70
|
+
Mould.class_variable_get(:@@template_dirs).each {|idx|
|
71
|
+
puts idx
|
72
|
+
}
|
73
|
+
|
74
|
+
when /exe|doc|test/
|
75
|
+
r1 = add_files ARGV[0], ARGV[1..-1]
|
76
|
+
r2 = true
|
77
|
+
(r2 = add_files 'doc', ARGV[1..-1]) if ARGV[0] == 'exe'
|
78
|
+
exit 1 if !r1 || !r2
|
79
|
+
|
52
80
|
when 'upgrade'
|
53
|
-
m = Mould.new(File.basename(Dir.pwd), $conf[:
|
81
|
+
m = Mould.new(File.basename(Dir.pwd), $conf[:template],
|
82
|
+
$conf[:user], $conf[:email], $conf[:gecos])
|
54
83
|
m.verbose = true if $conf[:verbose] > 0
|
55
84
|
m.batch = $conf[:batch]
|
56
|
-
m.upgrade(
|
85
|
+
m.upgrade() rescue Trestle.errx(1, $!.to_s)
|
86
|
+
|
57
87
|
when 'new'
|
58
88
|
if File.dirname(ARGV[1]) != '.'
|
59
89
|
Dir.chdir(File.dirname(ARGV[1])) rescue Trestle.errx(1, "cannot chdir to '#{File.dirname(ARGV[1])}'")
|
60
90
|
ARGV[1] = File.basename ARGV[1]
|
61
91
|
end
|
62
|
-
Trestle.errx(1, 'project name cannot start with a digit') if ARGV[1].strip[0] =~ /\d/
|
63
92
|
|
64
|
-
|
93
|
+
begin
|
94
|
+
m = Mould.new(ARGV[1], $conf[:template],
|
95
|
+
$conf[:user], $conf[:email], $conf[:gecos])
|
96
|
+
rescue
|
97
|
+
Trestle.errx 1, $!
|
98
|
+
end
|
65
99
|
m.verbose = true if $conf[:verbose] > 0
|
66
|
-
m.project_seed
|
100
|
+
m.project_seed
|
67
101
|
|
68
102
|
# create a git repository
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
103
|
+
if $conf[:git]
|
104
|
+
Dir.chdir m.project
|
105
|
+
$t.veputs(1, "Creating a git repository in #{Dir.pwd}... __NNL__")
|
106
|
+
g = Git.init
|
107
|
+
g.add '.'
|
108
|
+
g.commit "Initial import from #{Falsework::Meta::NAME} #{Falsework::Meta::VERSION}."
|
109
|
+
$t.veputs(1, 'OK')
|
110
|
+
end
|
75
111
|
else
|
76
112
|
Trestle.errx(1, "unknown command: " + ARGV[0])
|
77
113
|
end
|
data/doc/NEWS.rdoc
CHANGED
@@ -1,49 +1,76 @@
|
|
1
|
+
=== 1.3.0
|
2
|
+
|
3
|
+
Mon Nov 7 07:15:00 EET 2011
|
4
|
+
|
5
|
+
* <b>WARNING:</b> 'naive' template is now called 'ruby-naive'. To upgrade
|
6
|
+
to a new template you must manually find all files in your project
|
7
|
+
directory which contain a line like:
|
8
|
+
|
9
|
+
# Don't remove this: falsework/0.2.8/naive/2011-08-05T16:59:19+03:00
|
10
|
+
|
11
|
+
and replace it to:
|
12
|
+
|
13
|
+
# Don't remove this: falsework/0.2.8/ruby-naive/2011-08-05T16:59:19+03:00
|
14
|
+
|
15
|
+
Then run 'falsework upgrade' as usual.
|
16
|
+
|
17
|
+
* Added 'c-glib' template.
|
18
|
+
|
19
|
+
* '--no-git' CLO.
|
20
|
+
|
21
|
+
* Generalized template spec: it's possible to have templates for
|
22
|
+
non-Ruby programs.
|
23
|
+
|
24
|
+
* Template may have a '#config.yaml' file in its root directory.
|
25
|
+
|
26
|
+
* 'list' command displays a directory where the template is located.
|
27
|
+
|
1
28
|
=== 0.2.8
|
2
29
|
|
3
30
|
Fri Aug 5 16:57:06 EEST 2011
|
4
31
|
|
5
|
-
|
32
|
+
* Fixed a bug with minitest's capture_io.
|
6
33
|
|
7
34
|
=== 0.2.7
|
8
35
|
|
9
36
|
Sun Jul 17 01:23:32 EEST 2011
|
10
37
|
|
11
|
-
|
38
|
+
* Fixed a bug with symlinks in Trestle.gem_libdir.
|
12
39
|
|
13
40
|
=== 0.2.6
|
14
41
|
|
15
42
|
Fri Jul 15 20:07:45 EEST 2011
|
16
43
|
|
17
|
-
|
44
|
+
* Updates for rubygems 1.8.5 and rake 0.9.2.
|
18
45
|
|
19
46
|
=== 0.2.4
|
20
47
|
|
21
48
|
Thu May 5 23:45:24 EEST 2011
|
22
49
|
|
23
|
-
|
50
|
+
* Minor Rakefile update (including the template) to reflect rubygems 1.8
|
24
51
|
changes.
|
25
52
|
|
26
|
-
|
53
|
+
* Added Gemfile.erb to naive template.
|
27
54
|
|
28
55
|
=== 0.2.3
|
29
56
|
|
30
57
|
Mon Jan 3 12:41:16 EET 2011
|
31
58
|
|
32
|
-
|
59
|
+
* 'exe' command will add 2 files: an executable and a corresponding
|
33
60
|
.rdoc file.
|
34
61
|
|
35
|
-
|
62
|
+
* Fix a small bug in naive template.
|
36
63
|
|
37
64
|
=== 0.2.2
|
38
65
|
|
39
66
|
Sun Dec 26 04:48:46 EET 2010
|
40
67
|
|
41
|
-
|
68
|
+
* An ability to upgrade a project from a newest template.
|
42
69
|
|
43
70
|
=== 0.1.2
|
44
71
|
|
45
72
|
Wed Dec 22 19:09:01 EET 2010
|
46
73
|
|
47
|
-
|
74
|
+
* Create a git repository automatically for a new project.
|
48
75
|
|
49
|
-
|
76
|
+
* Generate a gem file list from git ls-tree.
|
data/doc/README.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
=Name
|
2
2
|
|
3
|
-
falsework--A primitive scaffold generator for writing CLI programs
|
4
|
-
Ruby.
|
3
|
+
falsework--A primitive scaffold generator for writing CLI programs.
|
5
4
|
|
6
5
|
|
7
6
|
==Synopsis
|
@@ -11,14 +10,28 @@ Ruby.
|
|
11
10
|
|
12
11
|
==Description
|
13
12
|
|
14
|
-
The falsework utility
|
13
|
+
The falsework utility ships with 2 templates: <tt>ruby-naive</tt> and
|
14
|
+
<tt>c-glib</tt>.
|
15
|
+
|
16
|
+
Initially the template spec was designed only for Ruby projects but
|
17
|
+
later (from version 1.3.0) hard-coded Ruby staff was removed which added
|
18
|
+
more flexibility.
|
19
|
+
|
20
|
+
The generated project <b>is not dependent</b> on falsework. The utility
|
21
|
+
can also add skeletons for tests end executables <i>after</i> the
|
22
|
+
project generation.
|
23
|
+
|
24
|
+
|
25
|
+
==Ruby Template
|
26
|
+
|
27
|
+
... is default. It generates a scaffold which have:
|
15
28
|
|
16
29
|
* auto-created git (but not github) project;
|
17
30
|
|
18
|
-
* <tt>gem</tt> (a file list is pulled from the git repository, no more
|
19
|
-
missing files in gems
|
31
|
+
* <tt>gem</tt> (a file list is pulled from the git repository, <b>no more
|
32
|
+
missing files in gems!</b>), <tt>doc</tt>, <tt>test</tt> targets;
|
20
33
|
|
21
|
-
* easy to use
|
34
|
+
* easy to use configuration parser/loader. This includes scanning for:
|
22
35
|
|
23
36
|
* env variable(s);
|
24
37
|
* the flat YAML configuration file;
|
@@ -26,10 +39,11 @@ The falsework utility generates a scaffold which have:
|
|
26
39
|
|
27
40
|
* an ability to pick up a user name & an email for a github project.
|
28
41
|
|
29
|
-
|
42
|
+
Version & name of your project can be located at generated
|
43
|
+
<tt>myproject/lib/myproject/meta.rb</tt> file.
|
44
|
+
|
30
45
|
|
31
|
-
|
32
|
-
<i>after</i> the project generation.
|
46
|
+
==Options
|
33
47
|
|
34
48
|
The commands:
|
35
49
|
|
@@ -37,21 +51,29 @@ list:: Do nothing except listing all available
|
|
37
51
|
templates. You can add your own templates in
|
38
52
|
<tt>~/.falsework/templates</tt> directory.
|
39
53
|
|
54
|
+
listdirs:: Do nothing except listing all available
|
55
|
+
templates directories. You can add another
|
56
|
+
directory, modifying <tt>tdir</tt> option in
|
57
|
+
the config file. (<tt>tdir</tt> is an array).
|
58
|
+
|
40
59
|
new NAME:: Create a new project. It creates a directory
|
41
60
|
<i>NAME</i> and populates it with files.
|
42
61
|
|
43
62
|
The following commands works only from the root project directory:
|
44
63
|
|
45
64
|
exe NAME:: Add a new executable to an existing
|
46
|
-
project and a corresponding
|
47
|
-
|
65
|
+
project and a corresponding doc in
|
66
|
+
<tt>doc</tt> sub-directory.
|
48
67
|
|
49
|
-
|
68
|
+
doc NAME:: Add a new doc file in
|
69
|
+
<tt>doc</tt> sub-directory.
|
70
|
+
|
71
|
+
test NAME:: Add a new test in
|
72
|
+
<tt>test</tt> sub-directory.
|
50
73
|
|
51
74
|
upgrade:: 'Inject' or upgrade some vital files from the
|
52
|
-
|
53
|
-
|
54
|
-
from version 0.2.2 and (hopefully) above.)
|
75
|
+
template into the project. Currently only
|
76
|
+
'ruby-naive' template supports this.
|
55
77
|
|
56
78
|
The options are as follows:
|
57
79
|
|
@@ -59,6 +81,9 @@ The options are as follows:
|
|
59
81
|
|
60
82
|
-b:: A batch mode. (No questions asked.)
|
61
83
|
|
84
|
+
--no-git:: Don't create a Git repository. Don't use
|
85
|
+
this for 'ruby-naive' template.
|
86
|
+
|
62
87
|
--config-dirs:: List all possible locations for the
|
63
88
|
configuration file. The first found wins.
|
64
89
|
|
@@ -72,11 +97,6 @@ The options are as follows:
|
|
72
97
|
times, viz. <tt>-vv</tt> dumps even more
|
73
98
|
debug info.
|
74
99
|
|
75
|
-
==Meta
|
76
|
-
|
77
|
-
Version & name of your project can be located at generated
|
78
|
-
<tt>myproject/lib/myproject/meta.rb</tt> file.
|
79
|
-
|
80
100
|
|
81
101
|
==Examples
|
82
102
|
|
@@ -98,13 +118,17 @@ Add another test file:
|
|
98
118
|
|
99
119
|
(It will appear in <tt>test/</tt> sub-directory.)
|
100
120
|
|
121
|
+
Create a project from another template:
|
122
|
+
|
123
|
+
% falsework -t c-glib -v new foo-bar
|
124
|
+
|
101
125
|
|
102
126
|
==Bugs
|
103
127
|
|
104
128
|
While falsework supports symlinks in templates, rubygems replaces
|
105
129
|
symlinks with its corresponding source files. That is why you'll get 2
|
106
130
|
<tt>README.rdoc</tt> files in generated project when it was intended to
|
107
|
-
have 1 in <tt>doc</tt>
|
131
|
+
have 1 in <tt>doc</tt> sub-directory and the symlink to it in the root
|
108
132
|
project directory.
|
109
133
|
|
110
134
|
If you think that this is pathetic, then just grab the source of
|