spree_essentials 0.3.3 → 0.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -26,15 +26,8 @@ Installation
26
26
  If you don't already have an existing Spree site, [click here](https://gist.github.com/946719) then come back later... You can also read the Spree docs [here](http://spreecommerce.com/documentation/getting_started.html)...
27
27
 
28
28
  Spree Essentials can be installed by itself by adding the following to your Gemfile:
29
-
30
- # Spree 1.0.x
31
- gem 'spree_essentials', '~> 0.4.0.rc2'
32
-
33
- # Spree 0.70.x
34
- gem 'spree_essentials', '~> 0.3.3'
35
29
 
36
- # Spree 0.60.x
37
- gem 'spree_essentials', '~> 0.2.3'
30
+ gem 'spree_essentials', '>= 0.3.2'
38
31
 
39
32
  This isn't necessary if you're using spree_essentials based extensions. If that's the case, just include the extensions normally:
40
33
 
@@ -134,7 +127,7 @@ You can easily use the test/dummy app as a demo of spree_essentials. Just `cd` t
134
127
 
135
128
  git clone git://github.com/citrus/spree_essentials.git
136
129
  cd spree_essentials
137
- mv lib/dummy_hooks/after_migrate.rb.sample lib/dummy_hooks/after_migrate.rb
130
+ cp test/dummy_hooks/after_migrate.rb.sample test/dummy_hooks/after_migrate.rb
138
131
  bundle install
139
132
  bundle exec dummier
140
133
  cd test/dummy
@@ -154,9 +147,10 @@ To Do
154
147
  Change Log
155
148
  ----------
156
149
 
157
- **0.3.3 - 2012/1/20**
150
+ **0.4.0.rc1 - 2012/1/16**
158
151
 
159
- * Precompile admin assets in production
152
+ * Add Spree 1.0.0 compatibility
153
+ * Breaks with previous versions of Spree
160
154
 
161
155
 
162
156
  **0.3.2 - 2011/12/30**
@@ -1,4 +1,4 @@
1
- class Admin::MarkdownController < Admin::BaseController
1
+ class Spree::Admin::MarkdownController < Spree::Admin::BaseController
2
2
 
3
3
  def preview
4
4
  render :text => RDiscount.new(params[:data].to_s).to_html
@@ -1,7 +1,7 @@
1
- class Admin::UploadsController < Admin::ResourceController
1
+ class Spree::Admin::UploadsController < Spree::Admin::ResourceController
2
2
 
3
3
  def index
4
- render :template => request.xhr? ? 'admin/uploads/picker' : 'admin/uploads/index', :layout => !request.xhr?
4
+ render :template => "spree/admin/uploads/#{request.xhr? ? 'picker' : 'index'}", :layout => !request.xhr?
5
5
  end
6
6
 
7
7
  private
@@ -13,7 +13,7 @@ class Admin::UploadsController < Admin::ResourceController
13
13
  def collection
14
14
  params[:search] ||= {}
15
15
  params[:search][:meta_sort] ||= "created_at.desc"
16
- @search = Upload.metasearch(params[:search])
16
+ @search = Spree::Upload.metasearch(params[:search])
17
17
  @collection = @search.page(params[:page]).per(Spree::Config[:orders_per_page])
18
18
  end
19
19
 
@@ -1,4 +1,4 @@
1
- module Admin::SpreeEssentialsHelper
1
+ module Spree::Admin::SpreeEssentialsHelper
2
2
 
3
3
  def contents_tab
4
4
  routes = SpreeEssentials.essentials.map do |key, cls|
@@ -8,7 +8,7 @@ module Admin::SpreeEssentialsHelper
8
8
  routes.push admin_uploads_path
9
9
  cls = request.path.scan(Regexp.new(routes.join("|"))).empty? ? nil : 'selected'
10
10
  content_tag :li, :class => cls do
11
- link_to I18n.t('admin.shared.contents_tab.content'), routes.first
11
+ link_to I18n.t('spree.admin.shared.contents_tab.content'), routes.first
12
12
  end
13
13
  end
14
14
 
@@ -0,0 +1,7 @@
1
+ ::Spree::Asset.class_eval do
2
+
3
+ def has_alt?
4
+ alt.present?
5
+ end
6
+
7
+ end
@@ -1,4 +1,4 @@
1
- class Upload < Asset
1
+ class Spree::Upload < ::Spree::Asset
2
2
 
