Navigation Menu

Skip to content

Commit

Permalink
Added gemspec, using active_support 3.0.1, new version
Browse files Browse the repository at this point in the history
  • Loading branch information
monkseal committed Nov 4, 2011
1 parent 8bb44e1 commit f89d0c9
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 81 deletions.
26 changes: 5 additions & 21 deletions .gitignore
@@ -1,21 +1,5 @@
## MAC OS
.DS_Store

## TEXTMATE
*.tmproj
tmtags

## EMACS
*~
\#*
.\#*

## VIM
*.swp

## PROJECT::GENERAL
coverage
rdoc
pkg

## PROJECT::SPECIFIC
*.gem
.bundle
Gemfile.lock
pkg/*
.rvmrc
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -3,4 +3,5 @@ source "http://rubygems.org"
# Specify your gem's dependencies in indefinite_article.gemspec
gemspec

gem 'activesupport', '3.0.10'
#gem 'activesupport', '3.0.10'
#gem 'i18n', '~>0.5.0'
53 changes: 1 addition & 52 deletions Rakefile
@@ -1,52 +1 @@
require 'rubygems'
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "indefinite_article"
gem.summary = %Q{Indefinite articles for stringlike classes in Ruby}
gem.description = %Q{Adds indefinite article ('a' vs. 'an') methods to String and Symbol}
gem.email = "andy@rossmeissl.net"
gem.homepage = "http://github.com/rossmeissl/indefinite_article"
gem.authors = ["Andy Rossmeissl"]
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: 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|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "indefinite_article #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
require 'bundler/gem_tasks'
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.1.0
0.1.1
23 changes: 21 additions & 2 deletions indefinite_article.gemspec
Expand Up @@ -8,13 +8,32 @@ Gem::Specification.new do |s|
s.authors = ["Kevin English"]
s.email = ["kenglish@gmail.com"]
s.homepage = ""
s.summary = %q{TODO: Write a gem summary}
s.description = %q{TODO: Write a gem description}
s.summary = %q{Adds indefinite article methods to String and Symbol}
s.description = %q{Adds indefinite article methods to String and Symbol}

s.rubyforge_project = "indefinite_article"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<activesupport>, ['>= 3.0.1'])
s.add_runtime_dependency(%q<i18n>, ['~>0.5.0'])

s.add_development_dependency(%q<activesupport>,['>= 3.0.1'])
s.add_development_dependency(%q<i18n>, ['~>0.5.0'])
else
s.add_dependency(%q<activesupport>, ['>= 3.0.1'])
s.add_dependency(%q<i18n>, ['~>0.5.0'])
end
else
s.add_dependency(%q<activesupport>, ['>= 3.0.1'])
s.add_dependency(%q<i18n>, ['~>0.5.0'])
end


end
3 changes: 2 additions & 1 deletion lib/indefinite_article.rb
@@ -1,5 +1,6 @@
require 'indefinite_article/articulated'
require 'activesupport'
require 'active_support'
require 'active_support/core_ext/string'

module IndefiniteArticle
WORDS_WITH_INITIAL_VOWELS_THAT_ACT_LIKE_WORDS_WITH_INITIAL_CONSONANTS = %w(one united)
Expand Down
2 changes: 1 addition & 1 deletion lib/indefinite_article/articulated.rb
Expand Up @@ -3,7 +3,7 @@ module Articulated
def indefinite_article
if ::IndefiniteArticle::WORDS_WITH_INITIAL_VOWELS_THAT_ACT_LIKE_WORDS_WITH_INITIAL_CONSONANTS.include? to_s._first_word_for_indefinite_article._first_term_for_indefinite_article.downcase
::IndefiniteArticle::INDEFINITE_ARTICLES[:consonant]
elsif VOWELS.include? to_s.first.downcase
elsif VOWELS.include? self.to_s.first.downcase
::IndefiniteArticle::INDEFINITE_ARTICLES[:vowel]
else
::IndefiniteArticle::INDEFINITE_ARTICLES[:consonant]
Expand Down
6 changes: 4 additions & 2 deletions test/test_indefinite_article.rb 100644 → 100755
@@ -1,9 +1,11 @@
require 'helper'
require_relative 'helper'

class TestIndefiniteArticle < Test::Unit::TestCase
def setup
end

def test_active_support
assert_equal 'banana'.first, 'b'
end
def test_indefinite_article_selection
assert_equal 'a', 'banana'.indefinite_article
assert_equal 'an', 'apple'.indefinite_article
Expand Down

0 comments on commit f89d0c9

Please sign in to comment.