Skip to content
Browse files

Use Bundler gem conventions.

This also removes Pry.
  • Loading branch information...
1 parent bc5c51d commit 49c8460e8ae77eacb644a5d04fa17cf86ad1ab41 @gabebw gabebw committed Nov 12, 2011
Showing with 53 additions and 149 deletions.
  1. +12 −3 .gitignore
  2. +2 −18 Gemfile
  3. +2 −45 Rakefile
  4. +2 −18 gemfiles/rails2.gemfile
  5. +2 −18 gemfiles/rails3.gemfile
  6. +2 −18 gemfiles/rails3_1.gemfile
  7. +31 −28 paperclip.gemspec
  8. +0 −1 test/helper.rb
View
15 .gitignore
@@ -1,13 +1,22 @@
*~
*.swp
+.rvmrc
+.bundle
tmp
+
test/s3.yml
+test/debug.log
+test/paperclip.db
+test/doc
+test/pkg
+test/tmp
+
public
paperclip*.gem
capybara*.html
+
*.rbc
-.bundle
+.rbx
+
*SPIKE*
-.rvmrc
*emfile.lock
-.rbx
View
20 Gemfile
@@ -1,21 +1,5 @@
source "http://rubygems.org"
-gem "activerecord", :require => "active_record"
-gem "appraisal"
-gem "aruba"
-gem "aws-s3", :require => "aws/s3"
-gem "bundler"
-gem "cocaine", "~>0.2"
-gem "fog"
-gem "jruby-openssl", :platform => :jruby
-gem "mime-types"
-gem "mocha"
-gem "rake"
-gem "rdoc", :require => false
-gem "capybara"
-gem "cucumber", "~> 1.0.0"
-gem "shoulda"
-gem "sqlite3", "~>1.3.4"
-gem "fakeweb", :require => false
+gemspec
-gem 'pry'
+gem "jruby-openssl", :platform => :jruby
View
47 Rakefile
@@ -1,14 +1,9 @@
-require 'rubygems'
-require 'bundler/setup'
+require 'bundler'
require 'appraisal'
-
-require 'rake'
require 'rake/testtask'
-require 'rdoc/task'
require 'cucumber/rake/task'
-$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
-require 'paperclip'
+Bundler::GemHelper.install_tasks
desc 'Default: run unit tests.'
task :default => [:clean, 'appraisal:install', :all]
@@ -36,20 +31,6 @@ task :shell do |t|
exec 'irb -I lib/ -I lib/paperclip -r rubygems -r active_record -r tempfile -r init'
end
-desc 'Generate documentation for the paperclip plugin.'
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = 'Paperclip'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-desc 'Update documentation on website'
-task :sync_docs => 'rdoc' do
- `rsync -ave ssh doc/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/paperclip`
-end
-
desc 'Clean up files.'
task :clean do |t|
FileUtils.rm_rf "doc"
@@ -60,27 +41,3 @@ task :clean do |t|
FileUtils.rm "test/paperclip.db" rescue nil
Dir.glob("paperclip-*.gem").each{|f| FileUtils.rm f }
end
-
-desc 'Build the gemspec.'
-task :gemspec do |t|
- exec 'gem build paperclip.gemspec'
-end
-
-desc "Print a list of the files to be put into the gem"
-task :manifest => :clean do
- spec.files.each do |file|
- puts file
- end
-end
-
-desc "Generate a gemspec file for GitHub"
-task :gemspec => :clean do
- File.open("#{spec.name}.gemspec", 'w') do |f|
- f.write spec.to_ruby
- end
-end
-
-desc "Build the gem into the current directory"
-task :gem => :gemspec do
- `gem build #{spec.name}.gemspec`
-end
View
20 gemfiles/rails2.gemfile
@@ -2,24 +2,8 @@
source "http://rubygems.org"
-gem "sqlite3", "~>1.3.4"
-gem "fakeweb", :require=>false
-gem "rails", "~> 2.3.14"
-gem "activerecord", :require=>"active_record"
-gem "pry"
-gem "cocaine", "~>0.2"
-gem "rake"
-gem "shoulda"
-gem "mime-types"
-gem "aruba"
gem "jruby-openssl", :platform=>:jruby
+gem "rails", "~> 2.3.14"
gem "paperclip", :path=>"../"
-gem "mocha"
-gem "bundler"
-gem "fog"
-gem "cucumber", "~> 1.0.0"
-gem "appraisal"
-gem "aws-s3", :require=>"aws/s3"
-gem "rdoc", :require=>false
-gem "capybara"
+gemspec :path=>"../"
View
20 gemfiles/rails3.gemfile
@@ -2,24 +2,8 @@
source "http://rubygems.org"
-gem "sqlite3", "~>1.3.4"
-gem "fakeweb", :require=>false
-gem "rails", "~> 3.0.10"
-gem "activerecord", :require=>"active_record"
-gem "pry"
-gem "cocaine", "~>0.2"
-gem "rake"
-gem "shoulda"
-gem "mime-types"
-gem "aruba"
gem "jruby-openssl", :platform=>:jruby
+gem "rails", "~> 3.0.10"
gem "paperclip", :path=>"../"
-gem "mocha"
-gem "bundler"
-gem "fog"
-gem "cucumber", "~> 1.0.0"
-gem "appraisal"
-gem "aws-s3", :require=>"aws/s3"
-gem "rdoc", :require=>false
-gem "capybara"
+gemspec :path=>"../"
View
20 gemfiles/rails3_1.gemfile
@@ -2,24 +2,8 @@
source "http://rubygems.org"
-gem "sqlite3", "~>1.3.4"
-gem "fakeweb", :require=>false
-gem "rails", "~> 3.1.0"
-gem "activerecord", :require=>"active_record"
-gem "pry"
-gem "cocaine", "~>0.2"
-gem "rake"
-gem "shoulda"
-gem "mime-types"
-gem "aruba"
gem "jruby-openssl", :platform=>:jruby
+gem "rails", "~> 3.1.0"
gem "paperclip", :path=>"../"
-gem "mocha"
-gem "bundler"
-gem "fog"
-gem "cucumber", "~> 1.0.0"
-gem "appraisal"
-gem "aws-s3", :require=>"aws/s3"
-gem "rdoc", :require=>false
-gem "capybara"
+gemspec :path=>"../"
View
59 paperclip.gemspec
@@ -1,38 +1,41 @@
-$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
+$LOAD_PATH.push File.expand_path("../lib", __FILE__)
require 'paperclip/version'
-include_files = ["README*", "LICENSE", "Rakefile", "init.rb", "{lib,tasks,test,rails,generators,shoulda_macros}/**/*"].map do |glob|
- Dir[glob]
-end.flatten
-exclude_files = ["**/*.rbc", "test/s3.yml", "test/debug.log", "test/paperclip.db", "test/doc", "test/doc/*", "test/pkg", "test/pkg/*", "test/tmp", "test/tmp/*"].map do |glob|
- Dir[glob]
-end.flatten
-
-spec = Gem::Specification.new do |s|
+Gem::Specification.new do |s|
s.name = "paperclip"
s.version = Paperclip::VERSION
+ s.platform = Gem::Platform::RUBY
s.author = "Jon Yurek"
- s.email = "jyurek@thoughtbot.com"
+ s.email = ["jyurek@thoughtbot.com"]
s.homepage = "https://github.com/thoughtbot/paperclip"
- s.description = "Easy upload management for ActiveRecord"
- s.platform = Gem::Platform::RUBY
s.summary = "File attachments as attributes for ActiveRecord"
- s.files = include_files - exclude_files
- s.require_path = "lib"
- s.test_files = Dir["test/**/test_*.rb"]
+ s.description = "Easy upload management for ActiveRecord"
+
s.rubyforge_project = "paperclip"
- s.extra_rdoc_files = Dir["README*"]
- s.rdoc_options << '--line-numbers' << '--inline-source'
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
s.requirements << "ImageMagick"
- s.add_dependency 'activerecord', '>=2.3.0'
- s.add_dependency 'activesupport', '>=2.3.2'
- s.add_dependency 'cocaine', '>=0.0.2'
- s.add_dependency 'mime-types'
- s.add_development_dependency 'shoulda'
- s.add_development_dependency 'appraisal'
- s.add_development_dependency 'mocha'
- s.add_development_dependency 'aws-s3'
- s.add_development_dependency 'sqlite3'
- s.add_development_dependency 'cucumber'
- s.add_development_dependency 'capybara'
+
+ s.add_dependency('activerecord', '>= 2.3.0')
+ s.add_dependency('activesupport', '>= 2.3.2')
+ s.add_dependency('cocaine', '>= 0.0.2')
+ s.add_dependency('mime-types')
+
+ s.add_development_dependency('shoulda')
+ s.add_development_dependency('appraisal', '~> 0.4.0')
+ s.add_development_dependency('mocha')
+ s.add_development_dependency('aws-s3')
+ s.add_development_dependency('sqlite3', '~> 1.3.4')
+ s.add_development_dependency('cucumber', '~> 1.0.0')
+ s.add_development_dependency('aruba')
+ s.add_development_dependency('capybara')
+ s.add_development_dependency('bundler')
+ s.add_development_dependency('cocaine', '~> 0.2')
+ s.add_development_dependency('fog')
+ s.add_development_dependency('rake')
+ s.add_development_dependency('fakeweb')
end
View
1 test/helper.rb
@@ -10,7 +10,6 @@
require 'active_record/version'
require 'active_support'
require 'mime/types'
-require 'pry'
require 'pathname'
puts "Testing against version #{ActiveRecord::VERSION::STRING}"

0 comments on commit 49c8460

Please sign in to comment.
Something went wrong with that request. Please try again.