Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Packaged things up so that it will work as a gem.

  • Loading branch information...
commit 5131b80ae919b69171a4d9348658de39112f6128 1 parent f1623f0
@mdeering authored
View
12 README.textile
@@ -4,6 +4,18 @@ h1. Gravatar Image Tag Plugin
Rails view helper for grabbing "Gravatar":http://en.gravatar.com/ images. The goal here is to be configurable and have those configuration points documented!
+h2. Install as a Ruby Gem
+
+<pre>sudo gem install gravatar_image_tag</pre>
+
+p. Include the following line in your Rails environment
+
+<pre>config.gem 'gravatar_image_tag'</pre>
+
+p. Then ensure the gem is installed if you did not already run the gem install as noted above.
+
+<pre>rake gems:install</pre>
+
h2. Install as a Ruby on Rails Plugin
The traditional way.
View
50 Rakefile
@@ -0,0 +1,50 @@
+require 'rake'
+require 'rake/rdoctask'
+require 'spec/rake/spectask'
+
+begin
+ AUTHOR = "Michael Deering"
+ EMAIL = "mdeering@mdeering.com"
+ GEM = "gravatar_image_tag"
+ HOMEPAGE = "http://github.com/mdeering/gravatar_image_tag"
+ SUMMARY = "A configurable and documented Rails view helper for adding gravatars into your Rails application."
+
+ require 'jeweler'
+ Jeweler::Tasks.new do |s|
+ s.author = AUTHOR
+ s.email = EMAIL
+ s.files = %w(install.rb install.txt MIT-LICENSE README.textile Rakefile) + Dir.glob("{rails,lib,spec}/**/*")
+ s.homepage = HOMEPAGE
+ s.name = GEM
+ s.require_path = 'lib'
+ s.summary = SUMMARY
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+end
+
+desc 'Default: spec tests.'
+task :default => :spec
+
+desc 'Test the attribute_normalizer plugin.'
+Spec::Rake::SpecTask.new('spec') do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ["-c"]
+end
+
+desc "Run all examples with RCov"
+Spec::Rake::SpecTask.new('examples_with_rcov') do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = ['--exclude', '/opt,spec,Library']
+end
+
+desc 'Generate documentation for the attribute_normalizer plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'AttributeNormalizer'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README.textile')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
45 gravatar_image_tag.gemspec
@@ -0,0 +1,45 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{gravatar_image_tag}
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Michael Deering"]
+ s.date = %q{2010-01-04}
+ s.email = %q{mdeering@mdeering.com}
+ s.extra_rdoc_files = [
+ "README.textile"
+ ]
+ s.files = [
+ "MIT-LICENSE",
+ "README.textile",
+ "Rakefile",
+ "lib/gravatar_image_tag.rb",
+ "spec/gravatar_image_tag_spec.rb",
+ "spec/test_helper.rb"
+ ]
+ s.homepage = %q{http://github.com/mdeering/gravatar_image_tag}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{A configurable and documented Rails view helper for adding gravatars into your Rails application.}
+ s.test_files = [
+ "spec/gravatar_image_tag_spec.rb",
+ "spec/test_helper.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
2  init.rb
@@ -1,3 +1 @@
require File.dirname(__FILE__) + '/lib/gravatar_image_tag'
-
-ActionView::Base.send(:include, GravatarImageTag)
View
2  lib/gravatar_image_tag.rb
@@ -28,3 +28,5 @@ def gravatar_url(email, overrides)
end
end
+
+ActionView::Base.send(:include, GravatarImageTag)
View
1  spec/gravatar_image_tag_spec.rb
@@ -25,7 +25,6 @@
it "#gravatar_image_tag should create the provided url with the provided options #{options}" do
view = ActionView::Base.new
image_tag = view.gravatar_image_tag(email, options)
- puts image_tag
params.all? {|key, value| image_tag.include?("#{key}=#{value}")}.should be_true
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.