refinerycms-images 0.9.9.21 → 0.9.9.22

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.
@@ -13,14 +13,14 @@ module Admin
13
13
  def new
14
14
  @image = Image.new if @image.nil?
15
15
 
16
- @url_override = admin_images_url(:dialog => from_dialog?)
16
+ @url_override = admin_images_path(:dialog => from_dialog?)
17
17
  end
18
18
 
19
19
  # This renders the image insert dialog
20
20
  def insert
21
21
  self.new if @image.nil?
22
22
 
23
- @url_override = admin_images_url(request.query_parameters.merge(:insert => true))
23
+ @url_override = admin_images_path(request.query_parameters.merge(:insert => true))
24
24
 
25
25
  if params[:conditions].present?
26
26
  extra_condition = params[:conditions].split(',')
@@ -3,13 +3,13 @@
3
3
  <%= render :partial => "/shared/admin/search", :locals => {:url => admin_images_url} %>
4
4
  </li>
5
5
  <li>
6
- <%= link_to t('.create_new_image'), new_admin_image_url(:dialog => true, :width => 600, :height => 300),
6
+ <%= link_to t('.create_new_image'), new_admin_image_path(:dialog => true, :width => 600, :height => 300),
7
7
  :class => "add_icon" %>
8
8
  </li>
9
9
  <% other_image_views.each do |image_view| %>
10
10
  <li>
11
11
  <%= link_to t('switch_to', :scope => 'admin.images.index.view', :view_name => t("#{image_view}", :scope => 'admin.images.index.view')),
12
- admin_images_url(:view => image_view, :page => params[:page]),
12
+ admin_images_path(:view => image_view, :page => params[:page]),
13
13
  :class => "reorder_icon" %>
14
14
  </li>
15
15
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <div id='existing_image_area' class='dialog_area' <%= "style='display:none;'" if @image.errors.any? %>>
2
2
  <%= render :partial => '/shared/admin/search',
3
- :locals => {:url => insert_admin_images_url(params.dup.delete(:image))} %>
3
+ :locals => {:url => insert_admin_images_path(params.dup.delete(:image))} %>
4
4
  <input type='hidden' name='selected_image' id='selected_image' />
5
5
  <div id='existing_image_area_content' class='clearfix'>
6
6
  <% if @images.any? %>
@@ -20,9 +20,9 @@ fi:
20
20
  no_images_yet: Kuvia ei ole vielä lisätty. Paina "Lisää uusi kuva-" nappia lisätäksesi ensimmäisen kuvan.
21
21
  index:
22
22
  view:
23
- switch_to: "Siirry %{view_name}näkymään"
24
- list: lista
25
- grid: ruudukko
23
+ switch_to: "%{view_name}näkymä"
24
+ list: Lista
25
+ grid: Ruudukko
26
26
  grid_view:
27
27
  view_live_html: Katsele tätä kuvaa <br/><em>Avautuu uudessa ikkunassa</em>
28
28
  existing_image:
@@ -34,7 +34,7 @@ fi:
34
34
  new_image: Lisää
35
35
  activerecord:
36
36
  models:
37
- image: image
37
+ image: kuva
38
38
  errors:
39
39
  models:
40
40
  image:
data/lib/gemspec.rb CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  ]
27
27
 
28
28
  s.add_dependency 'refinerycms-core', '= #{::Refinery::Version}'
29
- s.add_dependency 'dragonfly', '~> 0.8.4'
29
+ s.add_dependency 'dragonfly', '~> 0.9.0'
30
30
  s.add_dependency 'rack-cache', '>= 0.5.3'
31
31
  end
32
32
  EOF
@@ -23,31 +23,32 @@ module Refinery
23
23
  app_images.configure_with(:imagemagick)
24
24
  app_images.configure_with(:rails) do |c|
25
25
  c.datastore.root_path = Rails.root.join('public', 'system', 'images').to_s
26
- c.url_path_prefix = '/system/images'
26
+ # This url_format it so that dragonfly urls work in traditional
27
+ # situations where the filename and extension are required, e.g. lightbox.
28
+ # What this does is takes the url that is about to be produced e.g.
29
+ # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
30
+ # and adds the filename onto the end (say the image was 'refinery_is_awesome.jpg')
31
+ # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
32
+ c.url_format = '/system/images/:job/:basename.:format'
27
33
  c.secret = RefinerySetting.find_or_set(:dragonfly_secret,
28
34
  Array.new(24) { rand(256) }.pack('C*').unpack('H*').first)
29
35
  end
