bones 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 2.3.0 / 2009-01-25
2
+
3
+ * 1 minor enhancement
4
+ - removed the need for a Manifest.txt file
5
+
1
6
  == 2.2.0 / 2009-01-01
2
7
 
3
8
  * 4 minor enhancements
@@ -10,33 +10,6 @@ ease the management and deployment of your source code. Mr Bones is not
10
10
  viral -- all the code your project needs is included in the skeleton (no
11
11
  gem dependency required).
12
12
 
13
- == VERSION 2.1.0 CHANGES:
14
-
15
- With my Mr Bones projects, I found myself constantly updating the tasks as new
16
- versions of Mr Bones were released. This quickly became annoying. Why not use
17
- the tasks from the Mr Bones gem and only copy those tasks to my own projects
18
- when they are packaged and released? That is the goal of this release of Mr
19
- Bones.
20
-
21
- Version 2.1.0 of Mr Bones allows your projects to use the rake tasks found
22
- in the Mr Bones gem but still remain independent from Mr Bones when
23
- deployed. This is accomplished by copying the rake tasks into your project
24
- only when it is packaged into a gem (or zip file or tarball).
25
-
26
- You still have the option of copy the tasks to your local project when it is
27
- created. Or you can add tasks to your project at a later time.
28
-
29
- So, if you have an exsiting project and you want to use the Mr Bones tasks,
30
- simply delete your "tasks" folder and put the following at the top of your
31
- Rakefile:
32
-
33
- begin
34
- require 'bones'
35
- Bones.setup
36
- rescue LoadError
37
- load 'tasks/setup.rb' # this line should already be there
38
- end
39
-
40
13
  == FEATURES:
41
14
 
42
15
  Mr Bones provides the following rake tasks:
@@ -64,9 +37,6 @@ Mr Bones provides the following rake tasks:
64
37
  gem:uninstall # Uninstall the gem
65
38
  git:create_tag # Create a new tag in the Git repository
66
39
  git:show_tags # Show tags from the Git repository
67
- manifest # Alias to manifest:check
68
- manifest:check # Verify the manifest
69
- manifest:create # Create a new manifest
70
40
  notes # Enumerate all annotations
71
41
  notes:fixme # Enumerate all FIXME annotations
72
42
  notes:optimize # Enumerate all OPTIMIZE annotations
@@ -76,6 +46,8 @@ Mr Bones provides the following rake tasks:
76
46
  spec:run # Run all specs with basic output
77
47
  spec:specdoc # Run all specs with text output
78
48
  spec:verify # Verify that rcov coverage is at least 90.0%
49
+ svn:create_tag # Create a new tag in the SVN repository
50
+ svn:show_tags # Show tags from the SVN repository
79
51
  test # Alias to test:run
80
52
  test:rcov # Run rcov on the unit tests
81
53
  test:run # Run tests for run
@@ -368,3 +340,31 @@ names on the left and new names on the right).
368
340
  ann_email => ann.email
369
341
 
370
342
  And of course, each name should be prepended with PROJ in your Rakefile.
343
+
344
+ == VERSION 2.1.0 CHANGES:
345
+
346
+ With my Mr Bones projects, I found myself constantly updating the tasks as new
347
+ versions of Mr Bones were released. This quickly became annoying. Why not use
348
+ the tasks from the Mr Bones gem and only copy those tasks to my own projects
349
+ when they are packaged and released? That is the goal of this release of Mr
350
+ Bones.
351
+
352
+ Version 2.1.0 of Mr Bones allows your projects to use the rake tasks found
353
+ in the Mr Bones gem but still remain independent from Mr Bones when
354
+ deployed. This is accomplished by copying the rake tasks into your project
355
+ only when it is packaged into a gem (or zip file or tarball).
356
+
357
+ You still have the option of copy the tasks to your local project when it is
358
+ created. Or you can add tasks to your project at a later time.
359
+
360
+ So, if you have an exsiting project and you want to use the Mr Bones tasks,
361
+ simply delete your "tasks" folder and put the following at the top of your
362
+ Rakefile:
363
+
364
+ begin
365
+ require 'bones'
366
+ Bones.setup
367
+ rescue LoadError
368
+ load 'tasks/setup.rb' # this line should already be there
369
+ end
370
+
data/Rakefile CHANGED
@@ -9,9 +9,11 @@ PROJ.authors = 'Tim Pease'
9
9
  PROJ.email = 'tim.pease@gmail.com'
