rails_apps_composer 3.0.32 → 3.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/recipes/core.rb +1 -0
- data/recipes/devise.rb +3 -1
- data/recipes/init.rb +17 -0
- data/recipes/rails_stripe_coupons.rb +125 -0
- data/recipes/railsapps.rb +2 -1
- data/recipes/setup.rb +2 -2
- data/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a7b50abd2256e51868148c1cb8202e33b43228
|
4
|
+
data.tar.gz: 1843bf2b29aceb70954aac6d23be17a59009a805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a40b574707896053edb43a589457e8a6e4db92da0bffb450b39fbf02260419deb385dbd2acdde043eda141c2281ae6eb5d29e2497f30e16bc11ad1ad854ad51d
|
7
|
+
data.tar.gz: 3fd7f8ebb384e0af05a336f9e194dcafecc5b9d284487f9e3c35f8274411a53afc7ee7d12078fe81d1ebb5f10853af0be86ee65d91cf630ebbd37d201cf69db6
|
data/recipes/core.rb
CHANGED
data/recipes/devise.rb
CHANGED
@@ -9,7 +9,9 @@ stage_two do
|
|
9
9
|
generate 'devise:install'
|
10
10
|
generate 'devise_invitable:install' if prefer :devise_modules, 'invitable'
|
11
11
|
generate 'devise user' # create the User model
|
12
|
-
|
12
|
+
unless (prefer :apps4, 'rails-stripe-checkout') || (prefer :apps4, 'rails-stripe-coupons')
|
13
|
+
generate 'migration AddNameToUsers name:string'
|
14
|
+
end
|
13
15
|
if (prefer :devise_modules, 'confirmable') || (prefer :devise_modules, 'invitable')
|
14
16
|
gsub_file 'app/models/user.rb', /:registerable,/, ":registerable, :confirmable,"
|
15
17
|
generate 'migration AddConfirmableToUsers confirmation_token:string confirmed_at:datetime confirmation_sent_at:datetime unconfirmed_email:string'
|
data/recipes/init.rb
CHANGED
@@ -61,6 +61,11 @@ stage_three do
|
|
61
61
|
append_file '.env', foreman_omniauth if prefer :local_env_file, 'foreman'
|
62
62
|
append_file 'config/application.yml', figaro_omniauth if prefer :local_env_file, 'figaro'
|
63
63
|
end
|
64
|
+
## rails-stripe-coupons
|
65
|
+
if prefer :apps4, 'rails-stripe-coupons'
|
66
|
+
gsub_file 'config/secrets.yml', /<%= ENV\["PRODUCT_TITLE"] %>/, 'What is Ruby on Rails'
|
67
|
+
gsub_file 'config/secrets.yml', /<%= ENV\["PRODUCT_PRICE"] %>/, '995'
|
68
|
+
end
|
64
69
|
### EXAMPLE FILE FOR FOREMAN AND FIGARO ###
|
65
70
|
if prefer :local_env_file, 'figaro'
|
66
71
|
copy_file destination_root + '/config/application.yml', destination_root + '/config/application.example.yml'
|
@@ -78,6 +83,14 @@ stage_three do
|
|
78
83
|
copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise/master/'
|
79
84
|
end
|
80
85
|
end
|
86
|
+
if prefer :apps4, 'rails-stripe-coupons'
|
87
|
+
copy_from_repo 'app/services/create_couponcodes_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-stripe-coupons/master/'
|
88
|
+
append_file 'db/seeds.rb' do <<-FILE
|
89
|
+
CreateCouponcodesService.new.call
|
90
|
+
puts 'CREATED PROMOTIONAL CODES'
|
91
|
+
FILE
|
92
|
+
end
|
93
|
+
end
|
81
94
|
if prefer :local_env_file, 'figaro'
|
82
95
|
append_file 'db/seeds.rb' do <<-FILE
|
83
96
|
# Environment variables (ENV['...']) can be set in the file config/application.yml.
|
@@ -135,6 +148,10 @@ FILE
|
|
135
148
|
end
|
136
149
|
# create navigation links using the rails_layout gem
|
137
150
|
generate 'layout:navigation -f'
|
151
|
+
if prefer :apps4, 'rails-stripe-coupons'
|
152
|
+
inject_into_file 'app/views/layouts/_navigation_links.html.erb', ", data: { no_turbolink: true }", :after => "new_user_registration_path"
|
153
|
+
inject_into_file 'app/views/layouts/_navigation_links.html.erb', "\n <li><%= link_to 'Coupons', coupons_path %></li>", :after => "users_path %></li>"
|
154
|
+
end
|
138
155
|
### GIT ###
|
139
156
|
git :add => '-A' if prefer :git, true
|
140
157
|
git :commit => '-qm "rails_apps_composer: navigation links"' if prefer :git, true
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
|
+
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/rails_stripe_coupons.rb
|
3
|
+
|
4
|
+
if prefer :apps4, 'rails-stripe-coupons'
|
5
|
+
prefs[:frontend] = 'bootstrap3'
|
6
|
+
prefs[:authentication] = 'devise'
|
7
|
+
prefs[:authorization] = 'roles'
|
8
|
+
prefs[:better_errors] = true
|
9
|
+
prefs[:devise_modules] = false
|
10
|
+
prefs[:form_builder] = false
|
11
|
+
prefs[:git] = true
|
12
|
+
prefs[:local_env_file] = false
|
13
|
+
prefs[:pry] = false
|
14
|
+
prefs[:quiet_assets] = true
|
15
|
+
prefs[:secrets] = ['stripe_publishable_key',
|
16
|
+
'stripe_api_key',
|
17
|
+
'product_price',
|
18
|
+
'product_title',
|
19
|
+
'mailchimp_list_id',
|
20
|
+
'mailchimp_api_key']
|
21
|
+
prefs[:pages] = 'users'
|
22
|
+
prefs[:locale] = 'none'
|
23
|
+
prefs[:rubocop] = false
|
24
|
+
|
25
|
+
# gems
|
26
|
+
add_gem 'gibbon'
|
27
|
+
add_gem 'high_voltage'
|
28
|
+
add_gem 'stripe'
|
29
|
+
add_gem 'sucker_punch'
|
30
|
+
|
31
|
+
stage_three do
|
32
|
+
say_wizard "recipe stage three"
|
33
|
+
repo = 'https://raw.github.com/RailsApps/rails-stripe-coupons/master/'
|
34
|
+
|
35
|
+
# >-------------------------------[ Migrations ]---------------------------------<
|
36
|
+
|
37
|
+
generate 'migration AddStripeTokenToUsers stripe_token:string'
|
38
|
+
generate 'scaffold Coupon code role mailing_list_id list_group price:integer --no-test-framework --no-helper --no-assets --no-jbuilder'
|
39
|
+
generate 'migration AddCouponRefToUsers coupon:references'
|
40
|
+
run 'bundle exec rake db:migrate'
|
41
|
+
|
42
|
+
# >-------------------------------[ Config ]---------------------------------<
|
43
|
+
|
44
|
+
copy_from_repo 'config/initializers/active_job.rb', :repo => repo
|
45
|
+
copy_from_repo 'config/initializers/stripe.rb', :repo => repo
|
46
|
+
|
47
|
+
# >-------------------------------[ Assets ]--------------------------------<
|
48
|
+
|
49
|
+
copy_from_repo 'app/assets/images/rubyonrails.png', :repo => repo
|
50
|
+
|
51
|
+
# >-------------------------------[ Controllers ]--------------------------------<
|
52
|
+
|
53
|
+
copy_from_repo 'app/controllers/coupons_controller.rb', :repo => repo
|
54
|
+
copy_from_repo 'app/controllers/visitors_controller.rb', :repo => repo
|
55
|
+
copy_from_repo 'app/controllers/products_controller.rb', :repo => repo
|
56
|
+
copy_from_repo 'app/controllers/registrations_controller.rb', :repo => repo
|
57
|
+
|
58
|
+
# >-------------------------------[ Helpers ]--------------------------------<
|
59
|
+
|
60
|
+
copy_from_repo 'app/helpers/application_helper.rb', :repo => repo
|
61
|
+
|
62
|
+
# >-------------------------------[ Jobs ]---------------------------------<
|
63
|
+
|
64
|
+
copy_from_repo 'app/jobs/mailing_list_signup_job.rb', :repo => repo
|
65
|
+
copy_from_repo 'app/jobs/payment_job.rb', :repo => repo
|
66
|
+
|
67
|
+
# >-------------------------------[ Mailers ]--------------------------------<
|
68
|
+
|
69
|
+
copy_from_repo 'app/mailers/application_mailer.rb', :repo => repo
|
70
|
+
copy_from_repo 'app/mailers/payment_failure_mailer.rb', :repo => repo
|
71
|
+
|
72
|
+
# >-------------------------------[ Models ]--------------------------------<
|
73
|
+
|
74
|
+
copy_from_repo 'app/models/coupon.rb', :repo => repo
|
75
|
+
copy_from_repo 'app/models/user.rb', :repo => repo
|
76
|
+
|
77
|
+
# >-------------------------------[ Services ]---------------------------------<
|
78
|
+
|
79
|
+
copy_from_repo 'app/services/create_couponcodes_service.rb', :repo => repo
|
80
|
+
copy_from_repo 'app/services/mailing_list_signup_service.rb', :repo => repo
|
81
|
+
copy_from_repo 'app/services/make_payment_service.rb', :repo => repo
|
82
|
+
|
83
|
+
# >-------------------------------[ Views ]--------------------------------<
|
84
|
+
|
85
|
+
copy_from_repo 'app/views/coupons/_form.html.erb', :repo => repo
|
86
|
+
copy_from_repo 'app/views/coupons/edit.html.erb', :repo => repo
|
87
|
+
copy_from_repo 'app/views/coupons/index.html.erb', :repo => repo
|
88
|
+
copy_from_repo 'app/views/coupons/new.html.erb', :repo => repo
|
89
|
+
copy_from_repo 'app/views/coupons/show.html.erb', :repo => repo
|
90
|
+
copy_from_repo 'app/views/devise/registrations/_javascript.html.erb', :repo => repo
|
91
|
+
copy_from_repo 'app/views/devise/registrations/edit.html.erb', :repo => repo
|
92
|
+
copy_from_repo 'app/views/devise/registrations/new.html.erb', :repo => repo
|
93
|
+
copy_from_repo 'app/views/layouts/_navigation_links.html.erb', :repo => repo
|
94
|
+
copy_from_repo 'app/views/layouts/application.html.erb', :repo => repo
|
95
|
+
copy_from_repo 'app/views/layouts/mailer.html.erb', :repo => repo
|
96
|
+
copy_from_repo 'app/views/layouts/mailer.text.erb', :repo => repo
|
97
|
+
copy_from_repo 'app/views/pages/downloads.html.erb', :repo => repo
|
98
|
+
copy_from_repo 'app/views/payment_failure_mailer/failed_payment_email.html.erb', :repo => repo
|
99
|
+
copy_from_repo 'app/views/payment_failure_mailer/failed_payment_email.text.erb', :repo => repo
|
100
|
+
copy_from_repo 'app/views/users/show.html.erb', :repo => repo
|
101
|
+
copy_from_repo 'app/views/visitors/_purchase.html.erb', :repo => repo
|
102
|
+
copy_from_repo 'app/views/visitors/index.html.erb', :repo => repo
|
103
|
+
copy_from_repo 'app/views/products/product.pdf', :repo => repo
|
104
|
+
copy_from_repo 'public/offer.html', :repo => repo
|
105
|
+
|
106
|
+
# >-------------------------------[ Routes ]--------------------------------<
|
107
|
+
|
108
|
+
copy_from_repo 'config/routes.rb', :repo => repo
|
109
|
+
|
110
|
+
# >-------------------------------[ Tests ]--------------------------------<
|
111
|
+
|
112
|
+
### tests not implemented
|
113
|
+
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
__END__
|
118
|
+
|
119
|
+
name: rails_stripe_coupons
|
120
|
+
description: "rails-stripe-coupons starter application"
|
121
|
+
author: RailsApps
|
122
|
+
|
123
|
+
requires: [core]
|
124
|
+
run_after: [git]
|
125
|
+
category: apps
|
data/recipes/railsapps.rb
CHANGED
@@ -35,7 +35,8 @@ when "4"
|
|
35
35
|
["rails-devise-roles", "rails-devise-roles"],
|
36
36
|
["rails-devise-pundit", "rails-devise-pundit"],
|
37
37
|
["rails-signup-download", "rails-signup-download"],
|
38
|
-
["rails-stripe-checkout", "rails-stripe-checkout"]
|
38
|
+
["rails-stripe-checkout", "rails-stripe-checkout"],
|
39
|
+
["rails-stripe-coupons", "rails-stripe-coupons"]]
|
39
40
|
else
|
40
41
|
prefs[:apps4] = multiple_choice "Upgrade to Rails 4.2 for more choices.",
|
41
42
|
[["learn-rails", "learn-rails"],
|
data/recipes/setup.rb
CHANGED
@@ -42,8 +42,8 @@ end
|
|
42
42
|
## Front-end Framework
|
43
43
|
if recipes.include? 'frontend'
|
44
44
|
prefs[:frontend] = multiple_choice "Front-end framework?", [["None", "none"],
|
45
|
-
["Bootstrap 3.
|
46
|
-
["Zurb Foundation 5.
|
45
|
+
["Bootstrap 3.3", "bootstrap3"], ["Bootstrap 2.3", "bootstrap2"],
|
46
|
+
["Zurb Foundation 5.5", "foundation5"], ["Zurb Foundation 4.0", "foundation4"],
|
47
47
|
["Simple CSS", "simple"]] unless prefs.has_key? :frontend
|
48
48
|
end
|
49
49
|
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- recipes/rails_omniauth.rb
|
145
145
|
- recipes/rails_signup_download.rb
|
146
146
|
- recipes/rails_stripe_checkout.rb
|
147
|
+
- recipes/rails_stripe_coupons.rb
|
147
148
|
- recipes/railsapps.rb
|
148
149
|
- recipes/readme.rb
|
149
150
|
- recipes/roles.rb
|