refinerycms-resources 0.9.9.21 → 0.9.9.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module Admin
10
10
  def new
11
11
  @resource = Resource.new if @resource.nil?
12
12
 
13
- @url_override = admin_resources_url(:dialog => from_dialog?)
13
+ @url_override = admin_resources_path(:dialog => from_dialog?)
14
14
  end
15
15
 
16
16
  def create
@@ -44,7 +44,7 @@ module Admin
44
44
  def insert
45
45
  self.new if @resource.nil?
46
46
 
47
- @url_override = admin_resources_url(request.query_parameters.merge(:insert => true))
47
+ @url_override = admin_resources_path(request.query_parameters.merge(:insert => true))
48
48
 
49
49
  if params[:conditions].present?
50
50
  extra_condition = params[:conditions].split(',')
@@ -6,7 +6,7 @@
6
6
  <span class='actions'>
7
7
  <%= link_to refinery_icon_tag('page_white_put.png'), resource.url,
8
8
  :title => t('.download', :size => number_to_human_size(resource.size)) %>
9
- <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_resource_url(resource),
9
+ <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_resource_path(resource),
10
10
  :title => t('edit', :scope => 'admin.resources') %>
11
11
  <%= link_to refinery_icon_tag('delete.png'), admin_resource_path(resource),
12
12
  :class => "cancel confirm-delete",
@@ -27,7 +27,7 @@ fi:
27
27
  button_text: Lisää
28
28
  activerecord:
29
29
  models:
30
- resource: file
30
+ resource: tiedosto
31
31
  errors:
32
32
  models:
33
33
  resource:
@@ -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
@@ -22,31 +22,32 @@ module Refinery
22
22
  app_resources = Dragonfly[:resources]
23
23
  app_resources.configure_with(:rails) do |c|
24
24
  c.datastore.root_path = Rails.root.join('public', 'system', 'resources').to_s
25
- c.url_path_prefix = '/system/resources'
25
+ # This url_format makes it so that dragonfly urls work in traditional
26
+ # situations where the filename and extension are required, e.g. lightbox.
27
+ # What this does is takes the url that is about to be produced e.g.
28
+ # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
29
+ # and adds the filename onto the end (say the file was 'refinery_is_awesome.pdf')
30
+ # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.pdf
31
+ c.url_format = '/system/resources/:job/:basename.:format'
26
32
  c.secret = RefinerySetting.find_or_set(:dragonfly_secret,
27
33
  Array.new(24) { rand(256) }.pack('C*').unpack('H*').first)
28
34
  end
29
- app_resources.configure_with(:heroku, ENV['S3_BUCKET']) if Refinery.s3_backend
35
+
36
+ if Refinery.s3_backend
37
+ app_resources.configure_with(:heroku, ENV['S3_BUCKET'])
38
+ # Dragonfly doesn't set the S3 region, so we have to do this manually
39
+ app_resources.datastore.configure do |d|
40
+ d.region = ENV['S3_REGION'] if ENV['S3_REGION'] # defaults to 'us-east-1'
41
+ end
42
+ end
30
43
 
31
44
  app_resources.define_macro(ActiveRecord::Base, :resource_accessor)
32
45
  app_resources.analyser.register(Dragonfly::Analysis::FileCommandAnalyser)
33
46
  app_resources.content_disposition = :attachment
34
47
 
35
- # This url_suffix makes it so that dragonfly urls work in traditional
36
- # situations where the filename and extension are required, e.g. lightbox.
37
- # What this does is takes the url that is about to be produced e.g.
38
- # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
39
- # and adds the filename onto the end (say the file was 'refinery_is_awesome.pdf')
40
- # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.pdf
41
- # Officially the way to do it, from: http://markevans.github.com/dragonfly/file.URLs.html
42
- app_resources.url_suffix = proc{|job|
43
- 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}/)?}, '')
44
- "/#{object_file_name}#{job.encoded_extname || job.uid_extname}"
45
- }
46
-
47
48
  ### Extend active record ###
48
49
 
49
- app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :resources, '/system/resources'
50
+ app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :resources
50
51
 
51
52
  app.config.middleware.insert_before 'Dragonfly::Middleware', 'Rack::Cache', {
52
53
  :verbose => Rails.env.development?,
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-resources}
5
- s.version = %q{0.9.9.21}
5
+ s.version = %q{0.9.9.22}
6
6
  s.summary = %q{Resources engine for Refinery CMS}
7
7
  s.description = %q{Handles all file 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}
@@ -88,7 +88,7 @@ Gem::Specification.new do |s|
88
88
  'spec/uploads/refinery_is_awesome.txt'
89
89
  ]
90
90
 
91
- s.add_dependency 'refinerycms-core', '= 0.9.9.21'
92
- s.add_dependency 'dragonfly', '~> 0.8.4'
91
+ s.add_dependency 'refinerycms-core', '= 0.9.9.22'
92
+ s.add_dependency 'dragonfly', '~> 0.9.0'
93
93
  s.add_dependency 'rack-cache', '>= 0.5.3'
94
94
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-resources
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
@@ -108,6 +109,7 @@ files:
108
109
  - refinerycms-resources.gemspec
109
110
  - spec/models/resource_spec.rb
110
111
  - spec/uploads/refinery_is_awesome.txt
112
+ has_rdoc: true
111
113
  homepage: http://refinerycms.com
112
114
  licenses:
113
115
  - MIT
@@ -131,10 +133,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  requirements: []
132
134
 
133
135
  rubyforge_project: refinerycms
134
- rubygems_version: 1.7.2
136
+ rubygems_version: 1.6.2
135
137
  signing_key:
136
138
  specification_version: 3
137
139
  summary: Resources engine for Refinery CMS
138
140
  test_files: []
139
141
 
140
- has_rdoc: