has_phone_numbers 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  *SVN*
2
2
 
3
+ *0.0.2* (September 26th, 2007)
4
+
5
+ * Move test fixtures out of the test application root directory
6
+
3
7
  *0.0.1* (August 21st, 2007)
4
8
 
5
9
  * Added documentation
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  = has_phone_numbers
2
2
 
3
- has_phone_numbers adds a base skeleton for handling phone numbers.
3
+ +has_phone_numbers+ adds a base skeleton for handling phone numbers.
4
4
 
5
5
  == Resources
6
6
 
@@ -14,7 +14,7 @@ Wiki
14
14
 
15
15
  Announcement
16
16
 
17
- * http://www.pluginaweek.org/
17
+ * http://www.pluginaweek.org
18
18
 
19
19
  Source
20
20
 
@@ -31,9 +31,11 @@ standardized across multiple applications. Phone numbers are minimialistic in
31
31
  terms of the type of data required and follows the standard U.S. format.
32
32
  Support for international formats may be added in the future.
33
33
 
34
+ == Usage
35
+
34
36
  === Running migrations
35
37
 
36
- To migrate the tables required for has_phone_numbers, you can either run the
38
+ To migrate the tables required for this plugin, you can either run the
37
39
  migration from the command line like so:
38
40
 
39
41
  rake db:migrate:plugins PLUGIN=has_phone_numbers
@@ -41,15 +43,24 @@ migration from the command line like so:
41
43
  or (more ideally) generate a migration file that will integrate into your main
42
44
  application's migration path:
43
45
 
44
- ruby script/generate plugin_migration MigrateHasPhoneNumbersToVersion1
46
+ ruby script/generate plugin_migration has_phone_numbers
45
47
 
46
48
  == Testing
47
49
 
