indefinite_article 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in indefinite_article.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -1,52 +1 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "indefinite_article"
8
- gem.summary = %Q{Indefinite articles for stringlike classes in Ruby}
9
- gem.description = %Q{Adds indefinite article ('a' vs. 'an') methods to String and Symbol}
10
- gem.email = "andy@rossmeissl.net"
11
- gem.homepage = "http://github.com/rossmeissl/indefinite_article"
12
- gem.authors = ["Andy Rossmeissl"]
13
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
- end
15
- Jeweler::GemcutterTasks.new
16
- rescue LoadError
17
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
18
- end
19
-
20
- require 'rake/testtask'
21
- Rake::TestTask.new(:test) do |test|
22
- test.libs << 'lib' << 'test'
23
- test.pattern = 'test/**/test_*.rb'
24
- test.verbose = true
25
- end
26
-
27
- begin
28
- require 'rcov/rcovtask'
29
- Rcov::RcovTask.new do |test|
30
- test.libs << 'test'
31
- test.pattern = 'test/**/test_*.rb'
32
- test.verbose = true
33
- end
34
- rescue LoadError
35
- task :rcov do
36
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
37
- end
38
- end
39
-
40
- task :test => :check_dependencies
41
-
42
- task :default => :test
43
-
44
- require 'rake/rdoctask'
45
- Rake::RDocTask.new do |rdoc|
46
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
47
-
48
- rdoc.rdoc_dir = 'rdoc'
49
- rdoc.title = "indefinite_article #{version}"
50
- rdoc.rdoc_files.include('README*')
51
- rdoc.rdoc_files.include('lib/**/*.rb')
52
- end
1
+ require 'bundler/gem_tasks'
@@ -1,5 +1,6 @@
1
1
  require 'indefinite_article/articulated'
2
- require 'activesupport'
2
+ require 'active_support'
3
+ require 'active_support/core_ext/string'
3
4
 
4
5
  module IndefiniteArticle
5
6
  WORDS_WITH_INITIAL_VOWELS_THAT_ACT_LIKE_WORDS_WITH_INITIAL_CONSONANTS = %w(one united)
@@ -3,7 +3,7 @@ module IndefiniteArticle
3
3
  def indefinite_article
4
4
  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
5
5
  ::IndefiniteArticle::INDEFINITE_ARTICLES[:consonant]
6
- elsif VOWELS.include? to_s.first.downcase
6
+ elsif VOWELS.include? self.to_s.first.downcase
7
7
  ::IndefiniteArticle::INDEFINITE_ARTICLES[:vowel]
8
8
  else
9
9
  ::IndefiniteArticle::INDEFINITE_ARTICLES[:consonant]
@@ -0,0 +1,3 @@
1
+ module IndefiniteArticle
2
+ VERSION = "0.1.2"
3
+ end
@@ -1,22 +1,24 @@
1
- require 'helper'
1
+ require File.expand_path('../helper', __FILE__)
2
2
 
3
3
  class TestIndefiniteArticle < Test::Unit::TestCase
4
4
  def setup
5
5
  end
6
-
6
+ def test_active_support
7
+ assert_equal 'banana'.first, 'b'
8
+ end
7
9
  def test_indefinite_article_selection
8
10
  assert_equal 'a', 'banana'.indefinite_article
9
11
  assert_equal 'an', 'apple'.indefinite_article
10
12
  end
11
-
13
+
12
14
  def test_unusual_article_selection
13
15
  assert_equal 'a', 'one'.indefinite_article
14
16
  end
15
-
17
+
16
18
  def test_functionality_on_symbol
17
19
  assert_equal 'a', :banana.indefinite_article
18
20
  end
19
-
21
+
20
22
  def test_indefinite_article_prefix
21
23
  assert_equal 'a banana', 'banana'.with_indefinite_article
22
24
  end
metadata CHANGED
@@ -1,66 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indefinite_article
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ hash: 31
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 2
10
+ version: 0.1.2
5
11
  platform: ruby
6
12
  authors:
