Permalink
Browse files

Updated to using Jeweler and Gemcutter. Also fixed bug with trying to…

… send methods on nil associated objects.
  • Loading branch information...
1 parent 18f1756 commit 7dc9132232026526853cbf9484f752dcf47232b8 @midas committed Oct 30, 2009
Showing with 139 additions and 103 deletions.
  1. +5 −0 History.txt
  2. +22 −0 LICENSE
  3. +0 −15 Manifest.txt
  4. +0 −7 PostInstall.txt
  5. +1 −1 README.rdoc
  6. +58 −30 Rakefile
  7. +1 −1 VERSION
  8. +39 −24 g_sectioned_shower.gemspec
  9. +1 −1 lib/g_sectioned_shower.rb
  10. +2 −2 lib/g_sectioned_shower/view_helpers.rb
  11. +0 −11 spec/g_sectioned_shower_spec.rb
  12. +0 −1 spec/spec.opts
  13. +0 −10 spec/spec_helper.rb
  14. +10 −0 test/test_helper.rb
View
5 History.txt
@@ -1,3 +1,8 @@
+== 1.0.6 2009-10-29
+
+* Fixed bug with associated objects that are nil still trying to send methods to get values back.
+
+
== 1.0.3 2009-04-07
* Refactored to use the Guilded rest path helper resolvers
View
22 LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2009 C. Jason Harrelson (midas)
+
+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
15 Manifest.txt
@@ -1,15 +0,0 @@
-History.txt
-Manifest.txt
-PostInstall.txt
-README.rdoc
-Rakefile
-g_sectioned_shower.gemspec
-lib/g_sectioned_shower.rb
-lib/g_sectioned_shower/view_helpers.rb
-script/console
-script/destroy
-script/generate
-spec/g_sectioned_shower_spec.rb
-spec/spec.opts
-spec/spec_helper.rb
-tasks/rspec.rake
View
7 PostInstall.txt
@@ -1,7 +0,0 @@
-
-For more information on g_sectioned_shower, see http://g_sectioned_shower.rubyforge.org
-
-NOTE: Change this information in PostInstall.txt
-You can also delete it if you don't want it.
-
-
View
2 README.rdoc
@@ -5,7 +5,7 @@ http://github.com/midas/g_sectioned_shower/tree/master
== DESCRIPTION:
-A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptaple show (detail) views of a single
+A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single
ActiveRecord object.
View
88 Rakefile
@@ -1,30 +1,58 @@
-%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
-require File.dirname(__FILE__) + '/lib/g_sectioned_shower'
-
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-$hoe = Hoe.new('g_sectioned_shower', GSectionedShower::VERSION) do |p|
- p.developer('C. Jason Harrelson (midas)', 'jason@lookforwardenterprises.com')
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
- p.rubyforge_name = p.name # TODO this is default value
- # p.extra_deps = [
- # ['activesupport','>= 2.0.2'],
- # ]
- p.extra_dev_deps = [
- ['newgem', ">= #{::Newgem::VERSION}"],
- ['rails', ">= 2.2.0"],
- ['midas-guilded', ">=0.1.4"]
- ]
-
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
- p.rsync_args = '-av --delete --ignore-errors'
-end
-
-require 'newgem/tasks' # load /tasks/*.rake
-Dir['tasks/**/*.rake'].each { |t| load t }
-
-# TODO - want other tests/tasks run by default? Add them to the list
-# task :default => [:spec, :features]
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "g_sectioned_shower"
+ gem.summary = %Q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.}
+ gem.description = %Q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.}
+ gem.email = "jason@lookforwardenterprises.com"
+ gem.homepage = "http://github.com/midas/tester"
+ gem.authors = ["C. Jason Harrelson (midas)"]
+ gem.add_dependency 'rails', ">= 2.2.0"
+ gem.add_dependency 'guilded', ">= 1.0.0"
+ gem.add_development_dependency "shoulda"
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = true
+end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = true
+ end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => :check_dependencies
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION')
+ version = File.read('VERSION')
+ else
+ version = ""
+ end
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "tester #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
2 VERSION
@@ -1 +1 @@
-0.0.0
+1.0.6
View
63 g_sectioned_shower.gemspec
@@ -1,44 +1,59 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE
+# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{g_sectioned_shower}
- s.version = "1.0.5"
+ s.version = "1.0.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["C. Jason Harrelson (midas)"]
- s.date = %q{2009-04-15}
- s.description = %q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptaple show (detail) views of a single ActiveRecord object.}
- s.email = ["jason@lookforwardenterprises.com"]
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
- s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "g_sectioned_shower.gemspec", "lib/g_sectioned_shower.rb", "lib/g_sectioned_shower/view_helpers.rb", "script/console", "script/destroy", "script/generate", "spec/g_sectioned_shower_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rspec.rake"]
- s.has_rdoc = true
- s.homepage = %q{http://github.com/midas/g_sectioned_shower/tree/master}
- s.post_install_message = %q{PostInstall.txt}
- s.rdoc_options = ["--main", "README.rdoc"]
+ s.date = %q{2009-10-29}
+ s.description = %q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.}
+ s.email = %q{jason@lookforwardenterprises.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ "History.txt",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION",
+ "g_sectioned_shower.gemspec",
+ "lib/g_sectioned_shower.rb",
+ "lib/g_sectioned_shower/view_helpers.rb",
+ "script/console",
+ "script/destroy",
+ "script/generate",
+ "tasks/rspec.rake"
+ ]
+ s.homepage = %q{http://github.com/midas/tester}
+ s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubyforge_project = %q{g_sectioned_shower}
- s.rubygems_version = %q{1.3.1}
- s.summary = %q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptaple show (detail) views of a single ActiveRecord object.}
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{A Guilded (http://github.com/midas/guilded/tree/master) component that creates adaptable show (detail) views of a single ActiveRecord object.}
+ s.test_files = [
+ "test/test_helper.rb"
+ ]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
+ s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<newgem>, [">= 1.3.0"])
- s.add_development_dependency(%q<rails>, [">= 2.2.0"])
- s.add_development_dependency(%q<midas-guilded>, [">= 0.1.4"])
- s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
+ s.add_runtime_dependency(%q<rails>, [">= 2.2.0"])
+ s.add_runtime_dependency(%q<guilded>, [">= 1.0.0"])
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
else
- s.add_dependency(%q<newgem>, [">= 1.3.0"])
s.add_dependency(%q<rails>, [">= 2.2.0"])
- s.add_dependency(%q<midas-guilded>, [">= 0.1.4"])
- s.add_dependency(%q<hoe>, [">= 1.8.0"])
+ s.add_dependency(%q<guilded>, [">= 1.0.0"])
+ s.add_dependency(%q<shoulda>, [">= 0"])
end
else
- s.add_dependency(%q<newgem>, [">= 1.3.0"])
s.add_dependency(%q<rails>, [">= 2.2.0"])
- s.add_dependency(%q<midas-guilded>, [">= 0.1.4"])
- s.add_dependency(%q<hoe>, [">= 1.8.0"])
+ s.add_dependency(%q<guilded>, [">= 1.0.0"])
+ s.add_dependency(%q<shoulda>, [">= 0"])
end
end
View
2 lib/g_sectioned_shower.rb
@@ -4,7 +4,7 @@
require 'g_sectioned_shower/view_helpers'
module GSectionedShower
- VERSION = '1.0.5'
+ VERSION = '1.0.6'
end
if defined?( ActionView::Base )
View
4 lib/g_sectioned_shower/view_helpers.rb
@@ -143,7 +143,7 @@ def handle_associated_single( html, ar_obj, reflection, section, methods, index
rel_methods.each_with_index do |rel_method, rel_i|
- method_output = h( assoc_obj.send( rel_method ) )
+ method_output = h( assoc_obj.send( rel_method ) ) unless assoc_obj.nil?
links = section[:links]
throw "The 'links' option must have values in it, or be left out of the options for the section." if !links.nil? && links.empty?
@@ -226,7 +226,7 @@ def handle_associated_many( html, ar_obj, reflection, section, methods, index )
rel_methods.each_with_index do |rel_method, rel_i|
- method_output = h( assoc_ar_obj.send( rel_method ) )
+ method_output = h( assoc_ar_obj.send( rel_method ) ) unless assoc_obj.nil?
links = section[:links]
throw "The 'links' option must have values in it, or be left out of the options for the section." if !links.nil? && links.empty?
View
11 spec/g_sectioned_shower_spec.rb
@@ -1,11 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper.rb'
-
-# Time to add your specs!
-# http://rspec.info/
-describe "Place your specs here" do
-
- it "find this spec in spec directory" do
- violated "Be sure to write your specs"
- end
-
-end
View
1 spec/spec.opts
@@ -1 +0,0 @@
---colour
View
10 spec/spec_helper.rb
@@ -1,10 +0,0 @@
-begin
- require 'spec'
-rescue LoadError
- require 'rubygems'
- gem 'rspec'
- require 'spec'
-end
-
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-require 'g_sectioned_shower'
View
10 test/test_helper.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+require 'test/unit'
+require 'shoulda'
+
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'g_sectioned_shower'
+
+class Test::Unit::TestCase
+end

0 comments on commit 7dc9132

Please sign in to comment.