more_money 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2007 Paolo Negri
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/Manifest.txt CHANGED
@@ -1,6 +1,7 @@
1
- History.txt
2
1
  Manifest.txt
2
+ CHANGELOG.txt
3
3
  README.txt
4
+ MIT-LICENSE
4
5
  Rakefile
5
6
  setup.rb
6
7
  lib/more_money.rb
data/README.txt CHANGED
@@ -1,3 +1,72 @@
1
- README for more_money
2
- =====================
1
+ = MoreMoney -- A library to manage money
3
2
 
3
+ MoreMoney allows you to handle money without having to use a float/decimal
4
+ field to store the amount in the database.
5
+
6
+ MoreMoney is a fork of the original Money gem written by Tobias Luetke
7
+
8
+ The original project can be found at
9
+ http://rubyforge.org/projects/money/
10
+
11
+ Main differences from the original gem are the capability to manage the nil
12
+ value, an increased flexibility in formatting and the support for any currency
13
+
14
+ == Usage example:
15
+
16
+ require 'more_money'
17
+
18
+ #add the US dollar currency
19
+
20
+ MoreMoney::Money.add_currency({:code => 'USD', :symbol => '$', :description => 'us_dollar'})
21
+
22
+ #add the british pound
23
+
24
+ MoreMoney::Money.add_currency({:code => 'GBP', :symbol => '£', :description => 'gb_pound'})
25
+
26
+ #now is possible to instantiate some objects
27
+
28
+ ten_pounds = MoreMoney::Money.gp_pound(1000)
29
+ ten_bucks = MoreMoney::Money.us_dollar(1000)
30
+
31
+ ten_pounds.format
32
+ => "£ 10.00"
33
+
34
+ ten_bucks.format
35
+ => "$ 10.00"
36
+
37
+ == Configuration
38
+
39
+ No configuration is needed to use the library, just extend your class
40
+
41
+ == Dependencies
42
+
43
+ No dependencies are required
44
+
45
+ == Download
46
+
47
+ The latest version of Simple Descriptor can be found at
48
+
49
+ http://rubyforge.org/projects/moremoney/
50
+
51
+ Documentation can be found at
52
+
53
+ http://moremoney.rubyforge.org/
54
+
55
+ == Installation
56
+
57
+ Installation can be done using gem command
58
+
59
+ gem install more_money
60
+
61
+ == License
62
+
63
+ Simple Descriptor is released under the MIT license.
64
+
65
+ == Support
66
+
67
+ http://rubyforge.org/projects/moremoney/
68
+
69
+ == Author
70
+
71
+ Original Author of MoreMoney is Paolo Negri
72
+ MoreMoney is a fork of the original Money gem written by Tobias Luetke
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ AUTHOR = "blank" # can also be an array of Authors
15
15
  EMAIL = "your contact email for bug fixes and info"
16
16
  DESCRIPTION = "handles money objects using just integer as backend"
17
17
  GEM_NAME = "more_money" # what ppl will type to install your gem
18
- RUBYFORGE_PROJECT = "more_money" # The unix name for your project
18
+ RUBYFORGE_PROJECT = "moremoney" # The unix name for your project
19
19
  HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
20
20
  RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
21
21
 
@@ -24,11 +24,11 @@ NAME = "more_money"
24
24
  REV = nil # UNCOMMENT IF REQUIRED: File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
25
25
  VERS = ENV['VERSION'] || (MoreMoney::VERSION::STRING + (REV ? ".#{REV}" : ""))
26
26
  CLEAN.include ['**/.*.sw?', '*.gem', '.config']
27
- RDOC_OPTS = ['--quiet', '--title', "more_money documentation",
28
- "--opname", "index.html",
29
- "--line-numbers",
30
- "--main", "README",
31
- "--inline-source"]
27
+ #RDOC_OPTS = ['--title', "more_money documentation",
28
+ # "--opname", "index.html",
29
+ # "--line-numbers",
30
+ # "--main", "README.txt",
31
+ # "--inline-source"]
32
32
 
33
33
  # Generate all the Rake tasks
34
34
  # Run 'rake -T' to see list of generated tasks (from gem root directory)
@@ -47,4 +47,4 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
47
47
  #p.extra_deps - An array of rubygem dependencies.
48
48
  #p.spec_extras - A hash of extra values to set in the gemspec.
49
49
  end
50
-
50
+
@@ -1,24 +1,3 @@
1
- # === Usage with ActiveRecord
2
- #
3
- # Use the compose_of helper to let active record deal with embedding the money
4
- # object in your models. The following example requires a cents and a currency field.
5
- #
6
- # class ProductUnit < ActiveRecord::Base
7
- # belongs_to :product
8
- # composed_of :price, :class_name => "Money", :mapping => [ %w(cents cents), %w(currency currency) ]
9
- #
10
- # private
11
- # validate :cents_not_zero
12
- #
13
- # def cents_not_zero
14
- # errors.add("cents", "cannot be zero or less") unless cents > 0
15
- # end
16
- #
17
- # validates_presence_of :sku, :currency
18
- # validates_uniqueness_of :sku
19
- # end
20
- #
21
- #
22
1
  module MoreMoney
23
2
  class MoneyMissingExchangeRate < StandardError# :nodoc:
24
3
  end
@@ -2,7 +2,7 @@ module MoreMoney #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -3,14 +3,14 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: more_money
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.5
7
- date: 2007-01-08 00:00:00 +00:00
6
+ version: 0.0.6
7
+ date: 2007-01-09 00:00:00 +00:00
8
8
  summary: handles money objects using just integer as backend
9
9
  require_paths:
10
10
  - lib
11
11
  email: your contact email for bug fixes and info
12
- homepage: http://more_money.rubyforge.org
13
- rubyforge_project: more_money
12
+ homepage: http://moremoney.rubyforge.org
13
+ rubyforge_project: moremoney
14
14
  description: handles money objects using just integer as backend
15
15
  autorequire:
16
16
  default_executable:
@@ -29,9 +29,10 @@ post_install_message:
29
29
  authors:
30
30
  - blank
31
31
  files:
32
- - History.txt
33
32
  - Manifest.txt
33
+ - CHANGELOG.txt
34
34
  - README.txt
35
+ - MIT-LICENSE
35
36
  - Rakefile
36
37
  - setup.rb
37
38
  - lib/more_money.rb
File without changes