enju_book_jacket 0.1.0.pre → 0.1.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/manifestations/_google_book_thumbnail.html.erb +2 -2
- data/lib/enju_book_jacket/book_jacket_helper.rb +7 -7
- data/lib/enju_book_jacket/engine.rb +0 -2
- data/lib/enju_book_jacket/version.rb +1 -1
- 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 +8 -30
- data/spec/dummy/config/configatron/defaults.rb +0 -28
- data/spec/dummy/config/configatron/development.rb +0 -4
- data/spec/dummy/config/configatron/production.rb.sample +0 -9
- data/spec/dummy/config/configatron/test.rb +0 -4
- data/spec/dummy/config/initializers/configatron.rb +0 -2
@@ -3,8 +3,8 @@
|
|
3
3
|
<script>
|
4
4
|
function addTheCover(booksInfo){
|
5
5
|
var link = '<%= image_tag("unknown_resource.png", :size => "150x150", :alt => "*") %>';
|
6
|
-
<% unless
|
7
|
-
link = '<%=
|
6
|
+
<% unless Setting.book_jacket.unknown_resource.blank? %>
|
7
|
+
link = '<%= Setting.book_jacket.unknown_resource %>'
|
8
8
|
<% end %>
|
9
9
|
for (var i in booksInfo) {
|
10
10
|
var book = booksInfo[i];
|
@@ -26,7 +26,7 @@ module EnjuBookJacket
|
|
26
26
|
link
|
27
27
|
end
|
28
28
|
|
29
|
-
def screenshot_tag(manifestation, generator =
|
29
|
+
def screenshot_tag(manifestation, generator = Setting.screenshot.generator)
|
30
30
|
return nil unless manifestation.try(:access_address)
|
31
31
|
case generator
|
32
32
|
when :mozshot
|
@@ -40,27 +40,27 @@ module EnjuBookJacket
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
def book_jacket_tag(manifestation, generator =
|
43
|
+
def book_jacket_tag(manifestation, generator = Setting.book_jacket.source)
|
44
44
|
return nil unless manifestation
|
45
45
|
case generator
|
46
46
|
when :amazon
|
47
|
-
return nil unless
|
47
|
+
return nil unless Setting.amazon.hostname
|
48
48
|
book_jacket = manifestation.amazon_book_jacket
|
49
49
|
if book_jacket
|
50
|
-
link_to image_tag(book_jacket[:url], :width => book_jacket[:width], :height => book_jacket[:height], :alt => manifestation.original_title, :class => 'book_jacket', :itemprop => 'image'), "http://#{
|
50
|
+
link_to image_tag(book_jacket[:url], :width => book_jacket[:width], :height => book_jacket[:height], :alt => manifestation.original_title, :class => 'book_jacket', :itemprop => 'image'), "http://#{Setting.amazon.hostname}/dp/#{book_jacket[:asin]}"
|
51
51
|
end
|
52
52
|
when :google
|
53
53
|
render :partial => 'manifestations/google_book_thumbnail', :locals => {:manifestation => manifestation}
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
def amazon_link(asin, hostname =
|
57
|
+
def amazon_link(asin, hostname = Setting.amazon.hostname)
|
58
58
|
return nil if asin.blank?
|
59
59
|
"http://#{hostname}/dp/#{asin}"
|
60
60
|
end
|
61
61
|
|
62
62
|
def book_jacket_source_link
|
63
|
-
case
|
63
|
+
case Setting.book_jacket.source
|
64
64
|
when :google
|
65
65
|
link_to "Google Books", "http://books.google.com/"
|
66
66
|
when :amazon
|
@@ -69,7 +69,7 @@ module EnjuBookJacket
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def screenshot_generator_link
|
72
|
-
case
|
72
|
+
case Setting.screenshot.generator
|
73
73
|
when :mozshot
|
74
74
|
link_to "MozShot", "http://mozshot.nemui.org/"
|
75
75
|
when :simpleapi
|
@@ -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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_book_jacket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
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
|
@@ -27,22 +27,6 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3.2'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: configatron
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
31
|
name: sqlite3
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +66,7 @@ dependencies:
|
|
82
66
|
requirements:
|
83
67
|
- - ~>
|
84
68
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.1.0.
|
69
|
+
version: 0.1.0.pre5
|
86
70
|
type: :development
|
87
71
|
prerelease: false
|
88
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +74,7 @@ dependencies:
|
|
90
74
|
requirements:
|
91
75
|
- - ~>
|
92
76
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.1.0.
|
77
|
+
version: 0.1.0.pre5
|
94
78
|
- !ruby/object:Gem::Dependency
|
95
79
|
name: vcr
|
96
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,20 +114,17 @@ files:
|
|
130
114
|
- spec/dummy/app/controllers/application_controller.rb
|
131
115
|
- spec/dummy/app/helpers/application_helper.rb
|
132
116
|
- spec/dummy/app/models/manifestation.rb
|
117
|
+
- spec/dummy/app/models/setting.rb
|
133
118
|
- spec/dummy/app/views/layouts/application.html.erb
|
134
119
|
- spec/dummy/config/application.rb
|
120
|
+
- spec/dummy/config/application.yml
|
135
121
|
- spec/dummy/config/boot.rb
|
136
|
-
- spec/dummy/config/configatron/defaults.rb
|
137
|
-
- spec/dummy/config/configatron/development.rb
|
138
|
-
- spec/dummy/config/configatron/production.rb.sample
|
139
|
-
- spec/dummy/config/configatron/test.rb
|
140
122
|
- spec/dummy/config/database.yml
|
141
123
|
- spec/dummy/config/environment.rb
|
142
124
|
- spec/dummy/config/environments/development.rb
|
143
125
|
- spec/dummy/config/environments/production.rb
|
144
126
|
- spec/dummy/config/environments/test.rb
|
145
127
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
146
|
-
- spec/dummy/config/initializers/configatron.rb
|
147
128
|
- spec/dummy/config/initializers/inflections.rb
|
148
129
|
- spec/dummy/config/initializers/mime_types.rb
|
149
130
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -197,20 +178,17 @@ test_files:
|
|
197
178
|
- spec/dummy/app/controllers/application_controller.rb
|
198
179
|
- spec/dummy/app/helpers/application_helper.rb
|
199
180
|
- spec/dummy/app/models/manifestation.rb
|
181
|
+
- spec/dummy/app/models/setting.rb
|
200
182
|
- spec/dummy/app/views/layouts/application.html.erb
|
201
183
|
- spec/dummy/config/application.rb
|
184
|
+
- spec/dummy/config/application.yml
|
202
185
|
- spec/dummy/config/boot.rb
|
203
|
-
- spec/dummy/config/configatron/defaults.rb
|
204
|
-
- spec/dummy/config/configatron/development.rb
|
205
|
-
- spec/dummy/config/configatron/production.rb.sample
|
206
|
-
- spec/dummy/config/configatron/test.rb
|
207
186
|
- spec/dummy/config/database.yml
|
208
187
|
- spec/dummy/config/environment.rb
|
209
188
|
- spec/dummy/config/environments/development.rb
|
210
189
|
- spec/dummy/config/environments/production.rb
|
211
190
|
- spec/dummy/config/environments/test.rb
|
212
191
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
213
|
-
- spec/dummy/config/initializers/configatron.rb
|
214
192
|
- spec/dummy/config/initializers/inflections.rb
|
215
193
|
- spec/dummy/config/initializers/mime_types.rb
|
216
194
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# Put all your default configatron settings here.
|
2
|
-
|
3
|
-
# Example:
|
4
|
-
# configatron.emails.welcome.subject = 'Welcome!'
|
5
|
-
# configatron.emails.sales_reciept.subject = 'Thanks for your order'
|
6
|
-
#
|
7
|
-
# configatron.file.storage = :s3
|
8
|
-
|
9
|
-
configatron.enju.web_hostname = 'localhost'
|
10
|
-
configatron.enju.web_port_number = 3000
|
11
|
-
|
12
|
-
# パトロンの名前を入力する際、姓を先に表示する
|
13
|
-
configatron.family_name_first = true
|
14
|
-
|
15
|
-
configatron.max_number_of_results = 500
|
16
|
-
configatron.write_search_log_to_file = true
|
17
|
-
configatron.csv_charset_conversion = true
|
18
|
-
|
19
|
-
# Choose a locale from 'ca', 'de', 'fr', 'jp', 'uk', 'us'
|
20
|
-
#AMAZON_AWS_HOSTNAME = 'ecs.amazonaws.com'
|
21
|
-
configatron.amazon.aws_hostname = 'ecs.amazonaws.jp'
|
22
|
-
configatron.amazon.hostname = 'www.amazon.co.jp'
|
23
|
-
|
24
|
-
# :google, :amazon
|
25
|
-
configatron.book_jacket.source = :google
|
26
|
-
|
27
|
-
# :mozshot, :simpleapi, :heartrails, :thumbalizr
|
28
|
-
configatron.screenshot.generator = :mozshot
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# Override your default settings for the Production environment here.
|
2
|
-
#
|
3
|
-
# Example:
|
4
|
-
# configatron.uploaded_file.storage = :s3
|
5
|
-
|
6
|
-
#configatron.uploaded_file.storage = :s3
|
7
|
-
|
8
|
-
configatron.amazon.access_key = 'REPLACE_WITH_YOUR_AMAZON_ACCESS_KEY'
|
9
|
-
configatron.amazon.secret_access_key = 'REPLACE_WITH_YOUR_AMAZON_SECRET_ACCESS_KEY'
|