attachment_magick 0.3.3 → 0.3.4

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.
data/Gemfile CHANGED
@@ -1,18 +1,16 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rails", "3.0.10"
3
+ gem "rails", "3.2.3"
4
4
  gem "capybara", ">= 1.0.1"
5
5
  gem "sqlite3-ruby", :require => "sqlite3"
6
6
 
7
- gem "mongoid", "~> 2.2"
8
- gem "bson_ext", "~> 1.4"
7
+ gem "mongoid", "2.4.10"
8
+ gem "bson_ext", "1.5.2"
9
9
  gem "nokogiri"
10
10
  gem "hpricot"
11
11
  gem "colorific"
12
- gem "ruby-debug19"
13
12
  gem "simplecov", :require => false
14
13
  gem "mime-types", ">=1.16"
15
14
 
16
-
17
15
  # Specify your gem's dependencies in attachment_magick.gemspec
18
16
  gemspec
data/Gemfile.lock CHANGED
@@ -2,77 +2,76 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  attachment_magick (0.3.3)
5
- dragonfly (>= 0.9.5)
5
+ dragonfly (>= 0.9.10)
6
6
  jquery-rails (>= 0.2.7)
7
7
  marcosinger-auto_html (>= 1.3.6)
8
8
  marcosinger-css_parser (>= 1.3.0)
9
- rack-cache (>= 1.0)
9
+ rack-cache (>= 1.1)
10
10
 
11
11
  GEM
12
12
  remote: http://rubygems.org/
13
13
  specs:
14
- RedCloth (4.2.8)
15
- abstract (1.0.0)
16
- actionmailer (3.0.10)
17
- actionpack (= 3.0.10)
18
- mail (~> 2.2.19)
19
- actionpack (3.0.10)
20
- activemodel (= 3.0.10)
21
- activesupport (= 3.0.10)
22
- builder (~> 2.1.2)
23
- erubis (~> 2.6.6)
24
- i18n (~> 0.5.0)
25
- rack (~> 1.2.1)
26
- rack-mount (~> 0.6.14)
27
- rack-test (~> 0.5.7)
28
- tzinfo (~> 0.3.23)
29
- activemodel (3.0.10)
30
- activesupport (= 3.0.10)
31
- builder (~> 2.1.2)
32
- i18n (~> 0.5.0)
33
- activerecord (3.0.10)
34
- activemodel (= 3.0.10)
35
- activesupport (= 3.0.10)
36
- arel (~> 2.0.10)
37
- tzinfo (~> 0.3.23)
38
- activeresource (3.0.10)
39
- activemodel (= 3.0.10)
40
- activesupport (= 3.0.10)
41
- activesupport (3.0.10)
42
- archive-tar-minitar (0.5.2)
43
- arel (2.0.10)
44
- bson (1.4.1)
45
- bson_ext (1.4.1)
46
- builder (2.1.2)
47
- capybara (1.1.1)
14
+ RedCloth (4.2.9)
15
+ actionmailer (3.2.3)
16
+ actionpack (= 3.2.3)
17
+ mail (~> 2.4.4)
18
+ actionpack (3.2.3)
19
+ activemodel (= 3.2.3)
20
+ activesupport (= 3.2.3)
21
+ builder (~> 3.0.0)
22
+ erubis (~> 2.7.0)
23
+ journey (~> 1.0.1)
24
+ rack (~> 1.4.0)
25
+ rack-cache (~> 1.2)
26
+ rack-test (~> 0.6.1)
27
+ sprockets (~> 2.1.2)
28
+ activemodel (3.2.3)
29
+ activesupport (= 3.2.3)
30
+ builder (~> 3.0.0)
31
+ activerecord (3.2.3)
32
+ activemodel (= 3.2.3)
33
+ activesupport (= 3.2.3)
34
+ arel (~> 3.0.2)
35
+ tzinfo (~> 0.3.29)
36
+ activeresource (3.2.3)
37
+ activemodel (= 3.2.3)
38
+ activesupport (= 3.2.3)
39
+ activesupport (3.2.3)
40
+ i18n (~> 0.6)
41
+ multi_json (~> 1.0)
42
+ addressable (2.2.8)
43
+ arel (3.0.2)
44
+ bson (1.5.2)
45
+ bson_ext (1.5.2)
46
+ bson (= 1.5.2)
47
+ builder (3.0.0)
48
+ capybara (1.1.2)
48
49
  mime-types (>= 1.16)
