jpmobile 4.2.3 → 4.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/jpmobile.gemspec +2 -1
- data/lib/jpmobile/version.rb +1 -1
- data/lib/tasks/jpmobile_tasks.rake +45 -28
- data/spec/unit/mail_spec.rb +10 -1
- data/test/rails/overrides/Gemfile.jpmobile +2 -1
- data/test/rails/overrides/spec/features/filter_spec.rb +2 -2
- metadata +23 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c642e8e056bb3640414207b90b5f708bbbbb381b
|
4
|
+
data.tar.gz: b81621cee3f51f931acb99fe373950eeb8a2f167
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14337a48b6e5432ee5f4d2df98e1b3224722a9c72d70bbeb47f2b99c47b6e204ce551d9e5093ac42c83650a6a5c7c8e1d2965720e3245229db669c18d5b5cb37
|
7
|
+
data.tar.gz: de4719aad80730b8817ba8d197a67861584c42192f025f7226a5ff88b78df14706fdaa806710aae6570da80a9e1d020f8c5093408a18dd182f8d71947eaed407
|
data/.gitignore
CHANGED
data/jpmobile.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
|
19
|
-
gem.add_development_dependency 'rails'
|
19
|
+
gem.add_development_dependency 'rails', '~> 4.2'
|
20
20
|
gem.add_development_dependency 'rspec'
|
21
21
|
gem.add_development_dependency 'rspec-rails'
|
22
22
|
gem.add_development_dependency 'rspec-its'
|
@@ -26,4 +26,5 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_development_dependency 'hpricot'
|
27
27
|
gem.add_development_dependency 'git'
|
28
28
|
gem.add_development_dependency 'pry'
|
29
|
+
gem.add_development_dependency 'mail', '2.5.5'
|
29
30
|
end
|
data/lib/jpmobile/version.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
1
|
# desc "Explaining what the task does"
|
3
2
|
# task :jpmobile do
|
4
3
|
# # Task goes here
|
@@ -19,21 +18,19 @@ begin
|
|
19
18
|
end
|
20
19
|
end
|
21
20
|
rescue LoadError
|
22
|
-
warn
|
21
|
+
warn 'RSpec is not installed. Some tasks were skipped. please install rspec'
|
23
22
|
end
|
24
23
|
|
25
24
|
namespace :test do
|
26
|
-
desc
|
27
|
-
task :rails, [:skip] do |
|
28
|
-
rails_root
|
29
|
-
relative_root = "../../../"
|
25
|
+
desc 'Generate rails app and run jpmobile tests in the app'
|
26
|
+
task :rails, [:skip] do |_, args|
|
27
|
+
rails_root = 'test/rails/rails_root'
|
30
28
|
|
31
|
-
puts
|
32
|
-
skip = args.skip ==
|
29
|
+
puts 'Running tests in Rails'
|
30
|
+
skip = args.skip == 'true'
|
33
31
|
|
34
32
|
unless skip
|
35
33
|
# generate rails app
|
36
|
-
FileUtils.rm_rf("Gemfile.lock")
|
37
34
|
FileUtils.rm_rf(rails_root)
|
38
35
|
FileUtils.mkdir_p(rails_root)
|
39
36
|
`rails new #{rails_root} --skip-bundle`
|
@@ -42,7 +39,7 @@ namespace :test do
|
|
42
39
|
# setup jpmobile
|
43
40
|
plugin_path = File.join(rails_root, 'vendor', 'jpmobile')
|
44
41
|
FileUtils.mkdir_p(plugin_path)
|
45
|
-
FileList[
|
42
|
+
FileList['*'].exclude('test').exclude('spec').exclude('vendor').each do |file|
|
46
43
|
FileUtils.cp_r(file, plugin_path)
|
47
44
|
end
|
48
45
|
|
@@ -50,26 +47,37 @@ namespace :test do
|
|
50
47
|
begin
|
51
48
|
plugin_path = File.join(rails_root, 'vendor', 'jpmobile-ipaddresses')
|
52
49
|
FileUtils.mkdir_p(plugin_path)
|
53
|
-
FileList[
|
50
|
+
FileList['vendor/jpmobile-ipaddresses/*'].exclude('test').each do |file|
|
54
51
|
FileUtils.cp_r(file, plugin_path)
|
55
52
|
end
|
56
53
|
rescue LoadError
|
57
|
-
puts
|
54
|
+
puts 'IP Address test requires jpmobile-ipaddresses module'
|
58
55
|
end
|
59
56
|
|
60
57
|
# setup jpmobile-terminfo
|
61
58
|
begin
|
62
59
|
plugin_path = File.join(rails_root, 'vendor', 'jpmobile-terminfo')
|
63
60
|
FileUtils.mkdir_p(plugin_path)
|
64
|
-
FileList[
|
61
|
+
FileList['vendor/jpmobile-terminfo/*'].exclude('test').each do |file|
|
65
62
|
FileUtils.cp_r(file, plugin_path)
|
66
63
|
end
|
67
64
|
rescue LoadError
|
68
|
-
puts
|
65
|
+
puts 'Terminal display information test requires jpmobile-terminfo module'
|
66
|
+
end
|
67
|
+
|
68
|
+
# setup activerecord-session_store
|
69
|
+
begin
|
70
|
+
plugin_path = File.join(rails_root, 'vendor', 'activerecord-session_store')
|
71
|
+
FileUtils.mkdir_p(plugin_path)
|
72
|
+
FileList['../activerecord-session_store/*'].exclude('test').each do |file|
|
73
|
+
FileUtils.cp_r(file, plugin_path)
|
74
|
+
end
|
75
|
+
rescue LoadError
|
76
|
+
puts 'Terminal display information test requires jpmobile-terminfo module'
|
69
77
|
end
|
70
78
|
|
71
79
|
# setup tests
|
72
|
-
FileList[
|
80
|
+
FileList['test/rails/overrides/*'].each do |file|
|
73
81
|
FileUtils.cp_r(file, rails_root)
|
74
82
|
end
|
75
83
|
|
@@ -77,10 +85,10 @@ namespace :test do
|
|
77
85
|
# for cookie_only option
|
78
86
|
config_path = File.join(rails_root, 'config', 'initializers', 'session_store.rb')
|
79
87
|
File.open(config_path, 'w') do |file|
|
80
|
-
file.write <<-
|
81
|
-
Rails.application.config.session_store :active_record_store, :key => '_session_id'
|
82
|
-
Rails.application.config.session_options = {:cookie_only => false}
|
83
|
-
|
88
|
+
file.write <<-SESSION_CONFIG
|
89
|
+
Rails.application.config.session_store :active_record_store, :key => '_session_id'
|
90
|
+
Rails.application.config.session_options = { :cookie_only => false }
|
91
|
+
SESSION_CONFIG
|
84
92
|
end
|
85
93
|
end
|
86
94
|
|
@@ -88,20 +96,29 @@ END
|
|
88
96
|
# add gems for jpmobile spec
|
89
97
|
config_path = File.join(rails_root, 'Gemfile')
|
90
98
|
File.open(config_path, 'a+') do |file|
|
91
|
-
file.write <<-
|
92
|
-
instance_eval File.read(File.expand_path(__FILE__) + '.jpmobile')
|
93
|
-
|
99
|
+
file.write <<-GEMFILE
|
100
|
+
instance_eval File.read(File.expand_path(__FILE__) + '.jpmobile')
|
101
|
+
GEMFILE
|
94
102
|
end
|
95
103
|
end
|
96
104
|
|
97
105
|
# run tests in rails
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
106
|
+
Dir.chdir(rails_root) do
|
107
|
+
Bundler.with_clean_env do
|
108
|
+
original_env = ENV.to_hash
|
109
|
+
|
110
|
+
ENV.update('RBENV_VERSION' => nil)
|
111
|
+
ENV.update('RBENV_DIR' => nil)
|
112
|
+
|
113
|
+
system 'bundle install'
|
114
|
+
system 'bin/rake db:migrate RAILS_ENV=test' unless skip
|
115
|
+
system 'bin/rake spec'
|
116
|
+
|
117
|
+
ENV.replace(original_env)
|
118
|
+
end
|
119
|
+
end
|
103
120
|
end
|
104
|
-
desc
|
121
|
+
desc 'Run sinatra on jpmobile tests'
|
105
122
|
Rake::TestTask.new(:sinatra) do |t|
|
106
123
|
t.libs << 'lib'
|
107
124
|
t.libs << 'test/sinatra'
|
data/spec/unit/mail_spec.rb
CHANGED
@@ -342,7 +342,16 @@ describe "Jpmobile::Mail" do
|
|
342
342
|
end
|
343
343
|
|
344
344
|
it "delivers through SMTP" do
|
345
|
-
@mail.delivery_method :smtp, {
|
345
|
+
@mail.delivery_method :smtp, {
|
346
|
+
enable_starttls_auto: false,
|
347
|
+
user_name: ENV['MAILTRAP_USERNAME'],
|
348
|
+
password: ENV['MAILTRAP_PASSWORD'],
|
349
|
+
address: 'smtp.mailtrap.io',
|
350
|
+
domain: 'smtp.mailtrap.io',
|
351
|
+
port: '2525',
|
352
|
+
authentication: :cram_md5
|
353
|
+
}
|
354
|
+
|
346
355
|
expect {
|
347
356
|
@mail.deliver
|
348
357
|
}.not_to raise_error
|
@@ -6,11 +6,12 @@ gem 'jpmobile-ipaddresses', path: './vendor/jpmobile-ipaddresses'
|
|
6
6
|
|
7
7
|
gem 'activerecord-session_store'
|
8
8
|
|
9
|
+
gem 'mail', '2.5.5'
|
10
|
+
|
9
11
|
# Bundle gems for certain environments:
|
10
12
|
group :development, :test do
|
11
13
|
gem "rspec"
|
12
14
|
gem "rspec-rails"
|
13
|
-
gem 'capybara'
|
14
15
|
gem 'capybara-webkit'
|
15
16
|
gem 'pry'
|
16
17
|
end
|
@@ -18,7 +18,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
18
18
|
end
|
19
19
|
it "は 変換されない" do
|
20
20
|
visit "/#{controller}/nbsp_char"
|
21
|
-
expect(page.body.encode('UTF-8')).to have_content(
|
21
|
+
expect(page.body.encode('UTF-8')).to have_content("アブラ\xc2\xa0カダブラ")
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -33,7 +33,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
33
33
|
end
|
34
34
|
it "は 変換されない" do
|
35
35
|
visit "/#{controller}/nbsp_char"
|
36
|
-
expect(page.body.encode('UTF-8')).to have_content(
|
36
|
+
expect(page.body.encode('UTF-8')).to have_content("アブラ\xc2\xa0カダブラ")
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jpmobile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shin-ichiro OGAWA
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '4.2'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '4.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,6 +151,20 @@ dependencies:
|
|
151
151
|
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: mail
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - '='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 2.5.5
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - '='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: 2.5.5
|
154
168
|
description: A Rails plugin for mobile devices in Japan
|
155
169
|
email:
|
156
170
|
- rust.stnard@gmail.com
|
@@ -281,6 +295,7 @@ files:
|
|
281
295
|
- spec/unit/variants_spec.rb
|
282
296
|
- test/rails/.gitignore
|
283
297
|
- test/rails/overrides/.rspec
|
298
|
+
- test/rails/overrides/Gemfile
|
284
299
|
- test/rails/overrides/Gemfile.jpmobile
|
285
300
|
- test/rails/overrides/app/controllers/admin/top_controller.rb
|
286
301
|
- test/rails/overrides/app/controllers/application_controller.rb
|
@@ -434,7 +449,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
434
449
|
version: '0'
|
435
450
|
requirements: []
|
436
451
|
rubyforge_project:
|
437
|
-
rubygems_version: 2.
|
452
|
+
rubygems_version: 2.6.14.1
|
438
453
|
signing_key:
|
439
454
|
specification_version: 4
|
440
455
|
summary: A Rails plugin for mobile devices in Japan
|
@@ -495,6 +510,7 @@ test_files:
|
|
495
510
|
- spec/unit/variants_spec.rb
|
496
511
|
- test/rails/.gitignore
|
497
512
|
- test/rails/overrides/.rspec
|
513
|
+
- test/rails/overrides/Gemfile
|
498
514
|
- test/rails/overrides/Gemfile.jpmobile
|
499
515
|
- test/rails/overrides/app/controllers/admin/top_controller.rb
|
500
516
|
- test/rails/overrides/app/controllers/application_controller.rb
|