adcurve_spree 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +1 -0
  5. data/Gemfile +7 -0
  6. data/LICENSE +26 -0
  7. data/README.md +17 -0
  8. data/Rakefile +16 -0
  9. data/Versionfile +11 -0
  10. data/adcurve_spree.gemspec +31 -0
  11. data/app/assets/javascripts/admin/adcurve_spree.js +1 -0
  12. data/app/assets/javascripts/spree/admin/adcurve_tags.js +2 -0
  13. data/app/assets/javascripts/store/adcurve_spree.js +1 -0
  14. data/app/assets/stylesheets/admin/adcurve_spree.css +2 -0
  15. data/app/assets/stylesheets/spree/admin/adcurve_tags.css +4 -0
  16. data/app/assets/stylesheets/store/adcurve_spree.css +2 -0
  17. data/app/controllers/spree/admin/adcurve_tags_controller.rb +10 -0
  18. data/app/helpers/spree/admin/adcurve_tags_helper.rb +2 -0
  19. data/app/models/spree.rb +5 -0
  20. data/app/models/spree/adcurve_tag.rb +16 -0
  21. data/app/overrides/adcurve_configuration.rb +5 -0
  22. data/app/overrides/adcurve_tag.rb +11 -0
  23. data/app/overrides/spree/admin/shared/sub_menu/_configuration/add_adcurve_tracker_to_admin_configurations_sidebar_menu.html.erb.deface +2 -0
  24. data/app/views/spree/adcurve_tag/_configuration.html.erb +23 -0
  25. data/app/views/spree/adcurve_tag/_coversion_tag.html.erb +84 -0
  26. data/app/views/spree/adcurve_tag/_tracking_tag.html.erb +24 -0
  27. data/app/views/spree/admin/adcurve_tags/_form.html.erb +10 -0
  28. data/app/views/spree/admin/adcurve_tags/index.html.erb +13 -0
  29. data/config/locales/en.yml +5 -0
  30. data/config/routes.rb +5 -0
  31. data/db/migrate/20130317124315_create_spree_adcurve_tags.rb +10 -0
  32. data/lib/adcurve_spree.rb +2 -0
  33. data/lib/adcurve_spree/engine.rb +22 -0
  34. data/lib/generators/adcurve_spree/install/install_generator.rb +29 -0
  35. data/script/rails +7 -0
  36. data/spec/controllers/spree/admin/adcurve_tags_controller_spec.rb +5 -0
  37. data/spec/helpers/spree/admin/adcurve_tags_helper_spec.rb +15 -0
  38. data/spec/models/spree/adcurve_tag_spec.rb +5 -0
  39. data/spec/spec_helper.rb +46 -0
  40. metadata +46 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db11fe16a8ad5e58ce2cc7ec93904681fea090df
4
- data.tar.gz: c082de481bae403c5be6d84dabca13968b2351c9
3
+ metadata.gz: db03552dd9557d8806115e0edad576cda973167a
4
+ data.tar.gz: 277baf96df028be6a46702ccc4b5b382b782a006
5
5
  SHA512:
