spree_cmd 1.1.1 → 1.1.2.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spree_cmd/extension.rb +1 -1
- data/lib/spree_cmd/installer.rb +35 -11
- data/lib/spree_cmd/templates/extension/lib/%file_name%/engine.rb.tt +2 -1
- data/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +1 -1
- data/spree_cmd.gemspec +2 -0
- metadata +19 -11
data/lib/spree_cmd/extension.rb
CHANGED
data/lib/spree_cmd/installer.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
|
1
3
|
module SpreeCmd
|
2
4
|
|
3
5
|
class Installer < Thor::Group
|
@@ -26,9 +28,16 @@ module SpreeCmd
|
|
26
28
|
:desc => 'Precompile spree assets to public/assets'
|
27
29
|
|
28
30
|
def verify_rails
|
29
|
-
unless
|
31
|
+
unless rails_project?
|
30
32
|
say "#{@app_path} is not a rails project."
|
31
|
-
exit
|
33
|
+
exit 1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def verify_image_magick
|
38
|
+
unless image_magick_installed?
|
39
|
+
say "Image magick must be installed."
|
40
|
+
exit 1
|
32
41
|
end
|
33
42
|
end
|
34
43
|
|
@@ -71,7 +80,7 @@ module SpreeCmd
|
|
71
80
|
@admin_email = ask_string('Admin Email', 'spree@example.com', /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i)
|
72
81
|
@admin_password = ask_string('Admin Password', 'spree123', /^\S{5,32}$/)
|
73
82
|
end
|
74
|
-
@precompile_assets = options[:precompile_assets]
|
83
|
+
@precompile_assets = options[:precompile_assets] && ask_with_default('Would you like to precompile assets?')
|
75
84
|
end
|
76
85
|
|
77
86
|
def add_gems
|
@@ -139,7 +148,7 @@ module SpreeCmd
|
|
139
148
|
until valid
|
140
149
|
response = ask "#{message} [#{default}]"
|
141
150
|
response = default if response.empty?
|
142
|
-
valid = (response
|
151
|
+
valid = (valid_regex === response)
|
143
152
|
end
|
144
153
|
response
|
145
154
|
end
|
@@ -148,17 +157,32 @@ module SpreeCmd
|
|
148
157
|
say :create, @app_path
|
149
158
|
|
150
159
|
rails_cmd = "rails new #{@app_path} --skip-bundle"
|
151
|
-
if options[:template]
|
152
|
-
|
153
|
-
end
|
154
|
-
if options[:database]
|
155
|
-
rails_cmd += " -d #{options[:database]}"
|
156
|
-
end
|
160
|
+
rails_cmd << " -m #{options[:template]}" if options[:template]
|
161
|
+
rails_cmd << " -d #{options[:database]}" if options[:database]
|
157
162
|
run(rails_cmd)
|
158
163
|
end
|
159
164
|
|
160
|
-
def
|
165
|
+
def rails_project?
|
161
166
|
File.exists? File.join(@app_path, 'script', 'rails')
|
162
167
|
end
|
168
|
+
|
169
|
+
def linux?
|
170
|
+
/linux/i === RbConfig::CONFIG['host_os']
|
171
|
+
end
|
172
|
+
|
173
|
+
def mac?
|
174
|
+
/darwin/i === RbConfig::CONFIG['host_os']
|
175
|
+
end
|
176
|
+
|
177
|
+
def windows?
|
178
|
+
%r{msdos|mswin|djgpp|mingw} === RbConfig::CONFIG['host_os']
|
179
|
+
end
|
180
|
+
|
181
|
+
def image_magick_installed?
|
182
|
+
# true if command executed succesfully
|
183
|
+
# false for non zero exit status
|
184
|
+
# nil if command execution fails
|
185
|
+
system('identify -version')
|
186
|
+
end
|
163
187
|
end
|
164
188
|
end
|
data/spree_cmd.gemspec
CHANGED
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.2.rc1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Chris Mar
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-25 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70189203150080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,18 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70189203150080
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: thor
|
27
|
+
requirement: &70189203149140 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - =
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.14.6
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70189203149140
|
25
36
|
description: tools to create new Spree stores and extensions
|
26
37
|
email:
|
27
38
|
- chris@spreecommerce.com
|
@@ -75,16 +86,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
86
|
version: '0'
|
76
87
|
segments:
|
77
88
|
- 0
|
78
|
-
hash:
|
89
|
+
hash: -4114835332715602194
|
79
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
91
|
none: false
|
81
92
|
requirements:
|
82
|
-
- - ! '
|
93
|
+
- - ! '>'
|
83
94
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
hash: 1521068613993842786
|
95
|
+
version: 1.3.1
|
88
96
|
requirements: []
|
89
97
|
rubyforge_project: spree_cmd
|
90
98
|
rubygems_version: 1.8.10
|