Skip to content
This repository has been archived by the owner on Nov 17, 2018. It is now read-only.

Commit

Permalink
Merge commit 'origin/gem'
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Feb 25, 2009
2 parents 5e99fad + 99dc5fa commit d8ba7ad
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -1,2 +1,7 @@
.DS_Store
nbproject
.idea
pkg
doc
coverage
Manifest
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
Expand Up @@ -10,6 +10,8 @@

* ADDED: Added #helperful method as shortcut for including helper modules from the Helperful namespace.

* ADDED: Packaged library as a GEM.

* CHANGED: Renamed TitleHelper to HelperfulTitleHelper to prevent conflicts with other common helpers (subsequently renamed to Helperful::TitleHelper).

* CHANGED: Renamed all helper modules from HelperfulHelperName to Helperful::HelperName.
Expand Down
67 changes: 48 additions & 19 deletions Rakefile
@@ -1,23 +1,52 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

desc 'Default: run unit tests.'
task :default => :test

desc 'Test the helperful plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
require 'echoe'

$:.unshift(File.dirname(__FILE__) + "/lib")
require 'helperful'


PKG_NAME = ENV['PKG_NAME'] || Helperful::GEM
PKG_VERSION = ENV['PKG_VERSION'] || Helperful::VERSION
PKG_SUMMARY = "A collection of useful Rails helpers."
PKG_FILES = FileList.new("{lib,rails,tasks,test}/**/*") do |files|
files.include %w(*.{rdoc,rb})
files.include %w(Rakefile)
end
RUBYFORGE_PROJECT = nil

if ENV['SNAPSHOT'].to_i == 1
PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
end


Echoe.new(PKG_NAME, PKG_VERSION) do |p|
p.author = "Simone Carletti"
p.email = "weppos@weppos.net"
p.summary = PKG_SUMMARY
p.description = <<-EOD
Helperful aims to be a collection of useful and reusable Rails helpers.
EOD
p.url = "http://code.simonecarletti.com/helperful"
p.project = RUBYFORGE_PROJECT

p.need_zip = true
p.rcov_options = ["--main << README.rdoc -x Rakefile -x mocha -x rcov"]
p.rdoc_pattern = /^(lib|CHANGELOG.rdoc|README.rdoc|LICENSE.rdoc)/

p.development_dependencies += ["rake >=0.8",
"echoe >=3.1",
"mocha >=0.9"]
end


desc 'Generate documentation for the helperful plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Helperful'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
begin
require 'code_statistics'
desc "Show library's code statistics"
task :stats do
CodeStatistics.new(["Helperful", "lib"],
["Tests", "test"]).to_s
end
rescue LoadError
puts "CodeStatistics (Rails) is not available"
end
6 changes: 6 additions & 0 deletions lib/helperful.rb
Expand Up @@ -17,9 +17,15 @@

Dir.glob(File.dirname(__FILE__) + '/helperful/*_helper.rb').each { |helper| require helper }
require 'helperful/deprecations'
require 'helperful/version'


module Helperful

NAME = 'Helperful'
GEM = 'helperful'
AUTHOR = 'Simone Carletti <weppos@weppos.net>'


module ControllerMixin

Expand Down
32 changes: 32 additions & 0 deletions lib/helperful/version.rb
@@ -0,0 +1,32 @@
#
# = Helperful
#
# A collection of useful Rails helpers.
#
#
# Category:: Rails
# Package:: Helperful
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2008 The Authors
# License:: MIT License
#
#--
#
#++


module Helperful

module Version
MAJOR = 0
MINOR = 2
TINY = 0

STRING = [MAJOR, MINOR, TINY].join('.')
end

VERSION = Version::STRING
STATUS = 'alpha'
BUILD = ''.match(/(\d+)/).to_a.first

end

0 comments on commit d8ba7ad

Please sign in to comment.