6
- metadata.gz: b05efc7c1674d5a6a06a452a3d858d140a8ef767d4b67bdfdb4a55cdccc3dd578f9000272a4be87fbf388ff1e51a18b99d4e060d0fa7b223bcf332fd6dcb6dcf
7
- data.tar.gz: 3c9216025d8eb0517edc559f9ff50e1dfe4bfad21a971a37176849b6cc35aeb8263a0fe0b1c08e11eb3480230d226859814e0ebf080f43e93de16a08357f8e9d
6
+ metadata.gz: ed7058c352ce99479dc877ace2b096e6182d08d52cdcfc24d262c04ab46892af6236c8bd07de092d830f3d42b5d3698c3238f0ce2506ea19f2bfbe9a49e2da54
7
+ data.tar.gz: ac056c674d195906db5a1c3b28e5d520cf0e0642851c971bb6d0ae68f440894f432aa173f2ef3501fa27db140ecd76efb23d9d68a66f18b1d0dd0f6c53a2822a
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ \#*
2
+ *~
3
+ .#*
4
+ .DS_Store
5
+ .idea
6
+ .project
7
+ .sass-cache
8
+ coverage
9
+ Gemfile.lock
10
+ tmp
11
+ nbproject
12
+ pkg
13
+ *.swp
14
+ spec/dummy
15
+ adcurve_spree*.gem
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 2.1.6@adcurve_spree --create
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'http://rubygems.org'
2
+ gem 'spree', github: 'spree/spree', branch: '3-1-stable'
3
+ # Provides basic authentication functionality for testing parts of your engine
4
+ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-1-stable'
5
+
6
+
7
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2013 [name of plugin creator]
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,17 @@
1
+ Spree Shop2market Tag
2
+ =====================
3
+
4
+ Shop2market tags implementation for Spree shop engine
5
+
6
+ Installation and configuration
7
+ ==============================
8
+
9
+ Add to your spree shop Gemfile
10
+
11
+ gem 'spree_adcurve_import', :git => 'git://github.com/Shop2market/adcurve_spree.git'
12
+
13
+ Run bundle install
14
+
15
+ Go to admin > Configuration > adcurve Tags, fill in your shop_id and host for shop2market application( default is track.shop2market.com )
16
+
17
+ Copyright (c) 2013 Shop2market, released under the New BSD License
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ #require 'spree/core/testing_support/common_rake'
6
+ require 'spree/testing_support/common_rake'
7
+
8
+ RSpec::Core::RakeTask.new
9
+
10
+ task :default => [:spec]
11
+
12
+ desc 'Generates a dummy app for testing'
13
+ task :test_app do
14
+ ENV['LIB_NAME'] = 'adcurve_spree'
15
+ Rake::Task['common:test_app'].invoke
16
+ end
data/Versionfile ADDED
@@ -0,0 +1,11 @@
1
+ # This file is used to designate compatibilty with different versions of Spree
2
+ # Please see http://spreecommerce.com/documentation/extensions.html#versionfile for details
3
+
4
+ # Examples
5
+ #
6
+ # '1.2.x' => { :branch => 'master' }
7
+ # '1.1.x' => { :branch => '1-1-stable' }
8
+ # '1.0.x' => { :branch => '1-0-stable' }
9
+ # '0.70.x' => { :branch => '0-70-stable' }
10
+ # '0.40.x' => { :tag => 'v1.0.0', :version => '1.0.0' }
11
+
@@ -0,0 +1,31 @@
1
+ # encoding: UTF-8
2
+ Gem::Specification.new do |s|
3
+ s.platform = Gem::Platform::RUBY
4
+ s.name = 'adcurve_spree'
5
+ s.version = '0.0.5'
6
+ s.summary = 'Shop2market tag for spree'
7
+ s.description = 'Easy installation shop2market support for spree driven shops'
8
+ s.required_ruby_version = '>= 2.1.6'
9
+
10
+ s.author = 'Stanislav O. Pogrebnyak'
11
+ s.email = 'stanislav.pogrebnyak@gmail.com'
12
+ s.homepage = 'http://adcurve.com'
13
+
14
+ s.files = `git ls-files`.split($/)
15
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
+ s.require_path = "lib"
17
+ s.requirements << 'none'
18
+
19
+ s.add_dependency 'spree_core', '>= 3.1.0', '< 4.0'
20
+ s.add_dependency 'spree_backend', '>= 3.1.0', '< 4.0'
21
+ s.add_dependency 'spree_frontend', '>= 3.1.0', '< 4.0'
22
+ s.add_dependency 'spree_api', '>= 3.1.0', '< 4.0'
23
+
24
+ s.add_development_dependency 'capybara', '~> 1.1.2'
25
+ s.add_development_dependency 'coffee-rails'
26
+ s.add_development_dependency 'factory_girl', '~> 2.6.4'
27
+ s.add_development_dependency 'ffaker'
28
+ s.add_development_dependency 'rspec-rails', '~> 3.4'
29
+ s.add_development_dependency 'sass-rails'
30
+ s.add_development_dependency 'sqlite3'
31
+ end
@@ -0,0 +1 @@
1
+ require admin/spree_core
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1 @@
1
+ require store/spree_core
@@ -0,0 +1,2 @@
1
+
2
+ *= require admin/spree_core
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,2 @@
1
+
2
+ *= require store/spree_core
@@ -0,0 +1,10 @@
1
+ class Spree::Admin::AdcurveTagsController < Spree::Admin::ResourceController
2
+
3
+ def index
4
+ @adcurve_tag = Spree::AdcurveTag.first || Spree::AdcurveTag.new
5
+ end
6
+
7
+ def new
8
+ end
9
+
10
+ end
@@ -0,0 +1,2 @@
1
+ module Spree::Admin::AdcurveTagsHelper
2
+ end
@@ -0,0 +1,5 @@
1
+ module Spree
2
+ def self.table_name_prefix
3
+ 'spree_'
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ class Spree::AdcurveTag < ActiveRecord::Base
2
+ #attr_accessible :adcurve_host, :adcurve_shop_id
3
+
4
+ def self.activated?
5
+ first.present?
6
+ end
7
+
8
+ def self.adcurve_host
9
+ first.adcurve_host
10
+ end
11
+
12
+ def self.adcurve_shop_id
13
+ first.adcurve_shop_id
14
+ end
15
+
16
+ end
@@ -0,0 +1,5 @@
1
+ Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
2
+ :name => "adcurve_configuration_tag",
3
+ :insert_bottom => "[data-hook='inside_head']",
4
+ :partial => "spree/adcurve_tag/configuration",
5
+ :disabled => false)
@@ -0,0 +1,11 @@
1
+ Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
2
+ :name => "adcurve_tag_landing",
3
+ :insert_bottom => "[data-hook='body']",
4
+ :partial => "spree/adcurve_tag/tracking_tag",
5
+ :disabled => false)
6
+
7
+ Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
8
+ :name => "adcurve_tag_coversion",
9
+ :insert_bottom => "[data-hook='body']",
10
+ :partial => "spree/adcurve_tag/coversion_tag",
11
+ :disabled => false)
@@ -0,0 +1,2 @@
1
+ <!-- insert_bottom "[data-hook='admin_configurations_sidebar_menu']" -->
2
+ <%= configurations_sidebar_menu_item t('adcurve_spree.adcurve_tags'), admin_adcurve_tags_path %>
@@ -0,0 +1,23 @@
1
+ <script type="text/javascript">
2
+ window.adcurve_configuration = {};
3
+ <% case controller.controller_name %>
4
+ <% when "home" %>
5
+ window.adcurve_configuration.adcurve_page = "home";
6
+ <% when "orders" %>
7
+ <% if controller.action_name == "edit" %>
8
+ window.adcurve_configuration.adcurve_page = "cart";
9
+ window.adcurve_configuration.adcurve_cart_items = <%= raw @order.line_items.map{|li| {
10
+ :adcurve_product_id => li.product.sku, :adcurve_quantity => li.quantity, :adcurve_amount_1 => li.display_amount.to_s, :adcurve_amount_2 => li.display_amount.to_s } }.to_json %>
11
+ <% end %>
12
+ <% when "products" %>
13
+ <% if controller.action_name != "index" %>
14
+ window.adcurve_configuration.adcurve_page = "product";
15
+ window.adcurve_configuration.adcurve_product_id = <%= raw @product.sku.to_json %>
16
+ <% end %>
17
+ <% when "taxons" %>
18
+ window.adcurve_configuration.adcurve_page = "category";
19
+ window.adcurve_configuration.adcurve_category_path = "<%= raw params[:id].split("\/")[1..-1].join(" > ") %>";
20
+ window.adcurve_configuration.adcurve_products = <%=raw @products.map{|product| { :adcurve_product_id => product.sku } }.to_json %>;
21
+ <% end %>
22
+ //hello
23
+ </script>
@@ -0,0 +1,84 @@
1
+ <% if Spree::AdcurveTag.activated? %>
2
+
3
+ <% if controller.controller_name == "orders" && controller.action_name == "show" %>
4
+ <!-- Begin Shop2market Order Tag -->
5
+ <script type="text/javascript">
6
+ <!--
7
+ function _adcurve_t()
8
+ {
9
+ var adcurve_shop = AdcurveOrderTransaction( <%= Spree::AdcurveTag.adcurve_shop_id %>, "4.0.20140528" );
10
+
11
+ // Order information (required). Please replace the XXX values
12
+ // for the appropriate data.
13
+
14
+ var orderInfo = {};
15
+
16
+ orderInfo.trans_id = "<%= @order.number %>"; // required, unique string with order or lead identifier (required)
17
+ orderInfo.trans_type = "order"; // string: Type of the transaction like Lead, Order, Pre-order, etc (optional)
18
+ orderInfo.amount_1 = "<%= @order.total - @order.ship_total - 10 %>"; // string: order amount plus tax minus shipping costs in cents (required)
19
+ orderInfo.amount_2 = "<%= ( @order.total - @order.ship_total - 10 ) / 1.21 %>"; // string: order amount minus tax minus shipping costs in cents (required)
20
+ orderInfo.amount_3 = "<%= @order.ship_total %>"; // string: shipping amount plus tax in cents (required)
21
+ orderInfo.customer_id = "<%= @order.user_id %>"; // string: customer id (optional)
22
+ orderInfo.new_customer = false; // string: type of customer: 1=new, 0-=existing (optional)
23
+ orderInfo.coupon_code = ""; // string: used coupon code (optional)
24
+ orderInfo.discount = 10.00;
25
+ adcurve_shop.set_order_info( orderInfo );
26
+
27
+ <% @order.line_items.each do |line_item| %>
28
+ // Ordered items tracking. Replace the XXX values for the
29
+ // appropriate data. For each item call:
30
+ var itemInfo1 = {}
31
+ itemInfo1.trans_id = "<%= @order.number %>"; // unique string with order or lead identifier (required)
32
+ itemInfo1.item_id = "<%= line_item.product.sku %>"; // product id (in adcurve this is the unique product_id or article number) (required)
33
+ itemInfo1.item_info_1 = "<%= line_item.product.name %>"; // ordered product name (required)
34
+ itemInfo1.item_amount_1 = "<%= line_item.product.price %>"; // current selling price with tax in cents (required)
35
+ itemInfo1.item_amount_2 = "<%= line_item.product.price / ( 1.21 ) %>"; // current selling price exluding tax in cents (required)
36
+ itemInfo1.quantity = "<%= line_item.quantity %>"; // quantity of ordered products (required)
37
+ adcurve_shop.add_item_info( itemInfo1 );
38
+ <% end %>
39
+
40
+ // User information (optional).
41
+ // Please replace the example values for the appropriate data or remove
42
+ // the section
43
+ var userInfo = {};
44
+ userInfo.city = "<%= @order.bill_address.city %>";
45
+ userInfo.address = "<%= @order.bill_address.address1 %>";
46
+ userInfo.postal_code = "<%= @order.bill_address.zipcode %>";
47
+ userInfo.country = "<%= @order.bill_address.country %>";
48
+ userInfo.user_first_name = "<%= @order.bill_address.firstname %>";
49
+ userInfo.user_last_name = "<%= @order.bill_address.lastname %>";
50
+ userInfo.user_email = "<%= @order.email %>";
51
+
52
+ adcurve_shop.set_user_info( userInfo );
53
+
54
+ // Process the order information - DON'T EDIT THIS FUNCTION or ANY FUNCTIONS BELOW
55
+ adcurve_shop.transact();
56
+ }
57
+
58
+ try{
59
+ var __adcurve_host = "<%= Spree::AdcurveTag.adcurve_host %>";
60
+ var __adcurve_js = document.createElement('script');
61
+ __adcurve_js.type = 'text/javascript'; __adcurve_js.async = true;
62
+ __adcurve_js.src = (("https:" == document.location.protocol) ? "https://" : "http://") + __adcurve_host + "/javascripts/adcurve.js";
63
+ __adcurve_js.onload = _adcurve_t;
64
+ __adcurve_js.onreadystatechange = function () {
65
+ if (this.readyState == 'complete'|| this.readyState == 'loaded') _adcurve_t();
66
+ }
67
+ var __adcurve_script = document.getElementsByTagName('script')[0];
68
+ __adcurve_script.parentNode.insertBefore( __adcurve_js, __adcurve_script );
69
+ }catch(err){}
70
+ -->
71
+ </script>
72
+ <noscript>
73
+ <!-- TODO: finish -->
74
+ <!-- Start Shop2market backup Image tag - Please edit "XXX" to the appropriate data -->
75
+ <img src="//<%= Spree::AdcurveTag.adcurve_host %>/toi.gif?shop_code=<%= Spree::AdcurveTag.adcurve_shop_id %>&v=4.0.20140528&trans_id=<%= @order.number %>&trans_type=order&amount_1=XXX&amount_2=XXX&amount_3=XXX&customer_id=XXX&new_customer=XXX&coupon_code=XXX&oi[][trans_id]=XXX&oi[][item_id]=XXX&oi[][item_info_1]=XXX&oi[][item_amount_1]=XXX&oi[][item_amount_2]=XXX&oi[][quantity]=XXX // add this line for each product: &oi[][trans_id]=XXX&oi[][item_id]=XXX&oi[][item_info_1]=XXX&oi[][item_amount_1]=XXX&oi[][item_amount_2]=XXX&oi[][quantity]=XXX" alt="shop2market tracker pixel" />
76
+ <!-- End Shop2market backup Image tag -->
77
+ </noscript>
78
+ <!-- End Shop2market Order Tag -->
79
+
80
+ <!-- Copy code below per extra product at the end of the img tag
81
+ &oi[][trans_id]=XXX&oi[][item_id]=XXX&oi[][item_info_1]=XXX&oi[][item_amount_1]=XXX&oi[][item_amount_2]=XXX&oi[][quantity]=XXX
82
+ -->
83
+ <% end %>
84
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <% if Spree::AdcurveTag.activated? %>
2
+ <!-- Shop2Market product landing script BEGIN -->
3
+ <script type="text/javascript">
4
+ try{
5
+ var __adcurve_host_prefix = (("https:" == document.location.protocol) ? "https://" : "http://");
6
+ var __adcurve_link = "<%= Spree::AdcurveTag.adcurve_host %>/track_visit.js?shop_code=<%= Spree::AdcurveTag.adcurve_shop_id %>&v=2.0.20130317";
7
+ var __adcurve_js = document.createElement('script');
8
+ __adcurve_js.type = 'text/javascript'; __adcurve_js.async = true;
9
+ __adcurve_js.src = __adcurve_host_prefix + __adcurve_link;
10
+ var __adcurve_script = document.getElementsByTagName('script')[0];
11
+ __adcurve_script.parentNode.insertBefore( __adcurve_js, __adcurve_script );
12
+ }
13
+ catch(err){}
14
+ </script>
15
+ <noscript>
16
+ <![if gt IE 6]>
17
+ <img src="//<%= Spree::AdcurveTag.adcurve_host %>/v3/tvi.gif?shop_code=<%= Spree::AdcurveTag.adcurve_shop_id %>&v=2.0.20130317"
18
+ height="1" width="1" border="0" styles="border:0px;display:block;" />
19
+ <![endif]>
20
+ </noscript>
21
+
22
+
23
+ <% end %>
24
+ <!-- Shop2Market product landing script END -->
@@ -0,0 +1,10 @@
1
+ <%= f.label :adcurve_host %>
2
+ <%= f.text_field :adcurve_host %>
3
+ <br /><br />
4
+ <%= f.label :adcurve_shop_id %>
5
+ <%= f.text_field :adcurve_shop_id %>
6
+ <br /><br />
7
+ <%= f.label :api_key %>
8
+ <%= f.text_field :api_key %>
9
+ <br /><br />
10
+ <%= f.submit %>
@@ -0,0 +1,13 @@
1
+ <h1><%= t('spree.adcurve_tags_configuration') %></h1>
2
+
3
+ <br />
4
+ <br />
5
+ <% if @adcurve_tag.new_record? %>
6
+ <%= form_for [:admin, @adcurve_tag] do |f| %>
7
+ <%= render :partial => "form", :locals => { :f => f } %>
8
+ <% end %>
9
+ <% else %>
10
+ <%= form_for [:admin, @adcurve_tag], :method => :put do |f| %>
11
+ <%= render :partial => "form", :locals => { :f => f } %>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,5 @@
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
+ hello: "Hello world"
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Spree::Core::Engine.routes.draw do
2
+ namespace :admin do
3
+ resources :adcurve_tags
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class CreateSpreeAdcurveTags < ActiveRecord::Migration
2
+ def change
3
+ create_table :spree_adcurve_tags do |t|
4
+ t.text :adcurve_host
5
+ t.integer :adcurve_shop_id
6
+ t.timestamps
7
+ t.text :api_key
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,2 @@
1
+ require 'spree_core'
2
+ require 'adcurve_spree/engine'
@@ -0,0 +1,22 @@
1
+ module AdcurveSpree
2
+ class Engine < Rails::Engine
3
+ require 'spree/core'
4
+ isolate_namespace Spree
5
+ engine_name 'adcurve_spree'
6
+
7
+ config.autoload_paths += %W(#{config.root}/lib)
8
+
9
+ # use rspec for tests
10
+ config.generators do |g|
11
+ g.test_framework :rspec
12
+ end
13
+
14
+ def self.activate
15
+ Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
16
+ Rails.configuration.cache_classes ? require(c) : load(c)
17
+ end
18
+ end
19
+
20
+ config.to_prepare &method(:activate).to_proc
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ module AdcurveSpree
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+
5
+ def add_javascripts
6
+ append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require store/adcurve_spree\n"
7
+
8
+ end
9
+
10
+ def add_stylesheets
11
+ inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require store/adcurve_spree\n", :before => /\*\//, :verbose => true
12
+ inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require admin/adcurve_spree\n", :before => /\*\//, :verbose => true
13
+ end
14
+
15
+ def add_migrations
16
+ run 'bundle exec rake railties:install:migrations FROM=adcurve_spree'
17
+ end
18
+
19
+ def run_migrations
20
+ res = ask 'Would you like to run the migrations now? [Y/n]'
21
+ if res == '' || res.downcase == 'y'
22
+ run 'bundle exec rake db:migrate'
23
+ else
24
+ puts 'Skipping rake db:migrate, don\'t forget to run it!'
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
data/script/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/adcurve_spree/engine', __FILE__)
5
+
6
+ require 'rails/all'
7
+ require 'rails/engine/commands'
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Spree::Admin::AdcurveTagsController do
4
+
5
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ # Specs in this file have access to a helper object that includes
4
+ # the Spree::Admin::adcurveTagsHelper. For example:
5
+ #
6
+ # describe Spree::Admin::adcurveTagsHelper do
7
+ # describe "string concat" do
8
+ # it "concats two strings with spaces" do
9
+ # helper.concat_strings("this","that").should == "this that"
10
+ # end
11
+ # end
12
+ # end
13
+ describe Spree::Admin::AdcurveTagsHelper do
14
+ pending "add some examples to (or delete) #{__FILE__}"
15
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Spree::AdcurveTag do
4
+ pending "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,46 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
5
+
6
+ require 'rspec/rails'
7
+ require 'ffaker'
8
+
9
+ # Requires supporting ruby files with custom matchers and macros, etc,
10
+ # in spec/support/ and its subdirectories.
11
+ Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
12
+
13
+ # Requires factories defined in spree_core
14
+ require 'spree/core/testing_support/factories'
15
+ require 'spree/core/testing_support/controller_requests'
16
+ require 'spree/core/testing_support/authorization_helpers'
17
+ require 'spree/core/url_helpers'
18
+
19
+ RSpec.configure do |config|
20
+ config.include FactoryGirl::Syntax::Methods
21
+
22
+ # == URL Helpers
23
+ #
24
+ # Allows access to Spree's routes in specs:
25
+ #
26
+ # visit spree.admin_path
27
+ # current_path.should eql(spree.products_path)
28
+ config.include Spree::Core::UrlHelpers
29
+
30
+ # == Mock Framework
31
+ #
32
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
33
+ #
34
+ # config.mock_with :mocha
35
+ # config.mock_with :flexmock
36
+ # config.mock_with :rr
37
+ config.mock_with :rspec
38
+
39
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
40
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
41
+
42
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
43
+ # examples within a transaction, remove the following line or assign false
44
+ # instead of true.
45
+ config.use_transactional_fixtures = true
46
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adcurve_spree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav O. Pogrebnyak
@@ -193,8 +193,46 @@ email: stanislav.pogrebnyak@gmail.com
193
193
  executables: []
194
194
  extensions: []
195
195
  extra_rdoc_files: []
196
- files: []
197
- homepage:
196
+ files:
197
+ - ".gitignore"
198
+ - ".rspec"
199
+ - ".rvmrc"
200
+ - Gemfile
201
+ - LICENSE
202
+ - README.md
203
+ - Rakefile
204
+ - Versionfile
205
+ - adcurve_spree.gemspec
206
+ - app/assets/javascripts/admin/adcurve_spree.js
207
+ - app/assets/javascripts/spree/admin/adcurve_tags.js
208
+ - app/assets/javascripts/store/adcurve_spree.js
209
+ - app/assets/stylesheets/admin/adcurve_spree.css
210
+ - app/assets/stylesheets/spree/admin/adcurve_tags.css
211
+ - app/assets/stylesheets/store/adcurve_spree.css
212
+ - app/controllers/spree/admin/adcurve_tags_controller.rb
213
+ - app/helpers/spree/admin/adcurve_tags_helper.rb
214
+ - app/models/spree.rb
215
+ - app/models/spree/adcurve_tag.rb
216
+ - app/overrides/adcurve_configuration.rb
217
+ - app/overrides/adcurve_tag.rb
218
+ - app/overrides/spree/admin/shared/sub_menu/_configuration/add_adcurve_tracker_to_admin_configurations_sidebar_menu.html.erb.deface
219
+ - app/views/spree/adcurve_tag/_configuration.html.erb
220
+ - app/views/spree/adcurve_tag/_coversion_tag.html.erb
221
+ - app/views/spree/adcurve_tag/_tracking_tag.html.erb
222
+ - app/views/spree/admin/adcurve_tags/_form.html.erb
223
+ - app/views/spree/admin/adcurve_tags/index.html.erb
224
+ - config/locales/en.yml
225
+ - config/routes.rb
226
+ - db/migrate/20130317124315_create_spree_adcurve_tags.rb
227
+ - lib/adcurve_spree.rb
228
+ - lib/adcurve_spree/engine.rb
229
+ - lib/generators/adcurve_spree/install/install_generator.rb
230
+ - script/rails
231
+ - spec/controllers/spree/admin/adcurve_tags_controller_spec.rb
232
+ - spec/helpers/spree/admin/adcurve_tags_helper_spec.rb
233
+ - spec/models/spree/adcurve_tag_spec.rb
234
+ - spec/spec_helper.rb
235
+ homepage: http://adcurve.com
198
236
  licenses: []
199
237
  metadata: {}
200
238
  post_install_message:
@@ -218,4 +256,8 @@ rubygems_version: 2.2.3
218
256
  signing_key:
219
257
  specification_version: 4
220
258
  summary: Shop2market tag for spree
221
- test_files: []
259
+ test_files:
260
+ - spec/controllers/spree/admin/adcurve_tags_controller_spec.rb
261
+ - spec/helpers/spree/admin/adcurve_tags_helper_spec.rb
262
+ - spec/models/spree/adcurve_tag_spec.rb
263
+ - spec/spec_helper.rb