Skip to content
Browse files

Docfixes, and ignore certain files

  • Loading branch information...
1 parent 3418c28 commit 0b57d8e9c28109a7d51230c88087543a6aaca15a @ianwhite committed Mar 16, 2012
Showing with 61 additions and 113 deletions.
  1. +3 −1 .gitignore
  2. +17 −29 MIT-LICENSE
  3. +25 −65 Rakefile
  4. +5 −8 response_for_rc.gemspec
  5. +11 −10 spec/specs/resources_controller_spec.rb
View
4 .gitignore
@@ -1,3 +1,5 @@
.DS_Store
doc/*
-.garlic
+pkg/
+Gemfile.lock
+.rvmrc
View
46 MIT-LICENSE
@@ -1,32 +1,20 @@
-#!/usr/bin/env rake
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
-end
-begin
- require 'rdoc/task'
-rescue LoadError
- require 'rdoc/rdoc'
- require 'rake/rdoctask'
- RDoc::Task = Rake::RDocTask
-end
+Copyright (c) 2007-2012 Ian White - ian.w.white@ardes.com
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'ResponseForRc'
- rdoc.options << '--line-numbers'
- rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG', 'MIT-LICENSE')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
+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:
-Bundler::GemHelper.install_tasks
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-require 'rspec/core/rake_task'
-
-task :default => [:spec]
-
-desc "Run the specs"
-RSpec::Core::RakeTask.new(:spec => []) do |t|
- t.pattern = "./spec/**/*_spec.rb"
-end
+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
90 Rakefile
@@ -1,72 +1,32 @@
-# use pluginized rpsec if it exists
-rspec_base = File.expand_path(File.dirname(__FILE__) + '/../rspec/lib')
-$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) and !$LOAD_PATH.include?(rspec_base)
-
-require 'spec/rake/spectask'
-require 'spec/rake/verify_rcov'
-require 'rake/rdoctask'
-
-plugin_name = "response_for_rc"
-
-task :default => :spec
-
-desc "Run the specs for #{plugin_name}"
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts = ["--colour"]
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
end
-namespace :spec do
- desc "Generate RCov report for #{plugin_name}"
- Spec::Rake::SpecTask.new(:rcov) do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.rcov = true
- t.rcov_dir = 'doc/coverage'
- t.rcov_opts = ['--text-report', '--exclude', "spec/,rcov.rb,#{File.expand_path(File.join(File.dirname(__FILE__),'../../..'))}"]
- end
-
- namespace :rcov do
- desc "Verify RCov threshold for #{plugin_name}"
- RCov::VerifyTask.new(:verify => "spec:rcov") do |t|
- t.threshold = 100.0
- t.index_html = File.join(File.dirname(__FILE__), 'doc/coverage/index.html')
- end
- end
-
- desc "Generate specdoc for #{plugin_name}"
- Spec::Rake::SpecTask.new(:doc) do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts = ["--format", "specdoc:SPECDOC"]
- end
-
- namespace :doc do
- desc "Generate html specdoc for #{plugin_name}"
- Spec::Rake::SpecTask.new(:html => :rdoc) do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts = ["--format", "html:doc/rspec_report.html", "--diff"]
- end
- end
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'ResponseForRc'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG', 'MIT-LICENSE')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end
-task :rdoc => :doc
-task "SPECDOC" => "spec:doc"
+Bundler::GemHelper.install_tasks
-desc "Generate rdoc for #{plugin_name}"
-Rake::RDocTask.new(:doc) do |t|
- t.rdoc_dir = 'doc'
- t.main = 'README.rdoc'
- t.title = "#{plugin_name}"
- t.template = ENV['RDOC_TEMPLATE']
- t.options = ['--line-numbers', '--inline-source', '--all']
- t.rdoc_files.include('README.rdoc', 'SPECDOC', 'MIT-LICENSE', 'CHANGELOG')
- t.rdoc_files.include('lib/**/*.rb')
-end
+require 'rspec/core/rake_task'
-namespace :doc do
- desc "Generate all documentation (rdoc, specdoc, specdoc html and rcov) for #{plugin_name}"
- task :all => ["spec:doc:html", "spec:doc", "spec:rcov", "doc"]
-end
+task :default => [:spec]
-task :cruise do
- sh "garlic clean && garlic all"
-end
+desc "Run the specs"
+RSpec::Core::RakeTask.new(:spec => []) do |t|
+ t.pattern = "./spec/**/*_spec.rb"
+end
View
13 response_for_rc.gemspec
@@ -22,14 +22,11 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.require_path = "lib"
- s.add_runtime_dependency "rc_rails", '=> 2.1'
- s.add_runtime_dependency "response_for_rails", '=> 0.4'
+ s.add_runtime_dependency "rc_rails", '>= 2.1'
+ s.add_runtime_dependency "response_for_rails", '>= 0.4'
s.add_runtime_dependency "rails", '>= 3.0.0'
- s.add_development_dependency "rspec", '>= 2.5.0'
- s.add_development_dependency "rspec-rails", '>= 2.5.0'
- s.add_development_dependency 'sqlite3-ruby'
- s.add_development_dependency "rspec-rails", '>= 2.5.0'
- s.add_development_dependency 'rcov'
- s.add_development_dependency 'yard'
+ s.add_development_dependency "rspec", '>= 2.8.0'
+ s.add_development_dependency "rspec-rails", '>= 2.8.0'
+ s.add_development_dependency 'sqlite3'
end
View
21 spec/specs/resources_controller_spec.rb
@@ -1,12 +1,13 @@
# load up the resources_controller specs
-plugins_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..'))
-rc_path = File.join(plugins_path, 'resources_controller')
-
-unless File.exist?(rc_path) && File.exist?(File.join(plugins_path, 'response_for'))
- raise "response_for_rc specs require resources_controller and response_for"
-end
-
-Dir[File.join("#{rc_path}", '**', '*_spec.rb')].each do |spec|
- require spec
-end
+# TODO: figure out how to do this with gems
+#plugins_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..'))
+#rc_path = File.join(plugins_path, 'resources_controller')
+#
+#unless File.exist?(rc_path) && File.exist?(File.join(plugins_path, 'response_for'))
+# raise "response_for_rc specs require resources_controller and response_for"
+#end
+#
+#Dir[File.join("#{rc_path}", '**', '*_spec.rb')].each do |spec|
+# require spec
+#end

0 comments on commit 0b57d8e

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