spree_custom_trackers 0.0.1.alpha → 0.0.2.alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +21 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +27 -0
  5. data/Appraisals +11 -0
  6. data/Gemfile +7 -0
  7. data/LICENSE +26 -0
  8. data/README.md +50 -0
  9. data/Rakefile +21 -0
  10. data/app/assets/javascripts/spree/backend/spree_custom_trackers.js +2 -0
  11. data/app/assets/javascripts/spree/frontend/spree_custom_trackers.js +2 -0
  12. data/app/assets/stylesheets/spree/backend/spree_custom_trackers.css +4 -0
  13. data/app/assets/stylesheets/spree/frontend/spree_custom_trackers.css +4 -0
  14. data/app/controllers/spree/admin/custom_trackers_controller.rb +9 -0
  15. data/app/models/application_record.rb +3 -0
  16. data/app/models/spree/custom_tracker.rb +5 -0
  17. data/app/overrides/spree/admin/shared/sub_menu/_configuration/add_custom_trackers_to_admin_configurations_sidebar_menu.html.erb.deface +2 -0
  18. data/app/overrides/spree/layouts/spree_application/add_custom_trackers_to_spree_application.html.erb.deface +5 -0
  19. data/app/views/spree/admin/custom_trackers/_form.html.haml +14 -0
  20. data/app/views/spree/admin/custom_trackers/edit.html.haml +14 -0
  21. data/app/views/spree/admin/custom_trackers/index.html.haml +24 -0
  22. data/app/views/spree/admin/custom_trackers/new.html.haml +16 -0
  23. data/bin/rails +7 -0
  24. data/config/locales/en.yml +17 -0
  25. data/config/routes.rb +5 -0
  26. data/db/migrate/20170722235340_create_spree_custom_trackers.rb +11 -0
  27. data/gemfiles/.bundle/config +2 -0
  28. data/gemfiles/spree_3_2.gemfile +9 -0
  29. data/gemfiles/spree_master.gemfile +9 -0
  30. data/lib/generators/spree_custom_trackers/install/install_generator.rb +31 -0
  31. data/lib/spree_custom_trackers/engine.rb +20 -0
  32. data/lib/spree_custom_trackers/factories.rb +6 -0
  33. data/lib/spree_custom_trackers/version.rb +18 -0
  34. data/lib/spree_custom_trackers.rb +3 -0
  35. data/spec/models/spree/custom_tracker_spec.rb +7 -0
  36. data/spec/spec_helper.rb +93 -0
  37. data/spree_custom_trackers.gemspec +45 -0
  38. metadata +41 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fb6c1d2b2c2443a8a13fe60fc3dfd3d8db283da
4
- data.tar.gz: b9625c23cc452e372c1d84ca5566dfea9b0d0f48
3
+ metadata.gz: a76c42827f7e87c9a52fdfc3d80d5537f1094361
4
+ data.tar.gz: 67fb3108af864151ca4275866c5e8651c80fd2b4
5
5
  SHA512:
