payfast 1.0.1 → 1.0.2

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: 0d93902540cd8d2052c2c21f4c1ad469be1cbb9532f3c6ba20bcaa4d84047b28
4
- data.tar.gz: beef56fd565707a474944374d320bac4a369a10e68c4ac35c4d462e58cd38186
3
+ metadata.gz: 3a4574ba86a681658b8f23c60ffd4139e6d59d6abc5017a78042f05b302624e4
4
+ data.tar.gz: 47ed239d23fcd5966db19cefdb119ad8b0366e61dfed31c21d80ad848508f4e9
5
5
  SHA512:
6
- metadata.gz: be4c605758122af4e5fdb7e768852e0c76f02b6ee97e4bdf95eb8fe1a8dec2dabe4aae87e72c28e9e49a6f4a0a380a501d917666cccd09dd6845ad1a3c75ee9d
7
- data.tar.gz: 5540c7288967670d4e87f87f32de82519b1ff127ec3e43c37c960ddc2bace989c9f8e25d28ee35d3160bee62aea10d7d84be6f4c911e6bf2e8c70a13e998132c
6
+ metadata.gz: 3398d67e68303c866e80d60bafe730ee3093d9bddb18ab499d0f50017dc5fb3300ac512597fc7f8d49d73b1cbfdd74c362f881778d314e4845ddc47eb8727661
7
+ data.tar.gz: ab136a269460fb4d03de079ea2195a5aa9be3d5bea253c3046f948da648ef2e7992b2aa6849a9ddd4832d9d6a8b5c75477834c2cdf0b448a05c049a0446c2847
@@ -0,0 +1,54 @@
1
+ require "rails/generators"
2
+
3
+ module Payfast
4
+ class InstallGenerator < Rails::Generators::Base
5
+ source_root File.expand_path("templates", __dir__)
6
+
7
+ def modify_routes
8
+ insert_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
9
+ # Read and insert the contents of your routes template file
10
+ File.read(File.join(__dir__, "templates", "routes.rb"))
11
+ end
12
+ end
13
+
14
+ def create_controller
15
+ template "controller.rb", File.join("app/controllers", "#{controller_file_name}_controller.rb")
16
+ end
17
+
18
+ def create_views
19
+ actions.each do |action|
20
+ template "#{action}.html.erb", File.join("app/views", controller_file_name, "#{action}.html.erb")
21
+ end
22
+ end
23
+
24
+ def create_view_helper
25
+ template "helper.rb", "app/helpers/carts_helper.rb"
26
+ end
27
+
28
+ def create_migration
29
+ template "migration.rb", "db/migrate/#{timestamp}_create_carts.rb"
30
+ end
31
+
32
+ def create_config_file
33
+ template "config.yml", "config/payfast.yml"
34
+ end
35
+
36
+ def create_model
37
+ template "model.rb", "app/models/cart.rb"
38
+ end
39
+
40
+ private
41
+
42
+ def controller_file_name
43
+ "carts"
44
+ end
45
+
46
+ def timestamp
47
+ Time.now.strftime("%Y%m%d%H%M%S")
48
+ end
49
+
50
+ def actions
51
+ %w(index make_payment)
52
+ end
53
+ end
54
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payfast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dellan Muchengapadare
@@ -60,16 +60,16 @@ extra_rdoc_files: []
60
60
  files:
61
61
  - LICENSE
62
62
  - README.md
63
- - lib/generators.rb
64
- - lib/onsite_payments.rb
65
- - lib/templates/config.yml
66
- - lib/templates/controller.rb
67
- - lib/templates/helper.rb
68
- - lib/templates/index.html.erb
69
- - lib/templates/make_payment.html.erb
70
- - lib/templates/migration.rb
71
- - lib/templates/model.rb
72
- - lib/templates/routes.rb
63
+ - lib/generators/payfast/install_generator.rb
64
+ - lib/generators/payfast/templates/config.yml
65
+ - lib/generators/payfast/templates/controller.rb
66
+ - lib/generators/payfast/templates/helper.rb
67
+ - lib/generators/payfast/templates/index.html.erb
68
+ - lib/generators/payfast/templates/make_payment.html.erb
69
+ - lib/generators/payfast/templates/migration.rb
70
+ - lib/generators/payfast/templates/model.rb
71
+ - lib/generators/payfast/templates/routes.rb
72
+ - lib/payfast/onsite_payments.rb
73
73
  homepage: https://github.com/mactunechy/payfast-gem
74
74
  licenses:
75
75
  - MIT
data/lib/generators.rb DELETED
@@ -1,56 +0,0 @@
1
- require "rails/generators"
2
-
3
- module Payfast
4
- module Generators
5
- class InstallGenerator < Rails::Generators::Base
6
- source_root File.expand_path("templates", __dir__)
7
-
8
- def modify_routes
9
- insert_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
10
- # Read and insert the contents of your routes template file
11
- File.read(File.join(__dir__, "templates", "routes.rb"))
12
- end
13
- end
14
-
15
- def create_controller
16
- template "controller.rb", File.join("app/controllers", "#{controller_file_name}_controller.rb")
17
- end
18
-
19
- def create_views
20
- actions.each do |action|
21
- template "#{action}.html.erb", File.join("app/views", controller_file_name, "#{action}.html.erb")
22
- end
23
- end
24
-
25
- def create_view_helper
26
- template "helper.rb", "app/helpers/carts_helper.rb"
27
- end
28
-
29
- def create_migration
30
- template "migration.rb", "db/migrate/#{timestamp}_create_carts.rb"
31
- end
32
-
33
- def create_config_file
34
- template "config.yml", "config/payfast.yml"
35
- end
36
-
37
- def create_model
38
- template "model.rb", "app/models/cart.rb"
39
- end
40
-
41
- private
42
-
43
- def controller_file_name
44
- "carts"
45
- end
46
-
47
- def timestamp
48
- Time.now.strftime("%Y%m%d%H%M%S")
49
- end
50
-
51
- def actions
52
- %w(index make_payment)
53
- end
54
- end
55
- end
56
- end