vlatko_dawanda 1.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 83997f221c62c400d5001080e4e48c18e363ad3b
4
+ data.tar.gz: 892766a23ef320afc209b67ea20ca455c2f6fa00
5
+ SHA512:
6
+ metadata.gz: 89a873e3f7f92ecbd8b89a2e9a8f02bc464b6434944c155b9aabdae284c83ec12fab024fb613c369fbaac73133c688c8c93b5e6c216c045e430777b5411e5b72
7
+ data.tar.gz: 66a0b0af4c780900e7d6b67a3e0b704bbbeeb0e5a9997226fadc168e730fad0e8a5f62427076a32a23877eed47bab35625da456e8426396a231c50db1dfa1f56
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .ruby-version
11
+ .ruby-gemset
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.13.6
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ristovski.vlatko234@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vlatko_dawanda.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Vlatko Ristovski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ ## Installation
2
+
3
+ Add this line to your application's Gemfile:
4
+
5
+ ```ruby
6
+ gem 'vlatko_dawanda'
7
+ ```
8
+
9
+ And then execute:
10
+
11
+ $ bundle
12
+
13
+ Or install it yourself as:
14
+
15
+ $ gem install vlatko_dawanda
16
+
17
+ ## Usage
18
+
19
+ ```ruby
20
+ # First and foremost configure the currency rates with respect to a base currency (here EUR).
21
+
22
+ Money.conversion_rates('EUR', {
23
+ 'USD' => 1.11,
24
+ 'Bitcoin' => 0.0047
25
+ })
26
+
27
+ # Instantiate money objects (If you haven't configure a currency you can't instantiate a Money object with that currency):
28
+
29
+ fifty_eur = Money.new(50, 'EUR')
30
+
31
+ # Get amount and currency:
32
+
33
+ fifty_eur.amount # => 50
34
+ fifty_eur.currency # => "EUR"
35
+ fifty_eur.inspect # => "50.00 EUR"
36
+
37
+ # Convert to a different currency (should return a Money
38
+ # instance, not a String):
39
+
40
+ fifty_eur.convert_to('USD') # => 55.50 USD
41
+
42
+ # Perform operations in different currencies:
43
+
44
+ twenty_dollars = Money.new(20, 'USD')
45
+
46
+ # Arithmetics:
47
+
48
+ fifty_eur + twenty_dollars # => 68.02 EUR
49
+ fifty_eur - twenty_dollars # => 31.98 EUR
50
+ fifty_eur / 2 # => 25 EUR
51
+ twenty_dollars * 3 # => 60 USD
52
+
53
+ # Comparisons (also in different currencies):
54
+
55
+ twenty_dollars == Money.new(20, 'USD') # => true
56
+ twenty_dollars == Money.new(30, 'USD') # => false
57
+
58
+ fifty_eur_in_usd = fifty_eur.convert_to('USD')
59
+ fifty_eur_in_usd == fifty_eur # => true
60
+
61
+ twenty_dollars > Money.new(5, 'USD') # => true
62
+ twenty_dollars < fifty_eur # => true
63
+ ```
64
+
65
+ ## Development
66
+
67
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
68
+
69
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
70
+
71
+ ## Contributing
72
+
73
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vlatko_dawanda. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
74
+
75
+
76
+ ## License
77
+
78
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
79
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "vlatko_dawanda"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ require "pry"
11
+ Pry.start
12
+
13
+ # require "irb"
14
+ # IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,23 @@
1
+ module VlatkoDawanda
2
+ module Arithmetic
3
+
4
+ ['+','-','*','/'].each do |method_name|
5
+ define_method(method_name) do |other|
6
+ result = case other
7
+ when ::Numeric
8
+ self.amount.to_d.send(method_name, other.to_d)
9
+ when self.class
10
+ self.amount.to_d.send(method_name, other.convert_to(currency).amount.to_d)
11
+ else
12
+ raise InvalidOperand.new('please enter a number or an object from the Money class')
13
+ end
14
+
15
+ self.class.new(result, currency)
16
+ end
17
+ end
18
+
19
+ def coerce(other)
20
+ return self, other
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module VlatkoDawanda
2
+ class UnknownCurrency < StandardError; end
3
+ class InvalidRate < StandardError; end
4
+ class InvalidOperand < StandardError; end
5
+ end
@@ -0,0 +1,79 @@
1
+ module VlatkoDawanda
2
+ class Money
3
+
4
+ include Arithmetic
5
+ include Comparable
6
+
7
+ class << self
8
+ def conversion_rates(base_currency, currencies)
9
+ @currencies = parse_currencies(base_currency, currencies)
10
+ end
11
+
12
+ def currencies
13
+ @currencies ||= {}
14
+ end
15
+
16
+ private
17
+
18
+ # I'm doing this instead of simple merge with the input hash
19
+ # cause I prefer working with symbols as keys whenever possible
20
+ # and the garbage collector is not that polluted
21
+ def parse_currencies(base_currency, currencies)
22
+ currencies.merge({base_currency => 1}).inject({}) do |memo, (key,value)|
23
+ rate = validate_rate(value)
24
+ memo[key.downcase.to_sym] = {iso_code: key, rate: rate}
25
+ memo
26
+ end
27
+ end
28
+
29
+ def validate_rate(value)
30
+ rate = value.to_d rescue 0.to_d
31
+ raise InvalidRate.new('please enter a positive float as a rate') if rate <= 0
32
+ rate
33
+ end
34
+ end
35
+
36
+ def initialize(amount, iso_code)
37
+ @amount = amount.to_d
38
+ @currency = find_currency(iso_code)
39
+ end
40
+
41
+ def amount
42
+ to_f_or_i(@amount)
43
+ end
44
+
45
+ def currency
46
+ @currency[:iso_code]
47
+ end
48
+
49
+ def inspect
50
+ "#{"%.2f" % amount} #{currency}"
51
+ end
52
+
53
+ def convert_to(iso_code)
54
+ amount = (@amount / @currency[:rate]) * find_currency(iso_code)[:rate]
55
+ self.class.new(amount, iso_code)
56
+ end
57
+
58
+ def <=>(other)
59
+ if currency == other.currency
60
+ amount.to_d.round(2) <=> other.amount.to_d.round(2)
61
+ else
62
+ amount.to_d.round(2) <=> other.convert_to(currency).amount.to_d.round(2)
63
+ end
64
+ end
65
+
66
+ private
67
+
68
+ def find_currency(iso_code)
69
+ currency = self.class.currencies[iso_code.downcase.to_sym]
70
+ raise UnknownCurrency.new('currency not found') if currency.nil?
71
+ currency
72
+ end
73
+
74
+ def to_f_or_i(v)
75
+ ((float = v.to_f) && (float % 1.0 == 0) ? float.to_i : float) rescue v
76
+ end
77
+
78
+ end
79
+ end
@@ -0,0 +1,3 @@
1
+ module VlatkoDawanda
2
+ VERSION = "1.0.1"
3
+ end
@@ -0,0 +1,15 @@
1
+ require "bigdecimal"
2
+ require "bigdecimal/util"
3
+ require "vlatko_dawanda/version"
4
+ require 'vlatko_dawanda/error_classes'
5
+ require 'vlatko_dawanda/arithmetic'
6
+ require 'vlatko_dawanda/money'
7
+
8
+ begin
9
+ require "pry"
10
+ rescue LoadError
11
+ end
12
+
13
+ module VlatkoDawanda
14
+
15
+ end
@@ -0,0 +1,6 @@
1
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
2
+ require "vlatko_dawanda"
3
+
4
+ RSpec.configure do |config|
5
+ config.order = 'random'
6
+ end
@@ -0,0 +1,71 @@
1
+ require 'spec_helper'
2
+
3
+ describe VlatkoDawanda::Money do
4
+ context 'perform arithmetic operations' do
5
+ before(:context) do
6
+ described_class.conversion_rates('EUR', {'USD' => 1.11, 'Bitcoin' => 0.0047})
7
+ end
8
+ let(:fifty_eur){described_class.new(50,'EUR')}
9
+ let(:twenty_usd){described_class.new(20,'USD')}
10
+
11
+ it 'raises an error if the other participant is not a number or from Money class' do
12
+ expect{fifty_eur + 'a'}.to raise_error VlatkoDawanda::InvalidOperand
13
+ expect{fifty_eur - 'a'}.to raise_error VlatkoDawanda::InvalidOperand
14
+ expect{fifty_eur * 'a'}.to raise_error VlatkoDawanda::InvalidOperand
15
+ expect{fifty_eur / 'a'}.to raise_error VlatkoDawanda::InvalidOperand
16
+ end
17
+
18
+ it 'returns a new Money object' do
19
+ arithemtic_results = ['+','-','*','/'].map{|sign| fifty_eur.send(sign, twenty_usd)}
20
+ expect(arithemtic_results).to all(be_an_instance_of(described_class))
21
+ end
22
+
23
+ context '+' do
24
+ specify 'with number' do
25
+ sum = twenty_usd + 2
26
+ expect(sum.inspect).to eq '22.00 USD'
27
+ end
28
+
29
+ specify 'with other Money object' do
30
+ sum = fifty_eur + twenty_usd
31
+ expect(sum.inspect).to eq '68.02 EUR'
32
+ end
33
+ end
34
+
35
+ context '-' do
36
+ specify 'with number' do
37
+ difference = twenty_usd - 2
38
+ expect(difference.inspect).to eq '18.00 USD'
39
+ end
40
+
41
+ specify 'with other Money object' do
42
+ difference = fifty_eur - twenty_usd
43
+ expect(difference.inspect).to eq '31.98 EUR'
44
+ end
45
+ end
46
+
47
+ context '*' do
48
+ specify 'with number' do
49
+ product = twenty_usd * 3
50
+ expect(product.inspect).to eq '60.00 USD'
51
+ end
52
+
53
+ specify 'with other Money object' do
54
+ product = twenty_usd * fifty_eur
55
+ expect(product.inspect).to eq '1110.00 USD'
56
+ end
57
+ end
58
+
59
+ context '/' do
60
+ specify 'with number' do
61
+ quotient = fifty_eur / 2
62
+ expect(quotient.inspect).to eq '25.00 EUR'
63
+ end
64
+
65
+ specify 'with other Money object' do
66
+ quotient = fifty_eur / twenty_usd
67
+ expect(quotient.inspect).to eq '2.78 EUR'
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,141 @@
1
+ require 'spec_helper'
2
+
3
+ describe VlatkoDawanda::Money do
4
+
5
+ context '#conversion_rates parsing' do
6
+ let(:hash_currency_input){{'USD' => 1.11, 'Bitcoin' => 0.0047}}
7
+ let(:currencies){described_class.conversion_rates('EUR', hash_currency_input)}
8
+
9
+ it 'includes the right currencies from input' do
10
+ expect(currencies.keys).to contain_exactly(:eur, :usd, :bitcoin)
11
+ end
12
+
13
+ it 'does not include a currency that is not in the input' do
14
+ expect(currencies.keys).to_not include(:mkd)
15
+ end
16
+
17
+ context 'raises an InvalidRate' do
18
+ specify 'rate is zero' do
19
+ invalid_hash = {'MKD' => 0}
20
+ expect{described_class.conversion_rates('EUR', invalid_hash)}.to raise_error VlatkoDawanda::InvalidRate
21
+ end
22
+
23
+ specify 'rate is negative number' do
24
+ invalid_hash = {'MKD' => -1}
25
+ expect{described_class.conversion_rates('EUR', invalid_hash)}.to raise_error VlatkoDawanda::InvalidRate
26
+ end
27
+ end
28
+
29
+ it 'parses the base currency with rate 1' do
30
+ expect(currencies[:eur][:rate]).to eq 1
31
+ end
32
+
33
+ it 'parses the currencies with bigdecimal classes' do
34
+ expect(currencies.map{|k,v| v[:rate]}).to all(be_an_instance_of(BigDecimal))
35
+ end
36
+
37
+ it 'equals the same rates as the input hash' do
38
+ expect(currencies[:usd][:rate]).to eq hash_currency_input[currencies[:usd][:iso_code]]
39
+ expect(currencies[:bitcoin][:rate]).to eq hash_currency_input[currencies[:bitcoin][:iso_code]]
40
+ end
41
+ end
42
+
43
+ context 'instantation of objects' do
44
+ before(:context) do
45
+ described_class.conversion_rates('EUR', {'USD' => 1.11, 'Bitcoin' => 0.0047})
46
+ end
47
+
48
+ let(:existing_currency){described_class.new(50, 'EUR')}
49
+ let(:non_existing_currency){described_class.new(50, 'MKD')}
50
+ let(:float_currency){described_class.new(50.50, 'USD')}
51
+
52
+ it 'is valid when existing currency is in input' do
53
+ expect{ existing_currency }.to_not raise_error VlatkoDawanda::UnknownCurrency
54
+ end
55
+
56
+ it 'is raises UnknownCurrency error when non existing currency is in input' do
57
+ expect{ non_existing_currency }.to raise_error VlatkoDawanda::UnknownCurrency
58
+ end
59
+
60
+ context 'depending of the amount input' do
61
+
62
+ it 'outputs the amount in integer when 50' do
63
+ expect(existing_currency.amount).to eq 50
64
+ expect(existing_currency.amount).to be_an(Integer)
65
+ end
66
+
67
+ it 'outputs the amount in float when 50.50' do
68
+ expect(float_currency.amount).to eq 50.50
69
+ expect(float_currency.amount).to be_an(Float)
70
+ end
71
+
72
+ end
73
+
74
+ it 'outputs iso code for currency' do
75
+ expect(existing_currency.currency).to eq 'EUR'
76
+ end
77
+
78
+ it 'outputs the amount and currency iso code when inspected' do
79
+ expect(existing_currency.inspect).to eq "50.00 EUR"
80
+ end
81
+ end
82
+
83
+ context 'conversion to different currency' do
84
+ before(:context) do
85
+ @currencies = described_class.conversion_rates('EUR', {'USD' => 1.11, 'Bitcoin' => 0.0047})
86
+ end
87
+
88
+ let(:euro){described_class.new(50,'EUR')}
89
+
90
+ specify 'eur to usd' do
91
+ usd = euro.convert_to('USD')
92
+ expect(usd.amount).to eq(55.5)
93
+ expect(usd.currency).to eq('USD')
94
+ end
95
+
96
+ specify 'eur to usd to eur' do
97
+ usd = euro.convert_to('USD')
98
+
99
+ expect(usd.convert_to('EUR').amount).to eq(euro.amount)
100
+ end
101
+
102
+ specify 'to same currency' do
103
+ expect(euro.convert_to('EUR').amount).to eq(euro.amount)
104
+ end
105
+
106
+ it 'raises UnknownCurrency error for non existing rate' do
107
+ expect{ euro.convert_to('MKD') }.to raise_error VlatkoDawanda::UnknownCurrency
108
+ end
109
+ end
110
+
111
+ context 'comparisons' do
112
+ before(:context) do
113
+ described_class.conversion_rates('EUR', {'USD' => 1.11, 'Bitcoin' => 0.0047})
114
+ end
115
+
116
+ let(:fifty_eur){described_class.new(50,'EUR')}
117
+ let(:twenty_usd){described_class.new(20,'USD')}
118
+
119
+ it "is equal when the other's currency is same and amount" do
120
+ expect(twenty_usd).to eq described_class.new(20,'USD')
121
+ end
122
+
123
+ it "is not equal when the other's currency is same but not amount" do
124
+ expect(twenty_usd).to_not eq described_class.new(30,'USD')
125
+ end
126
+
127
+ it "is equal when the other's currency is different but the converted amount is the same" do
128
+ fifty_eur_in_usd = fifty_eur.convert_to('USD')
129
+ expect(fifty_eur).to eq fifty_eur_in_usd
130
+ end
131
+
132
+ it "is greater when the other's currency is the same but amount is lower" do
133
+ expect(fifty_eur).to be > described_class.new(40,'EUR')
134
+ end
135
+
136
+ it "is lower when the other's currency is different but the converted amount is greater" do
137
+ expect(twenty_usd).to be < fifty_eur
138
+ end
139
+ end
140
+
141
+ end
@@ -0,0 +1,7 @@
1
+ require "spec_helper"
2
+
3
+ describe VlatkoDawanda do
4
+ it "has a version number" do
5
+ expect(VlatkoDawanda::VERSION).not_to be nil
6
+ end
7
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vlatko_dawanda/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vlatko_dawanda"
8
+ spec.version = VlatkoDawanda::VERSION
9
+ spec.authors = ["Vlatko Ristovski"]
10
+ spec.email = ["ristovski.vlatko234@gmail.com"]
11
+
12
+ spec.summary = %q{Just an excercise gem.}
13
+ spec.description = %q{Just an excercise gem.}
14
+ spec.homepage = "https://github.com/ristovskiv/vlatko_dawanda"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.13"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.0"
25
+ spec.add_development_dependency "pry", '~> 0.10.4'
26
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vlatko_dawanda
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Vlatko Ristovski
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-12-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.10.4
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.10.4
69
+ description: Just an excercise gem.
70
+ email:
71
+ - ristovski.vlatko234@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
+ - CODE_OF_CONDUCT.md
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - bin/console
85
+ - bin/setup
86
+ - lib/vlatko_dawanda.rb
87
+ - lib/vlatko_dawanda/arithmetic.rb
88
+ - lib/vlatko_dawanda/error_classes.rb
89
+ - lib/vlatko_dawanda/money.rb
90
+ - lib/vlatko_dawanda/version.rb
91
+ - spec/spec_helper.rb
92
+ - spec/vlatko_dawanda/arithmetic_spec.rb
93
+ - spec/vlatko_dawanda/money_spec.rb
94
+ - spec/vlatko_dawanda_spec.rb
95
+ - vlatko_dawanda.gemspec
96
+ homepage: https://github.com/ristovskiv/vlatko_dawanda
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.5.1
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: Just an excercise gem.
120
+ test_files: []