48
- The following plugins/gems must be installed before any tests can be run:
49
- * plugin_dependencies - http://wiki.pluginaweekk.org/Plugin_dependencies
50
- * loaded_plugins - http://wiki.pluginaweek.org/Loaded_plugins
51
- * appable_plugins - http://wiki.pluginaweek.org/Appable_plugins
50
+ Before you can run any tests, the following gems must be installed:
51
+ * plugin_test_helper[http://wiki.pluginaweek.org/Plugin_test_helper]
52
+ * dry_validity_assertions[http://wiki.pluginaweek.org/Dry_validity_assertions]
52
53
 
53
54
  == Dependencies
54
55
 
55
- This plugin does not depend on the presence of any other plugin.
56
+ This plugin is a plugin+. That means that it contains a slice of an
57
+ application, such as models and migrations. To test or use a plugin+, you
58
+ must have the following plugins/gems installed:
59
+ * plugin_dependencies[http://wiki.pluginaweek.org/Plugin_dependencies]
60
+ * loaded_plugins[http://wiki.pluginaweek.org/Loaded_plugins]
61
+ * appable_plugins[http://wiki.pluginaweek.org/Appable_plugins]
62
+ * plugin_migrations[http://wiki.pluginaweek.org/Plugin_migrations]
63
+
64
+ Instead of installing each individual plugin+ feature, you can install them all
65
+ at once using the plugins+[http://wiki.pluginaweek.org/Plugins_plus] meta package,
66
+ which contains all additional features.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake/gempackagetask'
4
4
  require 'rake/contrib/sshpublisher'
5
5
 
6
6
  PKG_NAME = 'has_phone_numbers'
7
- PKG_VERSION = '0.0.1'
7
+ PKG_VERSION = '0.0.2'
8
8
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
9
9
  RUBY_FORGE_PROJECT = 'pluginaweek'
10
10
 
@@ -1,12 +1,12 @@
1
- # Represents a phone number
1
+ # Represents a phone number (most likely in the United States)
2
2
  class PhoneNumber < ActiveRecord::Base
3
3
  belongs_to :phoneable,
4
4
  :polymorphic => true
5
5
 
6
- validates_presence_of :phoneable_id,
7
- :phoneable_type,
8
- :country_code,
9
- :number
6
+ validates_presence_of :phoneable_id,
7
+ :phoneable_type,
8
+ :country_code,
9
+ :number
10
10
 
11
11
  with_options(:allow_nil => true) do |klass|
12
12
  klass.validates_numericality_of :country_code,
@@ -9,8 +9,8 @@ module PluginAWeek #:nodoc:
9
9
 
10
10
  module MacroMethods
11
11
  # Creates a new association for having a single phone number. This
12
- # takes the same parameters as ActiveRecord::Associations::ClassMethods#has_one.
13
- # By default, the following associations are the same:
12
+ # takes the same parameters as +has_one+. By default, the following
13
+ # associations are the same:
14
14
  #
15
15
  # class Person < ActiveRecord::Base
16
16
  # has_phone_number
@@ -29,8 +29,8 @@ module PluginAWeek #:nodoc:
29
29
  end
30
30
 
31
31
  # Creates a new association for having a multiple phone numbers. This
32
- # takes the same parameters as ActiveRecord::Associations::ClassMethods#has_many.
33
- # By default, the following associations are the same:
32
+ # takes the same parameters as +has_many+. By default, the following
33
+ # associations are the same:
34
34
  #
35
35
  # class Person < ActiveRecord::Base
36
36
  # has_phone_numbers
@@ -3,16 +3,10 @@ require 'config/boot'
3
3
  $:.unshift("#{RAILS_ROOT}/../../../../../rails/plugin_dependencies/lib")
4
4
  begin
5
5
  require 'plugin_dependencies'
6
- rescue
6
+ rescue Exception => e
7
7
  end
8
8
 
9
9
  Rails::Initializer.run do |config|
10
- config.log_level = :debug
11
- config.cache_classes = false
12
- config.whiny_nils = true
13
- config.breakpoint_server = true
14
- config.load_paths << "#{RAILS_ROOT}/../../lib"
15
-
16
10
  config.plugin_paths.concat([
17
11
  "#{RAILS_ROOT}/../../..",
18
12
  "#{RAILS_ROOT}/../../../../migrations",
@@ -20,11 +14,12 @@ Rails::Initializer.run do |config|
20
14
  "#{RAILS_ROOT}/../../../../../test"
21
15
  ])
22
16
  config.plugins = [
23
- File.basename(File.expand_path("#{RAILS_ROOT}/../..")),
17
+ 'loaded_plugins',
24
18
  'appable_plugins',
25
19
  'plugin_migrations',
20
+ File.basename(File.expand_path("#{RAILS_ROOT}/../..")),
26
21
  'dry_validity_assertions'
27
22
  ]
23
+ config.cache_classes = false
24
+ config.whiny_nils = true
28
25
  end
29
-
30
- Dependencies.log_activity = true
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: has_phone_numbers
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2007-08-21 00:00:00 -04:00
6
+ version: 0.0.2
7
+ date: 2007-09-26 00:00:00 -04:00
8
8
  summary: Adds a base skeleton for handling phone numbers.
9
9
  require_paths:
10
10
  - lib
@@ -35,15 +35,14 @@ files:
35
35
  - db/migrate/001_create_phone_numbers.rb
36
36
  - lib/has_phone_numbers.rb
37
37
  - test/test_helper.rb
38
+ - test/fixtures
38
39
  - test/app_root
39
40
  - test/unit
40
- - test/app_root/test
41
+ - test/fixtures/phone_numbers.yml
42
+ - test/fixtures/people.yml
41
43
  - test/app_root/config
42
44
  - test/app_root/app
43
45
  - test/app_root/db
44
- - test/app_root/test/fixtures
45
- - test/app_root/test/fixtures/phone_numbers.yml
46
- - test/app_root/test/fixtures/people.yml
47
46
  - test/app_root/config/environment.rb
48
47
  - test/app_root/app/models
49
48
  - test/app_root/app/models/person.rb