spree 0.60.6 → 0.70.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/README.md +41 -32
- data/lib/spree/bin/spree +6 -0
- data/lib/spree/cli.rb +52 -0
- data/lib/spree/engine.rb +5 -0
- data/lib/spree/extension.rb +77 -0
- data/lib/spree/templates/extension/Gemfile +22 -0
- data/lib/{generators/templates → spree/templates/extension}/LICENSE +11 -8
- data/lib/{generators/templates → spree/templates/extension}/README.md +7 -0
- data/lib/spree/templates/extension/Rakefile +36 -0
- data/lib/{generators/templates/Versionfile.tt → spree/templates/extension/Versionfile} +2 -2
- data/lib/spree/templates/extension/app/assets/javascripts/admin/%file_name%.js +1 -0
- data/lib/spree/templates/extension/app/assets/javascripts/store/%file_name%.js +1 -0
- data/lib/spree/templates/extension/app/assets/stylesheets/admin/%file_name%.css +3 -0
- data/lib/spree/templates/extension/app/assets/stylesheets/store/%file_name%.css +3 -0
- data/lib/{generators/templates/extension.gemspec.tt → spree/templates/extension/extension.gemspec} +7 -3
- data/lib/{generators/templates/gitignore.tt → spree/templates/extension/gitignore} +1 -0
- data/lib/spree/templates/extension/lib/%file_name%/engine.rb.tt +24 -0
- data/lib/spree/templates/extension/lib/%file_name%.rb.tt +2 -0
- data/lib/spree/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +29 -0
- data/lib/{generators/templates → spree/templates/extension}/routes.rb +0 -0
- data/lib/spree/templates/extension/rspec +1 -0
- data/lib/spree/templates/extension/script/rails.tt +12 -0
- data/lib/spree/templates/extension/spec_helper.rb.tt +33 -0
- data/lib/spree.rb +1 -4
- metadata +78 -78
- data/lib/generators/spree/extension_generator.rb +0 -71
- data/lib/generators/spree/site_generator.rb +0 -45
- data/lib/generators/spree/test_app_generator.rb +0 -145
- data/lib/generators/templates/Gemfile +0 -32
- data/lib/generators/templates/Rakefile.tt +0 -75
- data/lib/generators/templates/config/database.yml +0 -17
- data/lib/generators/templates/config/database.yml.mysql +0 -29
- data/lib/generators/templates/config/database.yml.sqlite3 +0 -17
- data/lib/generators/templates/config/environments/cucumber.rb +0 -38
- data/lib/generators/templates/extension/extension.rb.tt +0 -17
- data/lib/generators/templates/hooks.rb.tt +0 -3
- data/lib/generators/templates/install.rake.tt +0 -25
- data/lib/generators/templates/lib/tasks/%file_name%.rake.tt +0 -1
- data/lib/generators/templates/spec_helper.rb +0 -30
- data/lib/generators/templates/spree_site.rb +0 -12
- data/lib/tasks/install.rake +0 -29
metadata
CHANGED
@@ -1,151 +1,151 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 265
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 70
|
9
|
+
- 7
|
10
|
+
version: 0.70.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Schofield
|
14
14
|
autorequire:
|
15
|
-
bindir: bin
|
15
|
+
bindir: lib/spree/bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-07-08 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
type: :runtime
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
22
|
none: false
|
25
23
|
requirements:
|
26
24
|
- - "="
|
27
25
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
26
|
+
hash: 265
|
29
27
|
segments:
|
30
28
|
- 0
|
31
|
-
-
|
32
|
-
-
|
33
|
-
version: 0.
|
34
|
-
|
29
|
+
- 70
|
30
|
+
- 7
|
31
|
+
version: 0.70.7
|
32
|
+
requirement: *id001
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
35
|
name: spree_core
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
38
|
-
type: :runtime
|
39
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
38
|
none: false
|
41
39
|
requirements:
|
42
40
|
- - "="
|
43
41
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
42
|
+
hash: 265
|
45
43
|
segments:
|
46
44
|
- 0
|
47
|
-
-
|
48
|
-
-
|
49
|
-
version: 0.
|
50
|
-
|
45
|
+
- 70
|
46
|
+
- 7
|
47
|
+
version: 0.70.7
|
48
|
+
requirement: *id002
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
51
|
name: spree_auth
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
|
-
|
54
|
-
type: :runtime
|
55
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
54
|
none: false
|
57
55
|
requirements:
|
58
56
|
- - "="
|
59
57
|
- !ruby/object:Gem::Version
|
60
|
-
hash:
|
58
|
+
hash: 265
|
61
59
|
segments:
|
62
60
|
- 0
|
63
|
-
-
|
64
|
-
-
|
65
|
-
version: 0.
|
66
|
-
|
61
|
+
- 70
|
62
|
+
- 7
|
63
|
+
version: 0.70.7
|
64
|
+
requirement: *id003
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
67
|
name: spree_api
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
|
70
|
-
type: :runtime
|
71
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
70
|
none: false
|
73
71
|
requirements:
|
74
72
|
- - "="
|
75
73
|
- !ruby/object:Gem::Version
|
76
|
-
hash:
|
74
|
+
hash: 265
|
77
75
|
segments:
|
78
76
|
- 0
|
79
|
-
-
|
80
|
-
-
|
81
|
-
version: 0.
|
82
|
-
|
77
|
+
- 70
|
78
|
+
- 7
|
79
|
+
version: 0.70.7
|
80
|
+
requirement: *id004
|
81
|
+
type: :runtime
|
82
|
+
prerelease: false
|
83
83
|
name: spree_dash
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
|
86
|
-
type: :runtime
|
87
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
88
86
|
none: false
|
89
87
|
requirements:
|
90
88
|
- - "="
|
91
89
|
- !ruby/object:Gem::Version
|
92
|
-
hash:
|
90
|
+
hash: 265
|
93
91
|
segments:
|
94
92
|
- 0
|
95
|
-
-
|
96
|
-
-
|
97
|
-
version: 0.
|
98
|
-
|
93
|
+
- 70
|
94
|
+
- 7
|
95
|
+
version: 0.70.7
|
96
|
+
requirement: *id005
|
97
|
+
type: :runtime
|
98
|
+
prerelease: false
|
99
99
|
name: spree_sample
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
|
-
|
102
|
-
type: :runtime
|
103
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
101
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
104
102
|
none: false
|
105
103
|
requirements:
|
106
104
|
- - "="
|
107
105
|
- !ruby/object:Gem::Version
|
108
|
-
hash:
|
106
|
+
hash: 265
|
109
107
|
segments:
|
110
108
|
- 0
|
111
|
-
-
|
112
|
-
-
|
113
|
-
version: 0.
|
114
|
-
|
109
|
+
- 70
|
110
|
+
- 7
|
111
|
+
version: 0.70.7
|
112
|
+
requirement: *id006
|
113
|
+
type: :runtime
|
114
|
+
prerelease: false
|
115
115
|
name: spree_promo
|
116
116
|
description: "Spree is an open source e-commerce framework for Ruby on Rails. Join us on the spree-user google group or in #spree on IRC"
|
117
117
|
email: sean@railsdog.com
|
118
|
-
executables:
|
119
|
-
|
118
|
+
executables:
|
119
|
+
- spree
|
120
120
|
extensions: []
|
121
121
|
|
122
122
|
extra_rdoc_files: []
|
123
123
|
|
124
124
|
files:
|
125
125
|
- README.md
|
126
|
-
- lib/
|
127
|
-
- lib/
|
128
|
-
- lib/
|
129
|
-
- lib/
|
130
|
-
- lib/
|
131
|
-
- lib/
|
132
|
-
- lib/
|
133
|
-
- lib/
|
134
|
-
- lib/
|
135
|
-
- lib/
|
136
|
-
- lib/
|
137
|
-
- lib/
|
138
|
-
- lib/
|
139
|
-
- lib/
|
140
|
-
- lib/
|
141
|
-
- lib/
|
142
|
-
- lib/
|
143
|
-
- lib/
|
144
|
-
- lib/
|
145
|
-
- lib/
|
146
|
-
- lib/
|
126
|
+
- lib/spree/bin/spree
|
127
|
+
- lib/spree/cli.rb
|
128
|
+
- lib/spree/engine.rb
|
129
|
+
- lib/spree/extension.rb
|
130
|
+
- lib/spree/templates/extension/app/assets/javascripts/admin/%file_name%.js
|
131
|
+
- lib/spree/templates/extension/app/assets/javascripts/store/%file_name%.js
|
132
|
+
- lib/spree/templates/extension/app/assets/stylesheets/admin/%file_name%.css
|
133
|
+
- lib/spree/templates/extension/app/assets/stylesheets/store/%file_name%.css
|
134
|
+
- lib/spree/templates/extension/extension.gemspec
|
135
|
+
- lib/spree/templates/extension/Gemfile
|
136
|
+
- lib/spree/templates/extension/gitignore
|
137
|
+
- lib/spree/templates/extension/lib/%file_name%/engine.rb.tt
|
138
|
+
- lib/spree/templates/extension/lib/%file_name%.rb.tt
|
139
|
+
- lib/spree/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
|
140
|
+
- lib/spree/templates/extension/LICENSE
|
141
|
+
- lib/spree/templates/extension/Rakefile
|
142
|
+
- lib/spree/templates/extension/README.md
|
143
|
+
- lib/spree/templates/extension/routes.rb
|
144
|
+
- lib/spree/templates/extension/rspec
|
145
|
+
- lib/spree/templates/extension/script/rails.tt
|
146
|
+
- lib/spree/templates/extension/spec_helper.rb.tt
|
147
|
+
- lib/spree/templates/extension/Versionfile
|
147
148
|
- lib/spree.rb
|
148
|
-
- lib/tasks/install.rake
|
149
149
|
homepage: http://spreecommerce.com
|
150
150
|
licenses: []
|
151
151
|
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'rails/generators'
|
2
|
-
|
3
|
-
module Spree
|
4
|
-
module Generators
|
5
|
-
class ExtensionGenerator < Rails::Generators::NamedBase
|
6
|
-
source_root File.expand_path("../../templates", __FILE__)
|
7
|
-
|
8
|
-
desc "Creates a new extension with the name you specify."
|
9
|
-
check_class_collision
|
10
|
-
|
11
|
-
def create_root_files
|
12
|
-
empty_directory file_name
|
13
|
-
empty_directory "#{file_name}/config"
|
14
|
-
empty_directory "#{file_name}/db"
|
15
|
-
empty_directory "#{file_name}/public"
|
16
|
-
template "LICENSE", "#{file_name}/LICENSE"
|
17
|
-
template "Rakefile.tt", "#{file_name}/Rakefile"
|
18
|
-
template "README.md", "#{file_name}/README.md"
|
19
|
-
template "gitignore.tt", "#{file_name}/.gitignore"
|
20
|
-
template "extension.gemspec.tt", "#{file_name}/#{file_name}.gemspec"
|
21
|
-
template "Versionfile.tt", "#{file_name}/Versionfile"
|
22
|
-
end
|
23
|
-
|
24
|
-
def config_routes
|
25
|
-
template "routes.rb", "#{file_name}/config/routes.rb"
|
26
|
-
end
|
27
|
-
|
28
|
-
def install_rake
|
29
|
-
template "install.rake.tt", "#{file_name}/lib/tasks/install.rake"
|
30
|
-
end
|
31
|
-
|
32
|
-
def create_app_dirs
|
33
|
-
empty_directory extension_dir('app')
|
34
|
-
empty_directory extension_dir('app/controllers')
|
35
|
-
empty_directory extension_dir('app/helpers')
|
36
|
-
empty_directory extension_dir('app/models')
|
37
|
-
empty_directory extension_dir('app/views')
|
38
|
-
empty_directory extension_dir('spec')
|
39
|
-
end
|
40
|
-
|
41
|
-
def create_lib_files
|
42
|
-
directory "lib", "#{file_name}/lib"
|
43
|
-
template 'extension/extension.rb.tt', "#{file_name}/lib/#{file_name}.rb"
|
44
|
-
template 'hooks.rb.tt', "#{file_name}/lib/#{file_name}_hooks.rb"
|
45
|
-
end
|
46
|
-
|
47
|
-
def create_spec_helper
|
48
|
-
template "spec_helper.rb", "#{file_name}/spec/spec_helper.rb"
|
49
|
-
end
|
50
|
-
|
51
|
-
def update_gemfile
|
52
|
-
gem file_name, :path => file_name, :require => file_name
|
53
|
-
end
|
54
|
-
|
55
|
-
protected
|
56
|
-
|
57
|
-
def current_locale
|
58
|
-
I18n.locale.to_s
|
59
|
-
end
|
60
|
-
|
61
|
-
def extension_dir(join=nil)
|
62
|
-
if join
|
63
|
-
File.join(file_name, join)
|
64
|
-
else
|
65
|
-
file_name
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Generators
|
3
|
-
class SiteGenerator < Rails::Generators::Base
|
4
|
-
source_root File.expand_path("../../templates", __FILE__)
|
5
|
-
|
6
|
-
desc "Configures an existing Rails application to use Spree."
|
7
|
-
|
8
|
-
def create_lib_files
|
9
|
-
template 'spree_site.rb', "lib/spree_site.rb"
|
10
|
-
end
|
11
|
-
|
12
|
-
def additional_tweaks
|
13
|
-
remove_file "public/index.html"
|
14
|
-
|
15
|
-
append_file "public/robots.txt", <<-ROBOTS
|
16
|
-
User-agent: *
|
17
|
-
Disallow: /checkouts
|
18
|
-
Disallow: /orders
|
19
|
-
Disallow: /countries
|
20
|
-
Disallow: /line_items
|
21
|
-
Disallow: /password_resets
|
22
|
-
Disallow: /states
|
23
|
-
Disallow: /user_sessions
|
24
|
-
Disallow: /users
|
25
|
-
ROBOTS
|
26
|
-
|
27
|
-
append_file "db/seeds.rb", <<-SEEDS
|
28
|
-
\n
|
29
|
-
Rake::Task["db:load_dir"].invoke( "default" )
|
30
|
-
puts "Default data has been loaded"
|
31
|
-
SEEDS
|
32
|
-
end
|
33
|
-
|
34
|
-
def config_middleware
|
35
|
-
application 'config.middleware.use "SeoAssist"'
|
36
|
-
application 'config.middleware.use "RedirectLegacyProductUrl"'
|
37
|
-
end
|
38
|
-
|
39
|
-
def require_site
|
40
|
-
application "require 'spree_site'"
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,145 +0,0 @@
|
|
1
|
-
require 'rails/generators'
|
2
|
-
|
3
|
-
module Spree
|
4
|
-
module Generators
|
5
|
-
class TestAppGenerator < Rails::Generators::Base
|
6
|
-
|
7
|
-
class << self
|
8
|
-
attr_accessor :verbose
|
9
|
-
end
|
10
|
-
|
11
|
-
class_option :app_name, :type => :string,
|
12
|
-
:desc => "The name of the test rails app to generate. Defaults to test_app.",
|
13
|
-
:default => "test_app"
|
14
|
-
|
15
|
-
def self.source_root
|
16
|
-
File.expand_path('../../templates', __FILE__)
|
17
|
-
end
|
18
|
-
|
19
|
-
def generate_app
|
20
|
-
remove_directory_if_exists("spec/#{test_app}")
|
21
|
-
inside "spec" do
|
22
|
-
run "bundle exec rails new #{test_app} --database=#{database_name} -GJTq --skip-gemfile"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def create_rspec_gemfile
|
27
|
-
# newer versions of rspec require a Gemfile in the local gem dirs so create one there as well as in spec/test_app
|
28
|
-
silence_stream(STDOUT) {
|
29
|
-
template "Gemfile", :force => true
|
30
|
-
remove_file "Gemfile.lock"
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
def create_root
|
35
|
-
self.destination_root = File.expand_path("spec/#{test_app}", destination_root)
|
36
|
-
end
|
37
|
-
|
38
|
-
def remove_unneeded_files
|
39
|
-
silence_stream(STDOUT) {
|
40
|
-
remove_file "doc"
|
41
|
-
remove_file "lib/tasks"
|
42
|
-
remove_file "public/images/rails.png"
|
43
|
-
remove_file "public/index.html"
|
44
|
-
remove_file "README"
|
45
|
-
remove_file "vendor"
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
def replace_gemfile
|
50
|
-
silence_stream(STDOUT) {
|
51
|
-
template "Gemfile"
|
52
|
-
}
|
53
|
-
end
|
54
|
-
|
55
|
-
def setup_environments
|
56
|
-
silence_stream(STDOUT) {
|
57
|
-
template "config/environments/cucumber.rb"
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
def create_databases_yml
|
62
|
-
silence_stream(STDOUT) {
|
63
|
-
remove_file "config/database.yml"
|
64
|
-
template "config/database.yml.#{database_name}"
|
65
|
-
mv "spec/test_app/config/database.yml.#{database_name}", "spec/test_app/config/database.yml", :verbose => false
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
def tweak_gemfile
|
70
|
-
silence_stream(STDOUT) {
|
71
|
-
append_file '../../Gemfile' do
|
72
|
-
full_path_for_local_gems
|
73
|
-
end
|
74
|
-
|
75
|
-
append_file 'Gemfile' do
|
76
|
-
full_path_for_local_gems
|
77
|
-
end
|
78
|
-
}
|
79
|
-
end
|
80
|
-
|
81
|
-
def append_db_adapter_gem
|
82
|
-
silence_stream(STDOUT) {
|
83
|
-
case database_name
|
84
|
-
when "mysql"
|
85
|
-
gem "mysql2"
|
86
|
-
append_file '../../Gemfile' do
|
87
|
-
"gem 'mysql2'"
|
88
|
-
end
|
89
|
-
else
|
90
|
-
gem "sqlite3-ruby"
|
91
|
-
append_file '../../Gemfile' do
|
92
|
-
"gem 'sqlite3-ruby'"
|
93
|
-
end
|
94
|
-
end
|
95
|
-
}
|
96
|
-
end
|
97
|
-
|
98
|
-
protected
|
99
|
-
def full_path_for_local_gems
|
100
|
-
# Gemfile needs to be full local path to the source (ex. /Users/schof/repos/spree/auth)
|
101
|
-
# By default we do nothing but each gem should override this method with the appropriate content
|
102
|
-
end
|
103
|
-
|
104
|
-
private
|
105
|
-
|
106
|
-
def run_migrations
|
107
|
-
silence_stream(STDOUT) {
|
108
|
-
inside "" do
|
109
|
-
run "bundle exec rake db:drop db:create db:migrate db:seed RAILS_ENV=test"
|
110
|
-
run "bundle exec rake db:drop db:create db:migrate db:seed RAILS_ENV=cucumber"
|
111
|
-
end
|
112
|
-
}
|
113
|
-
end
|
114
|
-
|
115
|
-
def test_app
|
116
|
-
options[:app_name]
|
117
|
-
end
|
118
|
-
|
119
|
-
def database_name
|
120
|
-
ENV['DB_NAME'] || "sqlite3"
|
121
|
-
end
|
122
|
-
|
123
|
-
def remove_directory_if_exists(path)
|
124
|
-
silence_stream(STDOUT) {
|
125
|
-
run "rm -r #{path}" if File.directory?(path)
|
126
|
-
}
|
127
|
-
end
|
128
|
-
|
129
|
-
def silence_stream(stream)
|
130
|
-
if self.class.verbose
|
131
|
-
yield
|
132
|
-
else
|
133
|
-
begin
|
134
|
-
old_stream = stream.dup
|
135
|
-
stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
|
136
|
-
stream.sync = true
|
137
|
-
yield
|
138
|
-
ensure
|
139
|
-
stream.reopen(old_stream)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
group :test do
|
4
|
-
gem 'rspec-rails', '= 2.5.0'
|
5
|
-
gem 'factory_girl', '= 1.3.3'
|
6
|
-
gem 'factory_girl_rails', '= 1.0.1'
|
7
|
-
gem 'rcov'
|
8
|
-
gem 'shoulda'
|
9
|
-
gem 'faker'
|
10
|
-
if RUBY_VERSION < "1.9"
|
11
|
-
gem "ruby-debug"
|
12
|
-
else
|
13
|
-
gem "ruby-debug19"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
group :cucumber do
|
18
|
-
gem 'cucumber-rails'
|
19
|
-
gem 'database_cleaner', '= 0.6.7'
|
20
|
-
gem 'nokogiri'
|
21
|
-
gem 'capybara', '= 0.4.1.2'
|
22
|
-
gem 'factory_girl', '= 1.3.3'
|
23
|
-
gem 'factory_girl_rails', '= 1.0.1'
|
24
|
-
gem 'faker'
|
25
|
-
gem 'launchy'
|
26
|
-
|
27
|
-
if RUBY_VERSION < "1.9"
|
28
|
-
gem "ruby-debug"
|
29
|
-
else
|
30
|
-
gem "ruby-debug19"
|
31
|
-
end
|
32
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/packagetask'
|
5
|
-
require 'rake/gempackagetask'
|
6
|
-
|
7
|
-
gemfile = File.expand_path('../spec/test_app/Gemfile', __FILE__)
|
8
|
-
if File.exists?(gemfile) && (%w(spec cucumber).include?(ARGV.first.to_s) || ARGV.size == 0)
|
9
|
-
require 'bundler'
|
10
|
-
ENV['BUNDLE_GEMFILE'] = gemfile
|
11
|
-
Bundler.setup
|
12
|
-
|
13
|
-
require 'rspec'
|
14
|
-
require 'rspec/core/rake_task'
|
15
|
-
RSpec::Core::RakeTask.new
|
16
|
-
|
17
|
-
require 'cucumber/rake/task'
|
18
|
-
Cucumber::Rake::Task.new do |t|
|
19
|
-
t.cucumber_opts = %w{--format progress}
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "Default Task"
|
24
|
-
task :default => [:spec, :cucumber ]
|
25
|
-
|
26
|
-
spec = eval(File.read('<%= file_name %>.gemspec'))
|
27
|
-
|
28
|
-
Rake::GemPackageTask.new(spec) do |p|
|
29
|
-
p.gem_spec = spec
|
30
|
-
end
|
31
|
-
|
32
|
-
desc "Release to gemcutter"
|
33
|
-
task :release => :package do
|
34
|
-
require 'rake/gemcutter'
|
35
|
-
Rake::Gemcutter::Tasks.new(spec).define
|
36
|
-
Rake::Task['gem:push'].invoke
|
37
|
-
end
|
38
|
-
|
39
|
-
desc "Default Task"
|
40
|
-
task :default => [ :spec ]
|
41
|
-
|
42
|
-
desc "Regenerates a rails 3 app for testing"
|
43
|
-
task :test_app do
|
44
|
-
require '../spree/lib/generators/spree/test_app_generator'
|
45
|
-
class <%= file_name.classify %>TestAppGenerator < Spree::Generators::TestAppGenerator
|
46
|
-
|
47
|
-
def install_gems
|
48
|
-
inside "test_app" do
|
49
|
-
run 'bundle exec rake spree_core:install'
|
50
|
-
run 'bundle exec rake <%= file_name %>:install'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def migrate_db
|
55
|
-
run_migrations
|
56
|
-
end
|
57
|
-
|
58
|
-
protected
|
59
|
-
def full_path_for_local_gems
|
60
|
-
<<-gems
|
61
|
-
gem 'spree_core', :path => \'#{File.join(File.dirname(__FILE__), "../spree/", "core")}\'
|
62
|
-
gem '<%= file_name %>', :path => \'#{File.dirname(__FILE__)}\'
|
63
|
-
gems
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
<%= file_name.classify %>TestAppGenerator.start
|
68
|
-
end
|
69
|
-
|
70
|
-
namespace :test_app do
|
71
|
-
desc 'Rebuild test and cucumber databases'
|
72
|
-
task :rebuild_dbs do
|
73
|
-
system("cd spec/test_app && bundle exec rake db:drop db:migrate RAILS_ENV=test && rake db:drop db:migrate RAILS_ENV=cucumber")
|
74
|
-
end
|
75
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
adapter: sqlite3
|
3
|
-
database: db/cucumber.sqlite3
|
4
|
-
pool: 5
|
5
|
-
timeout: 5000
|
6
|
-
|
7
|
-
test:
|
8
|
-
adapter: sqlite3
|
9
|
-
database: db/test.sqlite3
|
10
|
-
pool: 5
|
11
|
-
timeout: 5000
|
12
|
-
|
13
|
-
cucumber:
|
14
|
-
adapter: sqlite3
|
15
|
-
database: db/cucumber.sqlite3
|
16
|
-
pool: 5
|
17
|
-
timeout: 5000
|
@@ -1,29 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
adapter: mysql2
|
3
|
-
encoding: utf8
|
4
|
-
reconnect: false
|
5
|
-
database: test_app_development
|
6
|
-
pool: 5
|
7
|
-
username: root
|
8
|
-
password: welcome
|
9
|
-
socket: /tmp/mysql.sock
|
10
|
-
|
11
|
-
test:
|
12
|
-
adapter: mysql2
|
13
|
-
encoding: utf8
|
14
|
-
reconnect: false
|
15
|
-
database: test_app_test
|
16
|
-
pool: 5
|
17
|
-
username: root
|
18
|
-
password: welcome
|
19
|
-
socket: /tmp/mysql.sock
|
20
|
-
|
21
|
-
cucumber:
|
22
|
-
adapter: mysql2
|
23
|
-
encoding: utf8
|
24
|
-
reconnect: false
|
25
|
-
database: test_app_cucumber
|
26
|
-
pool: 5
|
27
|
-
username: root
|
28
|
-
password: welcome
|
29
|
-
socket: /tmp/mysql.sock
|
@@ -1,17 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
adapter: sqlite3
|
3
|
-
database: db/cucumber.sqlite3
|
4
|
-
pool: 5
|
5
|
-
timeout: 5000
|
6
|
-
|
7
|
-
test:
|
8
|
-
adapter: sqlite3
|
9
|
-
database: db/test.sqlite3
|
10
|
-
pool: 5
|
11
|
-
timeout: 5000
|
12
|
-
|
13
|
-
cucumber:
|
14
|
-
adapter: sqlite3
|
15
|
-
database: db/cucumber.sqlite3
|
16
|
-
pool: 5
|
17
|
-
timeout: 5000
|