Permalink
Browse files

Removed everything to do with redactor_rails; updated the deployment …

…script for database migration and bower dependency installation; included all the singular JS files in the production preompilation and modified bower to use the standard installer and not the bower-rails gem. Finally updated the gitignore file in relation to the recent chnages and add a .map mime type.
  • Loading branch information...
1 parent 2ae3115 commit dadccacc0909213b82b4684e80d14e7f97830a29 @Jellyfishboy committed Apr 23, 2014
View
@@ -0,0 +1,3 @@
+{
+ "directory": "vendor/assets/components"
+}
View
@@ -4,8 +4,6 @@ tmp
.env
vendor/cache/*
tmp/cache/*
-vendor/assets/bower_components
+vendor/assets/components
-/solr/data
-/solr/development/data
-/solr/pids
+public/assets
View
@@ -1,11 +0,0 @@
-# A sample Bowerfile
-# Check out https://github.com/42dev/bower-rails#ruby-dsl-configuration for more options
-
-asset 'normalize-css', '~3.0.1'
-asset 'modernizr', '~2.7.2'
-asset 'fontawesome', '~4.0.3'
-asset 'icomoon', '~0.0.1'
-asset 'bootstrap-tagsinput', '~0.3.9'
-asset 'jquery.scrollTo', '~1.4.11'
-asset 'bootstrap-datepicker', '~1.3.0'
-asset 'typeahead.js', '~0.10.2'
View
@@ -59,7 +59,6 @@ group :assets do
gem 'uglifier', '>= 1.0.3'
gem 'asset_sync'
end
-gem "bower-rails", "~> 0.7.1"
platforms :ruby do
gem 'unicorn'
@@ -82,9 +81,6 @@ gem 'foreman', '~> 0.61.0'
# Transaction handler
gem 'activemerchant'
-# RTE
-gem 'redactor-rails'
-
# Authenication
gem 'devise'
gem 'cancan'
View
@@ -60,7 +60,6 @@ GEM
debug_inspector (>= 0.0.1)
bootstrap-sass (2.3.2.2)
sass (~> 3.2)
- bower-rails (0.7.1)
builder (3.0.4)
bullet (4.7.1)
activesupport
@@ -345,10 +344,6 @@ GEM
ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
- redactor-rails (0.4.3)
- devise
- mime-types
- orm_adapter
redcard (1.1.0)
reek (1.3.6)
ruby2ruby (~> 2.0.7)
@@ -452,7 +447,6 @@ GEM
rails (>= 3.0.7)
win32-process (0.7.4)
ffi (>= 1.0.0)
- win32console (1.3.2)
win32console (1.3.2-x86-mingw32)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -467,7 +461,6 @@ DEPENDENCIES
bcrypt-ruby!
better_errors
binding_of_caller
- bower-rails (~> 0.7.1)
bullet
cancan
capistrano (~> 2.15)
@@ -500,7 +493,6 @@ DEPENDENCIES
quiet_assets
rails (= 3.2.13)
rails_admin
- redactor-rails
remotipart (~> 1.2)
rollbar (~> 0.12.17)
rspec-rails
@@ -1,5 +0,0 @@
-class RedactorRails::Asset < ActiveRecord::Base
- include RedactorRails::Orm::ActiveRecord::AssetBase
- delegate :url, :current_path, :size, :content_type, :filename, :to => :data
- validates_presence_of :data
-end
@@ -1,11 +0,0 @@
-class RedactorRails::Document < RedactorRails::Asset
- mount_uploader :data, RedactorRailsDocumentUploader, :mount_on => :data_file_name
-
- def url_content
- url(:content)
- end
-
- def as_json_methods
- [:image]
- end
-end
@@ -1,7 +0,0 @@
-class RedactorRails::Picture < RedactorRails::Asset
- mount_uploader :data, RedactorRailsPictureUploader, :mount_on => :data_file_name
-
- def url_content
- url(:content)
- end
-end
@@ -1,19 +0,0 @@
-# encoding: utf-8
-class RedactorRailsDocumentUploader < CarrierWave::Uploader::Base
- include RedactorRails::Backend::CarrierWave
-
- # storage :fog
- storage :file
-
- def store_dir
- if Rails.env.production?
- "rte/documents/#{model.class.to_s.underscore}"
- else
- "uploads/redactor_assets/documents/#{model.id}"
- end
- end
-
- def extension_white_list
- RedactorRails.document_file_types
- end
-end
@@ -1,57 +0,0 @@
-# encoding: utf-8
-class RedactorRailsPictureUploader < CarrierWave::Uploader::Base
- include RedactorRails::Backend::CarrierWave
-
- # Include RMagick or ImageScience support:
- # include CarrierWave::RMagick
- include CarrierWave::MiniMagick
- # include CarrierWave::ImageScience
-
- # Choose what kind of storage to use for this uploader:
- storage :file
-
- # Override the directory where uploaded files will be stored.
- # This is a sensible default for uploaders that are meant to be mounted:
- def store_dir
- if Rails.env.production?
- "rte/pictures/#{model.class.to_s.underscore}"
- else
- "uploads/redactor_assets/pictures/#{model.id}"
- end
- end
-
- # Provide a default URL as a default if there hasn't been a file uploaded:
- # def default_url
- # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
- # end
-
- # Process files as they are uploaded:
- # process :scale => [200, 300]
- #
- # def scale(width, height)
- # # do something
- # end
-
- process :read_dimensions
-
- # Create different versions of your uploaded files:
- version :thumb do
- process :resize_to_fill => [118, 100]
- end
-
- version :content do
- process :resize_to_limit => [800, 800]
- end
-
- # Add a white list of extensions which are allowed to be uploaded.
- # For images you might use something like this:
- def extension_white_list
- RedactorRails.image_file_types
- end
-
- # Override the filename of the uploaded files:
- # Avoid using model.id or version_name here, see uploader/store.rb for details.
- # def filename
- # "something.jpg" if original_filename
- # end
-end
@@ -1,9 +1,8 @@
- content_for :title, 'Edit product'
- content_for :breadcrumb, 'Edit'
- breadcrumb_add 'Products', admin_products_path
-- javascript 'redactor-rails'
-- javascript 'bootstrap-tagsinput/dist/bootstrap-tagsinput'
-- javascript 'typeahead.js/dist/typeahead.jquery.min.js'
+- javascript 'bootstrap-tagsinput/dist/bootstrap-tagsinput.min'
+- javascript 'typeahead.js/dist/typeahead.jquery.min'
- javascript 'jquery.remotipart'
- javascript 'admin/soca.taginput'
@@ -1,7 +1,6 @@
- content_for :title, 'New product'
- content_for :breadcrumb, 'New'
- breadcrumb_add 'Products', admin_products_path
-- javascript 'redactor-rails'
- javascript 'bootstrap-tagsinput/dist/bootstrap-tagsinput.min'
- javascript 'jquery.remotipart'
- javascript 'admin/soca.taginput'
View
@@ -0,0 +1,22 @@
+{
+ "name": "Trado",
+ "version": "0.0.1",
+ "authors": [
+ "Tom Dallimore"
+ ],
+ "description": "Trado is a lightweight, easy to use e-commerce platform designed for sole traders and SME businesses.",
+ "license": "MIT",
+ "ignore": [
+ "vendor/assets/components"
+ ],
+ "dependencies": {
+ "normalize-css": "~3.0.1",
+ "modernizr": "~2.7.2",
+ "fontawesome": "~4.0.3",
+ "icomoon": "~0.0.1",
+ "bootstrap-tagsinput": "~0.3.9",
+ "bootstrap-datepicker": "~1.3.0",
+ "jquery.scrollTo": "~1.4.11",
+ "typeahead.js": "~0.10.2"
+ }
+}
@@ -16,7 +16,7 @@
module Trado
class Application < Rails::Application
- config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')
+ config.assets.paths << Rails.root.join('vendor', 'assets', 'components')
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
View
@@ -40,14 +40,24 @@
run "yes | cp /home/configs/database.yml /home/gimsonrobotics/current/config"
end
end
+namespace :database do
+ desc "Migrate the database"
+ task :migrate, :roles => :app do
+ run "cd /home/gimsonrobotics/current && RAILS_ENV=#{rails_env} bundle exec rake db:migrate"
+ end
+end
namespace :assets do
+ desc "Install Bower dependencies"
+ task :bower, :roles => :app do
+ run "cd /home/gimsonrobotics/current && sudo bower install --allow-root"
+ end
desc "Compile assets"
task :compile, :roles => :app do
- run "cd /home/gimsonrobotics/current && bundle exec rake assets:precompile"
+ run "cd /home/gimsonrobotics/current && RAILS_ENV=#{rails_env} bundle exec rake assets:precompile"
end
desc "Generate sitemap"
task :refresh_sitemaps do
- run "cd #{latest_release} && RAILS_ENV=#{rails_env} rake sitemap:refresh"
+ run "cd #{latest_release} && RAILS_ENV=#{rails_env} bundle exec rake sitemap:refresh"
end
end
namespace :rollbar do
@@ -66,7 +76,9 @@
after :deploy, 'configure:application'
after 'configure:application', 'configure:database'
-after 'configure:database', 'assets:compile'
+after 'configure:database', 'database:migrate'
+after 'database:migrate', 'assets:bower'
+after 'assets:bower', 'assets:compile'
after 'assets:compile', 'assets:refresh_sitemaps'
after 'assets:refresh_sitemaps', 'rollbar:notify'
after 'rollbar:notify', 'unicorn:restart'
@@ -17,7 +17,7 @@
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
- config.assets.precompile += ['administration.js', 'administration.css','rails_admin/rails_admin.css', 'rails_admin/rails_admin.js', 'custom.css', 'css3-fallback.js']
+ config.assets.precompile += ['administration.js', 'administration.css','rails_admin/rails_admin.css', 'rails_admin/rails_admin.js', 'custom.css', 'css3-fallback.js', 'modernizr/modernizr.js', 'bootstrap-datepicker/js/bootstrap-datepicker.js', 'admin/soca.datepicker.js', 'bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js', 'typeahead.js/dist/typeahead.jquery.min.js', 'admin/soca.taginput.js', 'jquery.remotipart.js', 'jquery.iframe-transport.js']
# Generate digests for assets URLs
config.assets.digest = true
@@ -1,6 +0,0 @@
-BowerRails.configure do |bower_rails|
- # Uncomment this line if you want `rake bower:resolve` task to be run
- # automatically before the `rake assets:precompile` task.
-
- # bower_rails.resolve_before_precompile = true
-end
@@ -1,6 +1,7 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
+Rack::Mime::MIME_TYPES.merge!({".map" => "text/plain"})
Rack::Mime::MIME_TYPES['.ttf'] = 'font/truetype'
Rack::Mime::MIME_TYPES['.woff'] = 'application/x-font-woff'
Rack::Mime::MIME_TYPES['.svg'] = 'image/svg+xml'
View
@@ -1,7 +1,5 @@
Trado::Application.routes.draw do
- mount RedactorRails::Engine => '/redactor_rails'
-
root :to => 'store#index'
# Standard pages
View
Binary file not shown.
@@ -1,5 +0,0 @@
-class RemoveAccessoryIdFromSku < ActiveRecord::Migration
- def change
- remove_column :skus, :accessory_id, :integer
- end
-end
@@ -0,0 +1,5 @@
+class RemoveRedactorAssetsTable < ActiveRecord::Migration
+ def change
+ drop_table :redactor_assets
+ end
+end
View
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140419021124) do
+ActiveRecord::Schema.define(:version => 20140423213118) do
create_table "accessories", :force => true do |t|
t.string "name"
@@ -198,23 +198,6 @@
add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories"
- create_table "redactor_assets", :force => true do |t|
- t.integer "user_id"
- t.string "data_file_name", :null => false
- t.string "data_content_type"
- t.integer "data_file_size"
- t.integer "assetable_id"
- t.string "assetable_type", :limit => 30
- t.string "type", :limit => 30
- t.integer "width"
- t.integer "height"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "redactor_assets", ["assetable_type", "assetable_id"], :name => "idx_redactor_assetable"
- add_index "redactor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_redactor_assetable_type"
-
create_table "related_products", :id => false, :force => true do |t|
t.integer "product_id"
t.integer "related_id"

0 comments on commit dadccac

Please sign in to comment.