6
Bundler.setup(:default, :development)
7
rescue Bundler::BundlerError => e
9
$stderr.puts "Run `bundle install` to install missing gems"
15
Jeweler::Tasks.new do |gem|
16
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
gem.name = "typed-array"
18
gem.homepage = "http://github.com/yaauie/typed-array"
20
gem.summary = %Q{Provides methods for creating type-enforced Arrays}
21
gem.description =<<-DESCRIPTION
22
All methods that alter the contents of an array that implements this Gem are first checked to
23
ensure that the added items are of the types allowed. All methods behave exactly as their Array
24
counterparts, including additional forms, block processing, etc.
26
Defining a TypedArray Class:
29
class ThingsArray < Array
31
restrict_types Thing1, Thing2
34
things = ThingsArray.new
37
Generating a single TypedArray
40
things = TypedArray(Thing1,Thing2).new
42
These classes can be extended, and their accepted-types appended to after their initial definition.
44
gem.email = "ruby-dev@yaauie.com"
45
gem.authors = ["Ryan Biesemeyer"]
46
# dependencies defined in Gemfile
48
Jeweler::RubygemsDotOrgTasks.new
51
require 'rspec/core/rake_task'
52
RSpec::Core::RakeTask.new(:spec) do |spec|
53
spec.pattern = FileList['spec/**/*_spec.rb']
56
RSpec::Core::RakeTask.new(:rcov) do |spec|
57
spec.pattern = 'spec/**/*_spec.rb'
61
task :default => :spec
63
require 'rake/rdoctask'
64
Rake::RDocTask.new do |rdoc|
65
version = File.exist?('VERSION') ? File.read('VERSION') : ""
67
rdoc.rdoc_dir = 'rdoc'
68
rdoc.title = "typed-array #{version}"
69
rdoc.rdoc_files.include('README*')
70
rdoc.rdoc_files.include('lib/**/*.rb')