spree_edrone 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +29 -0
  5. data/Appraisals +17 -0
  6. data/Gemfile +7 -0
  7. data/LICENSE +26 -0
  8. data/README.md +0 -0
  9. data/Rakefile +21 -0
  10. data/app/controllers/spree/admin/edrones_controller.rb +6 -0
  11. data/app/controllers/spree/store_controller_decorator.rb +5 -0
  12. data/app/helpers/spree/edrones_helper.rb +23 -0
  13. data/app/models/spree/edrone.rb +25 -0
  14. data/app/models/spree/line_item_decorator.rb +6 -0
  15. data/app/models/spree/order_decorator.rb +7 -0
  16. data/app/models/spree/product_decorator.rb +11 -0
  17. data/app/models/spree/user_decorator.rb +5 -0
  18. data/app/overrides/add_cart_viewed_to_orders_edit.rb +10 -0
  19. data/app/overrides/add_edrone_module_to_admin_sidebar.rb +9 -0
  20. data/app/overrides/add_edrone_module_to_spree_application.rb +9 -0
  21. data/app/overrides/add_order_complete_to_orders_show.rb +10 -0
  22. data/app/overrides/add_product_viewed_to_products_show.rb +10 -0
  23. data/app/views/spree/admin/edrones/_form.html.erb +40 -0
  24. data/app/views/spree/admin/edrones/edit.html.erb +12 -0
  25. data/app/views/spree/admin/edrones/index.html.erb +43 -0
  26. data/app/views/spree/admin/edrones/new.html.erb +12 -0
  27. data/app/views/spree/admin/shared/_edrone_sidebar_menu.html.erb +5 -0
  28. data/app/views/spree/shared/_edrone_module.html.erb +31 -0
  29. data/app/views/spree/shared/edrone/segment/_cart_viewed.js.erb +32 -0
  30. data/app/views/spree/shared/edrone/segment/_order_complete.js.erb +29 -0
  31. data/app/views/spree/shared/edrone/segment/_product_viewed.js.erb +16 -0
  32. data/bin/rails +7 -0
  33. data/config/locales/en.yml +7 -0
  34. data/config/routes.rb +5 -0
  35. data/db/migrate/20190603122826_create_spree_edrones.rb +21 -0
  36. data/gemfiles/.bundle/config +2 -0
  37. data/gemfiles/spree_3_5.gemfile +9 -0
  38. data/gemfiles/spree_3_7.gemfile +9 -0
  39. data/gemfiles/spree_master.gemfile +10 -0
  40. data/lib/generators/spree_edrone/install/install_generator.rb +20 -0
  41. data/lib/spree_edrone/engine.rb +20 -0
  42. data/lib/spree_edrone/factories.rb +9 -0
  43. data/lib/spree_edrone/version.rb +17 -0
  44. data/lib/spree_edrone.rb +4 -0
  45. data/spec/models/spree/edrone_spec.rb +17 -0
  46. data/spec/spec_helper.rb +93 -0
  47. data/spree_edrone.gemspec +45 -0
  48. metadata +370 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cd10c19412f117aae3e0702b9e2b9df97ddd28dda6b7be96159ae42c01a6b39f