10
10
  PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
11
11
  PROJ.version = Bones::VERSION
12
- PROJ.release_name = 'Distal Phalanges'
12
+ PROJ.release_name = 'Calcaneus'
13
13
  PROJ.ruby_opts = %w[-W0]
14
14
  PROJ.readme_file = 'README.rdoc'
15
+ PROJ.ignore_file = '.gitignore'
16
+ PROJ.exclude << 'bones.gemspec'
15
17
 
16
18
  PROJ.rubyforge.name = 'codeforpeople'
17
19
 
@@ -35,7 +37,7 @@ PROJ.ann.paragraphs = %w[install synopsis features requirements]
35
37
  PROJ.ann.text = <<-ANN
36
38
  == FUN FACT
37
39
 
38
- "Tom Sawyer" was the first novel written on a typewriter.
40
+ Twenty-five percent of a human's bones are in its feet.
39
41
 
40
42
  == POST SCRIPT
41
43
 
@@ -46,7 +48,6 @@ TwP
46
48
  ANN
47
49
 
48
50
  task :default => 'spec:specdoc'
49
- task 'gem:package' => 'manifest:assert'
50
51
  task 'ann:prereqs' do
51
52
  PROJ.name = 'Mr Bones'
52
53
  end
@@ -0,0 +1,12 @@
1
+ # The list of files that should be ignored by Mr Bones.
2
+ # Lines that start with '#' are comments.
3
+ #
4
+ # A .gitignore file can be used instead by setting it as the ignore
5
+ # file in your Rakefile:
6
+ #
7
+ # PROJ.ignore_file = '.gitignore'
8
+ #
9
+ # For a project with a C extension, the following would be a good set of
10
+ # exclude patterns (uncomment them if you want to use them):
11
+ # *.[oa]
12
+ # *~
@@ -2,7 +2,7 @@
2
2
  module Bones
3
3
 
4
4
  # :stopdoc:
5
- VERSION = '2.2.0'
5
+ VERSION = '2.3.0'
6
6
  PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))
7
7
  WIN32 = %r/win32/ =~ RUBY_PLATFORM
8
8
  DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
@@ -51,9 +51,8 @@ class AnnotationExtractor
51
51
  end
52
52
  end
53
53
 
54
- # Iterate over all the files in the project manifest and extract
55
- # annotations from the those files. Returns the results as a hash for
56
- # display.
54
+ # Iterate over all the files in the project and extract annotations from
55
+ # the those files. Returns the results as a hash for display.
57
56
  #
58
57
  def find
59
58
  results = {}
@@ -29,7 +29,6 @@ class CreateCommand < Command
29
29
  if test(?f, File.join(output_dir, 'Rakefile'))
30
30
  begin
31
31
  FileUtils.cd output_dir
32
- system "rake manifest:create 2>&1 > #{::Bones::DEV_NULL}"
33
32
  @out.puts "Now you need to fix these files"
34
33
  system "rake notes"
35
34
  ensure
@@ -141,7 +141,7 @@ class FileManager
141
141
  rgxp = %r/\A#{source}\/?/
142
142
  exclude = %r/tmp$|bak$|~$|CVS|\.svn/
143
143
 
144
- ary = Dir.glob(File.join(source, '**', '*')).map do |filename|
144
+ ary = Dir.glob(File.join(source, '**', '*.*'), File::FNM_DOTMATCH).map do |filename|
145
145
  next if exclude =~ filename
146
146
  next if test(?d, filename)
147
147
  filename.sub rgxp, ''
@@ -2,8 +2,8 @@
2
2
  # This file does not define any rake tasks. It is used to load some project
3
3
  # settings if they are not defined by the user.
4
4
 
5
- PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
6
5
  PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