49
50
  nokogiri (>= 1.3.3)
50
51
  rack (>= 1.0.0)
51
52
  rack-test (>= 0.5.4)
52
53
  selenium-webdriver (~> 2.0)
53
54
  xpath (~> 0.1.4)
54
- childprocess (0.2.2)
55
+ childprocess (0.3.2)
55
56
  ffi (~> 1.0.6)
56
- colorific (1.0.1)
57
- minitest (~> 2.6.2)
57
+ colorific (1.0.2)
58
+ minitest (~> 2.8.0)
58
59
  ruby-progressbar (~> 0.0.10)
59
- columnize (0.3.4)
60
- dragonfly (0.9.8)
60
+ dragonfly (0.9.12)
61
61
  rack
62
- erubis (2.6.6)
63
- abstract (>= 1.0.0)
64
- ffi (1.0.9)
65
- hpricot (0.8.4)
66
- i18n (0.5.0)
67
- jquery-rails (1.0.16)
68
- railties (~> 3.0)
62
+ erubis (2.7.0)
63
+ ffi (1.0.11)
64
+ hike (1.2.1)
65
+ hpricot (0.8.6)
66
+ i18n (0.6.0)
67
+ journey (1.0.3)
68
+ jquery-rails (2.0.2)
69
+ railties (>= 3.2.0, < 5.0)
69
70
  thor (~> 0.14)
70
- json (1.6.1)
71
- json_pure (1.6.1)
72
- linecache19 (0.5.12)
73
- ruby_core_source (>= 0.1.4)
74
- mail (2.2.19)
75
- activesupport (>= 2.3.6)
71
+ json (1.7.3)
72
+ libwebsocket (0.1.3)
73
+ addressable
74
+ mail (2.4.4)
76
75
  i18n (>= 0.4.0)
77
76
  mime-types (~> 1.16)
78
77
  treetop (~> 1.4.8)
@@ -83,73 +82,70 @@ GEM
83
82
  rinku
84
83
  tag_helper
85
84
  marcosinger-css_parser (1.3.0)
86
- mime-types (1.17.2)
87
- minitest (2.6.2)
88
- mongo (1.4.1)
89
- bson (= 1.4.1)
90
- mongoid (2.2.3)
91
- activemodel (~> 3.0)
85
+ mime-types (1.18)
86
+ minitest (2.8.1)
87
+ mongo (1.5.2)
88
+ bson (= 1.5.2)
89
+ mongoid (2.4.10)
90
+ activemodel (~> 3.1)
92
91
  mongo (~> 1.3)
93
92
  tzinfo (~> 0.3.22)
94
- multi_json (1.0.3)
95
- nokogiri (1.5.0)
96
- polyglot (0.3.2)
97
- rack (1.2.4)
98
- rack-cache (1.1)
93
+ multi_json (1.3.5)
94
+ nokogiri (1.5.2)
95
+ polyglot (0.3.3)
96
+ rack (1.4.1)
97
+ rack-cache (1.2)
99
98
  rack (>= 0.4)
100
- rack-mount (0.6.14)
101
- rack (>= 1.0.0)
102
- rack-test (0.5.7)
99
+ rack-ssl (1.3.2)
100
+ rack
101
+ rack-test (0.6.1)
103
102
  rack (>= 1.0)
104
- rails (3.0.10)
105
- actionmailer (= 3.0.10)
106
- actionpack (= 3.0.10)
107
- activerecord (= 3.0.10)
108
- activeresource (= 3.0.10)
109
- activesupport (= 3.0.10)
103
+ rails (3.2.3)
104
+ actionmailer (= 3.2.3)
105
+ actionpack (= 3.2.3)
106
+ activerecord (= 3.2.3)
107
+ activeresource (= 3.2.3)
108
+ activesupport (= 3.2.3)
110
109
  bundler (~> 1.0)
111
- railties (= 3.0.10)
112
- railties (3.0.10)
113
- actionpack (= 3.0.10)
114
- activesupport (= 3.0.10)
110
+ railties (= 3.2.3)
111
+ railties (3.2.3)
112
+ actionpack (= 3.2.3)
113
+ activesupport (= 3.2.3)
114
+ rack-ssl (~> 1.3.2)
115
115
  rake (>= 0.8.7)
116
116
  rdoc (~> 3.4)