6
- metadata.gz: d960d12463c01e58ae2a0f9f0ed9c03f8da3d48a332499511e9c07e17cea7d5e6a2103ca6279b1bbee17068f8af91ca9c4ad3db014744b186f33b1f519250c08
7
- data.tar.gz: a45a11d09a61bc6aab799a04a9510e73ef5c696fa78da43f911783ac6fa4fa4ed0533a4e8cfd548809aa5d76b6c24d2c80286fe0c8d5d2154f45cbd505dcb462
6
+ metadata.gz: 99dcda2bff7184b5c4c22553f0925c0dc70d35665fe1483632f21ecfd5f846eb03d4b6b46e6f396e07026c5971372d294ccd27652989470b4251bbe6ea1297f0
7
+ data.tar.gz: d9e20f56d2e89c3fd4f228561793308d86cb6b70559b5d38086929f8bdc1d12cce184b02a420ce451ea8f0cd69e18b35c752c68a48dd0082b207d9696fca73f4
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,27 @@
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_2.gemfile
12
+ - gemfiles/spree_master.gemfile
13
+
14
+ script:
15
+ - bundle exec rake test_app
16
+ - bundle exec rake spec
17
+
18
+ rvm:
19
+ - 2.4.1
20
+ - 2.3.4
21
+
22
+ addons:
23
+ apt:
24
+ packages:
25
+ - mysql-server-5.6
26
+ - mysql-client-core-5.6
27
+ - mysql-client-5.6
data/Appraisals ADDED
@@ -0,0 +1,11 @@
1
+ appraise 'spree-3-2' do
2
+ gem 'spree', '~> 3.2.0'
3
+ gem 'spree_auth_devise', '~> 3.2.0.beta'
4
+ gem 'rails-controller-testing'
5
+ end
6
+
7
+ appraise 'spree-master' do
8
+ gem 'spree', github: 'spree/spree', branch: 'master'
9
+ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
10
+ gem 'rails-controller-testing'
11
+ end
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'spree', github: 'spree/spree', branch: 'master'
4
+ # Provides basic authentication functionality for testing parts of your engine
5
+ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
6
+
7
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2017 REV365, LLC
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
@@ -0,0 +1,50 @@
1
+ SpreeCustomTrackers
2
+ ===================
3
+
4
+ Introduction goes here.
5
+
6
+ ## Installation
7
+
8
+ 1. Add this extension to your Gemfile with this line:
9
+ ```ruby
10
+ gem 'spree_custom_trackers', github: 'rev365/spree_custom_trackers'
11
+ ```
12
+
13
+ 2. Install the gem using Bundler:
14
+ ```ruby
15
+ bundle install
16
+ ```
17
+
18
+ 3. Copy & run migrations
19
+ ```ruby
20
+ bundle exec rails g spree_custom_trackers:install
21
+ ```
22
+
23
+ 4. Restart your server
24
+
25
+ If your server was running, restart it so that it can find the assets properly.
26
+
27
+ ## Testing
28
+
29
+ First bundle your dependencies, then run `rake`. `rake` will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using `rake test_app`.
30
+
31
+ ```shell
32
+ bundle
33
+ bundle exec rake
34
+ ```
35
+
36
+ When testing your applications integration with this extension you may use it's factories.
37
+ Simply add this require statement to your spec_helper:
38
+
39
+ ```ruby
40
+ require 'spree_custom_trackers/factories'
41
+ ```
42
+
43
+
44
+ ## Contributing
45
+
46
+ If you'd like to contribute, please take a look at the
47
+ [instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
48
+ pull request.
49
+
50
+ Copyright (c) 2017 REV365, LLC, released under the New BSD License
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_custom_trackers'
20
+ Rake::Task['extension:test_app'].invoke
21
+ end
@@ -0,0 +1,2 @@
1
+ // Placeholder manifest file.
2
+ // the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/backend/all.js'
@@ -0,0 +1,2 @@
1
+ // Placeholder manifest file.
2
+ // the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/frontend/all.js'
@@ -0,0 +1,4 @@
1
+ /*
2
+ Placeholder manifest file.
3
+ the installer will append this file to the app vendored assets here: 'vendor/assets/stylesheets/spree/backend/all.css'
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Placeholder manifest file.
3
+ the installer will append this file to the app vendored assets here: 'vendor/assets/stylesheets/spree/frontend/all.css'
4
+ */
@@ -0,0 +1,9 @@
1
+ module Spree
2
+ module Admin
3
+ class CustomTrackersController < ResourceController
4
+ def index
5
+ respond_with(@collection)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,5 @@
1
+ module Spree
2
+ class CustomTracker < ApplicationRecord
3
+ validates_presence_of :name, :snippet, :active
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ <!-- insert_bottom "[data-hook='admin_configurations_sidebar_menu']" -->
2
+ <%= configurations_sidebar_menu_item t('spree_custom_trackers.config_name'), admin_custom_trackers_path %>
@@ -0,0 +1,5 @@
1
+ <!-- insert_bottom "[data-hook='inside_head']" -->
2
+ <% Spree::CustomTracker.where(active: true).all.each do |tracker| %>
3
+ <!-- <%= tracker.name %> snippet -->
4
+ <%= raw(tracker.snippet) %>
5
+ <% end %>
@@ -0,0 +1,14 @@
1
+ .row
2
+ .col-md-12
3
+ = f.field_container :name do
4
+ = f.label :name, t('spree_custom_trackers.name')
5
+ = f.text_field :name, class: 'fullwidth form-control'
6
+
7
+ .col-md-12
8
+ = f.field_container :snippet do
9
+ = f.label :snippet, t('spree_custom_trackers.snippet')
10
+ = f.text_area :snippet, class: 'fullwidth form-control'
11
+ .col-md-12
12
+ = f.field_container :active do
13
+ = f.label :active, t('spree_custom_trackers.active')
14
+ = f.check_box :active, class: 'form-control'
@@ -0,0 +1,14 @@
1
+ - content_for :page_title do
2
+ = t('spree_custom_trackers.editing_tracker')
3
+
4
+ - content_for :page_actions do
5
+ = button_link_to t('spree_custom_trackers.back_to_trackers'), spree.admin_custom_trackers_path, icon: 'arrow-left'
6
+
7
+ = render 'spree/shared/error_messages', target: @custom_tracker
8
+
9
+ = form_for [:admin, @custom_tracker], html: { multipart: true } do |f|
10
+ %fieldset.no-border-top
11
+ = render partial: 'form', locals: { f: f }
12
+
13
+ %div{ data: { hook: 'admin_custom_trackers_edit_form_buttons' } }
14
+ = render partial: 'spree/admin/shared/edit_resource_links'
@@ -0,0 +1,24 @@
1
+ - content_for :page_actions do
2
+ = button_link_to t('spree_custom_trackers.new_tracker'), new_object_url, { class: 'btn-success', icon: 'add', id: 'admin_new_tracker_link' }
3
+
4
+ - content_for :page_title do
5
+ = t('spree_custom_trackers.index_title')
6
+
7
+ %table.table.sortable#listing_licensees
8
+ %thead
9
+ %tr{data: {hook:'admin_slides_index_headers' } }
10
+ %th
11
+ = t('spree_custom_trackers.name')
12
+ %th
13
+ = t('spree_custom_trackers.active')
14
+ %th.actions{ data: {hook:'admin_licensees_index_header_actions'} }
15
+ %tbody
16
+ - @collection.each do |tracker|
17
+ %tr{id: spree_dom_id(tracker), data: {hook: 'admin_trackers_index_rows'} }
18
+ %td
19
+ = tracker.name
20
+ %td
21
+ = tracker.active
22
+ %td.actions{ data:{hook:'admin_trackers_index_row_actions'} }
23
+ = link_to_edit tracker, no_text: true, class: 'edit'
24
+ = link_to_delete tracker, no_text: true
@@ -0,0 +1,16 @@
1
+ - content_for :page_title do
2
+ = t('spree_custom_trackers.new_tracker')
3
+
4
+
5
+ - content_for :page_actions do
6
+ = button_link_to t('spree_custom_trackers.back_to_trackers'), spree.admin_custom_trackers_path, icon: 'arrow-left'
7
+
8
+ = render 'spree/shared/error_messages', target: @custom_tracker
9
+
10
+ = form_for [:admin, @custom_tracker] , html: { multipart: true } do |f|
11
+ %fieldset.no-border-top
12
+ = render partial: 'form', locals: { f: f }
13
+ .clear
14
+
15
+ %div{ data: { hook: 'admin_custom_trackers_new_form_buttons'} }
16
+ = render partial: 'spree/admin/shared/new_resource_links'
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_custom_trackers/engine', __FILE__)
5
+
6
+ require 'rails/all'
7
+ require 'rails/engine/commands'
@@ -0,0 +1,17 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ activerecord:
6
+ models:
7
+ spree/custom_trackers: CustomTracker
8
+
9
+ spree_custom_trackers:
10
+ name: Name
11
+ snippet: Snippet
12
+ active: Active
13
+ config_name: Custom Trackers
14
+ new_tracker: New Custom Tracker
15
+ editing_tracker: Editing Custom Tracker
16
+ back_to_trackers: Back to Custom Trackers
17
+ index_title: Custom Trackers
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Spree::Core::Engine.routes.draw do
2
+ namespace :admin do
3
+ resources :custom_trackers
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class CreateSpreeCustomTrackers < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :spree_custom_trackers do |t|
4
+ t.string :name, null: false
5
+ t.text :snippet, null: false
6
+ t.boolean :active, null: false, default: true
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ 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.2.0"
6
+ gem "spree_auth_devise", "~> 3.2.0.beta"
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", github: "spree/spree", branch: "master"
6
+ gem "spree_auth_devise", github: "spree/spree_auth_devise", branch: "master"
7
+ gem "rails-controller-testing"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,31 @@
1
+ module SpreeCustomTrackers
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+
5
+ class_option :auto_run_migrations, type: :boolean, default: false
6
+
7
+ def add_javascripts
8
+ append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_custom_trackers\n"
9
+ append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/spree_custom_trackers\n"
10
+ end
11
+
12
+ def add_stylesheets
13
+ inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/spree_custom_trackers\n", before: /\*\//, verbose: true
14
+ inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/spree_custom_trackers\n", before: /\*\//, verbose: true
15
+ end
16
+
17
+ def add_migrations
18
+ run 'bundle exec rake railties:install:migrations FROM=spree_custom_trackers'
19
+ end
20
+
21
+ def run_migrations
22
+ run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
23
+ if run_migrations
24
+ run 'bundle exec rake db:migrate'
25
+ else
26
+ puts 'Skipping rake db:migrate, don\'t forget to run it!'
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,20 @@
1
+ module SpreeCustomTrackers
2
+ class Engine < Rails::Engine
3
+ require 'spree/core'
4
+ isolate_namespace Spree
5
+ engine_name 'spree_custom_trackers'
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,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_custom_trackers/factories'
6
+ end
@@ -0,0 +1,18 @@
1
+ module SpreeCustomTrackers
2
+ module_function
3
+
4
+ # Returns the version of the currently loaded SpreeCustomTrackers as a
5
+ # <tt>Gem::Version</tt>.
6
+ def version
7
+ Gem::Version.new VERSION::STRING
8
+ end
9
+
10
+ module VERSION
11
+ MAJOR = 0
12
+ MINOR = 0
13
+ TINY = 2
14
+ PRE = 'alpha'.freeze
15
+
16
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ require 'spree_core'
2
+ require 'spree_custom_trackers/engine'
3
+ require 'spree_custom_trackers/version'
@@ -0,0 +1,7 @@
1
+ RSpec.describe Spree::CustomTracker, type: :model do
2
+
3
+ it 'requires all fields' do
4
+ tracker = Spree::CustomTracker.new
5
+ expect(tracker.save).to be false
6
+ end
7
+ 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_custom_trackers/factories.rb
34
+ require 'spree_custom_trackers/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
+ # == 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
+ # encoding: UTF-8
2
+ lib = File.expand_path('../lib/', __FILE__)
3
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'spree_custom_trackers/version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.platform = Gem::Platform::RUBY
9
+ s.name = 'spree_custom_trackers'
10
+ s.version = SpreeCustomTrackers.version
11
+ s.summary = 'Add extension summary here'
12
+ s.description = 'Add (optional) extension description here'
13
+ s.required_ruby_version = '>= 2.3.1'
14
+
15
+ s.author = 'Jeremiah Bentch'
16
+ s.email = 'jeremiah@rev365.com'
17
+ s.homepage = 'https://github.com/rev365/spree_custom_trackers'
18
+ s.license = 'BSD-3-Clause'
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
+ s.require_path = 'lib'
23
+ s.requirements << 'none'
24
+
25
+ s.add_dependency 'spree_core', '>= 3.2.0', '< 4.0'
26
+ s.add_dependency 'spree_backend', '>= 3.2.0', '< 4.0'
27
+ s.add_dependency 'spree_frontend', '>= 3.2.0', '< 4.0'
28
+ s.add_dependency 'haml', '~> 4.0.0'
29
+ s.add_dependency 'haml-rails', '~> 1.0.0'
30
+
31
+ s.add_development_dependency 'capybara'
32
+ s.add_development_dependency 'capybara-screenshot'
33
+ s.add_development_dependency 'coffee-rails'
34
+ s.add_development_dependency 'database_cleaner'
35
+ s.add_development_dependency 'factory_girl'
36
+ s.add_development_dependency 'ffaker'
37
+ s.add_development_dependency 'rspec-rails'
38
+ s.add_development_dependency 'sass-rails'
39
+ s.add_development_dependency 'selenium-webdriver'
40
+ s.add_development_dependency 'simplecov'
41
+ s.add_development_dependency 'pg'
42
+ s.add_development_dependency 'mysql2'
43
+ s.add_development_dependency 'sqlite3'
44
+ s.add_development_dependency 'appraisal'
45
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_custom_trackers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
4
+ version: 0.0.2.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Bentch
@@ -299,7 +299,43 @@ email: jeremiah@rev365.com
299
299
  executables: []
300
300
  extensions: []
301
301
  extra_rdoc_files: []
302
- files: []
302
+ files:
303
+ - ".gitignore"
304
+ - ".rspec"
305
+ - ".travis.yml"
306
+ - Appraisals
307
+ - Gemfile
308
+ - LICENSE
309
+ - README.md
310
+ - Rakefile
311
+ - app/assets/javascripts/spree/backend/spree_custom_trackers.js
312
+ - app/assets/javascripts/spree/frontend/spree_custom_trackers.js
313
+ - app/assets/stylesheets/spree/backend/spree_custom_trackers.css
314
+ - app/assets/stylesheets/spree/frontend/spree_custom_trackers.css
315
+ - app/controllers/spree/admin/custom_trackers_controller.rb
316
+ - app/models/application_record.rb
317
+ - app/models/spree/custom_tracker.rb
318
+ - app/overrides/spree/admin/shared/sub_menu/_configuration/add_custom_trackers_to_admin_configurations_sidebar_menu.html.erb.deface
319
+ - app/overrides/spree/layouts/spree_application/add_custom_trackers_to_spree_application.html.erb.deface
320
+ - app/views/spree/admin/custom_trackers/_form.html.haml
321
+ - app/views/spree/admin/custom_trackers/edit.html.haml
322
+ - app/views/spree/admin/custom_trackers/index.html.haml
323
+ - app/views/spree/admin/custom_trackers/new.html.haml
324
+ - bin/rails
325
+ - config/locales/en.yml
326
+ - config/routes.rb
327
+ - db/migrate/20170722235340_create_spree_custom_trackers.rb
328
+ - gemfiles/.bundle/config
329
+ - gemfiles/spree_3_2.gemfile
330
+ - gemfiles/spree_master.gemfile
331
+ - lib/generators/spree_custom_trackers/install/install_generator.rb
332
+ - lib/spree_custom_trackers.rb
333
+ - lib/spree_custom_trackers/engine.rb
334
+ - lib/spree_custom_trackers/factories.rb
335
+ - lib/spree_custom_trackers/version.rb
336
+ - spec/models/spree/custom_tracker_spec.rb
337
+ - spec/spec_helper.rb
338
+ - spree_custom_trackers.gemspec
303
339
  homepage: https://github.com/rev365/spree_custom_trackers
304
340
  licenses:
305
341
  - BSD-3-Clause
@@ -325,4 +361,6 @@ rubygems_version: 2.6.11
325
361
  signing_key:
326
362
  specification_version: 4
327
363
  summary: Add extension summary here
328
- test_files: []
364
+ test_files:
365
+ - spec/models/spree/custom_tracker_spec.rb
366
+ - spec/spec_helper.rb