fund_raise_978 1.0.0
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 +7 -0
- data/LICENSE +1 -0
- data/README +1 -0
- data/bin/fund_raise_978 +46 -0
- data/bin/projects.csv +3 -0
- data/lib/fund_raise/die.rb +17 -0
- data/lib/fund_raise/fund_request.rb +117 -0
- data/lib/fund_raise/fundable.rb +27 -0
- data/lib/fund_raise/funding_round.rb +21 -0
- data/lib/fund_raise/pledge_pool.rb +28 -0
- data/lib/fund_raise/project.rb +93 -0
- data/lib/fund_raise/project_grant.rb +16 -0
- data/lib/fund_raise/project_match.rb +32 -0
- data/spec/fund_raise/fund_request_spec.rb +37 -0
- data/spec/fund_raise/project_spec.rb +57 -0
- metadata +74 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 9fd7f9cb62cec538c4248e6739e10b652491e0ca
|
|
4
|
+
data.tar.gz: 1457955aaa7d3dbfe3fdf330f9a2501d75583cd1
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1e00a39681a5ffb622c98b1412e753f29c1a9f19bda806843c6b710cdc23df9fd4e8ba75f9fb2bb74c994068f4c4f208075ecf802157e77bfb37404561ae6e3b
|
|
7
|
+
data.tar.gz: f6bf773e0774b6d629e86a645d9492cbb5b82357185504a7ae27e312ca5fd22476bff938dd5e318bf14aedcb34e9e3ee6a0a43bb782b0feaaa9d4eec51dd253f
|
data/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This Gem allows you to raise funds for various projects.
|
data/bin/fund_raise_978
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require_relative '../lib/fund_raise/project'
|
|
4
|
+
require_relative '../lib/fund_raise/fund_request'
|
|
5
|
+
require_relative '../lib/fund_raise/project_grant'
|
|
6
|
+
require_relative '../lib/fund_raise/project_match'
|
|
7
|
+
|
|
8
|
+
project1 = FundRaise::Project.new("Project LMN", 3000, 500)
|
|
9
|
+
project2 = FundRaise::Project.new("Project ABC", 5000, 1000)
|
|
10
|
+
project3 = FundRaise::Project.new("Project XYZ", 75, 25)
|
|
11
|
+
grant1 = FundRaise::ProjectGrant.new("Grant 123", 5000, 1000)
|
|
12
|
+
match1 = FundRaise::ProjectMatch.new("Match Me", 75, 25)
|
|
13
|
+
|
|
14
|
+
my_fund_request = FundRaise::FundRequest.new("VC-Friendly Start-up Projects")
|
|
15
|
+
|
|
16
|
+
my_fund_request.add_project(project1)
|
|
17
|
+
my_fund_request.add_project(project2)
|
|
18
|
+
my_fund_request.add_project(project3)
|
|
19
|
+
my_fund_request.add_project(grant1)
|
|
20
|
+
my_fund_request.add_project(match1)
|
|
21
|
+
# my_fund_request.request_funding(4)
|
|
22
|
+
# my_fund_request.print_stats
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
default_project_file = File.join(File.dirname(__FILE__), 'projects.csv')
|
|
26
|
+
my_fund_request.load_projects(ARGV.shift || default_project_file)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
loop do
|
|
30
|
+
puts "\nHow many game rounds? ('quit' to exit)"
|
|
31
|
+
num_rounds = gets.chomp.downcase
|
|
32
|
+
case num_rounds
|
|
33
|
+
when /^\d+$/
|
|
34
|
+
puts "Enjoy your #{num_rounds} funding rounds."
|
|
35
|
+
my_fund_request.request_funding(num_rounds.to_i)
|
|
36
|
+
when 'quit', 'exit'
|
|
37
|
+
my_fund_request.print_stats
|
|
38
|
+
break
|
|
39
|
+
else
|
|
40
|
+
puts "Please enter a number or 'quit'"
|
|
41
|
+
puts default_project_file
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
default_underfunded_file = File.join(File.dirname(__FILE__), 'underfunded_projects.txt')
|
|
46
|
+
my_fund_request.save_underfunded_projects(default_underfunded_file)
|
data/bin/projects.csv
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
require_relative 'project'
|
|
2
|
+
require_relative 'die'
|
|
3
|
+
require_relative 'funding_round'
|
|
4
|
+
require_relative 'pledge_pool'
|
|
5
|
+
|
|
6
|
+
module FundRaise
|
|
7
|
+
|
|
8
|
+
class FundRequest
|
|
9
|
+
attr_accessor :name
|
|
10
|
+
attr_reader :projects_ar
|
|
11
|
+
|
|
12
|
+
def initialize (mylistname)
|
|
13
|
+
@name = mylistname
|
|
14
|
+
@projects_ar = []
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def add_project(project)
|
|
18
|
+
@projects_ar.push(project)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def load_projects(from_file)
|
|
22
|
+
File.readlines(from_file).each do |line|
|
|
23
|
+
add_project(Project.from_csv(line))
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def save_underfunded_projects(to_file="underfunded_projects.txt")
|
|
28
|
+
File.open(to_file, "w") do |file|
|
|
29
|
+
file.puts "#{@name} Under-funded projects:"
|
|
30
|
+
|
|
31
|
+
@projects_ar.sort.each do |p|
|
|
32
|
+
if !p.fully_funded?
|
|
33
|
+
file.puts underfunded_entry(p)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def underfunded_entry(project)
|
|
40
|
+
formatted_name = project.name.ljust(20, '.')
|
|
41
|
+
"#{formatted_name} $#{project.funding_left} needed"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def request_funding(rounds)
|
|
45
|
+
PledgePool::print_pledges_available
|
|
46
|
+
puts "\nProject List #{@name}:"
|
|
47
|
+
puts @projects_ar.sort
|
|
48
|
+
|
|
49
|
+
1.upto(rounds) do |round|
|
|
50
|
+
puts "\nRound #{round}:"
|
|
51
|
+
@projects_ar.each do |project|
|
|
52
|
+
puts project
|
|
53
|
+
FundingRound.one_round(project)
|
|
54
|
+
puts "#{project}\n\n"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def total_pledges
|
|
60
|
+
@projects_ar.reduce(0) do |sum, project|
|
|
61
|
+
sum + project.total_pledge_points
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def print_stats
|
|
66
|
+
puts "\n#{@name}'s funding:"
|
|
67
|
+
|
|
68
|
+
puts "$#{total_pledges} in total pledges."
|
|
69
|
+
@projects_ar.sort.each do |p|
|
|
70
|
+
puts "\n#{p.name}'s pledges:"
|
|
71
|
+
p.each_given_pledge do |t|
|
|
72
|
+
puts "$#{t.amount} in #{t.name} pledges."
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
fully, not_fully = @projects_ar.partition { |project| project.fully_funded? }
|
|
77
|
+
|
|
78
|
+
puts "\nThese projects are fully funded:"
|
|
79
|
+
fully.sort.each do |p|
|
|
80
|
+
puts "#{p.name}"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
puts "\n#{not_fully.size} projects are not fully funded:"
|
|
84
|
+
not_fully.sort.each do |p|
|
|
85
|
+
puts "#{p.name} $#{p.current_funding}"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
puts "\n#{not_fully.size} projects need your help:"
|
|
89
|
+
not_fully.sort.each do |p|
|
|
90
|
+
formatted_name = p.name.ljust(20, '.')
|
|
91
|
+
puts "#{formatted_name} $#{p.funding_left} funds needed"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def to_s
|
|
97
|
+
"There are #{@projects_ar.size} projects in #{@name}."
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if __FILE__ == $0
|
|
102
|
+
|
|
103
|
+
project1 = Project.new("Project ABC", 5000, 1000)
|
|
104
|
+
project2 = Project.new("Project LMN", 3000, 500)
|
|
105
|
+
project3 = Project.new("Project XYZ", 75, 25)
|
|
106
|
+
|
|
107
|
+
my_project = FundRequest.new("VC-Friendly Start-up Projects.")
|
|
108
|
+
|
|
109
|
+
my_project.add_project(project1)
|
|
110
|
+
my_project.add_project(project2)
|
|
111
|
+
my_project.add_project(project3)
|
|
112
|
+
|
|
113
|
+
my_project.request_funding
|
|
114
|
+
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module FundRaise
|
|
2
|
+
|
|
3
|
+
module Fundable
|
|
4
|
+
|
|
5
|
+
def add_funds(add_funding=25, pledge=false)
|
|
6
|
+
@current_funding += add_funding
|
|
7
|
+
if !pledge
|
|
8
|
+
puts "#{@name} got more funds!"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def remove_funds(remove_funding=15)
|
|
13
|
+
@current_funding -= remove_funding
|
|
14
|
+
puts "#{@name} lost some funds!"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def fully_funded?
|
|
18
|
+
funding_left <= 0
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def funding_left
|
|
22
|
+
@target_funding - @current_funding
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require_relative 'die'
|
|
2
|
+
require_relative 'pledge_pool'
|
|
3
|
+
|
|
4
|
+
module FundRaise
|
|
5
|
+
|
|
6
|
+
module FundingRound
|
|
7
|
+
|
|
8
|
+
def self.one_round(project)
|
|
9
|
+
die_r = Die.new()
|
|
10
|
+
number = die_r.number
|
|
11
|
+
if number.odd?
|
|
12
|
+
project.remove_funds
|
|
13
|
+
else
|
|
14
|
+
project.add_funds
|
|
15
|
+
end
|
|
16
|
+
project.pledge_received(PledgePool.random)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module FundRaise
|
|
2
|
+
|
|
3
|
+
Pledge = Struct.new(:name, :amount)
|
|
4
|
+
|
|
5
|
+
module PledgePool
|
|
6
|
+
PLEDGES = [
|
|
7
|
+
Pledge.new(:bronze, 50),
|
|
8
|
+
Pledge.new(:silver, 75),
|
|
9
|
+
Pledge.new(:gold, 100),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
def self.random
|
|
13
|
+
PLEDGES.sample
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.print_pledges_available
|
|
17
|
+
puts "There are #{PLEDGES.size} possible pledge amounts:"
|
|
18
|
+
PLEDGES.each do |p|
|
|
19
|
+
puts "\t A #{p.name} pledge is worth $#{p.amount}"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
if __FILE__ == $0
|
|
25
|
+
puts PledgePool::PLEDGES
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
require_relative 'pledge_pool'
|
|
2
|
+
require_relative 'fundable'
|
|
3
|
+
|
|
4
|
+
module FundRaise
|
|
5
|
+
class Project
|
|
6
|
+
include Fundable
|
|
7
|
+
|
|
8
|
+
attr_accessor :name
|
|
9
|
+
attr_reader :current_funding, :target_funding
|
|
10
|
+
|
|
11
|
+
def initialize (name, target=1000, funding=0)
|
|
12
|
+
@name = name
|
|
13
|
+
@current_funding = funding
|
|
14
|
+
@target_funding = target
|
|
15
|
+
@pledges = Hash.new(0)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def total_pledge_points
|
|
19
|
+
@pledges.values.reduce(0, :+)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def pledge_received(pledge)
|
|
23
|
+
@pledges[pledge.name] += pledge.amount
|
|
24
|
+
add_funds(pledge.amount, true)
|
|
25
|
+
puts "#{@name} received a #{pledge.name} pledge worth $#{pledge.amount}."
|
|
26
|
+
puts "#{@name}'s pledges: #{@pledges}"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def each_given_pledge
|
|
30
|
+
@pledges.each do |name, amount|
|
|
31
|
+
pledge = Pledge.new(name, amount)
|
|
32
|
+
yield pledge
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def time
|
|
37
|
+
current_time = Time.new
|
|
38
|
+
current_time.strftime("%A, %B %d, %Y")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def <=>(other_project)
|
|
42
|
+
funding_left <=> other_project.funding_left
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def self.from_csv(string)
|
|
46
|
+
name, target, funding = string.split(',')
|
|
47
|
+
Project.new(name, Integer(target), Integer(funding))
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def to_csv
|
|
51
|
+
"#{@name}, #{@target_funding}, #{@current_funding}"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def to_s
|
|
55
|
+
"#{@name} has $#{@current_funding} in funding towards a goal of $#{@target_funding}."
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if __FILE__ == $0
|
|
61
|
+
|
|
62
|
+
project1 = Project.new("Project LMN", 3000, 500)
|
|
63
|
+
project2 = Project.new("Project XYZ", 255, 25)
|
|
64
|
+
project3 = Project.new("Project PTR", 100, 110)
|
|
65
|
+
|
|
66
|
+
projects_ar = [project1, project2]
|
|
67
|
+
|
|
68
|
+
puts "There are #{projects_ar.size} projects in the array."
|
|
69
|
+
projects_ar.each do |project|
|
|
70
|
+
puts project
|
|
71
|
+
end
|
|
72
|
+
puts project1.remove_funds
|
|
73
|
+
puts project2.add_funds(24)
|
|
74
|
+
|
|
75
|
+
projects_ar.each do |project|
|
|
76
|
+
puts project
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
projects_ar.each do |project|
|
|
80
|
+
if project.current_funding < 90
|
|
81
|
+
puts "DELETE #{project.name}"
|
|
82
|
+
projects_ar.delete(project)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
projects_ar.push(project3)
|
|
86
|
+
|
|
87
|
+
puts "\nThere are #{projects_ar.size} projects in the array."
|
|
88
|
+
projects_ar.each do |project|
|
|
89
|
+
puts project
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module FundRaise
|
|
2
|
+
|
|
3
|
+
class ProjectGrant < Project
|
|
4
|
+
|
|
5
|
+
def remove_funds
|
|
6
|
+
puts "#{@name} is a grant. Funds can not be removed."
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
if __FILE__ == $0
|
|
12
|
+
new_grant = ProjectGrant.new("Grant for a College", 5000, 300)
|
|
13
|
+
puts new_grant.remove_funds(100)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module FundRaise
|
|
2
|
+
|
|
3
|
+
class ProjectMatch < Project
|
|
4
|
+
|
|
5
|
+
def initialize (name, target, funding=0)
|
|
6
|
+
super(name, target, funding)
|
|
7
|
+
@halfway_funded = target / 2
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def add_funds(add_funding=25, pledge=false)
|
|
11
|
+
if halfway_funded?
|
|
12
|
+
super(add_funding * 2)
|
|
13
|
+
else
|
|
14
|
+
if (@current_funding + add_funding) >= @halfway_funded
|
|
15
|
+
difference = @current_funding + add_funding - @halfway_funded
|
|
16
|
+
super(difference * 2)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def halfway_funded?
|
|
22
|
+
@current_funding >= @halfway_funded
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
if __FILE__ == $0
|
|
28
|
+
new_match = ProjectMatch.new("Park Fund Matchings", 6000, 2000)
|
|
29
|
+
puts new_match.add_funds(4000)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'fund_raise/fund_request'
|
|
2
|
+
require 'fund_raise/die'
|
|
3
|
+
|
|
4
|
+
module FundRaise
|
|
5
|
+
|
|
6
|
+
describe FundRequest do
|
|
7
|
+
|
|
8
|
+
before do
|
|
9
|
+
@fundrequest = FundRequest.new("My Friendly Start-up Projects")
|
|
10
|
+
@initial_funding = 150
|
|
11
|
+
@target = 3000
|
|
12
|
+
@project = Project.new("Project LMN", @target, @initial_funding)
|
|
13
|
+
@fundrequest.add_project(@project)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
context "rolled die" do
|
|
17
|
+
it "rolled an even number" do
|
|
18
|
+
# Die.any_instance.stub(:roll).and_return(2)
|
|
19
|
+
allow_any_instance_of(Die).to receive(:number).and_return(2)
|
|
20
|
+
@fundrequest = FundRequest.new("My Friendly Start-up Projects")
|
|
21
|
+
@fundrequest.add_project(@project)
|
|
22
|
+
@fundrequest.request_funding(1)
|
|
23
|
+
expect(@project.current_funding).to eq(@initial_funding + 25)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "rolled an odd number" do
|
|
27
|
+
# Die.any_instance.stub(:roll).and_return(3)
|
|
28
|
+
allow_any_instance_of(Die).to receive(:number).and_return(3)
|
|
29
|
+
@fundrequest = FundRequest.new("My Friendly Start-up Projects")
|
|
30
|
+
@fundrequest.add_project(@project)
|
|
31
|
+
@fundrequest.request_funding(1)
|
|
32
|
+
expect(@project.current_funding).to eq(@initial_funding - 15)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require 'fund_raise/project'
|
|
2
|
+
require 'fund_raise/die'
|
|
3
|
+
|
|
4
|
+
module FundRaise
|
|
5
|
+
describe Project do
|
|
6
|
+
|
|
7
|
+
before do
|
|
8
|
+
$stdout = StringIO.new
|
|
9
|
+
@initial_funding = 150
|
|
10
|
+
@target = 3000
|
|
11
|
+
@project = Project.new("Project LMN", @target, @initial_funding)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "has an initial default funding of 0" do
|
|
15
|
+
@project = Project.new("Project LMN", @target)
|
|
16
|
+
|
|
17
|
+
# @project.current_funding.should == 0
|
|
18
|
+
expect(@project.current_funding).to eq(0)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "increased funds by 25 when funds are added" do
|
|
22
|
+
@project.add_funds
|
|
23
|
+
# @project.current_funding.should == @initial_funding + 25
|
|
24
|
+
expect(@project.current_funding).to eq(@initial_funding + 25)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "decreased funds by 15 when funds are removed" do
|
|
28
|
+
@project.remove_funds
|
|
29
|
+
# @project.current_funding.should == @initial_funding - 15
|
|
30
|
+
expect(@project.current_funding).to eq(@initial_funding - 15)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "increased funds and show funding outstanding" do
|
|
34
|
+
@project.add_funds(50)
|
|
35
|
+
# @project.funding_left.should == @initial_funding + 50
|
|
36
|
+
expect(@project.funding_left).to eq(@target - (@initial_funding + 50))
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "is fully funded" do
|
|
40
|
+
@project.add_funds(@target)
|
|
41
|
+
expect(@project.fully_funded?).to be true
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "is fully funded" do
|
|
45
|
+
@project.remove_funds(@initial_funding)
|
|
46
|
+
@project.add_funds(@target)
|
|
47
|
+
expect(@project.fully_funded?).to be true
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "is not fully funded" do
|
|
51
|
+
@project.remove_funds(@initial_funding)
|
|
52
|
+
@project.add_funds(@target-1)
|
|
53
|
+
expect(@project.fully_funded?).to be false
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: fund_raise_978
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Peter Fund Raise
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rspec
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description: This Gem allows you to raise funds for various projects.
|
|
28
|
+
email: prios978@fundraise978.com
|
|
29
|
+
executables:
|
|
30
|
+
- fund_raise_978
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- LICENSE
|
|
35
|
+
- README
|
|
36
|
+
- bin/fund_raise_978
|
|
37
|
+
- bin/projects.csv
|
|
38
|
+
- lib/fund_raise/die.rb
|
|
39
|
+
- lib/fund_raise/fund_request.rb
|
|
40
|
+
- lib/fund_raise/fundable.rb
|
|
41
|
+
- lib/fund_raise/funding_round.rb
|
|
42
|
+
- lib/fund_raise/pledge_pool.rb
|
|
43
|
+
- lib/fund_raise/project.rb
|
|
44
|
+
- lib/fund_raise/project_grant.rb
|
|
45
|
+
- lib/fund_raise/project_match.rb
|
|
46
|
+
- spec/fund_raise/fund_request_spec.rb
|
|
47
|
+
- spec/fund_raise/project_spec.rb
|
|
48
|
+
homepage: http://fundraise978.com
|
|
49
|
+
licenses:
|
|
50
|
+
- MIT
|
|
51
|
+
metadata: {}
|
|
52
|
+
post_install_message:
|
|
53
|
+
rdoc_options: []
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '1.9'
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubyforge_project:
|
|
68
|
+
rubygems_version: 2.4.5.1
|
|
69
|
+
signing_key:
|
|
70
|
+
specification_version: 4
|
|
71
|
+
summary: raise funds for projects
|
|
72
|
+
test_files:
|
|
73
|
+
- spec/fund_raise/fund_request_spec.rb
|
|
74
|
+
- spec/fund_raise/project_spec.rb
|