117
- thor (~> 0.14.4)
117
+ thor (~> 0.14.6)
118
118
  rake (0.9.2.2)
119
- rdoc (3.11)
119
+ rdoc (3.12)
120
120
  json (~> 1.4)
121
- redcarpet (1.17.2)
122
- rinku (1.2.2)
123
- ruby-debug-base19 (0.11.25)
124
- columnize (>= 0.3.1)
125
- linecache19 (>= 0.5.11)
126
- ruby_core_source (>= 0.1.4)
127
- ruby-debug19 (0.11.6)
128
- columnize (>= 0.3.1)
129
- linecache19 (>= 0.5.11)
130
- ruby-debug-base19 (>= 0.11.19)
121
+ redcarpet (2.1.1)
122
+ rinku (1.5.1)
131
123
  ruby-progressbar (0.0.10)
132
- ruby_core_source (0.1.5)
133
- archive-tar-minitar (>= 0.5.2)
134
- rubyzip (0.9.4)
135
- selenium-webdriver (2.9.1)
136
- childprocess (>= 0.2.1)
137
- ffi (= 1.0.9)
138
- json_pure
124
+ rubyzip (0.9.8)
125
+ selenium-webdriver (2.21.2)
126
+ childprocess (>= 0.2.5)
127
+ ffi (~> 1.0)
128
+ libwebsocket (~> 0.1.3)
129
+ multi_json (~> 1.0)
139
130
  rubyzip
140
- simplecov (0.5.4)
141
- multi_json (~> 1.0.3)
131
+ simplecov (0.6.4)
132
+ multi_json (~> 1.0)
142
133
  simplecov-html (~> 0.5.3)
143
134
  simplecov-html (0.5.3)
144
- sqlite3 (1.3.4)
135
+ sprockets (2.1.3)
136
+ hike (~> 1.2)
137
+ rack (~> 1.0)
138
+ tilt (~> 1.1, != 1.3.0)
139
+ sqlite3 (1.3.6)
145
140
  sqlite3-ruby (1.3.3)
146
141
  sqlite3 (>= 1.3.3)
147
142
  tag_helper (0.0.3)
148
143
  thor (0.14.6)
144
+ tilt (1.3.3)
149
145
  treetop (1.4.10)
150
146
  polyglot
151
147
  polyglot (>= 0.3.1)
152
- tzinfo (0.3.30)
148
+ tzinfo (0.3.33)
153
149
  xpath (0.1.4)
154
150
  nokogiri (~> 1.3)
155
151
 
@@ -158,14 +154,13 @@ PLATFORMS
158
154
 
159
155
  DEPENDENCIES
160
156
  attachment_magick!
161
- bson_ext (~> 1.4)
157
+ bson_ext (= 1.5.2)
162
158
  capybara (>= 1.0.1)
163
159
  colorific
164
160
  hpricot
165
161
  mime-types (>= 1.16)
166
- mongoid (~> 2.2)
162
+ mongoid (= 2.4.10)
167
163
  nokogiri
168
- rails (= 3.0.10)
169
- ruby-debug19
164
+ rails (= 3.2.3)
170
165
  simplecov
171
166
  sqlite3-ruby
data/README.rdoc CHANGED
@@ -30,7 +30,7 @@ Create a initializer like this (config/initializers/attachment_magick_setup.rb)
30
30
  config.columns_width = 52
31
31
  config.gutter = 8
32
32
  # Or with our magick :)
33
- config.parse_stylesheet('name_of_my_grid_file.css')
33
+ # config.parse_stylesheet('name_of_my_grid_file.css')
34
34
 
35
35
  config.orms = ["ActiveRecord", "Mongoid"] # Mongoid is default
36
36
 
@@ -40,16 +40,18 @@ Create a initializer like this (config/initializers/attachment_magick_setup.rb)
40
40
  end
41
41
  end
42
42
 
