spree_order_groove 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/.gitignore +14 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +26 -0
  5. data/README.md +60 -0
  6. data/Rakefile +21 -0
  7. data/app/assets/javascripts/spree/backend/spree_order_groove.js +2 -0
  8. data/app/assets/javascripts/spree/frontend/spree_order_groove.js +2 -0
  9. data/app/assets/stylesheets/spree/backend/spree_order_groove.css +4 -0
  10. data/app/assets/stylesheets/spree/frontend/spree_order_groove.css +4 -0
  11. data/app/controllers/spree/api/orders_controller_decorator.rb +293 -0
  12. data/app/controllers/spree/checkout_controller_decorator.rb +102 -0
  13. data/app/controllers/spree/orders_controller_decorator.rb +4 -0
  14. data/app/controllers/spree/store_controller_decorator.rb +24 -0
  15. data/app/models/spree/ordergroove_configuration.rb +12 -0
  16. data/app/models/spree/promotion/rules/autodelivery.rb +23 -0
  17. data/app/overrides/decorate_ordergroove_div_cart.rb +6 -0
  18. data/app/overrides/decorate_ordergroove_div_cart_remove.rb +6 -0
  19. data/app/overrides/decorate_ordergroove_div_product_main.rb +6 -0
  20. data/app/overrides/decorate_ordergroove_tags_cart.rb +6 -0
  21. data/app/overrides/decorate_ordergroove_tags_product.rb +6 -0
  22. data/app/views/spree/admin/promotions/rules/_autodelivery_rule.html.erb +0 -0
  23. data/app/views/spree/api/orders/ogcreateorder.v1.rabl +2 -0
  24. data/app/views/spree/shared/_ordergroove_line_item_div.html.erb +4 -0
  25. data/app/views/spree/shared/_ordergroove_line_item_div_remove.html.erb +3 -0
  26. data/app/views/spree/shared/_ordergroove_tags.html.erb +56 -0
  27. data/bin/rails +7 -0
  28. data/config/locales/en.yml +10 -0
  29. data/config/ordergroove.yml +35 -0
  30. data/config/routes.rb +10 -0
  31. data/db/migrate/20150604115532_add_auto_delivery_to_spree_line_items.spree_order_groove.rb +5 -0
  32. data/lib/generators/spree_order_groove/install/install_generator.rb +31 -0
  33. data/lib/rc4.rb +64 -0
  34. data/lib/spree_order_groove.rb +2 -0
  35. data/lib/spree_order_groove/engine.rb +23 -0
  36. data/lib/spree_order_groove/factories.rb +6 -0
  37. data/spec/spec_helper.rb +87 -0
  38. data/spree_order_groove.gemspec +31 -0
  39. metadata +268 -0
