rails_apps_composer 2.2.24 → 2.2.25
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.
- data/recipes/extras.rb +38 -34
- data/recipes/init.rb +1 -1
- data/recipes/saas.rb +2 -0
- data/recipes/testing.rb +3 -1
- data/templates/helpers.erb +13 -0
- data/version.rb +1 -1
- metadata +4 -4
data/recipes/extras.rb
CHANGED
@@ -60,43 +60,47 @@ if config['rvmrc']
|
|
60
60
|
prefs[:rvmrc] = true
|
61
61
|
end
|
62
62
|
if prefs[:rvmrc]
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
say_wizard "creating RVM gemset '#{app_name}'"
|
78
|
-
RVM.gemset_create app_name
|
79
|
-
say_wizard "switching to gemset '#{app_name}'"
|
80
|
-
# RVM.gemset_use! requires rvm version 1.11.3.5 or newer
|
81
|
-
rvm_spec =
|
82
|
-
if Gem::Specification.respond_to?(:find_by_name)
|
83
|
-
Gem::Specification.find_by_name("rvm")
|
84
|
-
else
|
85
|
-
Gem.source_index.find_name("rvm").last
|
63
|
+
if which("rvm")
|
64
|
+
say_wizard "recipe creating project-specific rvm gemset and .rvmrc"
|
65
|
+
# using the rvm Ruby API, see:
|
66
|
+
# http://blog.thefrontiergroup.com.au/2010/12/a-brief-introduction-to-the-rvm-ruby-api/
|
67
|
+
# https://rvm.io/integration/passenger
|
68
|
+
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
|
69
|
+
begin
|
70
|
+
gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')
|
71
|
+
ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"
|
72
|
+
require 'rvm'
|
73
|
+
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
|
74
|
+
rescue LoadError
|
75
|
+
raise "RVM gem is currently unavailable."
|
76
|
+
end
|
86
77
|
end
|
87
|
-
|
88
|
-
|
89
|
-
|
78
|
+
say_wizard "creating RVM gemset '#{app_name}'"
|
79
|
+
RVM.gemset_create app_name
|
80
|
+
say_wizard "switching to gemset '#{app_name}'"
|
81
|
+
# RVM.gemset_use! requires rvm version 1.11.3.5 or newer
|
82
|
+
rvm_spec =
|
83
|
+
if Gem::Specification.respond_to?(:find_by_name)
|
84
|
+
Gem::Specification.find_by_name("rvm")
|
85
|
+
else
|
86
|
+
Gem.source_index.find_name("rvm").last
|
87
|
+
end
|
88
|
+
unless rvm_spec.version > Gem::Version.create('1.11.3.4')
|
89
|
+
say_wizard "rvm gem version: #{rvm_spec.version}"
|
90
|
+
raise "Please update rvm gem to 1.11.3.5 or newer"
|
91
|
+
end
|
92
|
+
begin
|
93
|
+
RVM.gemset_use! app_name
|
94
|
+
rescue => e
|
95
|
+
say_wizard "rvm failure: unable to use gemset #{app_name}, reason: #{e}"
|
96
|
+
raise
|
90
97
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
98
|
+
run "rvm gemset list"
|
99
|
+
copy_from_repo '.rvmrc'
|
100
|
+
gsub_file '.rvmrc', /App_Name/, "#{app_name}"
|
101
|
+
else
|
102
|
+
say_wizard "WARNING! RVM does not appear to be available."
|
96
103
|
end
|
97
|
-
run "rvm gemset list"
|
98
|
-
copy_from_repo '.rvmrc'
|
99
|
-
gsub_file '.rvmrc', /App_Name/, "#{app_name}"
|
100
104
|
end
|
101
105
|
|
102
106
|
## AFTER_EVERYTHING
|
data/recipes/init.rb
CHANGED
@@ -72,7 +72,7 @@ FILE
|
|
72
72
|
unless prefer :authentication, 'omniauth'
|
73
73
|
append_file 'db/seeds.rb' do <<-FILE
|
74
74
|
puts 'DEFAULT USERS'
|
75
|
-
user = User.
|
75
|
+
user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
|
76
76
|
puts 'user: ' << user.name
|
77
77
|
FILE
|
78
78
|
end
|
data/recipes/saas.rb
CHANGED
@@ -82,6 +82,8 @@ if prefer :railsapps, 'rails-stripe-membership-saas'
|
|
82
82
|
copy_from_repo 'spec/controllers/content_controller_spec.rb', :repo => repo
|
83
83
|
copy_from_repo 'spec/mailers/user_mailer_spec.rb', :repo => repo
|
84
84
|
copy_from_repo 'spec/stripe/stripe_config_spec.rb', :repo => repo
|
85
|
+
copy_from_repo 'spec/support/stripe_helper.rb', :repo => repo
|
86
|
+
copy_from_repo 'spec/support/fixtures/success.json', :repo => repo
|
85
87
|
|
86
88
|
# >-------------------------------[ Cucumber ]--------------------------------<
|
87
89
|
say_wizard "copying Cucumber scenarios from the rails-stripe-membership-saas examples"
|
data/recipes/testing.rb
CHANGED
@@ -254,7 +254,9 @@ RUBY
|
|
254
254
|
if prefer :integration, 'cucumber'
|
255
255
|
gsub_file 'features/step_definitions/user_steps.rb', /@user = FactoryGirl.create\(:user, email: @visitor\[:email\]\)/, '@user = Fabricate(:user, email: @visitor[:email])'
|
256
256
|
end
|
257
|
-
|
257
|
+
if File.exist?('spec/controllers/users_controller_spec.rb')
|
258
|
+
gsub_file 'spec/controllers/users_controller_spec.rb', /@user = FactoryGirl.create\(:user\)/, '@user = Fabricate(:user)'
|
259
|
+
end
|
258
260
|
end
|
259
261
|
end # after_everything
|
260
262
|
|
data/templates/helpers.erb
CHANGED
@@ -103,3 +103,16 @@ def html_to_slim(source)
|
|
103
103
|
haml = Haml::HTML.new(html, :erb => true, :xhtml => true).render
|
104
104
|
Haml2Slim.convert!(haml)
|
105
105
|
end
|
106
|
+
|
107
|
+
# full credit to @mislav in this StackOverflow answer for the #which() method:
|
108
|
+
# - http://stackoverflow.com/a/5471032
|
109
|
+
def which(cmd)
|
110
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
111
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
112
|
+
exts.each do |ext|
|
113
|
+
exe = "#{path}#{File::SEPARATOR}#{cmd}#{ext}"
|
114
|
+
return exe if File.executable? exe
|
115
|
+
end
|
116
|
+
end
|
117
|
+
return nil
|
118
|
+
end
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.25
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -202,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
segments:
|
204
204
|
- 0
|
205
|
-
hash:
|
205
|
+
hash: 4467932565658261030
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
version: '0'
|
212
212
|
segments:
|
213
213
|
- 0
|
214
|
-
hash:
|
214
|
+
hash: 4467932565658261030
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project: rails_apps_composer
|
217
217
|
rubygems_version: 1.8.24
|