43
- * Attachment Magick is based in 960 Grid System (http://960.gs/)
43
+ * Attachment Magick is based on 960 Grid System (http://960.gs/)
44
44
 
45
45
  Add to application.rb
46
46
 
47
- config.middleware.insert 0, 'Dragonfly::Middleware', :images
48
- config.middleware.insert_before 'Dragonfly::Middleware', 'Rack::Cache', {
47
+ config.middleware.insert 0, 'Rack::Cache', {
49
48
  :verbose => true,
50
- :metastore => "file:#{Rails.root}/tmp/dragonfly/cache/meta",
51
- :entitystore => "file:#{Rails.root}/tmp/dragonfly/cache/body"
52
- }
49
+ :metastore => URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"),
50
+ :entitystore => URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
51
+ } # unless Rails.env.production? ## uncomment this 'unless' in Rails 3.1,
52
+ ## because it already inserts Rack::Cache in production
53
+
54
+ config.middleware.insert_after 'Rack::Cache', 'Dragonfly::Middleware', :images
53
55
 
54
56
  == Getting started
55
57
 
@@ -62,7 +64,7 @@ Include AttachmentMagick Module to your model
62
64
  class Post
63
65
  include AttachmentMagick
64
66
 
65
- ...
67
+ attachment_magick
66
68
  end
67
69
 
68
70
  Call this helpers in form views
@@ -4,25 +4,29 @@ class AttachmentMagick::ImagesController < ActionController::Base
4
4
  before_filter :load_klass
5
5
 
6
6
  def create
7
- @image = @klass.images.create(:photo => params[:Filedata], :source => params[:source], :file_name => params[:source] ? "" : params[:Filedata].original_filename)
7
+ options = {
8
+ :photo => params[:Filedata],
9
+ :source => params[:source],
10
+ :file_name => (params[:Filedata].original_filename unless params[:source])
11
+ }
12
+
13
+ @image = @klass.images.create(options)
8
14
  @klass.save
9
15
 
10
- if params[:data_partial].present?
11
- render :partial => params[:data_partial], :collection => [@image], :as => :image
12
- else
13
- render :partial => AttachmentMagick.configuration.default_add_partial, :collection => [@image], :as => :image, :locals => { :size => @klass.class.style_publisher }
14
- end
16
+ partial_options = {
17
+ :collection => [@image],
18
+ :as => :image,
19
+ :partial => AttachmentMagick.configuration.default_add_partial
20
+ }
21
+
22
+ partial_options.merge!({:partial => params[:data_partial]}) if params[:data_partial].present?
23
+ render partial_options
15
24
  end
16
25
 
17
26
  def update_sortable
18
- array_ids = params[:images]
19
- hash = {}
20
-
21
- array_ids.each_with_index do |id, index|
22
- hash.merge!( {"#{index}" => {:id => "#{id}", :priority => index}} )
23
- end
24
-
25
- @klass.images_attributes = hash
27
+ hsh = {}
28
+ params[:images].each_with_index {|id, index| hsh.merge!({"#{index}" => {:id => "#{id}", :priority => index}}) }
29
+ @klass.images_attributes = hsh
26
30
  @klass.save
27
31
 
28
32
  render :text => "ok"
@@ -30,6 +34,7 @@ class AttachmentMagick::ImagesController < ActionController::Base
30
34
 
31
35
  def destroy
32
36
  @klass.images.find(params[:id]).destroy
37
+
33
38
  render :text => "ok"
34
39
  end
35
40
 
@@ -91,4 +91,10 @@ module AttachmentMagick::AttachmentMagickHelper
91
91
  <!--<![endif]-->
92
92
  </object>".html_safe
93
93
  end
94
- end
94
+
95
+ def resize_video(html, x)
96
+ y = x.to_i * 2 / 3
97
+ html.gsub(/width=\"([0-9]+)\"/, "width='#{x}'").gsub(/height=\"([0-9]+)\"/, "height='#{y}'").html_safe
98
+ end
99
+
100
+ end
@@ -1,7 +1,7 @@
1
1
  module AttachmentMagick
2
2
  if AttachmentMagick.configuration.orms.include?("ActiveRecord")
3
3
  class ActiveRecordImage < ActiveRecord::Base
4
- set_table_name "amagick_images"
4
+ self.table_name = "amagick_images"
5
5
 
6
6
  belongs_to :imageable, :polymorphic => true
7
7
  image_accessor :photo
@@ -30,4 +30,4 @@ module AttachmentMagick
30
30
  end
31
31
  end
32
32
 
33
- end
33
+ end
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency "dragonfly", ">= 0.9.5"
22
- s.add_dependency "rack-cache", ">= 1.0"
21
+ s.add_dependency "dragonfly", ">= 0.9.10"
22
+ s.add_dependency "rack-cache", ">= 1.1"
23
23
  s.add_dependency "jquery-rails", ">= 0.2.7"
24
24
  s.add_dependency "marcosinger-auto_html", ">= 1.3.6"
25
25
  s.add_dependency "marcosinger-css_parser", ">= 1.3.0"
@@ -84,9 +84,7 @@ module AttachmentMagick
84
84
  end
85
85
  end
86
86
 
87
- module InstanceMethods
88
- def image_cover
89
- self.images.order(:priority).first
90
- end
87
+ def image_cover
88
+ self.images.order(:priority).first
91
89
  end
92
90
  end
@@ -17,12 +17,12 @@ if defined? Mongoid::Document
17
17
 
18
18
  app.datastore = Dragonfly::DataStorage::MongoDataStore.new
19
19
  app.datastore.configure do |c|
20
- c.host = yaml_file['host'] # defaults to localhost
21
- c.port = yaml_file['port'] # defaults to mongo default (27017)
22
- c.database = yaml_file['database'] # defaults to 'dragonfly'
23
- c.username = yaml_file['username'] # only needed if mongo is running in auth mode
24
- c.password = yaml_file['password'] # only needed if mongo is running in auth mode
20
+ c.host = yaml_file['host'] || yaml_file['uri'] # defaults to localhost
21
+ c.port = yaml_file['port'] # defaults to mongo default (27017)
22
+ c.database = yaml_file['database'] # defaults to 'dragonfly'
23
+ c.username = yaml_file['username'] # only needed if mongo is running in auth mode
24
+ c.password = yaml_file['password'] # only needed if mongo is running in auth mode
25
25
  end
26
26
 
27
27
  app.define_macro_on_include(Mongoid::Document, :image_accessor)
28
- end
28
+ end
@@ -1,10 +1,3 @@
1
- class Tempfile
2
- def original_filename
3
- "little_girl.jpg"
4
- end
5
- end
6
-
7
-
8
1
  module AttachmentMagickTestHelper
9
2
  def assert_element_in(target, match)
10
3
  target = Nokogiri::HTML(target)
@@ -41,7 +34,7 @@ module AttachmentMagickTestHelper
41
34
  end
42
35
 
43
36
  def example_file
44
- Tempfile.new('little_girl.jpg')
37
+ fixture_file_upload('little_girl.jpg', 'image/jpg')
45
38
  end
46
39
 
47
40
  def example_youtube
@@ -1,3 +1,3 @@
1
1
  module AttachmentMagick
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -12,6 +12,7 @@ class AttachmentMagick::ImagesControllerTest < ActionController::TestCase
12
12
  post :create, artist_hash.merge({ :Filedata => example_file })
13
13
  assert_response :success
14
14
  assert assert_element_in(response.body, "img")
15
+ assert assert_element_in(response.body, "div[@class='grid_5 attachment_magick_image']")
15
16
  end
16
17
 
17
18
  test "should create artist vimeo video" do
@@ -30,6 +31,8 @@ class AttachmentMagick::ImagesControllerTest < ActionController::TestCase
30
31
  post :create, work_hash.merge({ :Filedata => example_file })
31
32
  assert_response :success
32
33
  assert assert_element_in(response.body, "img")
34
+ assert assert_element_in(response.body, "div[@class='image_caption']")
35
+ assert assert_element_in(response.body, "div[@class='image_thumb']")
33
36
  end
34
37
 
35
38
  test "should create place image" do
@@ -61,4 +61,10 @@ class AttachmentMagick::AttachmentMagickHelperTest < ActionView::TestCase
61
61
  assert assert_element_in(html, "object")
62
62
  assert assert_element_in(html, "object[@width='100'][@height='60']")
63
63
  end
64
+
65
+ def test_should_resize_video
66
+ html = "<iframe width=\"450\" height=\"250\"></iframe>"
67
+ assert_equal(resize_video(html, 300), "<iframe width='300' height='200'></iframe>")
68
+ end
69
+
64
70
  end
@@ -62,7 +62,9 @@ class AttachmentMagickTest < ActiveSupport::TestCase
62
62
  column_amount = 10
63
63
  gutter = 3
64
64
 
65
- grid_system = open("http://www.spry-soft.com/grids/grid/?column_width=#{column_width}&column_amount=#{column_amount}&gutter_width=#{gutter}") { |url| Hpricot(url) }
65
+ #grid_system = open("http://www.spry-soft.com/grids/grid/?column_width=#{column_width}&column_amount=#{column_amount}&gutter_width=#{gutter}") { |url| Hpricot(url) }
66
+ grid_system = open("http://grids.heroku.com/grid?column_width=#{column_width}&column_amount=#{column_amount}&gutter_width=#{gutter}") { |url| Hpricot(url) }
67
+
66
68
  grids = Artist.send(:generate_grids, column_amount, column_width, gutter)
67
69
 
68
70
  assert_equal grids.size, column_amount + AttachmentMagick.configuration.custom_styles.styles.size
@@ -3,7 +3,7 @@ Dummy::Application.configure do
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the webserver when you make code changes.
6
+ # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
9
  # Log error messages when you accidentally call methods on nil.
@@ -11,7 +11,6 @@ Dummy::Application.configure do
11
11
 
12
12
  # Show full error reports and disable caching
13
13
  config.consider_all_requests_local = true
14
- config.action_view.debug_rjs = true
15
14
  config.action_controller.perform_caching = false
16
15
 
17
16
  # Don't care if the mailer can't send
@@ -22,5 +21,10 @@ Dummy::Application.configure do
22
21
 
23
22
  # Only use best-standards-support built into browsers
24
23
  config.action_dispatch.best_standards_support = :builtin
25
- end
26
24
 
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -1,7 +1,6 @@
1
1
  Dummy::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
- # The production environment is meant for finished, "live" apps.
5
4
  # Code is not reloaded between requests
6
5
  config.cache_classes = true
7
6
 
@@ -9,14 +8,27 @@ Dummy::Application.configure do
9
8
  config.consider_all_requests_local = false
10
9
  config.action_controller.perform_caching = true
11
10
 
12
- # Specifies the header that your server uses for sending files
13
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
14
22
 
15
- # For nginx:
16
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
17
25
 
18
- # If you have no front-end server that supports something like X-Sendfile,
19
- # just comment this out and Rails will serve the files
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
20
32
 
21
33
  # See everything in the log (default is :info)
22
34
  # config.log_level = :debug
@@ -27,13 +39,12 @@ Dummy::Application.configure do
27
39
  # Use a different cache store in production
28
40
  # config.cache_store = :mem_cache_store
29
41
 
30
- # Disable Rails's static asset server
31
- # In production, Apache or nginx will already do this
32
- config.serve_static_assets = false
33
-
34
- # Enable serving of images, stylesheets, and javascripts from an asset server
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
35
43
  # config.action_controller.asset_host = "http://assets.example.com"
36
44
 
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
37
48
  # Disable delivery errors, bad email addresses will be ignored
38
49
  # config.action_mailer.raise_delivery_errors = false
39
50
 
@@ -1,35 +1,39 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
9
 
10
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
12
13
 
13
- # Show full error reports and disable caching
14
- config.consider_all_requests_local = true
15
- config.action_controller.perform_caching = false
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
16
 
17
- # Raise exceptions instead of rendering exception templates
18
- config.action_dispatch.show_exceptions = false
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
19
20
 
20
- # Disable request forgery protection in test environment
21
- config.action_controller.allow_forgery_protection = false
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
22
23
 
23
- # Tell Action Mailer not to deliver emails to the real world.
24
- # The :test delivery method accumulates sent emails in the
25
- # ActionMailer::Base.deliveries array.
26
- config.action_mailer.delivery_method = :test
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
27
26
 
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
32
31
 
33
- # Print deprecation notices to the stderr
34
- config.active_support.deprecation = :stderr
35
- end
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
data/test/test_helper.rb CHANGED
@@ -9,7 +9,6 @@ end
9
9
 
10
10
  ENV["RAILS_ENV"] = "test"
11
11
 
12
- require 'ruby-debug' ; Debugger.start
13
12
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
14
13
  require "rails/test_help"
15
14
 
@@ -34,15 +33,18 @@ require "generators/attachment_magick/migration_generator"
34
33
 
35
34
  # Some helpers
36
35
  require "attachment_magick/test/attachment_magick_test_helper"
36
+ require "action_dispatch/testing/test_process"
37
37
 
38
38
  class ActiveSupport::TestCase
39
39
  include AttachmentMagickTestHelper
40
+ include ActionDispatch::TestProcess
40
41
  end
41
42
 
42
43
  class ActionController::TestCase
43
44
  include AttachmentMagickTestHelper
45
+ include ActionDispatch::TestProcess
44
46
  end
45
47
 
46
48
  class ActionView::TestCase
47
49
  include AttachmentMagickTestHelper
48
- end
50
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attachment_magick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,34 +11,33 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-10-27 00:00:00.000000000 -02:00
15
- default_executable:
14
+ date: 2012-05-15 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: dragonfly
19
- requirement: &2165303660 !ruby/object:Gem::Requirement
18
+ requirement: &2153159200 !ruby/object:Gem::Requirement
20
19
  none: false
21
20
  requirements:
22
21
  - - ! '>='
23
22
  - !ruby/object:Gem::Version
24
- version: 0.9.5
23
+ version: 0.9.10
25
24
  type: :runtime
26
25
  prerelease: false
27
- version_requirements: *2165303660
26
+ version_requirements: *2153159200
28
27
  - !ruby/object:Gem::Dependency
29
28
  name: rack-cache
30
- requirement: &2165303160 !ruby/object:Gem::Requirement
29
+ requirement: &2153158160 !ruby/object:Gem::Requirement
31
30
  none: false
32
31
  requirements:
33
32
  - - ! '>='
34
33
  - !ruby/object:Gem::Version
35
- version: '1.0'
34
+ version: '1.1'
36
35
  type: :runtime
37
36
  prerelease: false
38
- version_requirements: *2165303160
37
+ version_requirements: *2153158160
39
38
  - !ruby/object:Gem::Dependency
40
39
  name: jquery-rails
41
- requirement: &2165302700 !ruby/object:Gem::Requirement
40
+ requirement: &2153157300 !ruby/object:Gem::Requirement
42
41
  none: false
43
42
  requirements:
44
43
  - - ! '>='
@@ -46,10 +45,10 @@ dependencies:
46
45
  version: 0.2.7
47
46
  type: :runtime
48
47
  prerelease: false
49
- version_requirements: *2165302700
48
+ version_requirements: *2153157300
50
49
  - !ruby/object:Gem::Dependency
51
50
  name: marcosinger-auto_html
52
- requirement: &2165302240 !ruby/object:Gem::Requirement
51
+ requirement: &2153156620 !ruby/object:Gem::Requirement
53
52
  none: false
54
53
  requirements:
55
54
  - - ! '>='
@@ -57,10 +56,10 @@ dependencies:
57
56
  version: 1.3.6
58
57
  type: :runtime
59
58
  prerelease: false
60
- version_requirements: *2165302240
59
+ version_requirements: *2153156620
61
60
  - !ruby/object:Gem::Dependency
62
61
  name: marcosinger-css_parser
63
- requirement: &2165301780 !ruby/object:Gem::Requirement
62
+ requirement: &2153155960 !ruby/object:Gem::Requirement
64
63
  none: false
65
64
  requirements:
66
65
  - - ! '>='
@@ -68,7 +67,7 @@ dependencies:
68
67
  version: 1.3.0
69
68
  type: :runtime
70
69
  prerelease: false
71
- version_requirements: *2165301780
70
+ version_requirements: *2153155960
72
71
  description:
73
72
  email:
74
73
  - markaum@gmail.com
@@ -181,10 +180,10 @@ files:
181
180
  - test/dummy/public/stylesheets/swfupload.css
182
181
  - test/dummy/public/stylesheets/text.css
183
182
  - test/dummy/script/rails
183
+ - test/dummy/test/fixtures/little_girl.jpg
184
184
  - test/integration/navigation_test.rb
185
185
  - test/support/integration_case.rb
186
186
  - test/test_helper.rb
187
- has_rdoc: true
188
187
  homepage: http://github.com/marcosinger/attachment_magick
189
188
  licenses: []
190
189
  post_install_message:
@@ -205,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
204
  version: '0'
206
205
  requirements: []
207
206
  rubyforge_project: attachment_magick
208
- rubygems_version: 1.6.2
207
+ rubygems_version: 1.8.10
209
208
  signing_key:
210
209
  specification_version: 3
211
210
  summary: little more magick when you upload image files (with SwfUpload and Dragonfly)
@@ -284,6 +283,7 @@ test_files:
284
283
  - test/dummy/public/stylesheets/swfupload.css
285
284
  - test/dummy/public/stylesheets/text.css
286
285
  - test/dummy/script/rails
286
+ - test/dummy/test/fixtures/little_girl.jpg
287
287
  - test/integration/navigation_test.rb
288
288
  - test/support/integration_case.rb
289
289
  - test/test_helper.rb