Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 93 lines (73 sloc) 3.013 kB
df74667 @JoshCheek fix Rakefile's ability to test
authored
1 require "rubygems"
2 require "rake/gempackagetask"
3 require "rake/rdoctask"
4 # require "rake/testtask"
5
6
4c9e106 @JoshCheek Add rake task for a console
authored
7 task :default => :test
8
0a8dafd @JoshCheek add documentation
authored
9
4c9e106 @JoshCheek Add rake task for a console
authored
10 desc 'run the unit tests'
11 task :test do
40edd4a @JoshCheek change filenames to be more idiomatic
authored
12 query = File.dirname(__FILE__) << '/test/*_test.rb'
1caff72 @JoshCheek pull from play into its own project
authored
13 Dir[query].each { |filename| require filename }
4c9e106 @JoshCheek Add rake task for a console
authored
14 end
15
0a8dafd @JoshCheek add documentation
authored
16
4c9e106 @JoshCheek Add rake task for a console
authored
17 desc 'irb session with env loaded'
18 task :console do
19 dir = File.dirname(__FILE__)
20 requirements = String.new
21 requirements << "-r #{dir}/test/_helper.rb"
82b3f6d @JoshCheek use -f on irb invocation since Hirb goes wonky sometimes :/
authored
22 system "irb -f #{requirements}"
85a58e7 @JoshCheek add gem-this to Rakefile
authored
23 end
24
0a8dafd @JoshCheek add documentation
authored
25
85a58e7 @JoshCheek add gem-this to Rakefile
authored
26 # This builds the actual gem. For details of what all these options
27 # mean, and other ones you can add, check the documentation here:
28 #
29 # http://rubygems.org/read/chapter/20
30 #
31 spec = Gem::Specification.new do |s|
32
33 # Change these as appropriate
34 s.name = "arsettings"
e0479fd @JoshCheek bump minor version sicne we merged with the rdoc dir
authored
35 s.version = "1.0.1"
85a58e7 @JoshCheek add gem-this to Rakefile
authored
36 s.author = "Joshua Cheek"
37 s.email = "josh.cheek@gmail.com"
38 s.homepage = "https://github.com/JoshCheek/ARSettings"
39 s.summary = "Settings for ActiveRecord projects (ie Rails)"
40 s.description = "ActiveRecord has a lot of support for tables of similar values. But what about those one time only values, like site settings? This is what ARSettings is intended for. One line to add settings to your ActiveRecord classes. Two to non-ActiveRecord classes. And you can have settings that are not defined on any class as well."
41
42 s.has_rdoc = true
43 s.extra_rdoc_files = %w(Readme.mdown)
44 s.rdoc_options = %w(--main Readme.mdown)
45
46 # Add any extra files to include in the gem
47 s.files = %w(Rakefile Readme.mdown) + Dir.glob("{test,lib/**/*}")
48 s.require_paths = ["lib"]
49
50 # If you want to depend on other gems, add them here, along with any
51 # relevant versions
52 s.add_dependency("activerecord", ">= 2.3.8")
53
54 # If your tests use any gems, include them here
55 s.add_development_dependency("sqlite-ruby", ">= 1.3.1")
56 end
57
58 # This task actually builds the gem. We also regenerate a static
59 # .gemspec file, which is useful if something (i.e. GitHub) will
60 # be automatically building a gem for this project. If you're not
61 # using GitHub, edit as appropriate.
62 #
63 # To publish your gem online, install the 'gemcutter' gem; Read more
64 # about that here: http://gemcutter.org/pages/gem_docs
65 Rake::GemPackageTask.new(spec) do |pkg|
66 pkg.gem_spec = spec
67 end
68
69 desc "Build the gemspec file #{spec.name}.gemspec"
70 task :gemspec do
71 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
72 File.open(file, "w") {|f| f << spec.to_ruby }
73 end
74
75 task :package => :gemspec
76
77 # Generate documentation
78 Rake::RDocTask.new do |rd|
79 rd.main = "Readme.mdown"
80 rd.rdoc_files.include("Readme.mdown", "lib/**/*.rb")
81 rd.rdoc_dir = "rdoc"
82 end
83
84 desc 'Clear out RDoc and generated packages'
85 task :clean => [:clobber_rdoc, :clobber_package] do
86 rm "#{spec.name}.gemspec"
87 end
abee28b @JoshCheek merge with rdoc branch
authored
88
89 # desc 'generate docs'
90 # task :doc do
91 # system "rdoc --force-update --format=darkfish --main=lib/arsettings.rb --title=ARSettings --main=arsettings.rb #{File.dirname(__FILE__)}/lib"
92 # end
Something went wrong with that request. Please try again.