6
+ "^#{Regexp.escape(PROJ.ignore_file)}$",
7
7
  "^#{Regexp.escape(PROJ.rdoc.dir)}/",
8
8
  "^#{Regexp.escape(PROJ.rcov.dir)}/"]
9
9
 
@@ -25,12 +25,7 @@ PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
25
25
 
26
26
  PROJ.summary ||= PROJ.description.split('.').first
27
27
 
28
- PROJ.gem.files ||=
29
- if test(?f, PROJ.manifest_file)
30
- files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
31
- files.delete ''
32
- files
33
- else [] end
28
+ PROJ.gem.files ||= manifest
34
29
 
35
30
  PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
36
31
 
@@ -4,6 +4,7 @@ require 'rake'
4
4
  require 'rake/clean'
5
5
  require 'fileutils'
6
6
  require 'ostruct'
7
+ require 'find'
7
8
 
8
9
  class OpenStruct; undef :gem; end
9
10
 
@@ -27,8 +28,8 @@ PROJ = OpenStruct.new(
27
28
  :ruby_opts => %w(-w),
28
29
  :libs => [],
29
30
  :history_file => 'History.txt',
30
- :manifest_file => 'Manifest.txt',
31
31
  :readme_file => 'README.txt',
32
+ :ignore_file => '.bnsignore',
32
33
 
33
34
  # Announce
34
35
  :ann => OpenStruct.new(
@@ -254,9 +255,25 @@ end
254
255
  # Scans the current working directory and creates a list of files that are
255
256
  # candidates to be in the manifest.
256
257
  #
257
- def manifest_files
258
+ def manifest
258
259
  files = []
259
- exclude = Regexp.new(PROJ.exclude.join('|'))
260
+ exclude = PROJ.exclude.dup
261
+ comment = %r/^\s*#/
262
+
263
+ # process the ignore file and add the items there to the exclude list
264
+ if test(?f, PROJ.ignore_file)
265
+ ary = File.readlines(PROJ.ignore_file).map do |line|
266
+ next if line =~ comment
267
+ line.chomp.strip
268
+ end
269
+ ary.compact!
270
+ ary.delete ''
271
+ exclude.concat ary
272
+ end
273
+
274
+ # generate a regular expression from the exclude list
275
+ exclude = Regexp.new(exclude.join('|'))
276
+
260
277
  Find.find '.' do |path|
261
278
  path.sub! %r/^(\.\/|\/)/o, ''
262
279
  next unless test ?f, path
@@ -42,8 +42,8 @@ describe Bones::App::FileManager do
42
42
  ary.length.should == 9
43
43
 
44
44
  ary.should == %w[
45
+ .bnsignore
45
46
  History.txt.bns
46
- Manifest.txt
47
47
  README.txt.bns
48
48
  Rakefile.bns
49
49
  bin/NAME.bns
@@ -2,8 +2,8 @@
2
2
  # This file does not define any rake tasks. It is used to load some project
3
3
  # settings if they are not defined by the user.
4
4
 
5
- PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
6
5
  PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
6
+ "^#{Regexp.escape(PROJ.ignore_file)}$",
7
7
  "^#{Regexp.escape(PROJ.rdoc.dir)}/",
8
8
  "^#{Regexp.escape(PROJ.rcov.dir)}/"]
9
9
 
@@ -25,12 +25,7 @@ PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
25
25
 
26
26
  PROJ.summary ||= PROJ.description.split('.').first
27
27
 
28
- PROJ.gem.files ||=
29
- if test(?f, PROJ.manifest_file)
30
- files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
31
- files.delete ''
32
- files
33
- else [] end
28
+ PROJ.gem.files ||= manifest
34
29
 
35
30
  PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
36
31
 
@@ -4,6 +4,7 @@ require 'rake'
4
4
  require 'rake/clean'
5
5
  require 'fileutils'
6
6
  require 'ostruct'
7
+ require 'find'
7
8
 
8
9
  class OpenStruct; undef :gem; end
9
10
 
@@ -27,8 +28,8 @@ PROJ = OpenStruct.new(
27
28
  :ruby_opts => %w(-w),
28
29
  :libs => [],
29
30
  :history_file => 'History.txt',
30
- :manifest_file => 'Manifest.txt',
31
31
  :readme_file => 'README.txt',
32
+ :ignore_file => '.bnsignore',
32
33
 
33
34
  # Announce
34
35
  :ann => OpenStruct.new(
@@ -254,9 +255,25 @@ end
254
255
  # Scans the current working directory and creates a list of files that are
255
256
  # candidates to be in the manifest.
256
257
  #
257
- def manifest_files
258
+ def manifest
258
259
  files = []
259
- exclude = Regexp.new(PROJ.exclude.join('|'))
260
+ exclude = PROJ.exclude.dup
261
+ comment = %r/^\s*#/
262
+
263
+ # process the ignore file and add the items there to the exclude list
264
+ if test(?f, PROJ.ignore_file)
265
+ ary = File.readlines(PROJ.ignore_file).map do |line|
266
+ next if line =~ comment
267
+ line.chomp.strip
268
+ end
269
+ ary.compact!
270
+ ary.delete ''
271
+ exclude.concat ary
272
+ end
273
+
274
+ # generate a regular expression from the exclude list
275
+ exclude = Regexp.new(exclude.join('|'))
276
+
260
277
  Find.find '.' do |path|
261
278
  path.sub! %r/^(\.\/|\/)/o, ''
262
279
  next unless test ?f, path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bones
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-01 00:00:00 -07:00
12
+ date: 2009-01-25 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -36,7 +36,6 @@ extra_rdoc_files:
36
36
  - lib/bones/tasks/bones.rake
37
37
  - lib/bones/tasks/gem.rake
38
38
  - lib/bones/tasks/git.rake
39
- - lib/bones/tasks/manifest.rake
40
39
  - lib/bones/tasks/notes.rake
41
40
  - lib/bones/tasks/post_load.rake
42
41
  - lib/bones/tasks/rdoc.rake
@@ -47,13 +46,11 @@ extra_rdoc_files:
47
46
  - spec/data/foo/README.txt
48
47
  files:
49
48
  - History.txt
50
- - Manifest.txt
51
49
  - README.rdoc
52
50
  - Rakefile
53
51
  - bin/bones
54
- - bones.gemspec
52
+ - data/.bnsignore
55
53
  - data/History.txt.bns
56
- - data/Manifest.txt
57
54
  - data/README.txt.bns
58
55
  - data/Rakefile.bns
59
56
  - data/bin/NAME.bns
@@ -77,7 +74,6 @@ files:
77
74
  - lib/bones/tasks/bones.rake
78
75
  - lib/bones/tasks/gem.rake
79
76
  - lib/bones/tasks/git.rake
80
- - lib/bones/tasks/manifest.rake
81
77
  - lib/bones/tasks/notes.rake
82
78
  - lib/bones/tasks/post_load.rake
83
79
  - lib/bones/tasks/rdoc.rake
@@ -100,7 +96,6 @@ files:
100
96
  - tasks/bones.rake
101
97
  - tasks/gem.rake
102
98
  - tasks/git.rake
103
- - tasks/manifest.rake
104
99
  - tasks/notes.rake
105
100
  - tasks/post_load.rake
106
101
  - tasks/rdoc.rake
@@ -1,50 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.rdoc
4
- Rakefile
5
- bin/bones
6
- bones.gemspec
7
- data/History.txt.bns
8
- data/Manifest.txt
9
- data/README.txt.bns
10
- data/Rakefile.bns
11
- data/bin/NAME.bns
12
- data/lib/NAME.rb.bns
13
- data/spec/NAME_spec.rb.bns
14
- data/spec/spec_helper.rb.bns
15
- data/test/test_NAME.rb
16
- lib/bones.rb
17
- lib/bones/annotation_extractor.rb
18
- lib/bones/app.rb
19
- lib/bones/app/command.rb
20
- lib/bones/app/create_command.rb
21
- lib/bones/app/file_manager.rb
22
- lib/bones/app/freeze_command.rb
23
- lib/bones/app/info_command.rb
24
- lib/bones/app/unfreeze_command.rb
25
- lib/bones/app/update_command.rb
26
- lib/bones/debug.rb
27
- lib/bones/smtp_tls.rb
28
- lib/bones/tasks/ann.rake
29
- lib/bones/tasks/bones.rake
30
- lib/bones/tasks/gem.rake
31
- lib/bones/tasks/git.rake
32
- lib/bones/tasks/manifest.rake
33
- lib/bones/tasks/notes.rake
34
- lib/bones/tasks/post_load.rake
35
- lib/bones/tasks/rdoc.rake
36
- lib/bones/tasks/rubyforge.rake
37
- lib/bones/tasks/setup.rb
38
- lib/bones/tasks/spec.rake
39
- lib/bones/tasks/svn.rake
40
- lib/bones/tasks/test.rake
41
- spec/bones/app/file_manager_spec.rb
42
- spec/bones/app_spec.rb
43
- spec/bones_spec.rb
44
- spec/data/data/NAME/NAME.rb.bns
45
- spec/data/data/README.txt.bns
46
- spec/data/data/Rakefile.bns
47
- spec/data/data/lib/NAME.rb.bns
48
- spec/data/foo/README.txt
49
- spec/data/foo/Rakefile
50
- spec/spec_helper.rb
@@ -1,40 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{bones}
5
- s.version = "2.2.0"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Tim Pease"]
9
- s.date = %q{2009-01-01}
10
- s.default_executable = %q{bones}
11
- s.description = %q{Mr Bones is a handy tool that builds a skeleton for your new Ruby projects. The skeleton contains some starter code and a collection of rake tasks to ease the management and deployment of your source code. Mr Bones is not viral -- all the code your project needs is included in the skeleton (no gem dependency required).}
12
- s.email = %q{tim.pease@gmail.com}
13
- s.executables = ["bones"]
14
- s.extra_rdoc_files = ["History.txt", "README.rdoc", "bin/bones", "lib/bones/tasks/ann.rake", "lib/bones/tasks/bones.rake", "lib/bones/tasks/gem.rake", "lib/bones/tasks/git.rake", "lib/bones/tasks/manifest.rake", "lib/bones/tasks/notes.rake", "lib/bones/tasks/post_load.rake", "lib/bones/tasks/rdoc.rake", "lib/bones/tasks/rubyforge.rake", "lib/bones/tasks/spec.rake", "lib/bones/tasks/svn.rake", "lib/bones/tasks/test.rake", "spec/data/data/README.txt", "spec/data/foo/README.txt"]
15
- s.files = ["History.txt", "Manifest.txt", "README.rdoc", "Rakefile", "bin/bones", "data/History.txt.bns", "data/Manifest.txt", "data/README.txt.bns", "data/Rakefile.bns", "data/bin/NAME.bns", "data/lib/NAME.rb.bns", "data/spec/NAME_spec.rb.bns", "data/spec/spec_helper.rb.bns", "data/test/test_NAME.rb", "lib/bones.rb", "lib/bones/annotation_extractor.rb", "lib/bones/debug.rb", "lib/bones/main.rb", "lib/bones/smtp_tls.rb", "lib/bones/tasks/ann.rake", "lib/bones/tasks/bones.rake", "lib/bones/tasks/gem.rake", "lib/bones/tasks/git.rake", "lib/bones/tasks/manifest.rake", "lib/bones/tasks/notes.rake", "lib/bones/tasks/post_load.rake", "lib/bones/tasks/rdoc.rake", "lib/bones/tasks/rubyforge.rake", "lib/bones/tasks/setup.rb", "lib/bones/tasks/spec.rake", "lib/bones/tasks/svn.rake", "lib/bones/tasks/test.rake", "spec/bones/main_spec.rb", "spec/bones_spec.rb", "spec/data/data/README.txt", "spec/data/data/Rakefile", "spec/data/foo/README.txt", "spec/data/foo/Rakefile", "spec/spec_helper.rb"]
16
- s.has_rdoc = true
17
- s.homepage = %q{http://codeforpeople.rubyforge.org/bones}
18
- s.post_install_message = %q{--------------------------
19
- Keep rattlin' dem bones!
20
- --------------------------
21
- }
22
- s.rdoc_options = ["--main", "README.rdoc"]
23
- s.require_paths = ["lib"]
24
- s.rubyforge_project = %q{codeforpeople}
25
- s.rubygems_version = %q{1.3.1}
26
- s.summary = %q{Mr Bones is a handy tool that builds a skeleton for your new Ruby projects}
27
-
28
- if s.respond_to? :specification_version then
29
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
30
- s.specification_version = 2
31
-
32
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
33
- s.add_runtime_dependency(%q<rake>, [">= 0.8.3"])
34
- else
35
- s.add_dependency(%q<rake>, [">= 0.8.3"])
36
- end
37
- else
38
- s.add_dependency(%q<rake>, [">= 0.8.3"])
39
- end
40
- end
File without changes
@@ -1,48 +0,0 @@
1
-
2
- require 'find'
3
-
4
- namespace :manifest do
5
-
6
- desc 'Verify the manifest'
7
- task :check do
8
- fn = PROJ.manifest_file + '.tmp'
9
- files = manifest_files
10
-
11
- File.open(fn, 'w') {|fp| fp.puts files}
12
- lines = %x(#{DIFF} -du #{PROJ.manifest_file} #{fn}).split("\n")
13
- if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
14
- lines.map! do |line|
15
- case line
16
- when %r/^(-{3}|\+{3})/; nil
17
- when %r/^@/; ANSICode.blue line
18
- when %r/^\+/; ANSICode.green line
19
- when %r/^\-/; ANSICode.red line
20
- else line end
21
- end
22
- end
23
- puts lines.compact
24
- rm fn rescue nil
25
- end
26
-
27
- desc 'Create a new manifest'
28
- task :create do
29
- files = manifest_files
30
- unless test(?f, PROJ.manifest_file)
31
- files << PROJ.manifest_file
32
- files.sort!
33
- end
34
- File.open(PROJ.manifest_file, 'w') {|fp| fp.puts files}
35
- end
36
-
37
- task :assert do
38
- files = manifest_files
39
- manifest = File.read(PROJ.manifest_file).split($/)
40
- raise "ERROR: #{PROJ.manifest_file} is out of date" unless files == manifest
41
- end
42
-
43
- end # namespace :manifest
44
-
45
- desc 'Alias to manifest:check'
46
- task :manifest => 'manifest:check'
47
-
48
- # EOF
@@ -1,48 +0,0 @@
1
-
2
- require 'find'
3
-
4
- namespace :manifest do
5
-
6
- desc 'Verify the manifest'
7
- task :check do
8
- fn = PROJ.manifest_file + '.tmp'
9
- files = manifest_files
10
-
11
- File.open(fn, 'w') {|fp| fp.puts files}
12
- lines = %x(#{DIFF} -du #{PROJ.manifest_file} #{fn}).split("\n")
13
- if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
14
- lines.map! do |line|
15
- case line
16
- when %r/^(-{3}|\+{3})/; nil
17
- when %r/^@/; ANSICode.blue line
18
- when %r/^\+/; ANSICode.green line
19
- when %r/^\-/; ANSICode.red line
20
- else line end
21
- end
22
- end
23
- puts lines.compact
24
- rm fn rescue nil
25
- end
26
-
27
- desc 'Create a new manifest'
28
- task :create do
29
- files = manifest_files
30
- unless test(?f, PROJ.manifest_file)
31
- files << PROJ.manifest_file
32
- files.sort!
33
- end
34
- File.open(PROJ.manifest_file, 'w') {|fp| fp.puts files}
35
- end
36
-
37
- task :assert do
38
- files = manifest_files
39
- manifest = File.read(PROJ.manifest_file).split($/)
40
- raise "ERROR: #{PROJ.manifest_file} is out of date" unless files == manifest
41
- end
42
-
43
- end # namespace :manifest
44
-
45
- desc 'Alias to manifest:check'
46
- task :manifest => 'manifest:check'
47
-
48
- # EOF