7
- - Andy Rossmeissl
13
+ - Kevin English
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-03-05 00:00:00 -05:00
13
- default_executable:
14
- dependencies: []
15
-
16
- description: Adds indefinite article ('a' vs. 'an') methods to String and Symbol
17
- email: andy@rossmeissl.net
18
+ date: 2012-10-04 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: activesupport
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 7
29
+ segments:
30
+ - 3
31
+ - 0
32
+ - 0
33
+ version: 3.0.0
34
+ - - <
35
+ - !ruby/object:Gem::Version
36
+ hash: 11
37
+ segments:
38
+ - 3
39
+ - 3
40
+ - 0
41
+ version: 3.3.0
42
+ type: :runtime
43
+ version_requirements: *id001
44
+ - !ruby/object:Gem::Dependency
45
+ name: i18n
46
+ prerelease: false
47
+ requirement: &id002 !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ hash: 7
53
+ segments:
54
+ - 0
55
+ - 6
56
+ - 0
57
+ version: 0.6.0
58
+ type: :development
59
+ version_requirements: *id002
60
+ - !ruby/object:Gem::Dependency
61
+ name: activesupport
62
+ prerelease: false
63
+ requirement: &id003 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ hash: 7
69
+ segments:
70
+ - 3
71
+ - 0
72
+ - 0
73
+ version: 3.0.0
74
+ - - <
75
+ - !ruby/object:Gem::Version
76
+ hash: 11
77
+ segments:
78
+ - 3
79
+ - 3
80
+ - 0
81
+ version: 3.3.0
82
+ type: :development
83
+ version_requirements: *id003
84
+ - !ruby/object:Gem::Dependency
85
+ name: i18n
86
+ prerelease: false
87
+ requirement: &id004 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ~>
91
+ - !ruby/object:Gem::Version
92
+ hash: 7
93
+ segments:
94
+ - 0
95
+ - 6
96
+ - 0
97
+ version: 0.6.0
98
+ type: :development
99
+ version_requirements: *id004
100
+ description: Adds indefinite article methods to String and Symbol
101
+ email:
102
+ - kenglish@gmail.com
18
103
  executables: []
19
104
 
20
105
  extensions: []
21
106
 
22
- extra_rdoc_files:
23
- - LICENSE
24
- - README.rdoc
107
+ extra_rdoc_files: []
108
+
25
109
  files:
26
- - .document
27
- - .gitignore
110
+ - Gemfile
28
111
  - LICENSE
29
112
  - README.rdoc
30
113
  - Rakefile
31
- - VERSION
32
- - lib/indefinite_article.rb
33
114
  - lib/indefinite_article/articulated.rb
34
- - test/helper.rb
115
+ - lib/indefinite_article/version.rb
116
+ - lib/indefinite_article.rb
35
117
  - test/test_indefinite_article.rb
36
- has_rdoc: true
37
- homepage: http://github.com/rossmeissl/indefinite_article
118
+ homepage: ""
38
119
  licenses: []
39
120
 
40
121
  post_install_message:
41
- rdoc_options:
42
- - --charset=UTF-8
122
+ rdoc_options: []
123
+
43
124
  require_paths:
44
125
  - lib
45
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
+ none: false
46
128
  requirements:
47
129
  - - ">="
48
130
  - !ruby/object:Gem::Version
131
+ hash: 3
132
+ segments:
133
+ - 0
49
134
  version: "0"
50
- version:
51
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
+ none: false
52
137
  requirements:
53
138
  - - ">="
54
139
  - !ruby/object:Gem::Version
140
+ hash: 3
141
+ segments:
142
+ - 0
55
143
  version: "0"
56
- version:
57
144
  requirements: []
58
145
 
59
- rubyforge_project:
60
- rubygems_version: 1.3.5
146
+ rubyforge_project: indefinite_article
147
+ rubygems_version: 1.8.8
61
148
  signing_key:
62
149
  specification_version: 3
63
- summary: Indefinite articles for stringlike classes in Ruby
150
+ summary: Adds indefinite article methods to String and Symbol
64
151
  test_files:
65
- - test/helper.rb
66
152
  - test/test_indefinite_article.rb
153
+ has_rdoc:
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.0
@@ -1,9 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
-
4
- $LOAD_PATH.unshift(File.dirname(__FILE__))
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
- require 'indefinite_article'
7
-
8
- class Test::Unit::TestCase
9
- end