4
+ data.tar.gz: 1f4390c1c8d4b5af34c50ed02b27618434b6dfed209aa9e7abf778caab73bd9d
5
+ SHA512:
6
+ metadata.gz: c9e6cb42406b76682595f03a38ee36c4dd2f399573fd5e13c3392bc798702ea4426ffb3ab0cf86c6812f3b63eb085994b6351334986c574f40c6699d9772dc6e
7
+ data.tar.gz: fc9cb006d7f896ccb8784909cbf46dc859bd6c600f47e8d9caaa63e81ceefadf720fc7e99c9b066ed632e5d5844b3de9431443f53a7c7e2f253ea5e574a243c0
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ \#*
2
+ *~
3
+ .#*
4
+ .DS_Store
5
+ .idea
6
+ .localeapp/locales
7
+ .project
8
+ coverage
9
+ default
10
+ Gemfile.lock
11
+ tmp
12
+ nbproject
13
+ pkg
14
+ *.sw?
15
+ spec/dummy
16
+ .rvmrc
17
+ .sass-cache
18
+ public/spree
19
+ .ruby-version
20
+ .ruby-gemset
21
+ gemfiles/*.gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ -r spec_helper
3
+ -f documentation
data/.travis.yml ADDED
@@ -0,0 +1,29 @@
1
+ sudo: required
2
+ dist: trusty
3
+
4
+ language: ruby
5
+
6
+ env:
7
+ - DB=postgres
8
+ - DB=mysql
9
+
10
+ gemfile:
11
+ - gemfiles/spree_3_5.gemfile
12
+ - gemfiles/spree_3_7.gemfile
13
+ - gemfiles/spree_master.gemfile
14
+
15
+ script:
16
+ - bundle exec rake test_app
17
+ - bundle exec rake spec
18
+
19
+ rvm:
20
+ - 2.3.3
21
+ - 2.4.2
22
+ - 2.5.2
23
+
24
+ matrix:
25
+ allow_failures:
26
+ - gemfile: gemfiles/spree_master.gemfile
27
+
28
+ before_install:
29
+ - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
data/Appraisals ADDED
@@ -0,0 +1,17 @@
1
+ appraise 'spree-3-5' do
2
+ gem 'spree', '~> 3.5.0'
3
+ gem 'spree_auth_devise', '~> 3.3.0'
4
+ gem 'rails-controller-testing'
5
+ end
6
+
7
+ appraise 'spree-3-7' do
8
+ gem 'spree', '~> 3.7.0'
9
+ gem 'spree_auth_devise', '~> 3.5.0'
10
+ gem 'rails-controller-testing'
11
+ end
12
+
13
+ appraise 'spree-master' do
14
+ gem 'spree', github: 'spree/spree', branch: 'master'
15
+ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
16
+ gem 'rails-controller-testing'
17
+ end
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'spree', github: 'spree/spree', branch: 'master'
4
+ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
5
+ gem 'rails-controller-testing'
6
+
7
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2017-2018 edrone Sp. z o.o.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+ * Neither the name Spree nor the names of its contributors may be used to
13
+ endorse or promote products derived from this software without specific
14
+ prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ require 'spree/testing_support/extension_rake'
6
+
7
+ RSpec::Core::RakeTask.new
8
+
9
+ task :default do
10
+ if Dir["spec/dummy"].empty?
11
+ Rake::Task[:test_app].invoke
12
+ Dir.chdir("../../")
13
+ end
14
+ Rake::Task[:spec].invoke
15
+ end
16
+
17
+ desc 'Generates a dummy app for testing'
18
+ task :test_app do
19
+ ENV['LIB_NAME'] = 'spree_edrone'
20
+ Rake::Task['extension:test_app'].invoke
21
+ end
@@ -0,0 +1,6 @@
1
+ module Spree
2
+ module Admin
3
+ class EdronesController < ResourceController
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ if defined?(Spree::StoreController)
2
+ Spree::StoreController.class_eval do
3
+ helper Spree::EdronesHelper
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ module Spree
2
+ module EdronesHelper
3
+ def product_for_segment(product, optional = {})
4
+ {
5
+ product_id: product.id,
6
+ sku: product.sku,
7
+ category: product.category.try(:name),
8
+ category_id: product.category.try(:id),
9
+ name: product.name,
10
+ brand: product.brand.try(:name),
11
+ price: product.price.to_f,
12
+ currency: product.currency,
13
+ url: product_url(product),
14
+ }.tap do |hash|
15
+ if defined?(ActiveStorage) && !Rails.application.config.use_paperclip
16
+ hash[:image_url] = request.base_url + Rails.application.routes.url_helpers.rails_blob_path(optional.delete(:image).attachment, only_path: true) if optional[:image]
17
+ else
18
+ hash[:image_url] = request.base_url + asset_url(optional.delete(:image).attachment) if optional[:image]
19
+ end
20
+ end.merge(optional).to_json.html_safe
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ module Spree
2
+ class Edrone < Spree::Base
3
+ TRACKING_ENGINES = %i(google_analytics segment).freeze
4
+ enum engine: TRACKING_ENGINES
5
+
6
+ after_commit :clear_cache
7
+
8
+ validates :edrone_app_id, presence: true, uniqueness: { scope: :engine, case_sensitive: false }
9
+
10
+ scope :active, -> { where(active: true) }
11
+
12
+ def self.current(engine = TRACKING_ENGINES.first)
13
+ edrone = Rails.cache.fetch("current_edrone/#{engine}") do
14
+ send(engine).active.first
15
+ end
16
+ edrone.edrone_app_id.present? ? edrone : nil if edrone
17
+ end
18
+
19
+ def clear_cache
20
+ TRACKING_ENGINES.each do |engine|
21
+ Rails.cache.delete("current_edrone/#{engine}")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,6 @@
1
+ if Gem.loaded_specs['spree_core'].version < Gem::Version.create('3.2.0')
2
+ Spree::LineItem.class_eval do
3
+ delegate :brand, :category, to: :product
4
+ delegate :options_text, to: :variant
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ if Gem.loaded_specs['spree_core'].version < Gem::Version.create('3.3.0')
2
+ Spree::Order.class_eval do
3
+ def promo_code
4
+ promotions.pluck(:code).compact.first
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ if Gem.loaded_specs['spree_core'].version < Gem::Version.create('3.2.0')
2
+ Spree::Product.class_eval do
3
+ def category
4
+ taxons.joins(:taxonomy).find_by(spree_taxonomies: { name: Spree.t(:taxonomy_categories_name) })
5
+ end
6
+
7
+ def brand
8
+ taxons.joins(:taxonomy).find_by(spree_taxonomies: { name: Spree.t(:taxonomy_brands_name) })
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ Spree.user_class.class_eval do
2
+ def edrone_app_id
3
+ id
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ spree_version = Gem.loaded_specs['spree_core'].version
2
+ unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Version.create('3.5.0')
3
+ Deface::Override.new(
4
+ virtual_path: 'spree/orders/edit',
5
+ name: 'add_cart_viewed_to_orders_edit',
6
+ insert_top: "[data-hook='cart_container']",
7
+ partial: 'spree/shared/edrone/segment/cart_viewed.js',
8
+ original: 'e0a3dcdf759c4ec9fad085cd8a5360c8d68167f5'
9
+ )
10
+ end
@@ -0,0 +1,9 @@
1
+ if Gem.loaded_specs['spree_core'].version >= Gem::Version.create('3.5.0')
2
+ Deface::Override.new(
3
+ virtual_path: 'spree/admin/shared/sub_menu/_configuration',
4
+ name: 'add_edrone_module_to_admin_configurations_sidebar_menu',
5
+ insert_bottom: '[data-hook="admin_configurations_sidebar_menu"]',
6
+ original: '72f6a33afb2627a467ae458d42991ab0ce4cc6df',
7
+ text: '<%= configurations_sidebar_menu_item(Spree.t(:edrone_module), spree.admin_edrones_path) if can? :manage, Spree::Edrone %>'
8
+ )
9
+ end
@@ -0,0 +1,9 @@
1
+ if Gem.loaded_specs['spree_core'].version >= Gem::Version.create('3.5.0.alpha')
2
+ Deface::Override.new(
3
+ virtual_path: 'spree/layouts/spree_application',
4
+ name: 'add_edrone_module_to_spree_application',
5
+ insert_top: "[data-hook='body']",
6
+ partial: 'spree/shared/edrone_module',
7
+ original: 'cfa30a2831d9a41394c03229cd28b3c7eee69585'
8
+ )
9
+ end
@@ -0,0 +1,10 @@
1
+ spree_version = Gem.loaded_specs['spree_core'].version
2
+ unless spree_version >= Gem::Version.create('3.3.0') && spree_version < Gem::Version.create('3.5.0')
3
+ Deface::Override.new(
4
+ virtual_path: 'spree/orders/show',
5
+ name: 'add_order_complete_to_orders_show',
6
+ insert_before: "#order_summary",
7
+ partial: 'spree/shared/edrone/segment/order_complete.js',
8
+ original: 'ac7f302922a3c1bb080095296ccc20e42bab2967'
9
+ )
10
+ end
@@ -0,0 +1,10 @@
1
+ spree_version = Gem.loaded_specs['spree_core'].version
2
+ unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Version.create('3.5.0')
3
+ Deface::Override.new(
4
+ virtual_path: 'spree/products/show',
5
+ name: 'add_product_viewed_to_products_show',
6
+ insert_before: "[data-hook='product_show']",
7
+ partial: 'spree/shared/edrone/segment/product_viewed.js',
8
+ original: '5426c263ccfe477b270b55024abebc77cf951c91'
9
+ )
10
+ end
@@ -0,0 +1,40 @@
1
+ <div data-hook="admin_tracker_form_fields" class="row">
2
+ <div class="col-xs-12 col-md-4">
3
+ <div class="row">
4
+ <div class="col-xs-12" data-hook="edrone_app_id">
5
+ <%= f.field_container :edrone_app_id, class: ["form-group"], "data-hook" => "edrone_app_id" do %>
6
+ <%= f.label :edrone_app_id, Spree.t(:app_id) %>
7
+ <%= f.text_field :edrone_app_id, class: 'form-control' %>
8
+ <%= f.error_message_on :edrone_app_id %>
9
+ <% end %>
10
+ </div>
11
+ <div class="col-xs-12" data-hook="edrone_app_secret">
12
+ <%= f.field_container :edrone_app_secret, class: ["form-group"], "data-hook" => "edrone_app_secret" do %>
13
+ <%= f.label :edrone_app_secret, Spree.t(:app_secret) %>
14
+ <%= f.text_field :edrone_app_secret, class: 'form-control' %>
15
+ <%= f.error_message_on :edrone_app_secret %>
16
+ <% end %>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div class="col-xs-12 col-md-8">
21
+ <div data-hook="active" class="form-group">
22
+ <%= label_tag nil, Spree.t(:active) %>
23
+ <div class="radio">
24
+ <%= label_tag :edrone_active_true do %>
25
+ <%= radio_button(:edrone, :active, true) %>
26
+ <%= Spree.t(:say_yes) %>
27
+ <% end %>
28
+ </div>
29
+ <div class="radio">
30
+ <%= label_tag :edrone_active_false do %>
31
+ <%= radio_button(:edrone, :active, false) %>
32
+ <%= Spree.t(:say_no) %>
33
+ <% end %>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ <div data-hook="additional_tracker_fields"></div>
38
+ </div>
39
+ <div data-hook="admin_tracker_form_fields" class="row">
40
+ </div>
@@ -0,0 +1,12 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t(:edrone_module), spree.admin_edrones_url %>
3
+ <% end %>
4
+
5
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @edrone } %>
6
+
7
+ <%= form_for [:admin, @edrone] do |f| %>
8
+ <fieldset>
9
+ <%= render partial: 'form', locals: { f: f } %>
10
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
11
+ </fieldset>
12
+ <% end %>
@@ -0,0 +1,43 @@
1
+ <% content_for :page_title do %>
2
+ <%= Spree.t(:edrone_module) %>
3
+ <% end %>
4
+ <% content_for :page_actions do %>
5
+ <% if !@edrones.any? %>
6
+ <%= button_link_to Spree.t(:integrate_with_edrone), new_object_url, class: "btn-success", icon: 'add', id: 'admin_new_tracker_link' %>
7
+ <% end %>
8
+ <% end if can? :create, Spree::Edrone %>
9
+
10
+ <% if @edrones.any? %>
11
+ <table class="table">
12
+ <colgroup>
13
+ <col style="width: 30%">
14
+ <col style="width: 40%">
15
+ <col style="width: 15%">
16
+ <col style="width: 15%">
17
+ </colgroup>
18
+ <thead>
19
+ <tr data-hook="admin_trackers_index_headers">
20
+ <th><%= Spree.t(:app_id) %></th>
21
+ <th><%= Spree.t(:app_secret) %></th>
22
+ <th class="text-center"><%= Spree.t(:active) %></th>
23
+ <th class="actions"></th>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ <% @edrones.each do |edrone|%>
28
+ <tr id="<%= spree_dom_id edrone %>" data-hook="admin_trackers_index_rows">
29
+ <td><%= edrone.edrone_app_id %></td>
30
+ <td><%= edrone.edrone_app_secret %></td>
31
+ <td class="text-center"><%= edrone.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
32
+ <td class="actions text-right">
33
+ <%= link_to_edit(edrone, no_text: true) if can? :edit, edrone %>
34
+ </td>
35
+ </tr>
36
+ <% end %>
37
+ </tbody>
38
+ </table>
39
+ <% else %>
40
+ <div class="alert alert-warning">
41
+ <%= link_to(Spree.t(:integrate_with_edrone), new_object_url) if can? :create, Spree::Edrone %>!
42
+ </div>
43
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t(:edrone_module), spree.admin_edrones_url %>
3
+ <% end %>
4
+
5
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @edrone } %>
6
+
7
+ <%= form_for [:admin, @edrone] do |f| %>
8
+ <fieldset>
9
+ <%= render partial: 'form', locals: { f: f } %>
10
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
11
+ </fieldset>
12
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <% if can? :admin, Spree::Edrone %>
2
+ <ul class="nav nav-sidebar">
3
+ <%= tab :analytic_trackers, url: spree.admin_edrones_path, icon: 'tasks' %>
4
+ </ul>
5
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <% if Spree::Edrone.current and Spree::Edrone.current.active %>
2
+ <script type="text/javascript">
3
+ (function (srcjs) {
4
+ window._edrone = window._edrone || {};
5
+ _edrone.app_id = '<%= Spree::Edrone.current.edrone_app_id %>';
6
+ _edrone.version = '<%= SpreeEdrone.version %>';
7
+ _edrone.platform = 'spreecommerce';
8
+ <% if defined?spree_current_user.email %>
9
+ _edrone.email = '<%= spree_current_user.email %>';
10
+ <% end %>
11
+ <% if defined?current_spree_user.bill_address.firstname %>
12
+ _edrone.first_name = '<%= current_spree_user.bill_address.firstname %>';
13
+ <% end %>
14
+ <% if defined?current_spree_user.bill_address.lastname %>
15
+ _edrone.last_name = '<%= current_spree_user.bill_address.lastname %>';
16
+ <% end %>
17
+ <% if defined?current_spree_user.bill_address.phone %>
18
+ _edrone.phone = '<%= current_spree_user.bill_address.phone %>';
19
+ <% end %>
20
+ <% if defined?current_spree_user.bill_address.city %>
21
+ _edrone.city = '<%= current_spree_user.bill_address.city %>';
22
+ <% end %>
23
+ var doc = document.createElement('script');
24
+ doc.type = 'text/javascript';
25
+ doc.async = true;
26
+ doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs;
27
+ var s = document.getElementsByTagName('script')[0];
28
+ s.parentNode.insertBefore(doc, s);
29
+ })("//d3bo67muzbfgtl.cloudfront.net/edrone_2_0.js?app_id=<%= Spree::Edrone.current.edrone_app_id %>");
30
+ </script>
31
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <% if Spree::Edrone.current and Spree::Edrone.current.active %>
2
+ <script>
3
+ !(function() {
4
+ window._edrone = window._edrone || {};
5
+ let edrone_cart = [
6
+ <% @order.line_items.each_with_index do |line_item, index| %>
7
+ <%= product_for_segment(line_item) %>,
8
+ <% end %> ];
9
+ var current_product_ids = edrone_cart.map((product) => product.product_id);
10
+ var previous_product_ids = JSON.parse(localStorage.getItem('edrone_products_added_to_cart') !== null ? localStorage.getItem('edrone_products_added_to_cart') : '[]')
11
+ let diff = current_product_ids.filter(x => !previous_product_ids.includes(x));
12
+ if (diff.length !== 0) {
13
+ edrone_cart.map((product) => {
14
+ if(product.product_id == diff[0]) {
15
+ window._edrone_send_handler = function () {
16
+ _edrone.first_run = false;
17
+ _edrone.product_skus = product.sku;
18
+ _edrone.product_ids = product.product_id;
19
+ _edrone.product_titles = product.name;
20
+ _edrone.product_urls = product.url;
21
+ _edrone.product_category_ids = product.category_id;
22
+ _edrone.product_category_names = product.category;
23
+ _edrone.action_type = 'add_to_cart';
24
+ _edrone.init();
25
+ };
26
+ }
27
+ })
28
+ }
29
+ localStorage.setItem('edrone_products_added_to_cart', JSON.stringify(current_product_ids));
30
+ })()
31
+ </script>
32
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <% if Spree::Edrone.current and Spree::Edrone.current.active %>
2
+ <script type="text/javascript">
3
+ !(function() {
4
+ window._edrone = window._edrone || {};
5
+ let edrone_products = [
6
+ <% @order.line_items.each_with_index do |line_item, index| %>
7
+ <%= product_for_segment(line_item, quantity: line_item.quantity) %>,
8
+ <% end %> ];
9
+ _edrone.action_type = 'order';
10
+ _edrone.email = '<%= @order.email %>';
11
+ _edrone.first_name = '<%= @order.bill_address.firstname %>';
12
+ _edrone.last_name = '<%= @order.bill_address.lastname %>';
13
+ _edrone.product_skus = edrone_products.map(product => product.sku).join('|');
14
+ _edrone.product_ids = edrone_products.map(product => product.product_id).join('|');
15
+ _edrone.product_titles = edrone_products.map(product => product.name).join('|');
16
+ _edrone.product_urls = edrone_products.map(product => product.url).join('|');
17
+ _edrone.product_category_ids = edrone_products.map(product => product.category_id).join('|');
18
+ _edrone.product_category_names = edrone_products.map(product => product.category).join('|');
19
+ _edrone.product_counts = edrone_products.map(product => product.quantity).join('|');
20
+ _edrone.order_id = '<%= @order.number %>';
21
+ _edrone.coupon = '<%= @order.promo_code %>';
22
+ _edrone.city = '<%= @order.bill_address.city %>';
23
+ _edrone.base_currency = '<%= @order.currency %>';
24
+ _edrone.order_currency = '<%= @order.currency %>';
25
+ _edrone.base_payment_value = '<%= @order.total %>';
26
+ _edrone.order_payment_value = '<%= @order.total %>';
27
+ })()
28
+ </script>
29
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <% if Spree::Edrone.current and Spree::Edrone.current.active %>
2
+ <script>
3
+ !(function() {
4
+ let edrone_product = <%= product_for_segment(@product, image: @product.images.first) %>
5
+ window._edrone = window._edrone || {};
6
+ _edrone.product_ids = edrone_product.product_id;
7
+ _edrone.product_skus = edrone_product.sku;
8
+ _edrone.product_titles = edrone_product.name ;
9
+ _edrone.product_images = edrone_product.image_url;
10
+ _edrone.product_urls = edrone_product.url;
11
+ _edrone.product_category_ids = edrone_product.category_id;
12
+ _edrone.product_category_names = edrone_product.category;
13
+ _edrone.action_type = 'product_view';
14
+ })()
15
+ </script>
16
+ <% end %>
data/bin/rails ADDED
@@ -0,0 +1,7 @@
1
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
2
+
3
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
4
+ ENGINE_PATH = File.expand_path('../../lib/spree_edrone/engine', __FILE__)
5
+
6
+ require 'rails/all'
7
+ require 'rails/engine/commands'
@@ -0,0 +1,7 @@
1
+ en:
2
+ spree:
3
+ new_edrone: New Edrone
4
+ app_id: edrone App ID
5
+ app_secret: edrone APP Secret
6
+ edrone_module: Edrone Module
7
+ integrate_with_edrone: Integrate with edrone
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Spree::Core::Engine.add_routes do
2
+ namespace :admin, path: Spree.admin_path do
3
+ resources :edrones
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ class CreateSpreeEdrones < SpreeExtension::Migration[4.2]
2
+ def change
3
+ if table_exists?(:spree_edrones)
4
+ add_index :spree_edrones, :active unless index_exists?(:spree_edrones, :active)
5
+ remove_column :spree_edrones, :environment if column_exists?(:spree_edrones, :environment)
6
+ unless column_exists?(:spree_edrones, :engine)
7
+ add_column :spree_edrones, :kind, :integer, default: 0, null: false, index: true unless column_exists?(:spree_edrones, :kind)
8
+ rename_column :spree_edrones, :kind, :engine if column_exists?(:spree_edrones, :kind)
9
+ end
10
+ else
11
+ create_table :spree_edrones do |t|
12
+ t.string 'edrone_app_id'
13
+ t.string 'edrone_app_secret'
14
+ t.boolean 'active', default: true, index: true
15
+ t.datetime 'created_at', null: false
16
+ t.datetime 'updated_at', null: false
17
+ t.integer 'engine', default: 0, null: false, index: true
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "spree", "~> 3.5.0"
6
+ gem "spree_auth_devise", "~> 3.3.0"
7
+ gem "rails-controller-testing"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "spree", "~> 3.7.0"
6
+ gem "spree_auth_devise", "~> 3.5.0"
7
+ gem "rails-controller-testing"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "spree", github: "spree/spree", branch: "master"
6
+ gem "spree_auth_devise", github: "spree/spree_auth_devise", branch: "master"
7
+ gem "mysql2", "~> 0.5.1"
8
+ gem "rails-controller-testing"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,20 @@
1
+ module SpreeEdrone
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ class_option :auto_run_migrations, type: :boolean, default: false
5
+
6
+ def add_migrations
7
+ run 'bundle exec rake railties:install:migrations FROM=spree_edrone'
8
+ end
9
+
10
+ def run_migrations
11
+ run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
12
+ if run_migrations
13
+ run 'bundle exec rake db:migrate'
14
+ else
15
+ puts 'Skipping rake db:migrate, don\'t forget to run it!'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ module SpreeEdrone
2
+ class Engine < Rails::Engine
3
+ require 'spree/core'
4
+ isolate_namespace Spree
5
+ engine_name 'spree_edrone'
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
+ end
17
+
18
+ config.to_prepare &method(:activate).to_proc
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ unless FactoryBot.factories.registered?(:edrone)
2
+ FactoryBot.define do
3
+ factory :edrone, class: Spree::Edrone do
4
+ edrone_app_id { '' }
5
+ edrone_app_secret { '' }
6
+ active { true }
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ module SpreeEdrone
2
+ module_function
3
+
4
+ # Returns the version of the currently loaded SpreeEdrone as a
5
+ # <tt>Gem::Version</tt>.
6
+ def version
7
+ Gem::Version.new VERSION::STRING
8
+ end
9
+
10
+ module VERSION
11
+ MAJOR = 1
12
+ MINOR = 0
13
+ TINY = 1
14
+
15
+ STRING = [MAJOR, MINOR, TINY].compact.join('.')
16
+ end
17
+ end
@@ -0,0 +1,4 @@
1
+ require 'spree_core'
2
+ require 'spree_extension'
3
+ require 'spree_edrone/engine'
4
+ require 'spree_edrone/version'
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Spree::Edrone, type: :model do
4
+ describe 'current' do
5
+ it 'returns the first active edrone' do
6
+ edrone = create(:edrone)
7
+ edrone.clear_cache
8
+ expect(Spree::Edrone.current).to eq(edrone)
9
+ end
10
+
11
+ it 'does not return an inactive edrone' do
12
+ edrone = create(:edrone, active: false)
13
+ edrone.clear_cache
14
+ expect(Spree::Edrone.current).to be_nil
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,93 @@
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_edrone/factories.rb
34
+ require 'spree_edrone/factories'
35
+
36
+ RSpec.configure do |config|
37
+ config.include FactoryBot::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
+ # == Requests support
51
+ #
52
+ # Adds convenient methods to request Spree's controllers
53
+ # spree_get :index
54
+ config.include Spree::TestingSupport::ControllerRequests, type: :controller
55
+
56
+ # == Mock Framework
57
+ #
58
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
59
+ #
60
+ # config.mock_with :mocha
61
+ # config.mock_with :flexmock
62
+ # config.mock_with :rr
63
+ config.mock_with :rspec
64
+ config.color = true
65
+
66
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
67
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
68
+
69
+ # Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
70
+ # to cleanup after each test instead. Without transactional fixtures set to false the records created
71
+ # to setup a test will be unavailable to the browser, which runs under a separate server instance.
72
+ config.use_transactional_fixtures = false
73
+
74
+ # Ensure Suite is set to use transactions for speed.
75
+ config.before :suite do
76
+ DatabaseCleaner.strategy = :transaction
77
+ DatabaseCleaner.clean_with :truncation
78
+ end
79
+
80
+ # Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
81
+ config.before :each do
82
+ DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
83
+ DatabaseCleaner.start
84
+ end
85
+
86
+ # After each spec clean the database.
87
+ config.after :each do
88
+ DatabaseCleaner.clean
89
+ end
90
+
91
+ config.fail_fast = ENV['FAIL_FAST'] || false
92
+ config.order = "random"
93
+ end
@@ -0,0 +1,45 @@
1
+ lib = File.expand_path('../lib/', __FILE__)
2
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'spree_edrone/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.platform = Gem::Platform::RUBY
8
+ s.name = 'spree_edrone'
9
+ s.version = SpreeEdrone.version
10
+ s.summary = 'Adds edrone integration with Spree'
11
+ s.description = 'Supports Edrone'
12
+ s.required_ruby_version = '>= 2.2.7'
13
+
14
+ s.author = 'edrone'
15
+ s.email = 'admin@edrone.me'
16
+ s.homepage = 'https://edrone.me'
17
+ s.license = 'MIT'
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- spec/*`.split("\n")
21
+ s.require_path = 'lib'
22
+ s.requirements << 'none'
23
+
24
+ spree_version = '>= 3.1.0', '< 5.0'
25
+ s.add_dependency 'spree_core', spree_version
26
+ s.add_dependency 'spree_backend', spree_version
27
+ s.add_dependency 'spree_extension'
28
+ s.add_dependency 'deface', '~> 1.0'
29
+
30
+ s.add_development_dependency 'appraisal'
31
+ s.add_development_dependency 'capybara'
32
+ s.add_development_dependency 'capybara-screenshot'
33
+ s.add_development_dependency 'chromedriver-helper'
34
+ s.add_development_dependency 'coffee-rails'
35
+ s.add_development_dependency 'database_cleaner'
36
+ s.add_development_dependency 'factory_bot', '~> 4.7'
37
+ s.add_development_dependency 'ffaker'
38
+ s.add_development_dependency 'mysql2'
39
+ s.add_development_dependency 'pg'
40
+ s.add_development_dependency 'rspec-rails'
41
+ s.add_development_dependency 'sass-rails'
42
+ s.add_development_dependency 'selenium-webdriver'
43
+ s.add_development_dependency 'simplecov'
44
+ s.add_development_dependency 'sqlite3', '~> 1.3.6'
45
+ end
metadata ADDED
@@ -0,0 +1,370 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_edrone
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - edrone
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-06-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: spree_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.1.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 3.1.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: spree_backend
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.1.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '5.0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.1.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '5.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: spree_extension
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ - !ruby/object:Gem::Dependency
68
+ name: deface
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '1.0'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '1.0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: appraisal
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: capybara
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: capybara-screenshot
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: chromedriver-helper
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ - !ruby/object:Gem::Dependency
138
+ name: coffee-rails
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ - !ruby/object:Gem::Dependency
152
+ name: database_cleaner
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ - !ruby/object:Gem::Dependency
166
+ name: factory_bot
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '4.7'
172
+ type: :development
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: '4.7'
179
+ - !ruby/object:Gem::Dependency
180
+ name: ffaker
181
+ requirement: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ type: :development
187
+ prerelease: false
188
+ version_requirements: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ - !ruby/object:Gem::Dependency
194
+ name: mysql2
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ type: :development
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ - !ruby/object:Gem::Dependency
208
+ name: pg
209
+ requirement: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ - !ruby/object:Gem::Dependency
222
+ name: rspec-rails
223
+ requirement: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: '0'
228
+ type: :development
229
+ prerelease: false
230
+ version_requirements: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - ">="
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ - !ruby/object:Gem::Dependency
236
+ name: sass-rails
237
+ requirement: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - ">="
240
+ - !ruby/object:Gem::Version
241
+ version: '0'
242
+ type: :development
243
+ prerelease: false
244
+ version_requirements: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - ">="
247
+ - !ruby/object:Gem::Version
248
+ version: '0'
249
+ - !ruby/object:Gem::Dependency
250
+ name: selenium-webdriver
251
+ requirement: !ruby/object:Gem::Requirement
252
+ requirements:
253
+ - - ">="
254
+ - !ruby/object:Gem::Version
255
+ version: '0'
256
+ type: :development
257
+ prerelease: false
258
+ version_requirements: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ - !ruby/object:Gem::Dependency
264
+ name: simplecov
265
+ requirement: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - ">="
268
+ - !ruby/object:Gem::Version
269
+ version: '0'
270
+ type: :development
271
+ prerelease: false
272
+ version_requirements: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - ">="
275
+ - !ruby/object:Gem::Version
276
+ version: '0'
277
+ - !ruby/object:Gem::Dependency
278
+ name: sqlite3
279
+ requirement: !ruby/object:Gem::Requirement
280
+ requirements:
281
+ - - "~>"
282
+ - !ruby/object:Gem::Version
283
+ version: 1.3.6
284
+ type: :development
285
+ prerelease: false
286
+ version_requirements: !ruby/object:Gem::Requirement
287
+ requirements:
288
+ - - "~>"
289
+ - !ruby/object:Gem::Version
290
+ version: 1.3.6
291
+ description: Supports Edrone
292
+ email: admin@edrone.me
293
+ executables: []
294
+ extensions: []
295
+ extra_rdoc_files: []
296
+ files:
297
+ - ".gitignore"
298
+ - ".rspec"
299
+ - ".travis.yml"
300
+ - Appraisals
301
+ - Gemfile
302
+ - LICENSE
303
+ - README.md
304
+ - Rakefile
305
+ - app/controllers/spree/admin/edrones_controller.rb
306
+ - app/controllers/spree/store_controller_decorator.rb
307
+ - app/helpers/spree/edrones_helper.rb
308
+ - app/models/spree/edrone.rb
309
+ - app/models/spree/line_item_decorator.rb
310
+ - app/models/spree/order_decorator.rb
311
+ - app/models/spree/product_decorator.rb
312
+ - app/models/spree/user_decorator.rb
313
+ - app/overrides/add_cart_viewed_to_orders_edit.rb
314
+ - app/overrides/add_edrone_module_to_admin_sidebar.rb
315
+ - app/overrides/add_edrone_module_to_spree_application.rb
316
+ - app/overrides/add_order_complete_to_orders_show.rb
317
+ - app/overrides/add_product_viewed_to_products_show.rb
318
+ - app/views/spree/admin/edrones/_form.html.erb
319
+ - app/views/spree/admin/edrones/edit.html.erb
320
+ - app/views/spree/admin/edrones/index.html.erb
321
+ - app/views/spree/admin/edrones/new.html.erb
322
+ - app/views/spree/admin/shared/_edrone_sidebar_menu.html.erb
323
+ - app/views/spree/shared/_edrone_module.html.erb
324
+ - app/views/spree/shared/edrone/segment/_cart_viewed.js.erb
325
+ - app/views/spree/shared/edrone/segment/_order_complete.js.erb
326
+ - app/views/spree/shared/edrone/segment/_product_viewed.js.erb
327
+ - bin/rails
328
+ - config/locales/en.yml
329
+ - config/routes.rb
330
+ - db/migrate/20190603122826_create_spree_edrones.rb
331
+ - gemfiles/.bundle/config
332
+ - gemfiles/spree_3_5.gemfile
333
+ - gemfiles/spree_3_7.gemfile
334
+ - gemfiles/spree_master.gemfile
335
+ - lib/generators/spree_edrone/install/install_generator.rb
336
+ - lib/spree_edrone.rb
337
+ - lib/spree_edrone/engine.rb
338
+ - lib/spree_edrone/factories.rb
339
+ - lib/spree_edrone/version.rb
340
+ - spec/models/spree/edrone_spec.rb
341
+ - spec/spec_helper.rb
342
+ - spree_edrone.gemspec
343
+ homepage: https://edrone.me
344
+ licenses:
345
+ - MIT
346
+ metadata: {}
347
+ post_install_message:
348
+ rdoc_options: []
349
+ require_paths:
350
+ - lib
351
+ required_ruby_version: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - ">="
354
+ - !ruby/object:Gem::Version
355
+ version: 2.2.7
356
+ required_rubygems_version: !ruby/object:Gem::Requirement
357
+ requirements:
358
+ - - ">="
359
+ - !ruby/object:Gem::Version
360
+ version: '0'
361
+ requirements:
362
+ - none
363
+ rubyforge_project:
364
+ rubygems_version: 2.7.6
365
+ signing_key:
366
+ specification_version: 4
367
+ summary: Adds edrone integration with Spree
368
+ test_files:
369
+ - spec/models/spree/edrone_spec.rb
370
+ - spec/spec_helper.rb