enju_event 0.1.16 → 0.1.17.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/event_import_files_controller.rb +2 -2
- data/app/models/event_import_file.rb +2 -2
- data/lib/enju_event/version.rb +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +1 -1
- data/spec/dummy/app/mailers/notifier.rb +3 -3
- data/spec/dummy/app/models/setting.rb +4 -0
- data/spec/dummy/config/application.yml +38 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +9 -5
@@ -16,7 +16,7 @@ class EventImportFilesController < ApplicationController
|
|
16
16
|
# GET /event_import_files/1.json
|
17
17
|
def show
|
18
18
|
if @event_import_file.event_import.path
|
19
|
-
unless
|
19
|
+
unless Setting.uploaded_file.storage == :s3
|
20
20
|
file = @event_import_file.event_import.path
|
21
21
|
end
|
22
22
|
end
|
@@ -25,7 +25,7 @@ class EventImportFilesController < ApplicationController
|
|
25
25
|
format.html # show.html.erb
|
26
26
|
format.json { render :json => @event_import_file }
|
27
27
|
format.download {
|
28
|
-
if
|
28
|
+
if Setting.uploaded_file.storage == :s3
|
29
29
|
redirect_to @event_import_file.event_import.expiring_url(10)
|
30
30
|
else
|
31
31
|
send_file file, :filename => @event_import_file.event_import_file_name, :type => 'application/octet-stream'
|
@@ -5,7 +5,7 @@ class EventImportFile < ActiveRecord::Base
|
|
5
5
|
scope :not_imported, where(:state => 'pending')
|
6
6
|
scope :stucked, where('created_at < ? AND state = ?', 1.hour.ago, 'pending')
|
7
7
|
|
8
|
-
if
|
8
|
+
if Setting.uploaded_file.storage == :s3
|
9
9
|
has_attached_file :event_import, :storage => :s3, :s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
|
10
10
|
:s3_permissions => :private
|
11
11
|
else
|
@@ -167,7 +167,7 @@ class EventImportFile < ActiveRecord::Base
|
|
167
167
|
private
|
168
168
|
def open_import_file
|
169
169
|
tempfile = Tempfile.new('event_import_file')
|
170
|
-
if
|
170
|
+
if Setting.uploaded_file.storage == :s3
|
171
171
|
uploaded_file_path = event_import.expiring_url(10)
|
172
172
|
else
|
173
173
|
uploaded_file_path = event_import.path
|
data/lib/enju_event/version.rb
CHANGED
@@ -76,7 +76,7 @@ class ApplicationController < ActionController::Base
|
|
76
76
|
def convert_charset
|
77
77
|
case params[:format]
|
78
78
|
when 'csv'
|
79
|
-
return unless
|
79
|
+
return unless Setting.csv_charset_conversion
|
80
80
|
# TODO: 他の言語
|
81
81
|
if @locale.to_sym == :ja
|
82
82
|
headers["Content-Type"] = "text/csv; charset=Shift_JIS"
|
@@ -2,10 +2,10 @@ class Notifier < ActionMailer::Base
|
|
2
2
|
if LibraryGroup.site_config.try(:url)
|
3
3
|
uri = Addressable::URI.parse(LibraryGroup.site_config.url)
|
4
4
|
default_url_options[:host] = uri.host
|
5
|
-
default_url_options[:port] = uri.port if
|
5
|
+
default_url_options[:port] = uri.port if Setting.enju.web_port_number != 80
|
6
6
|
else
|
7
|
-
default_url_options[:host] =
|
8
|
-
default_url_options[:port] =
|
7
|
+
default_url_options[:host] = Setting.enju.web_hostname
|
8
|
+
default_url_options[:port] = Setting.enju.web_port_number if Setting.enju.web_port_number != 80
|
9
9
|
end
|
10
10
|
|
11
11
|
def message_notification(message)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
enju:
|
3
|
+
web_hostname: localhost
|
4
|
+
web_port_number: 3000
|
5
|
+
|
6
|
+
family_name_first: true
|
7
|
+
max_number_of_results: 500
|
8
|
+
write_search_log_to_file: true
|
9
|
+
csv_charset_conversion: true
|
10
|
+
|
11
|
+
# Choose a locale from 'ca', 'de', 'fr', 'jp', 'uk', 'us'
|
12
|
+
#AMAZON_AWS_HOSTNAME = 'ecs.amazonaws.com'
|
13
|
+
amazon:
|
14
|
+
aws_hostname: ecs.amazonaws.jp
|
15
|
+
hostname: www.amazon.co.jp
|
16
|
+
access_key: REPLACE_WITH_YOUR_AMAZON_ACCESS_KEY
|
17
|
+
secret_access_key: REPLACE_WITH_YOUR_AMAZON_SECRET_ACCESS_KEY
|
18
|
+
|
19
|
+
# :google, :amazon
|
20
|
+
book_jacket:
|
21
|
+
source: :google
|
22
|
+
unknown_resource:
|
23
|
+
|
24
|
+
# :mozshot, :simpleapi, :heartrails, :thumbalizr
|
25
|
+
screenshot:
|
26
|
+
generator: :mozshot
|
27
|
+
|
28
|
+
uploaded_file:
|
29
|
+
storage: :local
|
30
|
+
|
31
|
+
development:
|
32
|
+
<<: *defaults
|
33
|
+
|
34
|
+
test:
|
35
|
+
<<: *defaults
|
36
|
+
|
37
|
+
production:
|
38
|
+
<<: *defaults
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.17.pre
|
5
|
+
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kosuke Tanabe
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -348,6 +348,7 @@ files:
|
|
348
348
|
- spec/dummy/app/mailers/notifier.rb
|
349
349
|
- spec/dummy/app/models/ability.rb
|
350
350
|
- spec/dummy/app/models/role.rb
|
351
|
+
- spec/dummy/app/models/setting.rb
|
351
352
|
- spec/dummy/app/models/user.rb
|
352
353
|
- spec/dummy/app/models/user_group.rb
|
353
354
|
- spec/dummy/app/models/user_has_role.rb
|
@@ -359,6 +360,7 @@ files:
|
|
359
360
|
- spec/dummy/app/views/page/404.mobile.erb
|
360
361
|
- spec/dummy/app/views/page/404.xml.erb
|
361
362
|
- spec/dummy/config/application.rb
|
363
|
+
- spec/dummy/config/application.yml
|
362
364
|
- spec/dummy/config/boot.rb
|
363
365
|
- spec/dummy/config/database.yml
|
364
366
|
- spec/dummy/config/environment.rb
|
@@ -557,9 +559,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
557
559
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
558
560
|
none: false
|
559
561
|
requirements:
|
560
|
-
- - ! '
|
562
|
+
- - ! '>'
|
561
563
|
- !ruby/object:Gem::Version
|
562
|
-
version:
|
564
|
+
version: 1.3.1
|
563
565
|
requirements: []
|
564
566
|
rubyforge_project:
|
565
567
|
rubygems_version: 1.8.23
|
@@ -579,6 +581,7 @@ test_files:
|
|
579
581
|
- spec/dummy/app/mailers/notifier.rb
|
580
582
|
- spec/dummy/app/models/ability.rb
|
581
583
|
- spec/dummy/app/models/role.rb
|
584
|
+
- spec/dummy/app/models/setting.rb
|
582
585
|
- spec/dummy/app/models/user.rb
|
583
586
|
- spec/dummy/app/models/user_group.rb
|
584
587
|
- spec/dummy/app/models/user_has_role.rb
|
@@ -590,6 +593,7 @@ test_files:
|
|
590
593
|
- spec/dummy/app/views/page/404.mobile.erb
|
591
594
|
- spec/dummy/app/views/page/404.xml.erb
|
592
595
|
- spec/dummy/config/application.rb
|
596
|
+
- spec/dummy/config/application.yml
|
593
597
|
- spec/dummy/config/boot.rb
|
594
598
|
- spec/dummy/config/database.yml
|
595
599
|
- spec/dummy/config/environment.rb
|