spree_cmd 3.1.14 → 3.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +5 -2
- data/lib/spree_cmd/extension.rb +1 -1
- data/lib/spree_cmd/templates/extension/Gemfile +2 -2
- data/lib/spree_cmd/templates/extension/extension.gemspec +8 -7
- data/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +3 -3
- data/lib/spree_cmd/version.rb +4 -6
- data/lib/spree_cmd.rb +6 -11
- data/spree_cmd.gemspec +10 -11
- metadata +7 -8
- data/lib/spree_cmd/installer.rb +0 -197
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49eb51684f60ae501ed44480e32570cfab1398a1
|
4
|
+
data.tar.gz: 29a3a5a0f2f68099e2322cd20f3cdab3fe91631a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31b2513e8d8a315227273489eac7a43655e9338fa9814ae1e4383c1f955229ac4ed275aa62069467a9f4be3682b6eb2319a4275d4e9de24c564091ff07dad065
|
7
|
+
data.tar.gz: 983d9ee09137bd9fbe89628ec874cafb4f9cd025b7b29fbdf4699b22c2e21a14c81e62aea7fee7c746be947568e28df3fc31bcbaf17fce43853a9b73c48062cb
|
data/Rakefile
CHANGED
data/lib/spree_cmd/extension.rb
CHANGED
@@ -35,7 +35,7 @@ module SpreeCmd
|
|
35
35
|
Your extension has been generated with a gemspec dependency on Spree #{spree_version}.
|
36
36
|
|
37
37
|
For more information on the versioning of Spree.
|
38
|
-
See
|
38
|
+
See http://guides.spreecommerce.org/developer/extensions_tutorial.html#versioning-your-extension
|
39
39
|
|
40
40
|
#{'*' * 80}
|
41
41
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'spree', github: 'spree/spree', branch: '
|
3
|
+
gem 'spree', github: 'spree/spree', branch: 'master'
|
4
4
|
# Provides basic authentication functionality for testing parts of your engine
|
5
|
-
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '
|
5
|
+
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
|
6
6
|
|
7
7
|
gemspec
|
@@ -5,26 +5,27 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.version = '<%= spree_version %>'
|
6
6
|
s.summary = 'TODO: Add gem summary here'
|
7
7
|
s.description = 'TODO: Add (optional) gem description here'
|
8
|
-
s.required_ruby_version = '>= 2.
|
8
|
+
s.required_ruby_version = '>= 2.2.2'
|
9
9
|
|
10
10
|
# s.author = 'You'
|
11
11
|
# s.email = 'you@example.com'
|
12
12
|
# s.homepage = 'http://www.spreecommerce.com'
|
13
|
-
s.license = 'BSD-3'
|
13
|
+
s.license = 'BSD-3-Clause'
|
14
14
|
|
15
|
-
# s.files = `git ls-files`.split("\n")
|
15
|
+
# s.files = `git ls-files`.split("\n")
|
16
|
+
# s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
17
|
s.require_path = 'lib'
|
17
18
|
s.requirements << 'none'
|
18
19
|
|
19
20
|
s.add_dependency 'spree_core', '~> <%= spree_version %>'
|
20
21
|
|
21
|
-
s.add_development_dependency 'capybara'
|
22
|
+
s.add_development_dependency 'capybara'
|
22
23
|
s.add_development_dependency 'coffee-rails'
|
23
24
|
s.add_development_dependency 'database_cleaner'
|
24
|
-
s.add_development_dependency 'factory_girl'
|
25
|
+
s.add_development_dependency 'factory_girl'
|
25
26
|
s.add_development_dependency 'ffaker'
|
26
|
-
s.add_development_dependency 'rspec-rails'
|
27
|
-
s.add_development_dependency 'sass-rails'
|
27
|
+
s.add_development_dependency 'rspec-rails'
|
28
|
+
s.add_development_dependency 'sass-rails'
|
28
29
|
s.add_development_dependency 'selenium-webdriver'
|
29
30
|
s.add_development_dependency 'simplecov'
|
30
31
|
s.add_development_dependency 'sqlite3'
|
data/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
CHANGED
@@ -2,7 +2,7 @@ module <%= class_name %>
|
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
4
|
|
5
|
-
class_option :auto_run_migrations, :
|
5
|
+
class_option :auto_run_migrations, type: :boolean, default: false
|
6
6
|
|
7
7
|
def add_javascripts
|
8
8
|
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/<%= file_name %>\n"
|
@@ -10,8 +10,8 @@ module <%= class_name %>
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def add_stylesheets
|
13
|
-
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/<%= file_name %>\n", :
|
14
|
-
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/<%= file_name %>\n", :
|
13
|
+
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/<%= file_name %>\n", before: /\*\//, verbose: true
|
14
|
+
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/<%= file_name %>\n", before: /\*\//, verbose: true
|
15
15
|
end
|
16
16
|
|
17
17
|
def add_migrations
|
data/lib/spree_cmd/version.rb
CHANGED
@@ -2,11 +2,9 @@ module SpreeCmd
|
|
2
2
|
class Version < Thor::Group
|
3
3
|
include Thor::Actions
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
5
|
+
desc 'display spree_cmd version'
|
6
|
+
def cmd_version
|
7
|
+
puts Gem.loaded_specs['spree_cmd'].version
|
8
|
+
end
|
11
9
|
end
|
12
10
|
end
|
data/lib/spree_cmd.rb
CHANGED
@@ -2,15 +2,10 @@ require 'thor'
|
|
2
2
|
require 'thor/group'
|
3
3
|
|
4
4
|
case ARGV.first
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
else
|
12
|
-
warn "[WARNING] Spree CMD Installer is deprecated. Please follow installation instructions at https://github.com/spree/spree#getting-started"
|
13
|
-
ARGV.shift
|
14
|
-
require 'spree_cmd/installer'
|
15
|
-
SpreeCmd::Installer.start
|
5
|
+
when 'version', '-v', '--version'
|
6
|
+
puts Gem.loaded_specs['spree_cmd'].version
|
7
|
+
when 'extension'
|
8
|
+
ARGV.shift
|
9
|
+
require 'spree_cmd/extension'
|
10
|
+
SpreeCmd::Extension.start
|
16
11
|
end
|
data/spree_cmd.gemspec
CHANGED
@@ -5,19 +5,18 @@ require_relative '../core/lib/spree/core/version.rb'
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "spree_cmd"
|
7
7
|
s.version = Spree.version
|
8
|
-
s.authors = [
|
9
|
-
s.email = [
|
10
|
-
s.homepage =
|
11
|
-
s.license = 'BSD-3'
|
12
|
-
s.summary =
|
13
|
-
s.description =
|
8
|
+
s.authors = ['Chris Mar']
|
9
|
+
s.email = ['chris@spreecommerce.com']
|
10
|
+
s.homepage = 'http://spreecommerce.com'
|
11
|
+
s.license = 'BSD-3-Clause'
|
12
|
+
s.summary = 'Spree Commerce command line utility'
|
13
|
+
s.description = 'tools to create new Spree stores and extensions'
|
14
14
|
|
15
|
-
s.
|
16
|
-
|
17
|
-
s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split('\n')
|
18
17
|
s.bindir = 'bin'
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
-
s.require_paths = [
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
19
|
+
s.require_paths = ['lib']
|
21
20
|
|
22
21
|
s.add_development_dependency 'rspec'
|
23
22
|
# Temporary hack until https://github.com/wycats/thor/issues/234 is fixed
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Mar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -54,7 +54,6 @@ files:
|
|
54
54
|
- bin/spree_cmd
|
55
55
|
- lib/spree_cmd.rb
|
56
56
|
- lib/spree_cmd/extension.rb
|
57
|
-
- lib/spree_cmd/installer.rb
|
58
57
|
- lib/spree_cmd/templates/extension/CONTRIBUTING.md
|
59
58
|
- lib/spree_cmd/templates/extension/Gemfile
|
60
59
|
- lib/spree_cmd/templates/extension/LICENSE
|
@@ -79,7 +78,7 @@ files:
|
|
79
78
|
- spree_cmd.gemspec
|
80
79
|
homepage: http://spreecommerce.com
|
81
80
|
licenses:
|
82
|
-
- BSD-3
|
81
|
+
- BSD-3-Clause
|
83
82
|
metadata: {}
|
84
83
|
post_install_message:
|
85
84
|
rdoc_options: []
|
@@ -92,12 +91,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
91
|
version: '0'
|
93
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
93
|
requirements:
|
95
|
-
- - "
|
94
|
+
- - ">"
|
96
95
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
96
|
+
version: 1.3.1
|
98
97
|
requirements: []
|
99
|
-
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 2.5.1
|
101
100
|
signing_key:
|
102
101
|
specification_version: 4
|
103
102
|
summary: Spree Commerce command line utility
|
data/lib/spree_cmd/installer.rb
DELETED
@@ -1,197 +0,0 @@
|
|
1
|
-
require 'rbconfig'
|
2
|
-
require 'active_support/core_ext/string'
|
3
|
-
|
4
|
-
module SpreeCmd
|
5
|
-
|
6
|
-
class Installer < Thor::Group
|
7
|
-
include Thor::Actions
|
8
|
-
|
9
|
-
desc 'Creates a new rails project with a spree store'
|
10
|
-
argument :app_path, :type => :string, :desc => 'rails app_path', :default => '.'
|
11
|
-
|
12
|
-
class_option :auto_accept, :type => :boolean, :aliases => '-A',
|
13
|
-
:desc => 'Answer yes to all prompts'
|
14
|
-
|
15
|
-
class_option :skip_install_data, :type => :boolean, :default => false,
|
16
|
-
:desc => 'Skip running migrations and loading seed and sample data'
|
17
|
-
|
18
|
-
class_option :version, :type => :string, :desc => 'Spree Version to use'
|
19
|
-
|
20
|
-
class_option :edge, :type => :boolean
|
21
|
-
|
22
|
-
class_option :path, :type => :string, :desc => 'Spree gem path'
|
23
|
-
class_option :git, :type => :string, :desc => 'Spree gem git url'
|
24
|
-
class_option :ref, :type => :string, :desc => 'Spree gem git ref'
|
25
|
-
class_option :branch, :type => :string, :desc => 'Spree gem git branch'
|
26
|
-
class_option :tag, :type => :string, :desc => 'Spree gem git tag'
|
27
|
-
|
28
|
-
def verify_rails
|
29
|
-
unless rails_project?
|
30
|
-
say "#{@app_path} is not a rails project."
|
31
|
-
exit 1
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def verify_image_magick
|
36
|
-
unless image_magick_installed?
|
37
|
-
say "Image magick must be installed."
|
38
|
-
exit 1
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def prepare_options
|
43
|
-
@spree_gem_options = {}
|
44
|
-
|
45
|
-
if options[:edge] || options[:branch]
|
46
|
-
@spree_gem_options[:git] = 'https://github.com/spree/spree.git'
|
47
|
-
elsif options[:path]
|
48
|
-
@spree_gem_options[:path] = options[:path]
|
49
|
-
elsif options[:git]
|
50
|
-
@spree_gem_options[:git] = options[:git]
|
51
|
-
@spree_gem_options[:ref] = options[:ref] if options[:ref]
|
52
|
-
@spree_gem_options[:tag] = options[:tag] if options[:tag]
|
53
|
-
elsif options[:version]
|
54
|
-
@spree_gem_options[:version] = options[:version]
|
55
|
-
else
|
56
|
-
version = Gem.loaded_specs['spree_cmd'].version
|
57
|
-
@spree_gem_options[:version] = version.to_s
|
58
|
-
end
|
59
|
-
|
60
|
-
@spree_gem_options[:branch] = options[:branch] if options[:branch]
|
61
|
-
end
|
62
|
-
|
63
|
-
def ask_questions
|
64
|
-
@install_default_gateways = ask_with_default('Would you like to install the default gateways? (Recommended)')
|
65
|
-
@install_default_auth = ask_with_default('Would you like to install the default authentication system?')
|
66
|
-
|
67
|
-
if @install_default_auth
|
68
|
-
@user_class = "Spree::User"
|
69
|
-
else
|
70
|
-
@user_class = ask("What is the name of the class representing users within your application? [User]")
|
71
|
-
if @user_class.blank?
|
72
|
-
@user_class = "User"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
if options[:skip_install_data]
|
77
|
-
@run_migrations = false
|
78
|
-
@load_seed_data = false
|
79
|
-
@load_sample_data = false
|
80
|
-
else
|
81
|
-
@run_migrations = ask_with_default('Would you like to run the migrations?')
|
82
|
-
if @run_migrations
|
83
|
-
@load_seed_data = ask_with_default('Would you like to load the seed data?')
|
84
|
-
@load_sample_data = ask_with_default('Would you like to load the sample data?')
|
85
|
-
else
|
86
|
-
@load_seed_data = false
|
87
|
-
@load_sample_data = false
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def add_gems
|
93
|
-
inside @app_path do
|
94
|
-
|
95
|
-
gem :spree, @spree_gem_options
|
96
|
-
|
97
|
-
if @install_default_gateways && @spree_gem_options[:branch]
|
98
|
-
gem :spree_gateway, github: 'spree/spree_gateway', branch: @spree_gem_options[:branch]
|
99
|
-
elsif @install_default_gateways
|
100
|
-
gem :spree_gateway, version: '3.0.0'
|
101
|
-
end
|
102
|
-
|
103
|
-
if @install_default_auth && @spree_gem_options[:branch]
|
104
|
-
gem :spree_auth_devise, github: 'spree/spree_auth_devise', branch: @spree_gem_options[:branch]
|
105
|
-
elsif @install_default_auth
|
106
|
-
gem :spree_auth_devise, version: '3.0.0'
|
107
|
-
end
|
108
|
-
|
109
|
-
run 'bundle install', :capture => true
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
def initialize_spree
|
114
|
-
spree_options = []
|
115
|
-
spree_options << "--migrate=#{@run_migrations}"
|
116
|
-
spree_options << "--seed=#{@load_seed_data}"
|
117
|
-
spree_options << "--sample=#{@load_sample_data}"
|
118
|
-
spree_options << "--user_class=#{@user_class}"
|
119
|
-
spree_options << "--auto_accept" if options[:auto_accept]
|
120
|
-
|
121
|
-
inside @app_path do
|
122
|
-
run "rails generate spree:install #{spree_options.join(' ')}", :verbose => false
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
private
|
127
|
-
|
128
|
-
def gem(name, gem_options={})
|
129
|
-
say_status :gemfile, name
|
130
|
-
parts = ["'#{name}'"]
|
131
|
-
parts << ["'~> #{gem_options.delete(:version)}'"] if gem_options[:version]
|
132
|
-
gem_options.each { |key, value| parts << "#{key}: '#{value}'" }
|
133
|
-
append_file 'Gemfile', "\ngem #{parts.join(', ')}", :verbose => false
|
134
|
-
end
|
135
|
-
|
136
|
-
def ask_with_default(message, default = 'yes')
|
137
|
-
return true if options[:auto_accept]
|
138
|
-
|
139
|
-
valid = false
|
140
|
-
until valid
|
141
|
-
response = ask "#{message} (yes/no) [#{default}]"
|
142
|
-
response = default if response.empty?
|
143
|
-
valid = (response =~ /\Ay(?:es)?|no?\Z/i)
|
144
|
-
end
|
145
|
-
response.downcase[0] == ?y
|
146
|
-
end
|
147
|
-
|
148
|
-
def ask_string(message, default, valid_regex = /\w/)
|
149
|
-
return default if options[:auto_accept]
|
150
|
-
valid = false
|
151
|
-
until valid
|
152
|
-
response = ask "#{message} [#{default}]"
|
153
|
-
response = default if response.empty?
|
154
|
-
valid = (valid_regex === response)
|
155
|
-
end
|
156
|
-
response
|
157
|
-
end
|
158
|
-
|
159
|
-
def create_rails_app
|
160
|
-
say :create, @app_path
|
161
|
-
|
162
|
-
rails_cmd = "rails new #{@app_path} --skip-bundle"
|
163
|
-
rails_cmd << " -m #{options[:template]}" if options[:template]
|
164
|
-
rails_cmd << " -d #{options[:database]}" if options[:database]
|
165
|
-
run(rails_cmd)
|
166
|
-
end
|
167
|
-
|
168
|
-
def rails_project?
|
169
|
-
File.exists? File.join(@app_path, 'bin', 'rails')
|
170
|
-
end
|
171
|
-
|
172
|
-
def linux?
|
173
|
-
/linux/i === RbConfig::CONFIG['host_os']
|
174
|
-
end
|
175
|
-
|
176
|
-
def mac?
|
177
|
-
/darwin/i === RbConfig::CONFIG['host_os']
|
178
|
-
end
|
179
|
-
|
180
|
-
def windows?
|
181
|
-
%r{msdos|mswin|djgpp|mingw} === RbConfig::CONFIG['host_os']
|
182
|
-
end
|
183
|
-
|
184
|
-
def image_magick_installed?
|
185
|
-
cmd = 'identify -version'
|
186
|
-
if RUBY_PLATFORM =~ /mingw|mswin/ #windows
|
187
|
-
cmd += " >nul"
|
188
|
-
else
|
189
|
-
cmd += " >/dev/null"
|
190
|
-
end
|
191
|
-
# true if command executed succesfully
|
192
|
-
# false for non zero exit status
|
193
|
-
# nil if command execution fails
|
194
|
-
system(cmd)
|
195
|
-
end
|
196
|
-
end
|
197
|
-
end
|