yolk-biggs 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.textile ADDED
@@ -0,0 +1,9 @@
1
+ h3. biggs 0.1.1 - 2009-3-3
2
+
3
+ * Refactored activerecord-adapter to include only basic setup method in ActiveRecord:Base
4
+
5
+ h3. biggs 0.1.0 - 2009-3-3
6
+
7
+ * Allow Procs as params in biggs-activerecord-setup.
8
+ * Cleanup
9
+
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 0
3
- :major: 0
4
2
  :minor: 1
3
+ :patch: 1
4
+ :major: 0
@@ -2,22 +2,15 @@ module Biggs
2
2
  module ActiveRecordAdapter
3
3
 
4
4
  def self.included(base)
5
- base.extend ClassMethods
5
+ base.extend(InitialClassMethods)
6
6
  end
7
7
 
8
- module ClassMethods
9
- def biggs_value_methods
10
- read_inheritable_attribute(:biggs_value_methods) || write_inheritable_attribute(:biggs_value_methods, {})
11
- end
12
-
13
- def biggs_instance
14
- read_inheritable_attribute(:biggs_formatter) || write_inheritable_attribute(:biggs_formatter, Biggs::Formatter.new)
15
- end
16
-
8
+ module InitialClassMethods
17
9
  def biggs(method_name=nil, options={})
10
+ self.extend(ClassMethods)
18
11
  self.send(:include, Biggs::ActiveRecordAdapter::InstanceMethods)
19
12
  alias_method(method_name || :postal_address, :biggs_postal_address)
20
-
13
+
21
14
  value_methods = {}
22
15
  Biggs::Formatter::FIELDS.each do |field|
23
16
  value_methods[field] = options.delete(field) if options[field]
@@ -27,6 +20,16 @@ module Biggs
27
20
  end
28
21
  end
29
22
 
23
+ module ClassMethods
24
+ def biggs_value_methods
25
+ read_inheritable_attribute(:biggs_value_methods) || write_inheritable_attribute(:biggs_value_methods, {})
26
+ end
27
+
28
+ def biggs_instance
29
+ read_inheritable_attribute(:biggs_formatter) || write_inheritable_attribute(:biggs_formatter, Biggs::Formatter.new)
30
+ end
31
+ end
32
+
30
33
  module InstanceMethods
31
34
 
32
35
  def biggs_postal_address
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yolk-biggs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Munz
@@ -13,7 +13,7 @@ date: 2009-03-03 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: biggs is a small ruby tool to format postal addresses from over 60 countries. Use it as a standalone ruby gem or as a plugin for Rails.
16
+ description: biggs is a small ruby gem/rails plugin for formatting postal addresses from over 60 countries.
17
17
  email: sebastian@yo.lk
18
18
  executables: []
19
19
 
@@ -22,6 +22,7 @@ extensions: []
22
22
  extra_rdoc_files: []
23
23
 
24
24
  files:
25
+ - CHANGES.textile
25
26
  - README.textile
26
27
  - VERSION.yml
27
28
  - lib/biggs
@@ -54,6 +55,6 @@ rubyforge_project:
54
55
  rubygems_version: 1.2.0
55
56
  signing_key:
56
57
  specification_version: 2
57
- summary: biggs is a small ruby tool to format postal addresses from over 60 countries. Use it as a standalone ruby gem or as a plugin for Rails.
58
+ summary: biggs is a small ruby gem/rails plugin for formatting postal addresses from over 60 countries.
58
59
  test_files: []
59
60