@@ -0,0 +1,2 @@
1
+ require 'spree_core'
2
+ require 'spree_order_groove/engine'
@@ -0,0 +1,23 @@
1
+ module SpreeOrderGroove
2
+ class Engine < Rails::Engine
3
+ require 'spree/core'
4
+ isolate_namespace Spree
5
+ engine_name 'spree_order_groove'
6
+
7
+ # use rspec for tests
8
+ config.generators do |g|
9
+ g.test_framework :rspec
10
+ end
11
+
12
+ def self.activate
13
+ Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
14
+ Rails.configuration.cache_classes ? require(c) : load(c)
15
+ end
16
+ Dir.glob(File.join(File.dirname(__FILE__), '../../lib/rc4.rb')) do |c|
17
+ Rails.configuration.cache_classes ? require(c) : load(c)
18
+ end
19
+ end
20
+
21
+ config.to_prepare &method(:activate).to_proc
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
3
+ #
4
+ # Example adding this to your spec_helper will load these Factories for use:
5
+ # require 'spree_order_groove/factories'
6
+ end
@@ -0,0 +1,87 @@
1
+ # Run Coverage report
2
+ require 'simplecov'
3
+ SimpleCov.start do
4
+ add_filter 'spec/dummy'
5
+ add_group 'Controllers', 'app/controllers'
6
+ add_group 'Helpers', 'app/helpers'
7
+ add_group 'Mailers', 'app/mailers'
8
+ add_group 'Models', 'app/models'
9
+ add_group 'Views', 'app/views'
10
+ add_group 'Libraries', 'lib'
11
+ end
12
+
13
+ # Configure Rails Environment
14
+ ENV['RAILS_ENV'] = 'test'
15
+
16
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
17
+
18
+ require 'rspec/rails'
19
+ require 'database_cleaner'
20
+ require 'ffaker'
21
+
22
+ # Requires supporting ruby files with custom matchers and macros, etc,
23
+ # in spec/support/ and its subdirectories.
24
+ Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
25
+
26
+ # Requires factories and other useful helpers defined in spree_core.
27
+ require 'spree/testing_support/authorization_helpers'
28
+ require 'spree/testing_support/capybara_ext'
29
+ require 'spree/testing_support/controller_requests'
30
+ require 'spree/testing_support/factories'
31
+ require 'spree/testing_support/url_helpers'
32
+
33
+ # Requires factories defined in lib/spree_order_groove/factories.rb
34
+ require 'spree_order_groove/factories'
35
+
36
+ RSpec.configure do |config|
37
+ config.include FactoryGirl::Syntax::Methods
38
+
39
+ # Infer an example group's spec type from the file location.
40
+ config.infer_spec_type_from_file_location!
41
+
42
+ # == URL Helpers
43
+ #
44
+ # Allows access to Spree's routes in specs:
45
+ #
46
+ # visit spree.admin_path
47
+ # current_path.should eql(spree.products_path)
48
+ config.include Spree::TestingSupport::UrlHelpers
49
+
50
+ # == Mock Framework
51
+ #
52
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
53
+ #
54
+ # config.mock_with :mocha
55
+ # config.mock_with :flexmock
56
+ # config.mock_with :rr
57
+ config.mock_with :rspec
58
+ config.color = true
59
+
60
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
61
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
62
+
63
+ # Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
64
+ # to cleanup after each test instead. Without transactional fixtures set to false the records created
65
+ # to setup a test will be unavailable to the browser, which runs under a separate server instance.
66
+ config.use_transactional_fixtures = false
67
+
68
+ # Ensure Suite is set to use transactions for speed.
69
+ config.before :suite do
70
+ DatabaseCleaner.strategy = :transaction
71
+ DatabaseCleaner.clean_with :truncation
72
+ end
73
+
74
+ # Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
75
+ config.before :each do
76
+ DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
77
+ DatabaseCleaner.start
78
+ end
79
+
80
+ # After each spec clean the database.
81
+ config.after :each do
82
+ DatabaseCleaner.clean
83
+ end
84
+
85
+ config.fail_fast = ENV['FAIL_FAST'] || false
86
+ config.order = "random"
87
+ end
@@ -0,0 +1,31 @@
1
+ # encoding: UTF-8
2
+ Gem::Specification.new do |s|
3
+ s.platform = Gem::Platform::RUBY
4
+ s.name = 'spree_order_groove'
5
+ s.version = '3.0.0'
6
+ s.summary = 'Order Groove provide the retain engine for ecommerce web sites, all customer sign up for auto delivery. This spree extension integrate it into spree'
7
+ s.description = 'This extension works with classic Ordergroove server. There latest upgrade which needs Oath is not included'
8
+ s.required_ruby_version = '>= 2.0.0'
9
+
10
+ s.author = 'Albert Liu'
11
+ s.email = 'albertliu@naturalwellbeing.com'
12
+ s.homepage = 'http://www.naturalwellbeing.com'
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.require_path = 'lib'
17
+ s.requirements << 'none'
18
+
19
+ s.add_dependency 'spree_core', '~> 3.0.0'
20
+
21
+ s.add_development_dependency 'capybara', '~> 2.4'
22
+ s.add_development_dependency 'coffee-rails'
23
+ s.add_development_dependency 'database_cleaner'
24
+ s.add_development_dependency 'factory_girl', '~> 4.5'
25
+ s.add_development_dependency 'ffaker'
26
+ s.add_development_dependency 'rspec-rails', '~> 3.1'
27
+ s.add_development_dependency 'sass-rails', '~> 5.0.0.beta1'
28
+ s.add_development_dependency 'selenium-webdriver'
29
+ s.add_development_dependency 'simplecov'
30
+ s.add_development_dependency 'sqlite3'
31
+ end
metadata ADDED
@@ -0,0 +1,268 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_order_groove
3
+ version: !ruby/object:Gem::Version
4
+ hash: 7
5
+ prerelease:
6
+ segments:
7
+ - 3
8
+ - 0
9
+ - 0
10
+ version: 3.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Albert Liu
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2015-06-17 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: spree_core
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 3
32
+ - 0
33
+ - 0
34
+ version: 3.0.0
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: capybara
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 11
46
+ segments:
47
+ - 2
48
+ - 4
49
+ version: "2.4"
50
+ type: :development
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: coffee-rails
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ type: :development
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: database_cleaner
68
+ prerelease: false
69
+ requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ type: :development
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: factory_girl
82
+ prerelease: false
83
+ requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ hash: 17
89
+ segments:
90
+ - 4
91
+ - 5
92
+ version: "4.5"
93
+ type: :development
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ name: ffaker
97
+ prerelease: false
98
+ requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ type: :development
108
+ version_requirements: *id006
109
+ - !ruby/object:Gem::Dependency
110
+ name: rspec-rails
111
+ prerelease: false
112
+ requirement: &id007 !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ hash: 5
118
+ segments:
119
+ - 3
120
+ - 1
121
+ version: "3.1"
122
+ type: :development
123
+ version_requirements: *id007
124
+ - !ruby/object:Gem::Dependency
125
+ name: sass-rails
126
+ prerelease: false
127
+ requirement: &id008 !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ~>
131
+ - !ruby/object:Gem::Version
132
+ hash: -2153450156
133
+ segments:
134
+ - 5
135
+ - 0
136
+ - 0
137
+ - beta
138
+ - 1
139
+ version: 5.0.0.beta1
140
+ type: :development
141
+ version_requirements: *id008
142
+ - !ruby/object:Gem::Dependency
143
+ name: selenium-webdriver
144
+ prerelease: false
145
+ requirement: &id009 !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
153
+ version: "0"
154
+ type: :development
155
+ version_requirements: *id009
156
+ - !ruby/object:Gem::Dependency
157
+ name: simplecov
158
+ prerelease: false
159
+ requirement: &id010 !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ hash: 3
165
+ segments:
166
+ - 0
167
+ version: "0"
168
+ type: :development
169
+ version_requirements: *id010
170
+ - !ruby/object:Gem::Dependency
171
+ name: sqlite3
172
+ prerelease: false
173
+ requirement: &id011 !ruby/object:Gem::Requirement
174
+ none: false
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ hash: 3
179
+ segments:
180
+ - 0
181
+ version: "0"
182
+ type: :development
183
+ version_requirements: *id011
184
+ description: This extension works with classic Ordergroove server. There latest upgrade which needs Oath is not included
185
+ email: albertliu@naturalwellbeing.com
186
+ executables: []
187
+
188
+ extensions: []
189
+
190
+ extra_rdoc_files: []
191
+
192
+ files:
193
+ - .gitignore
194
+ - .rspec
195
+ - Gemfile
196
+ - LICENSE
197
+ - README.md
198
+ - Rakefile
199
+ - app/assets/javascripts/spree/backend/spree_order_groove.js
200
+ - app/assets/javascripts/spree/frontend/spree_order_groove.js
201
+ - app/assets/stylesheets/spree/backend/spree_order_groove.css
202
+ - app/assets/stylesheets/spree/frontend/spree_order_groove.css
203
+ - app/controllers/spree/api/orders_controller_decorator.rb
204
+ - app/controllers/spree/checkout_controller_decorator.rb
205
+ - app/controllers/spree/orders_controller_decorator.rb
206
+ - app/controllers/spree/store_controller_decorator.rb
207
+ - app/models/spree/ordergroove_configuration.rb
208
+ - app/models/spree/promotion/rules/autodelivery.rb
209
+ - app/overrides/decorate_ordergroove_div_cart.rb
210
+ - app/overrides/decorate_ordergroove_div_cart_remove.rb
211
+ - app/overrides/decorate_ordergroove_div_product_main.rb
212
+ - app/overrides/decorate_ordergroove_tags_cart.rb
213
+ - app/overrides/decorate_ordergroove_tags_product.rb
214
+ - app/views/spree/admin/promotions/rules/_autodelivery_rule.html.erb
215
+ - app/views/spree/api/orders/ogcreateorder.v1.rabl
216
+ - app/views/spree/shared/_ordergroove_line_item_div.html.erb
217
+ - app/views/spree/shared/_ordergroove_line_item_div_remove.html.erb
218
+ - app/views/spree/shared/_ordergroove_tags.html.erb
219
+ - bin/rails
220
+ - config/locales/en.yml
221
+ - config/ordergroove.yml
222
+ - config/routes.rb
223
+ - db/migrate/20150604115532_add_auto_delivery_to_spree_line_items.spree_order_groove.rb
224
+ - lib/generators/spree_order_groove/install/install_generator.rb
225
+ - lib/rc4.rb
226
+ - lib/spree_order_groove.rb
227
+ - lib/spree_order_groove/engine.rb
228
+ - lib/spree_order_groove/factories.rb
229
+ - spec/spec_helper.rb
230
+ - spree_order_groove.gemspec
231
+ has_rdoc: true
232
+ homepage: http://www.naturalwellbeing.com
233
+ licenses: []
234
+
235
+ post_install_message:
236
+ rdoc_options: []
237
+
238
+ require_paths:
239
+ - lib
240
+ required_ruby_version: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ hash: 15
246
+ segments:
247
+ - 2
248
+ - 0
249
+ - 0
250
+ version: 2.0.0
251
+ required_rubygems_version: !ruby/object:Gem::Requirement
252
+ none: false
253
+ requirements:
254
+ - - ">="
255
+ - !ruby/object:Gem::Version
256
+ hash: 3
257
+ segments:
258
+ - 0
259
+ version: "0"
260
+ requirements:
261
+ - none
262
+ rubyforge_project:
263
+ rubygems_version: 1.5.2
264
+ signing_key:
265
+ specification_version: 3
266
+ summary: Order Groove provide the retain engine for ecommerce web sites, all customer sign up for auto delivery. This spree extension integrate it into spree
267
+ test_files:
268
+ - spec/spec_helper.rb