30
- app_images.configure_with(:heroku, ENV['S3_BUCKET']) if Refinery.s3_backend
36
+
37
+ if Refinery.s3_backend
38
+ app_images.configure_with(:heroku, ENV['S3_BUCKET'])
39
+ # Dragonfly doesn't set the S3 region, so we have to do this manually
40
+ app_images.datastore.configure do |d|
41
+ d.region = ENV['S3_REGION'] if ENV['S3_REGION'] # otherwise defaults to 'us-east-1'
42
+ end
43
+ end
31
44
 
32
45
  app_images.define_macro(ActiveRecord::Base, :image_accessor)
33
- app_images.analyser.register(Dragonfly::Analysis::ImageMagickAnalyser)
46
+ app_images.analyser.register(Dragonfly::ImageMagick::Analyser)
34
47
  app_images.analyser.register(Dragonfly::Analysis::FileCommandAnalyser)
35
48
 
36
- # This url_suffix makes it so that dragonfly urls work in traditional
37
- # situations where the filename and extension are required, e.g. lightbox.
38
- # What this does is takes the url that is about to be produced e.g.
39
- # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
40
- # and adds the filename onto the end (say the image was 'refinery_is_awesome.jpg')
41
- # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
42
- # Officially the way to do it, from: http://markevans.github.com/dragonfly/file.URLs.html
43
- app_images.url_suffix = proc{|job|
44
- object_file_name = job.uid_basename.gsub(%r{^(\d{4}|\d{2})[_/]\d{2}[_/]\d{2}[_/]\d{2,3}[_/](\d{2}/\d{2}/\d{3}/)?}, '')
45
- "/#{object_file_name}#{job.encoded_extname || job.uid_extname}"
46
- }
47
-
48
49
  ### Extend active record ###
49
50
 
50
- app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :images, '/system/images'
51
+ app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :images
51
52
 
52
53
  app.config.middleware.insert_before 'Dragonfly::Middleware', 'Rack::Cache', {
53
54
  :verbose => Rails.env.development?,
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-images}
5
- s.version = %q{0.9.9.21}
5
+ s.version = %q{0.9.9.22}
6
6
  s.summary = %q{Images engine for Refinery CMS}
7
7
  s.description = %q{Handles all image upload and processing functionality in Refinery CMS.}
8
- s.date = %q{2011-05-03}
8
+ s.date = %q{2011-05-22}
9
9
  s.email = %q{info@refinerycms.com}
10
10
  s.homepage = %q{http://refinerycms.com}
11
11
  s.rubyforge_project = %q{refinerycms}
@@ -95,7 +95,7 @@ Gem::Specification.new do |s|
95
95
  'spec/uploads/beach.jpeg'
96
96
  ]
97
97
 
98
- s.add_dependency 'refinerycms-core', '= 0.9.9.21'
99
- s.add_dependency 'dragonfly', '~> 0.8.4'
98
+ s.add_dependency 'refinerycms-core', '= 0.9.9.22'
99
+ s.add_dependency 'dragonfly', '~> 0.9.0'
100
100
  s.add_dependency 'rack-cache', '>= 0.5.3'
101
101
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-images
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.9.21
5
+ version: 0.9.9.22
6
6
  platform: ruby
7
7
  authors:
8
8
  - Resolve Digital
@@ -13,7 +13,8 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2011-05-03 00:00:00 Z
16
+ date: 2011-05-22 00:00:00 +12:00
17
+ default_executable:
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
20
  name: refinerycms-core
@@ -23,7 +24,7 @@ dependencies:
23
24
  requirements:
24
25
  - - "="
25
26
  - !ruby/object:Gem::Version
26
- version: 0.9.9.21
27
+ version: 0.9.9.22
27
28
  type: :runtime
28
29
  version_requirements: *id001
29
30
  - !ruby/object:Gem::Dependency
@@ -34,7 +35,7 @@ dependencies:
34
35
  requirements:
35
36
  - - ~>
36
37
  - !ruby/object:Gem::Version
37
- version: 0.8.4
38
+ version: 0.9.0
38
39
  type: :runtime
39
40
  version_requirements: *id002
40
41
  - !ruby/object:Gem::Dependency
@@ -113,6 +114,7 @@ files:
113
114
  - refinerycms-images.gemspec
114
115
  - spec/models/image_spec.rb
115
116
  - spec/uploads/beach.jpeg
117
+ has_rdoc: true
116
118
  homepage: http://refinerycms.com
117
119
  licenses:
118
120
  - MIT
@@ -136,10 +138,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
138
  requirements: []
137
139
 
138
140
  rubyforge_project: refinerycms
139
- rubygems_version: 1.7.2
141
+ rubygems_version: 1.6.2
140
142
  signing_key:
141
143
  specification_version: 3
142
144
  summary: Images engine for Refinery CMS
143
145
  test_files: []
144
146
 
145
- has_rdoc: