core_merchant 0.3.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57cd9272d6c0056fdfd69e31fa31d88ebcee7e0f707d45201564ff464a1ad1d8
4
- data.tar.gz: 8715a63c453c11936e17b98d9712073a1f083f9f35170e6723d03f7789eef67f
3
+ metadata.gz: 465238229ff4e985efc17153d4d8efc1cca941745ded4a1e5dbe3a189499e6d0
4
+ data.tar.gz: 07ee307e66cbf913b89abbb41ec1eaa92a5ed5e981a577148cba3e8be0c02e95
5
5
  SHA512:
6
- metadata.gz: cd166c331713fe259316708d16aee09ed7144a54302a52bf5b3aae298e58fa9bee37cc6371f54b3e6bf622be5fcf76ba5b2449e1fafd39e0ce177a5a1be44851
7
- data.tar.gz: a9760cb3d38f36b196bf0f3c22abee20e357bd1cd176c1385e36d00febf5ddbf07135a03a961454d65743063d6cb528f296836a19e042d062a5f557c8892652b
6
+ metadata.gz: 6e85d2853136062219964072612ec3d82a8fa2296b3cf71f3400e1f68b01ff19c9ce7da09ef0acdcc9b681aecb487ae5680e9342df5428f7281d12569cad860c
7
+ data.tar.gz: 851db004b49a0ac7e0c737c6a53741b5d8747acfa052dedba8e78ac959ff532b02ff556a5a8a6a59cfe65b5aa0aec7cdb92d7500161904b37afdbd3ca1457607
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- core_merchant (0.2.2)
4
+ core_merchant (0.5.0)
5
5
  activesupport (~> 7.0)
6
6
  rails (~> 7.0)
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoreMerchant
4
- VERSION = "0.3.0"
4
+ VERSION = "0.5.1"
5
5
  end
@@ -10,8 +10,12 @@ 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
- template "core_merchant.rb", "config/initializers/core_merchant.rb"
17
+ @customer_class = options[:customer_class].classify
18
+ template "core_merchant.erb", "config/initializers/core_merchant.rb"
15
19
  end
16
20
 
17
21
  def copy_locales
@@ -26,6 +30,23 @@ module CoreMerchant
26
30
  migration_template "create_core_merchant_subscription_plans.erb",
27
31
  "db/migrate/create_core_merchant_subscription_plans.rb"
28
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
29
50
  end
30
51
  end
31
52
  end
@@ -0,0 +1,5 @@
1
+ # Created by: rails generate core_merchant:install --customer_class=<%= @customer_class %>
2
+
3
+ CoreMerchant.configure do |config|
4
+ config.customer_class = "<%= @customer_class %>"
5
+ 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.3.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seyithan Teymur
@@ -135,7 +135,7 @@ files:
135
135
  - lib/core_merchant/version.rb
136
136
  - lib/generators/core_merchant/install_generator.rb
137
137
  - lib/generators/core_merchant/templates/core_merchant.en.yml
138
- - lib/generators/core_merchant/templates/core_merchant.rb
138
+ - lib/generators/core_merchant/templates/core_merchant.erb
139
139
  - lib/generators/core_merchant/templates/create_core_merchant_subscription_plans.erb
140
140
  - sig/core_merchant.rbs
141
141
  homepage: https://github.com/theseyithan/core_merchant
@@ -1,4 +0,0 @@
1
- # Created by: rails generate core_merchant:install
2
- CoreMerchant.configure do |config|
3
- # config.customer_class = "User" # Uncomment and set to your class name that can represent a customer
4
- end