paid_up 0.4.0 → 0.4.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 +4 -4
- data/Gemfile +0 -1
- data/README.md +1 -2
- data/VERSION +1 -1
- data/paid_up.gemspec +3 -8
- data/spec/dummy/db/seeds.rb +139 -0
- metadata +2 -18
- data/spec/dummy/db/seeds/plan_feature_settings.seeds.rb +0 -47
- data/spec/dummy/db/seeds/plans.seeds.rb +0 -91
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c5c93d2db20e8152a346dee55ed095d166258bb
|
4
|
+
data.tar.gz: b46846afea23f975d2373b4ba45eaf3b4e8ebbf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85966a87a4a92f0a7ed6f0cf0c6107f66c38b8f446e59460d731448ee1beea7ee2acbf6b42f1bd00453022f538b0ac519abf4c460a04d15ee1e25a87b9e1f217
|
7
|
+
data.tar.gz: 82fb4ca355abfc9ad160c481b41030dcf7b0c8a3177f3236f3d2ff90a4f990aad3c0bee49b3f5aa306c7d4e491bbef9fcbe3f08ecddd6cf7e6d7e8077fbbd3bc
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -31,7 +31,6 @@ Next, install PaidUp for your user model by executing these commands:
|
|
31
31
|
|
32
32
|
## Configuration
|
33
33
|
|
34
|
-
|
35
34
|
Edit your config file at `config/initializers/paid_up.rb` to set up some other key details.
|
36
35
|
|
37
36
|
Set your environment variables with your STRIPE_PUBLISHABLE_KEY and your STRIPE_SECRET_KEY. (Check your operating system or IDE's documentation for details)
|
@@ -44,7 +43,7 @@ Next, add a `Stripe::Customer` to serve as the Anonymous User, and subscribe tha
|
|
44
43
|
|
45
44
|
## Features Setup
|
46
45
|
|
47
|
-
Set up each `PaidUp::Feature` using the config file. (A config file is used rather than using records in an `ActiveRecord::Base` model because relationships cannot be created at runtime.) Associate the features with the corresponding plans using the `PaidUp::PlanFeatureSetting` model. For an example, check out the seeds
|
46
|
+
Set up each `PaidUp::Feature` using the config file. (A config file is used rather than using records in an `ActiveRecord::Base` model because relationships cannot be created at runtime.) Associate the features with the corresponding plans using the `PaidUp::PlanFeatureSetting` model. For an example, check out the seeds file at [`spec/dummy/db/seeds.db`](spec/dummy/db/seeds.db)
|
48
47
|
|
49
48
|
Possible `:setting_type` values are: `boolean`, `table_rows`, `rolify_rows`. The latter two require that a table corresponding to the feature's `:name` value.
|
50
49
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/paid_up.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: paid_up 0.4.
|
5
|
+
# stub: paid_up 0.4.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "paid_up"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -135,8 +135,6 @@ Gem::Specification.new do |s|
|
|
135
135
|
"spec/dummy/db/migrate/20150523010840_add_stripe_id_column_to_users.paid_up.rb",
|
136
136
|
"spec/dummy/db/schema.rb",
|
137
137
|
"spec/dummy/db/seeds.rb",
|
138
|
-
"spec/dummy/db/seeds/plan_feature_settings.seeds.rb",
|
139
|
-
"spec/dummy/db/seeds/plans.seeds.rb",
|
140
138
|
"spec/dummy/db/test.sqlite3",
|
141
139
|
"spec/dummy/lib/assets/.keep",
|
142
140
|
"spec/dummy/log/.keep",
|
@@ -176,7 +174,7 @@ Gem::Specification.new do |s|
|
|
176
174
|
]
|
177
175
|
s.homepage = "http://www.gemvein.com/museum/cases/paid_up"
|
178
176
|
s.licenses = ["MIT"]
|
179
|
-
s.rubygems_version = "2.4.
|
177
|
+
s.rubygems_version = "2.4.5"
|
180
178
|
s.summary = "Allows a model of your choosing to subscribe to a plan, which enables features."
|
181
179
|
|
182
180
|
if s.respond_to? :specification_version then
|
@@ -190,7 +188,6 @@ Gem::Specification.new do |s|
|
|
190
188
|
s.add_runtime_dependency(%q<uglifier>, ["~> 2.7"])
|
191
189
|
s.add_runtime_dependency(%q<jeweler>, ["~> 2"])
|
192
190
|
s.add_runtime_dependency(%q<bootstrap_leather>, ["~> 0.5"])
|
193
|
-
s.add_runtime_dependency(%q<seedbank>, ["~> 0.3"])
|
194
191
|
s.add_runtime_dependency(%q<chronic>, ["~> 0.10"])
|
195
192
|
s.add_runtime_dependency(%q<money>, ["~> 6.5"])
|
196
193
|
s.add_runtime_dependency(%q<devise>, ["~> 3.4"])
|
@@ -210,7 +207,6 @@ Gem::Specification.new do |s|
|
|
210
207
|
s.add_dependency(%q<uglifier>, ["~> 2.7"])
|
211
208
|
s.add_dependency(%q<jeweler>, ["~> 2"])
|
212
209
|
s.add_dependency(%q<bootstrap_leather>, ["~> 0.5"])
|
213
|
-
s.add_dependency(%q<seedbank>, ["~> 0.3"])
|
214
210
|
s.add_dependency(%q<chronic>, ["~> 0.10"])
|
215
211
|
s.add_dependency(%q<money>, ["~> 6.5"])
|
216
212
|
s.add_dependency(%q<devise>, ["~> 3.4"])
|
@@ -231,7 +227,6 @@ Gem::Specification.new do |s|
|
|
231
227
|
s.add_dependency(%q<uglifier>, ["~> 2.7"])
|
232
228
|
s.add_dependency(%q<jeweler>, ["~> 2"])
|
233
229
|
s.add_dependency(%q<bootstrap_leather>, ["~> 0.5"])
|
234
|
-
s.add_dependency(%q<seedbank>, ["~> 0.3"])
|
235
230
|
s.add_dependency(%q<chronic>, ["~> 0.10"])
|
236
231
|
s.add_dependency(%q<money>, ["~> 6.5"])
|
237
232
|
s.add_dependency(%q<devise>, ["~> 3.4"])
|
data/spec/dummy/db/seeds.rb
CHANGED
@@ -0,0 +1,139 @@
|
|
1
|
+
###############
|
2
|
+
# Plans #
|
3
|
+
###############
|
4
|
+
|
5
|
+
Stripe::Plan.find_or_create_by_id(
|
6
|
+
'anonymous-plan',
|
7
|
+
{
|
8
|
+
:amount => 0,
|
9
|
+
:interval => 'month',
|
10
|
+
:name => 'Anonymous Plan',
|
11
|
+
:currency => 'usd',
|
12
|
+
:id => 'anonymous-plan'
|
13
|
+
}
|
14
|
+
)
|
15
|
+
anonymous = PaidUp::Plan.create(
|
16
|
+
name: 'Anonymous',
|
17
|
+
stripe_id: 'anonymous-plan',
|
18
|
+
description: "What you can do without logging in.",
|
19
|
+
sort_order: -1
|
20
|
+
)
|
21
|
+
Stripe::Plan.find_or_create_by_id(
|
22
|
+
'free-plan',
|
23
|
+
{
|
24
|
+
:amount => 0,
|
25
|
+
:interval => 'month',
|
26
|
+
:name => 'Free Plan',
|
27
|
+
:currency => 'usd',
|
28
|
+
:id => 'free-plan'
|
29
|
+
}
|
30
|
+
)
|
31
|
+
free = PaidUp::Plan.create(
|
32
|
+
name: 'Free',
|
33
|
+
stripe_id: 'free-plan',
|
34
|
+
description: "Can't beat the price!",
|
35
|
+
sort_order: 0
|
36
|
+
)
|
37
|
+
Stripe::Plan.find_or_create_by_id(
|
38
|
+
'no-ads-plan',
|
39
|
+
{
|
40
|
+
:amount => 100,
|
41
|
+
:interval => 'month',
|
42
|
+
:name => 'No Ads Plan',
|
43
|
+
:currency => 'usd',
|
44
|
+
:id => 'no-ads-plan'
|
45
|
+
}
|
46
|
+
)
|
47
|
+
no_ads = PaidUp::Plan.create(
|
48
|
+
name: 'No Ads',
|
49
|
+
stripe_id: 'no-ads-plan',
|
50
|
+
description: "No frills, just removes the ads.",
|
51
|
+
sort_order: 1
|
52
|
+
)
|
53
|
+
Stripe::Plan.find_or_create_by_id(
|
54
|
+
'group-leader-plan',
|
55
|
+
{
|
56
|
+
:amount => 500,
|
57
|
+
:interval => 'month',
|
58
|
+
:name => 'Group Leader Plan',
|
59
|
+
:currency => 'usd',
|
60
|
+
:id => 'group-leader-plan'
|
61
|
+
}
|
62
|
+
)
|
63
|
+
group_leader = PaidUp::Plan.create(
|
64
|
+
name: 'Group Leader',
|
65
|
+
stripe_id: 'group-leader-plan',
|
66
|
+
description: "For leaders of single groups, with configuration.",
|
67
|
+
sort_order: 2
|
68
|
+
)
|
69
|
+
Stripe::Plan.find_or_create_by_id(
|
70
|
+
'professional-plan',
|
71
|
+
{
|
72
|
+
:amount => 1000,
|
73
|
+
:interval => 'month',
|
74
|
+
:name => 'Professional Plan',
|
75
|
+
:currency => 'usd',
|
76
|
+
:id => 'professional-plan'
|
77
|
+
}
|
78
|
+
)
|
79
|
+
professional = PaidUp::Plan.create(
|
80
|
+
name: 'Professional',
|
81
|
+
stripe_id: 'professional-plan',
|
82
|
+
description: "Designed for professionals with unlimited groups, a calendar and configuration.",
|
83
|
+
sort_order: 3
|
84
|
+
)
|
85
|
+
######################
|
86
|
+
# Anonymous Customer #
|
87
|
+
######################
|
88
|
+
Stripe::Customer.find_or_create_by_id(
|
89
|
+
'anonymous-customer',
|
90
|
+
{
|
91
|
+
id: 'anonymous-customer',
|
92
|
+
description: 'Anonymous Customer',
|
93
|
+
plan: 'anonymous-plan'
|
94
|
+
}
|
95
|
+
)
|
96
|
+
#######################
|
97
|
+
# PlanFeatureSettings #
|
98
|
+
#######################
|
99
|
+
|
100
|
+
# Ad Free
|
101
|
+
PaidUp::PlanFeatureSetting.create(
|
102
|
+
feature: 'ad_free',
|
103
|
+
plan: no_ads,
|
104
|
+
setting: 1
|
105
|
+
)
|
106
|
+
|
107
|
+
# Group Leader
|
108
|
+
PaidUp::PlanFeatureSetting.create(
|
109
|
+
feature: 'ad_free',
|
110
|
+
plan: group_leader,
|
111
|
+
setting: 1
|
112
|
+
)
|
113
|
+
PaidUp::PlanFeatureSetting.create(
|
114
|
+
feature: 'groups',
|
115
|
+
plan: group_leader,
|
116
|
+
setting: 1
|
117
|
+
)
|
118
|
+
PaidUp::PlanFeatureSetting.create(
|
119
|
+
feature: 'doodads',
|
120
|
+
plan: group_leader,
|
121
|
+
setting: 5
|
122
|
+
)
|
123
|
+
|
124
|
+
# Professional
|
125
|
+
PaidUp::PlanFeatureSetting.create(
|
126
|
+
feature: 'ad_free',
|
127
|
+
plan: professional,
|
128
|
+
setting: 1
|
129
|
+
)
|
130
|
+
PaidUp::PlanFeatureSetting.create(
|
131
|
+
feature: 'groups',
|
132
|
+
plan: professional,
|
133
|
+
setting: PaidUp::Unlimited.to_i(:db)
|
134
|
+
)
|
135
|
+
PaidUp::PlanFeatureSetting.create(
|
136
|
+
feature: 'doodads',
|
137
|
+
plan: professional,
|
138
|
+
setting: PaidUp::Unlimited.to_i(:db)
|
139
|
+
)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paid_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karen Lundgren
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.5'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: seedbank
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0.3'
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0.3'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: chronic
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -401,8 +387,6 @@ files:
|
|
401
387
|
- spec/dummy/db/migrate/20150523010840_add_stripe_id_column_to_users.paid_up.rb
|
402
388
|
- spec/dummy/db/schema.rb
|
403
389
|
- spec/dummy/db/seeds.rb
|
404
|
-
- spec/dummy/db/seeds/plan_feature_settings.seeds.rb
|
405
|
-
- spec/dummy/db/seeds/plans.seeds.rb
|
406
390
|
- spec/dummy/db/test.sqlite3
|
407
391
|
- spec/dummy/lib/assets/.keep
|
408
392
|
- spec/dummy/log/.keep
|
@@ -459,7 +443,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
459
443
|
version: '0'
|
460
444
|
requirements: []
|
461
445
|
rubyforge_project:
|
462
|
-
rubygems_version: 2.4.
|
446
|
+
rubygems_version: 2.4.5
|
463
447
|
signing_key:
|
464
448
|
specification_version: 4
|
465
449
|
summary: Allows a model of your choosing to subscribe to a plan, which enables features.
|
@@ -1,47 +0,0 @@
|
|
1
|
-
after :plans do
|
2
|
-
free = PaidUp::Plan.find_by_name 'Free'
|
3
|
-
no_ads = PaidUp::Plan.find_by_name 'No Ads'
|
4
|
-
group_leader = PaidUp::Plan.find_by_name 'Group Leader'
|
5
|
-
professional = PaidUp::Plan.find_by_name 'Professional'
|
6
|
-
|
7
|
-
# Ad Free
|
8
|
-
PaidUp::PlanFeatureSetting.create(
|
9
|
-
feature: 'ad_free',
|
10
|
-
plan: no_ads,
|
11
|
-
setting: 1
|
12
|
-
)
|
13
|
-
|
14
|
-
# Group Leader
|
15
|
-
PaidUp::PlanFeatureSetting.create(
|
16
|
-
feature: 'ad_free',
|
17
|
-
plan: group_leader,
|
18
|
-
setting: 1
|
19
|
-
)
|
20
|
-
PaidUp::PlanFeatureSetting.create(
|
21
|
-
feature: 'groups',
|
22
|
-
plan: group_leader,
|
23
|
-
setting: 1
|
24
|
-
)
|
25
|
-
PaidUp::PlanFeatureSetting.create(
|
26
|
-
feature: 'doodads',
|
27
|
-
plan: group_leader,
|
28
|
-
setting: 5
|
29
|
-
)
|
30
|
-
|
31
|
-
# Professional
|
32
|
-
PaidUp::PlanFeatureSetting.create(
|
33
|
-
feature: 'ad_free',
|
34
|
-
plan: professional,
|
35
|
-
setting: 1
|
36
|
-
)
|
37
|
-
PaidUp::PlanFeatureSetting.create(
|
38
|
-
feature: 'groups',
|
39
|
-
plan: professional,
|
40
|
-
setting: PaidUp::Unlimited.to_i(:db)
|
41
|
-
)
|
42
|
-
PaidUp::PlanFeatureSetting.create(
|
43
|
-
feature: 'doodads',
|
44
|
-
plan: professional,
|
45
|
-
setting: PaidUp::Unlimited.to_i(:db)
|
46
|
-
)
|
47
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
Stripe::Plan.find_or_create_by_id(
|
2
|
-
'anonymous-plan',
|
3
|
-
{
|
4
|
-
:amount => 0,
|
5
|
-
:interval => 'month',
|
6
|
-
:name => 'Anonymous Plan',
|
7
|
-
:currency => 'usd',
|
8
|
-
:id => 'anonymous-plan'
|
9
|
-
}
|
10
|
-
)
|
11
|
-
PaidUp::Plan.create(
|
12
|
-
name: 'Anonymous',
|
13
|
-
stripe_id: 'anonymous-plan',
|
14
|
-
description: "What you can do without logging in.",
|
15
|
-
sort_order: -1
|
16
|
-
)
|
17
|
-
Stripe::Plan.find_or_create_by_id(
|
18
|
-
'free-plan',
|
19
|
-
{
|
20
|
-
:amount => 0,
|
21
|
-
:interval => 'month',
|
22
|
-
:name => 'Free Plan',
|
23
|
-
:currency => 'usd',
|
24
|
-
:id => 'free-plan'
|
25
|
-
}
|
26
|
-
)
|
27
|
-
PaidUp::Plan.create(
|
28
|
-
name: 'Free',
|
29
|
-
stripe_id: 'free-plan',
|
30
|
-
description: "Can't beat the price!",
|
31
|
-
sort_order: 0
|
32
|
-
)
|
33
|
-
Stripe::Plan.find_or_create_by_id(
|
34
|
-
'no-ads-plan',
|
35
|
-
{
|
36
|
-
:amount => 100,
|
37
|
-
:interval => 'month',
|
38
|
-
:name => 'No Ads Plan',
|
39
|
-
:currency => 'usd',
|
40
|
-
:id => 'no-ads-plan'
|
41
|
-
}
|
42
|
-
)
|
43
|
-
PaidUp::Plan.create(
|
44
|
-
name: 'No Ads',
|
45
|
-
stripe_id: 'no-ads-plan',
|
46
|
-
description: "No frills, just removes the ads.",
|
47
|
-
sort_order: 1
|
48
|
-
)
|
49
|
-
Stripe::Plan.find_or_create_by_id(
|
50
|
-
'group-leader-plan',
|
51
|
-
{
|
52
|
-
:amount => 500,
|
53
|
-
:interval => 'month',
|
54
|
-
:name => 'Group Leader Plan',
|
55
|
-
:currency => 'usd',
|
56
|
-
:id => 'group-leader-plan'
|
57
|
-
}
|
58
|
-
)
|
59
|
-
PaidUp::Plan.create(
|
60
|
-
name: 'Group Leader',
|
61
|
-
stripe_id: 'group-leader-plan',
|
62
|
-
description: "For leaders of single groups, with configuration.",
|
63
|
-
sort_order: 2
|
64
|
-
)
|
65
|
-
Stripe::Plan.find_or_create_by_id(
|
66
|
-
'professional-plan',
|
67
|
-
{
|
68
|
-
:amount => 1000,
|
69
|
-
:interval => 'month',
|
70
|
-
:name => 'Professional Plan',
|
71
|
-
:currency => 'usd',
|
72
|
-
:id => 'professional-plan'
|
73
|
-
}
|
74
|
-
)
|
75
|
-
PaidUp::Plan.create(
|
76
|
-
name: 'Professional',
|
77
|
-
stripe_id: 'professional-plan',
|
78
|
-
description: "Designed for professionals with unlimited groups, a calendar and configuration.",
|
79
|
-
sort_order: 3
|
80
|
-
)
|
81
|
-
######################
|
82
|
-
# Anonymous Customer #
|
83
|
-
######################
|
84
|
-
Stripe::Customer.find_or_create_by_id(
|
85
|
-
'anonymous-customer',
|
86
|
-
{
|
87
|
-
id: 'anonymous-customer',
|
88
|
-
description: 'Anonymous Customer',
|
89
|
-
plan: 'anonymous-plan'
|
90
|
-
}
|
91
|
-
)
|