Permalink
Browse files

Restructured project for rspec usage and jeweler-based releasing.

  • Loading branch information...
1 parent 93252a8 commit 6cef55d6d457eff161fca82dfcc7ba3d8fc33ea1 @btelles committed Jul 30, 2009
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Bernie Telles
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,29 +0,0 @@
-History.txt
-License.txt
-Manifest.txt
-README.txt
-Rakefile
-config/hoe.rb
-config/requirements.rb
-faker.tmproj
-lib/extensions/array.rb
-lib/extensions/object.rb
-lib/faker.rb
-lib/faker/address.rb
-lib/faker/company.rb
-lib/faker/internet.rb
-lib/faker/lorem.rb
-lib/faker/name.rb
-lib/faker/phone_number.rb
-lib/faker/version.rb
-script/destroy
-script/generate
-script/txt2html
-setup.rb
-tasks/deployment.rake
-tasks/environment.rake
-tasks/website.rake
-test/test_faker.rb
-test/test_faker_internet.rb
-test/test_faker_name.rb
-test/test_helper.rb
View
@@ -0,0 +1,26 @@
+= faker
+
+A fork of Benjamin Curtis' Faker gem (http://faker.rubyforge.org/) with a few more US-specific methods.
+
+
+This was originally a port of Perl's Data::Faker library that generates fake data.
+
+== Usage
+* Faker::Name.name => "Christophe Bartell"
+
+* Faker::Internet.email => "kirsten.greenholt@corkeryfisher.info"
+
+== Note on Patches/Pull Requests
+
+* Fork the project.
+* Make your feature addition or bug fix.
+* Add tests for it. This is important so I don't break it in a
+ future version unintentionally.
+* Commit, do not mess with rakefile, version, or history.
+ (if you want to have your own version, that is fine but
+ bump version in a commit by itself I can ignore when I pull)
+* Send me a pull request. Bonus points for topic branches.
+
+== Copyright
+
+Copyright (c) 2009 Bernie Telles. See LICENSE for details.
View
@@ -1,11 +0,0 @@
-= Faker
-
-A fork of Benjamin Curtis' Faker gem (http://faker.rubyforge.org/) with a few more US address methods.
-
-
-This was originally a port of Perl's Data::Faker library that generates fake data.
-
-== Usage
-* Faker::Name.name => "Christophe Bartell"
-
-* Faker::Internet.email => "kirsten.greenholt@corkeryfisher.info"
View
@@ -1,4 +1,52 @@
-require 'config/requirements'
-require 'config/hoe' # setup Hoe + all gem configuration
-
-Dir['tasks/**/*.rake'].each { |rake| load rake }
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "faker"
+ gem.summary = "Generates fake addresses, names and such"
+ gem.description = "A fork of Benjamin Curtis' Faker gem with more us-specific options."
+ gem.email = "btelles@gmail.com"
+ gem.homepage = "http://github.com/btelles/faker"
+ gem.authors = ["Bernie Telles"]
+ gem.version = '0.4.0'
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'spec/rake/spectask'
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+
+
+
+task :default => :spec
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION.yml')
+ config = YAML.load(File.read('VERSION.yml'))
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
+ else
+ version = ""
+ end
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "faker #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
View
@@ -0,0 +1,52 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "faker"
+ gem.summary = "Generates fake addresses, names and such"
+ gem.description = "A fork of Benjamin Curtis' Faker gem with more us-specific options."
+ gem.email = "btelles@gmail.com"
+ gem.homepage = "http://github.com/btelles/faker"
+ gem.authors = ["Bernie Telles"]
+ gem.spec = '0.4.0'
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'spec/rake/spectask'
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+
+
+
+task :default => :spec
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION.yml')
+ config = YAML.load(File.read('VERSION.yml'))
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
+ else
+ version = ""
+ end
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "faker #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
View
@@ -0,0 +1 @@
+0.3.1
View
@@ -0,0 +1 @@
+0.3.1.1
View
@@ -1,71 +0,0 @@
-require 'faker/version'
-
-AUTHOR = 'Benjamin Curtis' # can also be an array of Authors
-EMAIL = "benjamin.curtis@gmail.com"
-DESCRIPTION = "A port of Perl's Data::Faker - Generates fake names, phone numbers, etc."
-GEM_NAME = 'faker' # what ppl will type to install your gem
-RUBYFORGE_PROJECT = 'faker' # The unix name for your project
-HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
-DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
-
-@config_file = "~/.rubyforge/user-config.yml"
-@config = nil
-RUBYFORGE_USERNAME = "unknown"
-def rubyforge_username
- unless @config
- begin
- @config = YAML.load(File.read(File.expand_path(@config_file)))
- rescue
- puts <<-EOS
-ERROR: No rubyforge config file found: #{@config_file}
-Run 'rubyforge setup' to prepare your env for access to Rubyforge
- - See http://newgem.rubyforge.org/rubyforge.html for more details
- EOS
- exit
- end
- end
- RUBYFORGE_USERNAME.replace @config["username"]
-end
-
-
-REV = nil
-# UNCOMMENT IF REQUIRED:
-# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
-VERS = Faker::VERSION::STRING + (REV ? ".#{REV}" : "")
-RDOC_OPTS = ['--quiet', '--title', 'faker documentation',
- "--opname", "index.html",
- "--line-numbers",
- "--main", "README",
- "--inline-source"]
-
-class Hoe
- def extra_deps
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
- @extra_deps
- end
-end
-
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-hoe = Hoe.new(GEM_NAME, VERS) do |p|
- p.author = AUTHOR
- p.description = DESCRIPTION
- p.email = EMAIL
- p.summary = DESCRIPTION
- p.url = HOMEPATH
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
- p.test_globs = ["test/**/test_*.rb"]
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
-
- # == Optional
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
-
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
-
-end
-
-CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
-PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
-hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
-hoe.rsync_args = '-av --delete --ignore-errors'
View
@@ -1,17 +0,0 @@
-require 'fileutils'
-include FileUtils
-
-require 'rubygems'
-%w[rake hoe newgem rubigen].each do |req_gem|
- begin
- require req_gem
- rescue LoadError
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
- puts "Installation: gem install #{req_gem} -y"
- exit
- end
-end
-
-$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
-
-require 'faker'
View
@@ -0,0 +1,58 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{faker}
+ s.version = "0.3.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Bernie Telles"]
+ s.date = %q{2009-07-29}
+ s.description = %q{A fork of Benjamin Curtis' Faker gem with more us-specific options.}
+ s.email = %q{btelles@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ "History.txt",
+ "License.txt",
+ "Rakefile",
+ "lib/extensions/array.rb",
+ "lib/extensions/object.rb",
+ "lib/faker.rb",
+ "lib/faker/address.rb",
+ "lib/faker/company.rb",
+ "lib/faker/internet.rb",
+ "lib/faker/lorem.rb",
+ "lib/faker/name.rb",
+ "lib/faker/phone_number.rb",
+ "lib/faker/version.rb",
+ "test/test_faker.rb",
+ "test/test_faker_internet.rb",
+ "test/test_faker_name.rb",
+ "test/test_helper.rb"
+ ]
+ s.homepage = %q{http://github.com/btelles/faker}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.4}
+ s.summary = %q{Generates fake addresses, names and such}
+ s.test_files = [
+ "spec/spec_helper.rb",
+ "spec/faker_spec.rb",
+ "test/test_faker.rb",
+ "test/test_helper.rb",
+ "test/test_faker_name.rb",
+ "test/test_faker_internet.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
View
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.join(File.dirname(__FILE__), '..')
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/destroy'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
-RubiGen::Scripts::Destroy.new.run(ARGV)
View
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.join(File.dirname(__FILE__), '..')
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/generate'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
-RubiGen::Scripts::Generate.new.run(ARGV)
Oops, something went wrong.

0 comments on commit 6cef55d

Please sign in to comment.