falsework 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +7 -5
- data/doc/NEWS.rdoc +6 -0
- data/lib/falsework/meta.rb +1 -1
- data/lib/falsework/templates/naive/Gemfile.erb +1 -1
- data/lib/falsework/templates/naive/Rakefile.erb +10 -9
- data/lib/falsework/templates/naive/lib/%%@project%%/trestle.rb.erb +4 -4
- data/lib/falsework/templates/naive/test/helper_trestle.rb.erb +6 -9
- data/lib/falsework/templates/naive/test/rake_git.rb.erb +1 -1
- data/lib/falsework/templates/naive/test/test_%%@project%%.rb.erb +1 -2
- data/lib/falsework/trestle.rb +3 -3
- data/test/helper_trestle.rb +5 -8
- data/test/test_exe.rb +11 -11
- metadata +3 -3
data/Rakefile
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# -*-ruby-*-
|
2
2
|
|
3
3
|
require 'rake'
|
4
|
-
require 'rake/gempackagetask'
|
5
4
|
require 'rake/clean'
|
6
|
-
require 'rake/rdoctask'
|
7
5
|
require 'rake/testtask'
|
6
|
+
require 'rubygems/package_task'
|
7
|
+
|
8
|
+
gem 'rdoc'
|
9
|
+
require 'rdoc/task'
|
8
10
|
|
9
11
|
require_relative 'lib/falsework/meta'
|
10
12
|
include Falsework
|
@@ -55,14 +57,14 @@ spec = Gem::Specification.new {|i|
|
|
55
57
|
i.extra_rdoc_files = FileList['doc/*']
|
56
58
|
|
57
59
|
i.add_dependency('git', '>= 1.2.5')
|
58
|
-
i.add_dependency('open4', '>= 1.0
|
60
|
+
i.add_dependency('open4', '>= 1.1.0')
|
59
61
|
}
|
60
62
|
|
61
|
-
|
63
|
+
Gem::PackageTask.new(spec).define
|
62
64
|
|
63
65
|
task default: [:naive, :repackage]
|
64
66
|
|
65
|
-
|
67
|
+
RDoc::Task.new('html') do |i|
|
66
68
|
i.main = 'doc/README.rdoc'
|
67
69
|
i.rdoc_files = FileList['doc/*', 'lib/**/*.rb']
|
68
70
|
i.rdoc_files.exclude("lib/**/templates")
|
data/doc/NEWS.rdoc
CHANGED
data/lib/falsework/meta.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# -*-ruby-*-
|
2
2
|
|
3
3
|
require 'rake'
|
4
|
-
require 'rake/gempackagetask'
|
5
4
|
require 'rake/clean'
|
6
|
-
require 'rake/rdoctask'
|
7
5
|
require 'rake/testtask'
|
6
|
+
require 'rubygems/package_task'
|
7
|
+
|
8
|
+
gem 'rdoc'
|
9
|
+
require 'rdoc/task'
|
8
10
|
|
9
11
|
require_relative 'lib/<%= @project %>/meta'
|
10
12
|
include <%= @project.capitalize %>
|
@@ -31,21 +33,20 @@ spec = Gem::Specification.new {|i|
|
|
31
33
|
i.rdoc_options << '-m' << 'doc/README.rdoc'
|
32
34
|
i.extra_rdoc_files = FileList['doc/*']
|
33
35
|
|
34
|
-
i.add_dependency('open4', '>= 1.0
|
36
|
+
i.add_dependency('open4', '>= 1.1.0')
|
35
37
|
i.add_development_dependency('git', '>= 1.2.5')
|
36
38
|
}
|
37
39
|
|
38
|
-
|
40
|
+
Gem::PackageTask.new(spec).define
|
39
41
|
|
40
42
|
task default: [:repackage]
|
41
43
|
|
42
|
-
|
44
|
+
RDoc::Task.new('html') do |i|
|
43
45
|
i.main = 'doc/README.rdoc'
|
44
46
|
i.rdoc_files = FileList['doc/*', 'lib/**/*.rb']
|
45
47
|
# i.rdoc_files.exclude("lib/**/some-nasty-staff")
|
46
|
-
|
48
|
+
end
|
47
49
|
|
48
|
-
Rake::TestTask.new
|
50
|
+
Rake::TestTask.new do |i|
|
49
51
|
i.test_files = FileList['test/test_*.rb']
|
50
|
-
|
51
|
-
}
|
52
|
+
end
|
@@ -89,7 +89,7 @@ module <%= @project.capitalize %>
|
|
89
89
|
end
|
90
90
|
|
91
91
|
if @conf[:verbose] >= level
|
92
|
-
nnl ? print(t) :
|
92
|
+
nnl ? print(t) : print("#{t}\n")
|
93
93
|
STDOUT.flush
|
94
94
|
end
|
95
95
|
end
|
@@ -188,10 +188,10 @@ module <%= @project.capitalize %>
|
|
188
188
|
puts Meta::VERSION
|
189
189
|
exit 0
|
190
190
|
}
|
191
|
-
o.on('--config NAME', "Set a config name (default is #{@conf[:config]})") {|i|
|
191
|
+
o.on('--config NAME', "Set a config name (default is #{@conf[:config]}).") {|i|
|
192
192
|
@conf[:config] = i
|
193
193
|
}
|
194
|
-
o.on('--config-dirs', 'Show possible config locations') {
|
194
|
+
o.on('--config-dirs', 'Show possible config locations.') {
|
195
195
|
@conf[:config_dirs].each { |j|
|
196
196
|
f = j + '/' + @conf[:config]
|
197
197
|
puts (File.readable?(f) ? '* ' : ' ') + f
|
@@ -213,4 +213,4 @@ module <%= @project.capitalize %>
|
|
213
213
|
end # trestle
|
214
214
|
end
|
215
215
|
|
216
|
-
# Don't remove this: falsework/0.2.
|
216
|
+
# Don't remove this: falsework/0.2.6/naive/2011-04-30T02:11:00+03:00
|
@@ -7,23 +7,20 @@ include FileUtils
|
|
7
7
|
require_relative '../lib/<%= @project %>/trestle'
|
8
8
|
include <%= @project.capitalize %>
|
9
9
|
|
10
|
-
|
11
|
-
if $0 =~ /gem/
|
12
|
-
require 'minitest/unit'
|
13
|
-
else
|
14
|
-
require 'minitest/autorun'
|
15
|
-
end
|
10
|
+
require 'minitest/autorun'
|
16
11
|
|
17
|
-
# Return
|
12
|
+
# Return an absolute path of a _c_.
|
18
13
|
def cmd(c)
|
19
14
|
case File.basename(Dir.pwd)
|
20
15
|
when Meta::NAME.downcase
|
21
16
|
# test probably is executed from the Rakefile
|
22
17
|
Dir.chdir('test')
|
18
|
+
STDERR.puts('*** chdir to ' + Dir.pwd)
|
23
19
|
when 'test'
|
24
20
|
# we are in the test directory, there is nothing special to do
|
25
21
|
else
|
26
22
|
# tests were invoked by 'gem check -t <%= @project %>'
|
23
|
+
# (for a classic rubygems 1.3.7)
|
27
24
|
begin
|
28
25
|
Dir.chdir(Trestle.gem_libdir + '/../../test')
|
29
26
|
rescue
|
@@ -31,7 +28,7 @@ def cmd(c)
|
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|
34
|
-
'../bin/' + c
|
31
|
+
File.absolute_path('../bin/' + c)
|
35
32
|
end
|
36
33
|
|
37
|
-
# Don't remove this: falsework/0.2.
|
34
|
+
# Don't remove this: falsework/0.2.6/naive/2011-04-30T02:11:00+03:00
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require_relative 'helper'
|
2
2
|
|
3
3
|
class Test<%= @project.capitalize %>_<%= rand 2**32 %> < MiniTest::Unit::TestCase
|
4
|
-
CMD = cmd('<%= @project %>') # get path to the exe & cd to tests directory
|
5
|
-
|
6
4
|
def setup
|
7
5
|
# this runs every time before test_*
|
6
|
+
@cmd = cmd('<%= @project %>') # get path to the exe & cd to tests directory
|
8
7
|
end
|
9
8
|
|
10
9
|
def test_foobar
|
data/lib/falsework/trestle.rb
CHANGED
@@ -89,7 +89,7 @@ module Falsework
|
|
89
89
|
end
|
90
90
|
|
91
91
|
if @conf[:verbose] >= level
|
92
|
-
nnl ? print(t) :
|
92
|
+
nnl ? print(t) : print("#{t}\n")
|
93
93
|
STDOUT.flush
|
94
94
|
end
|
95
95
|
end
|
@@ -188,10 +188,10 @@ module Falsework
|
|
188
188
|
puts Meta::VERSION
|
189
189
|
exit 0
|
190
190
|
}
|
191
|
-
o.on('--config NAME', "Set a config name (default is #{@conf[:config]})") {|i|
|
191
|
+
o.on('--config NAME', "Set a config name (default is #{@conf[:config]}).") {|i|
|
192
192
|
@conf[:config] = i
|
193
193
|
}
|
194
|
-
o.on('--config-dirs', 'Show possible config locations') {
|
194
|
+
o.on('--config-dirs', 'Show possible config locations.') {
|
195
195
|
@conf[:config_dirs].each { |j|
|
196
196
|
f = j + '/' + @conf[:config]
|
197
197
|
puts (File.readable?(f) ? '* ' : ' ') + f
|
data/test/helper_trestle.rb
CHANGED
@@ -7,23 +7,20 @@ include FileUtils
|
|
7
7
|
require_relative '../lib/falsework/trestle'
|
8
8
|
include Falsework
|
9
9
|
|
10
|
-
|
11
|
-
if $0 =~ /gem/
|
12
|
-
require 'minitest/unit'
|
13
|
-
else
|
14
|
-
require 'minitest/autorun'
|
15
|
-
end
|
10
|
+
require 'minitest/autorun'
|
16
11
|
|
17
|
-
# Return
|
12
|
+
# Return an absolute path of a _c_.
|
18
13
|
def cmd(c)
|
19
14
|
case File.basename(Dir.pwd)
|
20
15
|
when Meta::NAME.downcase
|
21
16
|
# test probably is executed from the Rakefile
|
22
17
|
Dir.chdir('test')
|
18
|
+
STDERR.puts('*** chdir to ' + Dir.pwd)
|
23
19
|
when 'test'
|
24
20
|
# we are in the test directory, there is nothing special to do
|
25
21
|
else
|
26
22
|
# tests were invoked by 'gem check -t falsework'
|
23
|
+
# (for a classic rubygems 1.3.7)
|
27
24
|
begin
|
28
25
|
Dir.chdir(Trestle.gem_libdir + '/../../test')
|
29
26
|
rescue
|
@@ -31,5 +28,5 @@ def cmd(c)
|
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|
34
|
-
'../bin/' + c
|
31
|
+
File.absolute_path('../bin/' + c)
|
35
32
|
end
|
data/test/test_exe.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
require_relative 'helper'
|
2
2
|
|
3
3
|
class TestFalsework < MiniTest::Unit::TestCase
|
4
|
-
CMD = cmd('falsework') # get path to the exe & cd to tests directory
|
5
|
-
|
6
4
|
def setup
|
7
5
|
# this runs every time before test_*
|
6
|
+
@cmd = cmd('falsework') # get path to the exe & cd to tests directory
|
8
7
|
end
|
9
8
|
|
10
9
|
def test_project_list
|
11
|
-
r = Trestle.cmd_run "#{
|
10
|
+
r = Trestle.cmd_run "#{@cmd} list"
|
12
11
|
assert_equal(0, r[0])
|
13
12
|
assert_match(/naive\n/, r[2])
|
14
13
|
end
|
@@ -21,7 +20,7 @@ class TestFalsework < MiniTest::Unit::TestCase
|
|
21
20
|
|
22
21
|
def test_project_new
|
23
22
|
rm_rf 'templates/foo'
|
24
|
-
r = Trestle.cmd_run "#{
|
23
|
+
r = Trestle.cmd_run "#{@cmd} new templates/foo -v"
|
25
24
|
# pp r
|
26
25
|
assert_equal(0, r[0], r)
|
27
26
|
|
@@ -32,6 +31,7 @@ class TestFalsework < MiniTest::Unit::TestCase
|
|
32
31
|
|
33
32
|
tree = ["templates/foo/.git",
|
34
33
|
"templates/foo/.gitignore",
|
34
|
+
"templates/foo/Gemfile",
|
35
35
|
"templates/foo/README.rdoc",
|
36
36
|
"templates/foo/Rakefile",
|
37
37
|
"templates/foo/bin",
|
@@ -61,35 +61,35 @@ class TestFalsework < MiniTest::Unit::TestCase
|
|
61
61
|
origdir = pwd
|
62
62
|
cd 'templates/foo'
|
63
63
|
|
64
|
-
r = Trestle.cmd_run "
|
64
|
+
r = Trestle.cmd_run "#{@cmd} exe qqq"
|
65
65
|
assert_equal(0, r[0])
|
66
66
|
assert_equal(true, File.executable?('bin/qqq'))
|
67
67
|
assert_equal(true, File.exist?('doc/qqq.rdoc'))
|
68
68
|
|
69
|
-
r = Trestle.cmd_run "
|
69
|
+
r = Trestle.cmd_run "#{@cmd} test qqq"
|
70
70
|
assert_equal(0, r[0])
|
71
71
|
assert_equal(true, File.exist?('test/test_qqq.rb'))
|
72
72
|
|
73
73
|
# upgrade
|
74
|
-
r = Trestle.cmd_run "
|
74
|
+
r = Trestle.cmd_run "#{@cmd} upgrade -b"
|
75
75
|
assert_equal(0, r[0])
|
76
76
|
rm ['test/helper_trestle.rb', 'test/rake_git.rb']
|
77
|
-
r = Trestle.cmd_run "
|
77
|
+
r = Trestle.cmd_run "#{@cmd} upgrade -b"
|
78
78
|
assert_equal(0, r[0])
|
79
79
|
sed 'test/helper_trestle.rb',
|
80
80
|
/^(# Don't.+falsework\/)\d+\.\d+\.\d+(\/.+)$/, '\1999.999.999\2'
|
81
|
-
r = Trestle.cmd_run "
|
81
|
+
r = Trestle.cmd_run "#{@cmd} upgrade -b"
|
82
82
|
assert_equal(1, r[0])
|
83
83
|
assert_match(/file .+ is from .+ falsework: 999.999.999/, r[1])
|
84
84
|
mv('test', 'ttt')
|
85
|
-
r = Trestle.cmd_run "
|
85
|
+
r = Trestle.cmd_run "#{@cmd} upgrade -b"
|
86
86
|
assert_equal(0, r[0])
|
87
87
|
|
88
88
|
cd origdir
|
89
89
|
end
|
90
90
|
|
91
91
|
def test_project_invalid_name
|
92
|
-
r = Trestle.cmd_run "#{
|
92
|
+
r = Trestle.cmd_run "#{@cmd} new 123"
|
93
93
|
assert_equal(1, r[0])
|
94
94
|
assert_match(/project name cannot start with a digit/, r[1])
|
95
95
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: falsework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alexander Gromnitsky
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 1.0
|
34
|
+
version: 1.1.0
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id002
|
37
37
|
description: A primitive scaffold generator for writing CLI programs in Ruby.
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
requirements: []
|
104
104
|
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 1.8.
|
106
|
+
rubygems_version: 1.8.5
|
107
107
|
signing_key:
|
108
108
|
specification_version: 3
|
109
109
|
summary: A primitive scaffold generator for writing CLI programs in Ruby
|