Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify manifest generation code by using `git ls-files`

  • Loading branch information...
commit b9eef8961ae20a9afc75859876f50fbf082bc129 1 parent df42582
@mislav mislav authored
Showing with 6 additions and 21 deletions.
  1. +0 −6 .manifest
  2. +4 −13 Rakefile
  3. +2 −2 will_paginate.gemspec
View
6 .manifest
@@ -2,15 +2,12 @@ CHANGELOG.rdoc
LICENSE
README.rdoc
Rakefile
-examples
examples/apple-circle.gif
examples/index.haml
examples/index.html
examples/pagination.css
examples/pagination.sass
init.rb
-lib
-lib/will_paginate
lib/will_paginate.rb
lib/will_paginate/array.rb
lib/will_paginate/collection.rb
@@ -20,13 +17,11 @@ lib/will_paginate/named_scope.rb
lib/will_paginate/named_scope_patch.rb
lib/will_paginate/version.rb
lib/will_paginate/view_helpers.rb
-test
test/boot.rb
test/collection_test.rb
test/console
test/database.yml
test/finder_test.rb
-test/fixtures
test/fixtures/admin.rb
test/fixtures/developer.rb
test/fixtures/developers_projects.yml
@@ -40,7 +35,6 @@ test/fixtures/topics.yml
test/fixtures/user.rb
test/fixtures/users.yml
test/helper.rb
-test/lib
test/lib/activerecord_test_case.rb
test/lib/activerecord_test_connector.rb
test/lib/load_fixtures.rb
View
17 Rakefile
@@ -32,18 +32,9 @@ desc %{Update ".manifest" with the latest list of project filenames. Respect\
.gitignore by excluding everything that git ignores. Update `files` and\
`test_files` arrays in "*.gemspec" file if it's present.}
task :manifest do
- list = Dir['**/*'].sort
- spec_file = Dir['*.gemspec'].first
- list -= [spec_file] if spec_file
+ list = `git ls-files --full-name --exclude=*.gemspec --exclude=.*`.chomp.split("\n")
- File.read('.gitignore').each_line do |glob|
- glob = glob.chomp.sub(/^\//, '')
- list -= Dir[glob]
- list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
- puts "excluding #{glob}"
- end
-
- if spec_file
+ if spec_file = Dir['*.gemspec'].first
spec = File.read spec_file
spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
assignment = $1
@@ -51,9 +42,9 @@ task :manifest do
'%s%%w(%s)' % [assignment, bunch.join(' ')]
end
- File.open(spec_file, 'w') {|f| f << spec }
+ File.open(spec_file, 'w') { |f| f << spec }
end
- File.open('.manifest', 'w') {|f| f << list.join("\n") }
+ File.open('.manifest', 'w') { |f| f << list.join("\n") }
end
task :examples do
View
4 will_paginate.gemspec
@@ -15,6 +15,6 @@ Gem::Specification.new do |s|
s.rdoc_options << '--inline-source' << '--charset=UTF-8'
s.extra_rdoc_files = ['README.rdoc', 'LICENSE', 'CHANGELOG.rdoc']
- s.files = %w(CHANGELOG.rdoc LICENSE README.rdoc Rakefile examples examples/apple-circle.gif examples/index.haml examples/index.html examples/pagination.css examples/pagination.sass init.rb lib lib/will_paginate lib/will_paginate.rb lib/will_paginate/array.rb lib/will_paginate/collection.rb lib/will_paginate/core_ext.rb lib/will_paginate/finder.rb lib/will_paginate/named_scope.rb lib/will_paginate/named_scope_patch.rb lib/will_paginate/version.rb lib/will_paginate/view_helpers.rb test test/boot.rb test/collection_test.rb test/console test/database.yml test/finder_test.rb test/fixtures test/fixtures/admin.rb test/fixtures/developer.rb test/fixtures/developers_projects.yml test/fixtures/project.rb test/fixtures/projects.yml test/fixtures/replies.yml test/fixtures/reply.rb test/fixtures/schema.rb test/fixtures/topic.rb test/fixtures/topics.yml test/fixtures/user.rb test/fixtures/users.yml test/helper.rb test/lib test/lib/activerecord_test_case.rb test/lib/activerecord_test_connector.rb test/lib/load_fixtures.rb test/lib/view_test_process.rb test/tasks.rake test/view_test.rb)
- s.test_files = %w(test/boot.rb test/collection_test.rb test/console test/database.yml test/finder_test.rb test/fixtures test/fixtures/admin.rb test/fixtures/developer.rb test/fixtures/developers_projects.yml test/fixtures/project.rb test/fixtures/projects.yml test/fixtures/replies.yml test/fixtures/reply.rb test/fixtures/schema.rb test/fixtures/topic.rb test/fixtures/topics.yml test/fixtures/user.rb test/fixtures/users.yml test/helper.rb test/lib test/lib/activerecord_test_case.rb test/lib/activerecord_test_connector.rb test/lib/load_fixtures.rb test/lib/view_test_process.rb test/tasks.rake test/view_test.rb)
+ s.files = %w(CHANGELOG.rdoc LICENSE README.rdoc Rakefile examples/apple-circle.gif examples/index.haml examples/index.html examples/pagination.css examples/pagination.sass init.rb lib/will_paginate.rb lib/will_paginate/array.rb lib/will_paginate/collection.rb lib/will_paginate/core_ext.rb lib/will_paginate/finder.rb lib/will_paginate/named_scope.rb lib/will_paginate/named_scope_patch.rb lib/will_paginate/version.rb lib/will_paginate/view_helpers.rb test/boot.rb test/collection_test.rb test/console test/database.yml test/finder_test.rb test/fixtures/admin.rb test/fixtures/developer.rb test/fixtures/developers_projects.yml test/fixtures/project.rb test/fixtures/projects.yml test/fixtures/replies.yml test/fixtures/reply.rb test/fixtures/schema.rb test/fixtures/topic.rb test/fixtures/topics.yml test/fixtures/user.rb test/fixtures/users.yml test/helper.rb test/lib/activerecord_test_case.rb test/lib/activerecord_test_connector.rb test/lib/load_fixtures.rb test/lib/view_test_process.rb test/tasks.rake test/view_test.rb)
+ s.test_files = %w(test/boot.rb test/collection_test.rb test/console test/database.yml test/finder_test.rb test/fixtures/admin.rb test/fixtures/developer.rb test/fixtures/developers_projects.yml test/fixtures/project.rb test/fixtures/projects.yml test/fixtures/replies.yml test/fixtures/reply.rb test/fixtures/schema.rb test/fixtures/topic.rb test/fixtures/topics.yml test/fixtures/user.rb test/fixtures/users.yml test/helper.rb test/lib/activerecord_test_case.rb test/lib/activerecord_test_connector.rb test/lib/load_fixtures.rb test/lib/view_test_process.rb test/tasks.rake test/view_test.rb)
end
Please sign in to comment.
Something went wrong with that request. Please try again.