3
3
  default_scope where(:type => "Upload") if table_exists?
4
4
 
@@ -1,5 +1,5 @@
1
- Deface::Override.new(:virtual_path => "layouts/admin",
1
+ Deface::Override.new(:virtual_path => "spree/layouts/admin",
2
2
  :name => "spree_essential_admin_tabs",
3
3
  :insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
4
- :partial => "admin/shared/contents_tab",
4
+ :partial => "spree/admin/shared/contents_tab",
5
5
  :disabled => false)
@@ -3,6 +3,6 @@
3
3
  <% SpreeEssentials.essentials.each_pair do |name, cls| %>
4
4
  <%= tab *cls.sub_tab if defined?(cls.sub_tab) %>
5
5
  <% end %>
6
- <%= tab :uploads, :label => 'admin.subnav.uploads' %>
6
+ <%= tab :uploads, :label => 'spree.admin.subnav.uploads' %>
7
7
  </ul>
8
8
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= render :partial => 'admin/shared/contents_sub_menu' %>
1
+ <%= render :partial => "spree/admin/shared/contents_sub_menu" %>
2
2
 
3
3
  <h1><%= t('.edit_upload') %></h1>
4
4
 
@@ -1,4 +1,4 @@
1
- <%= render :partial => 'admin/shared/contents_sub_menu' %>
1
+ <%= render :partial => "spree/admin/shared/contents_sub_menu" %>
2
2
 
3
3
  <h1><%= t('.listing_uploads') %></h1>
4
4
 
@@ -1,4 +1,4 @@
1
- <%= render :partial => 'admin/shared/contents_sub_menu' unless request.xhr? %>
1
+ <%= render :partial => "spree/admin/shared/contents_sub_menu" unless request.xhr? %>
2
2
 
3
3
  <h3><%= t('.new_upload') %></h3>
4
4
 
@@ -8,6 +8,9 @@ en:
8
8
  parsed_with: Parsed With
9
9
 
10
10
  activerecord:
11
+ attributes:
12
+ order:
13
+ completed_at: Completed At
11
14
  errors:
12
15
  messages:
13
16
  invalid_date_time: is an invalid date.
@@ -17,25 +20,26 @@ en:
17
20
  file_name: File Name
18
21
  size: Size
19
22
 
20
- admin:
21
- shared:
22
- contents_tab:
23
- content: Content
24
-
25
- subnav:
26
- uploads: Uploads
27
-
28
- uploads:
29
- new:
30
- new_upload: New Upload
31
- edit:
32
- edit_upload: Edit Upload
33
- preview: Preview
34
- link: Link
35
- index:
36
- listing_uploads: Listing Uploads
37
- new_upload: Upload a file
38
-
23
+ spree:
24
+ admin:
25
+ shared:
26
+ contents_tab:
27
+ content: Content
28
+
29
+ subnav:
30
+ uploads: Uploads
31
+
32
+ uploads:
33
+ new:
34
+ new_upload: New Upload
35
+ edit:
36
+ edit_upload: Edit Upload
37
+ preview: Preview
38
+ link: Link
39
+ index:
40
+ listing_uploads: Listing Uploads
41
+ new_upload: Upload a file
42
+
39
43
  faker:
40
44
  lorem:
41
45
  words: [alias, consequatur, perferendis, voluptatem, accusantium, doloremque, aperiam, eaque, ipsa, quae, illo, inventore, veritatis, quasi, architecto, beatae, vitae, dicta, sunt, explicabo, aspernatur, aut, odit, aut, fugit, sed, quia, consequuntur, magni, dolores, eos, qui, ratione, voluptatem, sequi, nesciunt, neque, dolorem, ipsum, quia, dolor, sit, amet, consectetur, adipisci, velit, sed, quia, non, numquam, eius, modi, tempora, incidunt, ut, labore, et, dolore, magnam, aliquam, quaerat, voluptatem, ut, enim, ad, minima, veniam, quis, nostrum, exercitationem, ullam, corporis, nemo, enim, ipsam, voluptatem, quia, voluptas, sit, suscipit, laboriosam, nisi, ut, aliquid, ex, ea, commodi, consequatur, quis, autem, vel, eum, iure, reprehenderit, qui, in, ea, voluptate, velit, esse, quam, nihil, molestiae, et, iusto, odio, dignissimos, ducimus, qui, blanditiis, praesentium, laudantium, totam, rem, voluptatum, deleniti, atque, corrupti, quos, dolores, et, quas, molestias, excepturi, sint, occaecati, cupiditate, non, provident, sed, ut, perspiciatis, unde, omnis, iste, natus, error, similique, sunt, in, culpa, qui, officia, deserunt, mollitia, animi, id, est, laborum, et, dolorum, fuga, et, harum, quidem, rerum, facilis, est, et, expedita, distinctio, nam, libero, tempore, cum, soluta, nobis, est, eligendi, optio, cumque, nihil, impedit, quo, porro, quisquam, est, qui, minus, id, quod, maxime, placeat, facere, possimus, omnis, voluptas, assumenda, est, omnis, dolor, repellendus, temporibus, autem, quibusdam, et, aut, consequatur, vel, illum, qui, dolorem, eum, fugiat, quo, voluptas, nulla, pariatur, accusamus, officiis, debitis, aut, rerum, necessitatibus, saepe, eveniet, ut, et, voluptates, repudiandae, sint, molestiae, non, recusandae, itaque, earum, rerum, tenetur, sapiente, delectus, reiciendis, voluptatibus, maiores, doloribus, asperiores, repellat]
data/config/routes.rb CHANGED
@@ -1,10 +1,6 @@
1
- Rails.application.routes.draw do
2
-
3
- namespace :admin do
4
-
1
+ Spree::Core::Engine.routes.draw do
2
+ namespace :admin do
5
3
  post "/markdown/preview" => "markdown#preview"
6
- resources :uploads
7
-
8
- end
9
-
4
+ resources :uploads
5
+ end
10
6
  end
@@ -1,9 +1,9 @@
1
1
  class AddAttachmentFileSizeToAssets < ActiveRecord::Migration
2
2
  def self.up
3
- add_column :assets, :attachment_file_size, :integer
3
+ add_column :spree_assets, :attachment_file_size, :integer
4
4
  end
5
5
 
6
6
  def self.down
7
- remove_column :assets, :attachment_file_size
7
+ remove_column :spree_assets, :attachment_file_size
8
8
  end
9
9
  end
@@ -25,11 +25,7 @@ module SpreeEssentials
25
25
  class Engine < Rails::Engine
26
26
 
27
27
  config.autoload_paths += %W(#{config.root}/lib)
28
-
29
- initializer :assets do |config|
30
- Rails.application.config.assets.precompile += %w( markitup.css date.js jquery.autodate.js jquery.markitup.js markdown.set.js )
31
- end
32
-
28
+
33
29
  config.to_prepare do
34
30
  #loads application's model / class decorators
35
31
  Dir.glob File.expand_path("../../app/**/*_decorator.rb", __FILE__) do |c|
@@ -1,8 +1,7 @@
1
- require 'rails/test_help'
2
- require 'shoulda'
3
- require 'factory_girl'
4
- require 'sqlite3'
5
- require 'faker'
1
+ require "rails/test_help"
2
+ require "shoulda"
3
+ require "factory_girl"
4
+ require "sqlite3"
6
5
 
7
6
  ActionMailer::Base.delivery_method = :test
8
7
  ActionMailer::Base.perform_deliveries = true
@@ -22,8 +21,8 @@ Capybara.default_selector = :css
22
21
  class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
23
22
 
24
23
  include Capybara::DSL
25
- include Rails.application.routes.url_helpers
26
-
24
+ include Spree::Core::Engine.routes.url_helpers
25
+
27
26
 
28
27
  # Extreme hax! wtf is this for anyways.. and why is it erroring?
29
28
  def testmail_admin_mail_method_url(*args)
@@ -39,7 +38,7 @@ class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
39
38
  teardown do
40
39
  unless source.blank?
41
40
  matches = source.match(/translation[\s-]+missing[^"]*/) || []
42
- assert_equal 0, matches.length, "Translation Missing! - #{matches[0]}"
41
+ assert_equal 0, matches.length, "** #{matches[0]}"
43
42
  end
44
43
  end
45
44
 
@@ -1,3 +1,3 @@
1
1
  module SpreeEssentials
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0.rc1"
3
3
  end
metadata CHANGED
@@ -1,30 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_essentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
5
- prerelease:
4
+ version: 0.4.0.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Spencer Steffen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-21 00:00:00.000000000Z
12
+ date: 2012-01-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: spree_core
16
- requirement: &70123953835120 !ruby/object:Gem::Requirement
15
+ name: spree
16
+ requirement: &70184704119680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.70.0
21
+ version: 1.0.0.rc1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70123953835120
24
+ version_requirements: *70184704119680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdiscount
27
- requirement: &70123953833680 !ruby/object:Gem::Requirement
27
+ requirement: &70184704118720 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.6.8
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70123953833680
35
+ version_requirements: *70184704118720
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &70123953823520 !ruby/object:Gem::Requirement
38
+ requirement: &70184704117940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.0.0.beta2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70123953823520
46
+ version_requirements: *70184704117940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: dummier
49
- requirement: &70123953822140 !ruby/object:Gem::Requirement
49
+ requirement: &70184704113180 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.2.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70123953822140
57
+ version_requirements: *70184704113180
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: factory_girl
60
- requirement: &70123953821420 !ruby/object:Gem::Requirement
60
+ requirement: &70184704112600 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.3.2
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70123953821420
68
+ version_requirements: *70184704112600
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: capybara
71
- requirement: &70123953820000 !ruby/object:Gem::Requirement
71
+ requirement: &70184704095680 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.1.2
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70123953820000
79
+ version_requirements: *70184704095680
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sqlite3
82
- requirement: &70123953818660 !ruby/object:Gem::Requirement
82
+ requirement: &70184704094600 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: 1.3.4
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70123953818660
90
+ version_requirements: *70184704094600
91
91
  description: Spree Essentials provides a base for several other Spree Commerce extensions.
92
92
  The idea is to provide other extensions with common functionality such as an asset-upload
93
93
  interface, a markdown editor, and a common admin-navigation tab.
@@ -137,20 +137,20 @@ files:
137
137
  - app/assets/javascripts/jquery.markitup.js
138
138
  - app/assets/javascripts/markdown.set.js
139
139
  - app/assets/stylesheets/markitup.css.erb
140
- - app/controllers/admin/markdown_controller.rb
141
- - app/controllers/admin/uploads_controller.rb
142
- - app/helpers/admin/spree_essentials_helper.rb
143
- - app/models/image_decorator.rb
144
- - app/models/upload.rb
140
+ - app/controllers/spree/admin/markdown_controller.rb
141
+ - app/controllers/spree/admin/uploads_controller.rb
142
+ - app/helpers/spree/admin/spree_essentials_helper.rb
143
+ - app/models/spree/asset_decorator.rb
144
+ - app/models/spree/upload.rb
145
145
  - app/overrides/spree_essentials.rb
146
146
  - app/validators/datetime_validator.rb
147
- - app/views/admin/shared/_contents_sub_menu.html.erb
148
- - app/views/admin/shared/_contents_tab.html.erb
149
- - app/views/admin/uploads/_form.html.erb
150
- - app/views/admin/uploads/edit.html.erb
151
- - app/views/admin/uploads/index.html.erb
152
- - app/views/admin/uploads/new.html.erb
153
- - app/views/admin/uploads/picker.html.erb
147
+ - app/views/spree/admin/shared/_contents_sub_menu.html.erb
148
+ - app/views/spree/admin/shared/_contents_tab.html.erb
149
+ - app/views/spree/admin/uploads/_form.html.erb
150
+ - app/views/spree/admin/uploads/edit.html.erb
151
+ - app/views/spree/admin/uploads/index.html.erb
152
+ - app/views/spree/admin/uploads/new.html.erb
153
+ - app/views/spree/admin/uploads/picker.html.erb
154
154
  - Rakefile
155
155
  homepage: https://github.com/citrus/spree_essentials
156
156
  licenses: []
@@ -166,16 +166,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  segments:
168
168
  - 0
169
- hash: 4082963416670233000
169
+ hash: 917132819264177002
170
170
  required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
- - - ! '>='
173
+ - - ! '>'
174
174
  - !ruby/object:Gem::Version
175
- version: '0'
176
- segments:
177
- - 0
178
- hash: 4082963416670233000
175
+ version: 1.3.1
179
176
  requirements: []
180
177
  rubyforge_project:
181
178
  rubygems_version: 1.8.10
@@ -1,7 +0,0 @@
1
- Image.class_eval do
2
-
3
- def has_alt?
4
- !alt.blank?
5
- end
6
-
7
- end