core_merchant 0.2.2 → 0.5.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.lock +1 -1
- data/lib/core_merchant/subscription_plan.rb +1 -1
- data/lib/core_merchant/version.rb +1 -1
- data/lib/generators/core_merchant/install_generator.rb +26 -1
- data/lib/generators/core_merchant/templates/core_merchant.en.yml +4 -0
- data/lib/generators/core_merchant/templates/core_merchant.erb +5 -0
- metadata +3 -2
- data/lib/generators/core_merchant/templates/core_merchant.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 465238229ff4e985efc17153d4d8efc1cca941745ded4a1e5dbe3a189499e6d0
|
4
|
+
data.tar.gz: 07ee307e66cbf913b89abbb41ec1eaa92a5ed5e981a577148cba3e8be0c02e95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e85d2853136062219964072612ec3d82a8fa2296b3cf71f3400e1f68b01ff19c9ce7da09ef0acdcc9b681aecb487ae5680e9342df5428f7281d12569cad860c
|
7
|
+
data.tar.gz: 851db004b49a0ac7e0c737c6a53741b5d8747acfa052dedba8e78ac959ff532b02ff556a5a8a6a59cfe65b5aa0aec7cdb92d7500161904b37afdbd3ca1457607
|
data/Gemfile.lock
CHANGED
@@ -18,7 +18,7 @@ module CoreMerchant
|
|
18
18
|
#
|
19
19
|
# Example:
|
20
20
|
# ```
|
21
|
-
# plan = CoreMerchant::SubscriptionPlan.new(name_key: "
|
21
|
+
# plan = CoreMerchant::SubscriptionPlan.new(name_key: "basic_monthly", price_cents: 7_99)
|
22
22
|
# plan.save
|
23
23
|
# ```
|
24
24
|
#
|
@@ -10,8 +10,16 @@ module CoreMerchant
|
|
10
10
|
|
11
11
|
source_root File.expand_path("templates", __dir__)
|
12
12
|
|
13
|
+
class_option :customer_class, type: :string, required: true,
|
14
|
+
desc: "Name of your existing customer class, e.g. User"
|
15
|
+
|
13
16
|
def copy_initializer
|
14
|
-
|
17
|
+
@customer_class = options[:customer_class].classify
|
18
|
+
template "core_merchant.erb", "config/initializers/core_merchant.rb"
|
19
|
+
end
|
20
|
+
|
21
|
+
def copy_locales
|
22
|
+
template "core_merchant.en.yml", "config/locales/core_merchant.en.yml"
|
15
23
|
end
|
16
24
|
|
17
25
|
def self.next_migration_number(_dir)
|
@@ -22,6 +30,23 @@ module CoreMerchant
|
|
22
30
|
migration_template "create_core_merchant_subscription_plans.erb",
|
23
31
|
"db/migrate/create_core_merchant_subscription_plans.rb"
|
24
32
|
end
|
33
|
+
|
34
|
+
def show_post_install
|
35
|
+
say "CoreMerchant has been successfully installed.", :green
|
36
|
+
say "Customer class: #{@customer_class}"
|
37
|
+
say "Please run `rails db:migrate` to create the subscription plans table."
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.banner
|
41
|
+
"rails generate core_merchant:install --customer_class=User"
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.description
|
45
|
+
<<~DESC
|
46
|
+
Installs CoreMerchant into your application with the specified customer class.
|
47
|
+
This could be User, Customer, or any other existing model in your application that represents a customer."
|
48
|
+
DESC
|
49
|
+
end
|
25
50
|
end
|
26
51
|
end
|
27
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core_merchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seyithan Teymur
|
@@ -134,7 +134,8 @@ files:
|
|
134
134
|
- lib/core_merchant/subscription_plan.rb
|
135
135
|
- lib/core_merchant/version.rb
|
136
136
|
- lib/generators/core_merchant/install_generator.rb
|
137
|
-
- lib/generators/core_merchant/templates/core_merchant.
|
137
|
+
- lib/generators/core_merchant/templates/core_merchant.en.yml
|
138
|
+
- lib/generators/core_merchant/templates/core_merchant.erb
|
138
139
|
- lib/generators/core_merchant/templates/create_core_merchant_subscription_plans.erb
|
139
140
|
- sig/core_merchant.rbs
|
140
141
|
homepage: https://github.com/theseyithan/core_merchant
|