spree_cmd 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/spree_cmd/installer.rb
CHANGED
@@ -33,7 +33,7 @@ module SpreeCmd
|
|
33
33
|
@spree_gem_options = {}
|
34
34
|
|
35
35
|
if options[:edge]
|
36
|
-
@spree_gem_options[:git] = '
|
36
|
+
@spree_gem_options[:git] = 'git://github.com/spree/spree.git'
|
37
37
|
elsif options[:path]
|
38
38
|
@spree_gem_options[:path] = options[:path]
|
39
39
|
elsif options[:git]
|
@@ -45,7 +45,6 @@ module SpreeCmd
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def ask_questions
|
48
|
-
@install_blue_theme = ask_with_default("Would you like to install the default blue theme?")
|
49
48
|
@install_default_gateways = ask_with_default("Would you like to install the default gateways?")
|
50
49
|
|
51
50
|
if options[:skip_install_data]
|
@@ -62,6 +61,11 @@ module SpreeCmd
|
|
62
61
|
@load_sample_data = false
|
63
62
|
end
|
64
63
|
end
|
64
|
+
|
65
|
+
if @load_seed_data
|
66
|
+
@admin_email = ask_string('Admin Email', 'spree@example.com', /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i)
|
67
|
+
@admin_password = ask_string('Admin Password', 'spree123', /^\S{5,32}$/)
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
def add_gems
|
@@ -69,20 +73,15 @@ module SpreeCmd
|
|
69
73
|
|
70
74
|
gem :spree, @spree_gem_options
|
71
75
|
|
72
|
-
if @install_blue_theme
|
73
|
-
gem :spree_blue_theme, { :git => 'git://github.com/spree/spree_blue_theme.git',
|
74
|
-
:ref => '10666404ccb3ed4a4cc9cbe41e822ab2bb55112e' }
|
75
|
-
end
|
76
|
-
|
77
76
|
if @install_default_gateways
|
78
77
|
gem :spree_usa_epay, { :git => 'git://github.com/spree/spree_usa_epay.git',
|
79
78
|
:ref => '0cb57b4afbf1eef6a0ad67a4a1ea506c6418fde1' }
|
80
79
|
|
81
80
|
gem :spree_skrill, { :git => 'git://github.com/spree/spree_skrill.git',
|
82
|
-
:ref => '
|
81
|
+
:ref => '37e6159aa71ec053499e2c7aa9cf799a3b3bdb39' }
|
83
82
|
end
|
84
83
|
|
85
|
-
run 'bundle install'
|
84
|
+
run 'bundle install', :capture => true
|
86
85
|
end
|
87
86
|
end
|
88
87
|
|
@@ -92,9 +91,18 @@ module SpreeCmd
|
|
92
91
|
spree_options << "--seed=#{@load_seed_data}"
|
93
92
|
spree_options << "--sample=#{@load_sample_data}"
|
94
93
|
spree_options << "--auto_accept" if options[:auto_accept]
|
94
|
+
spree_options << "--admin_email=#{@admin_email}" if @admin_email
|
95
|
+
spree_options << "--admin_password=#{@admin_password}" if @admin_password
|
96
|
+
|
97
|
+
inside @app_path do
|
98
|
+
run "rails generate spree:install #{spree_options.join(' ')}", :verbose => false
|
99
|
+
end
|
100
|
+
end
|
95
101
|
|
102
|
+
def precompile_assets
|
103
|
+
say_status :precompiling, "assets"
|
96
104
|
inside @app_path do
|
97
|
-
run
|
105
|
+
run 'bundle exec rake assets:precompile', :verbose => false
|
98
106
|
end
|
99
107
|
end
|
100
108
|
|
@@ -119,6 +127,17 @@ module SpreeCmd
|
|
119
127
|
response.downcase[0] == ?y
|
120
128
|
end
|
121
129
|
|
130
|
+
def ask_string(message, default, valid_regex=/\w/)
|
131
|
+
return default if options[:auto_accept]
|
132
|
+
valid = false
|
133
|
+
until valid
|
134
|
+
response = ask "#{message} [#{default}]"
|
135
|
+
response = default if response.empty?
|
136
|
+
valid = (response =~ valid_regex)
|
137
|
+
end
|
138
|
+
response
|
139
|
+
end
|
140
|
+
|
122
141
|
def create_rails_app
|
123
142
|
say :create, @app_path
|
124
143
|
|
@@ -18,4 +18,4 @@ Be sure to bundle your dependencies and then create a dummy test app for the spe
|
|
18
18
|
$ bundle exec rake test app
|
19
19
|
$ bundle exec rspec spec
|
20
20
|
|
21
|
-
Copyright (c) <%=
|
21
|
+
Copyright (c) <%= Time.now.year %> [name of extension creator], released under the New BSD License
|
@@ -7,7 +7,7 @@ require 'rspec/rails'
|
|
7
7
|
|
8
8
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
9
|
# in spec/support/ and its subdirectories.
|
10
|
-
Dir[
|
10
|
+
Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each {|f| require f }
|
11
11
|
|
12
12
|
# Requires factories defined in spree_core
|
13
13
|
require 'spree/core/testing_support/factories'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70284221484100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: 3.1.3
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70284221484100
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
|
-
requirement: &
|
30
|
+
requirement: &70284221481540 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70284221481540
|
39
39
|
description: tools to create new Spree stores and extensions
|
40
40
|
email:
|
41
41
|
- chris@spreecommerce.com
|
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
segments:
|
90
90
|
- 0
|
91
|
-
hash:
|
91
|
+
hash: -1563334463560285860
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
none: false
|
94
94
|
requirements:
|