jpmobile 5.0.0.beta1 → 5.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jpmobile.gemspec +1 -1
- data/lib/jpmobile/filter.rb +1 -1
- data/lib/jpmobile/resolver.rb +3 -2
- data/lib/jpmobile/version.rb +1 -1
- data/lib/tasks/jpmobile_tasks.rake +3 -3
- data/test/rails/overrides/Gemfile.jpmobile +2 -3
- data/test/rails/overrides/spec/rails_helper.rb +10 -4
- data/test/rails/overrides/spec/spec_helper.rb +18 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb4d8766b1ea417201147e466f2084b48f794cac
|
4
|
+
data.tar.gz: a4a672f26c05452639406937df52be1b3406c6cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d00c714192c78351c8c3eb345fee00d76a6911c33a962e91614b6a6117a2ae9f483d4e65e68f2cdde4502c8c8172a610fe82307962880a90dddccb01e0598dc8
|
7
|
+
data.tar.gz: dd5018b73e174846580146ad799aeefb66fb6fb501c65c9bf0f449f4221b2a8a6cefaca9ac60d49b15ee3c10e10c984673fff8fe00f225805916ed2e91e389a5
|
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', '5.0.0.
|
19
|
+
gem.add_development_dependency 'rails', '5.0.0.beta2'
|
20
20
|
gem.add_development_dependency 'rspec'
|
21
21
|
gem.add_development_dependency 'rspec-rails'
|
22
22
|
gem.add_development_dependency 'rspec-its'
|
data/lib/jpmobile/filter.rb
CHANGED
data/lib/jpmobile/resolver.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Jpmobile
|
2
2
|
class Resolver < ActionView::FileSystemResolver
|
3
3
|
EXTENSIONS = [:locale, :formats, :handlers, :mobile]
|
4
|
-
DEFAULT_PATTERN = ":prefix/:action{_:mobile,}{.:locale,}{.:formats,}{.:handlers,}"
|
4
|
+
DEFAULT_PATTERN = ":prefix/:action{_:mobile,}{.:locale,}{.:formats,}{+:variants,}{.:handlers,}"
|
5
5
|
|
6
6
|
def initialize(path, pattern=nil)
|
7
7
|
raise ArgumentError, "path already is a Resolver class" if path.is_a?(Resolver)
|
@@ -11,11 +11,12 @@ module Jpmobile
|
|
11
11
|
|
12
12
|
private
|
13
13
|
|
14
|
-
def query(path, details, formats)
|
14
|
+
def query(path, details, formats, outside_app_allowed)
|
15
15
|
query = build_query(path, details)
|
16
16
|
|
17
17
|
begin
|
18
18
|
template_paths = find_template_paths query
|
19
|
+
template_paths = reject_files_external_to_app(template_paths) unless outside_app_allowed
|
19
20
|
rescue NoMethodError
|
20
21
|
self.class_eval do
|
21
22
|
def find_template_paths(query)
|
data/lib/jpmobile/version.rb
CHANGED
@@ -36,7 +36,7 @@ namespace :test do
|
|
36
36
|
FileUtils.rm_rf("Gemfile.lock")
|
37
37
|
FileUtils.rm_rf(rails_root)
|
38
38
|
FileUtils.mkdir_p(rails_root)
|
39
|
-
`rails _5.0.0.
|
39
|
+
`rails _5.0.0.beta2_ new #{rails_root} --skip-bundle`
|
40
40
|
end
|
41
41
|
|
42
42
|
# setup jpmobile
|
@@ -108,8 +108,8 @@ END
|
|
108
108
|
# run tests in rails
|
109
109
|
cd rails_root
|
110
110
|
ruby "-S bundle install"
|
111
|
-
ruby "-S
|
112
|
-
ruby "-S
|
111
|
+
ruby "-S rails db:migrate RAILS_ENV=test" unless skip
|
112
|
+
ruby "-S rails spec"
|
113
113
|
# ruby "-S rspec -b --color spec/features/filter_spec.rb"
|
114
114
|
end
|
115
115
|
desc "Run sinatra on jpmobile tests"
|
@@ -4,15 +4,14 @@ gem 'jpmobile', path: './vendor/jpmobile'
|
|
4
4
|
gem 'jpmobile-terminfo', path: './vendor/jpmobile-terminfo'
|
5
5
|
gem 'jpmobile-ipaddresses', path: './vendor/jpmobile-ipaddresses'
|
6
6
|
|
7
|
-
gem 'activerecord-session_store',
|
7
|
+
gem 'activerecord-session_store', git: 'https://github.com/rails/activerecord-session_store'
|
8
8
|
|
9
9
|
gem 'pry'
|
10
10
|
gem 'pry-byebug'
|
11
11
|
|
12
12
|
# Bundle gems for certain environments:
|
13
13
|
group :development, :test do
|
14
|
-
gem "rspec"
|
15
|
-
gem "rspec-rails"
|
14
|
+
gem "rspec-rails", '3.5.0.beta1'
|
16
15
|
gem 'capybara'
|
17
16
|
gem 'capybara-webkit'
|
18
17
|
gem 'rails-controller-testing'
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV[
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
|
+
require File.expand_path('../../config/environment', __FILE__)
|
4
|
+
# Prevent database truncation if the environment is production
|
5
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
3
6
|
require 'spec_helper'
|
4
|
-
require File.expand_path("../../config/environment", __FILE__)
|
5
7
|
require 'rspec/rails'
|
6
8
|
# Add additional requires below this line. Rails is not loaded until this point!
|
7
9
|
|
@@ -18,9 +20,9 @@ require 'rspec/rails'
|
|
18
20
|
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
19
21
|
# require only the support files necessary.
|
20
22
|
#
|
21
|
-
# Dir[Rails.root.join(
|
23
|
+
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
22
24
|
|
23
|
-
# Checks for pending
|
25
|
+
# Checks for pending migration and applies them before tests are run.
|
24
26
|
# If you are not using ActiveRecord, you can remove this line.
|
25
27
|
ActiveRecord::Migration.maintain_test_schema!
|
26
28
|
|
@@ -50,6 +52,10 @@ RSpec.configure do |config|
|
|
50
52
|
# https://relishapp.com/rspec/rspec-rails/docs
|
51
53
|
config.infer_spec_type_from_file_location!
|
52
54
|
|
55
|
+
# Filter lines from Rails gems in backtraces.
|
56
|
+
config.filter_rails_from_backtrace!
|
57
|
+
# arbitrary gems may also be filtered via:
|
58
|
+
# config.filter_gems_from_backtrace("gem name")
|
53
59
|
config.filter_run focus: true
|
54
60
|
config.run_all_when_everything_filtered = true
|
55
61
|
config.color = true
|
@@ -1,14 +1,16 @@
|
|
1
1
|
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
2
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
-
# file to always be loaded, without a need to explicitly require it in any
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
5
6
|
#
|
6
7
|
# Given that it is always loaded, you are encouraged to keep this file as
|
7
8
|
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
9
|
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
10
|
# individual file that may not need all of that loaded. Instead, consider making
|
10
11
|
# a separate helper file that requires the additional dependencies and performs
|
11
|
-
# the additional setup, and require it from the spec files that actually need
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
12
14
|
#
|
13
15
|
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
16
|
# users commonly want.
|
@@ -22,10 +24,10 @@ RSpec.configure do |config|
|
|
22
24
|
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
25
|
# and `failure_message` of custom matchers include text for helper methods
|
24
26
|
# defined using `chain`, e.g.:
|
25
|
-
#
|
26
|
-
#
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
29
|
# ...rather than:
|
28
|
-
#
|
30
|
+
# # => "be bigger than 2"
|
29
31
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
32
|
end
|
31
33
|
|
@@ -48,11 +50,16 @@ RSpec.configure do |config|
|
|
48
50
|
config.filter_run :focus
|
49
51
|
config.run_all_when_everything_filtered = true
|
50
52
|
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
|
55
|
-
|
53
|
+
# Allows RSpec to persist some state between runs in order to support
|
54
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
55
|
+
# you configure your source control system to ignore this file.
|
56
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
57
|
+
|
58
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
59
|
+
# recommended. For more details, see:
|
60
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
61
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
62
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
56
63
|
config.disable_monkey_patching!
|
57
64
|
|
58
65
|
# Many RSpec users commonly either run the entire suite or an individual
|
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: 5.0.0.
|
4
|
+
version: 5.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shin-ichiro OGAWA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 5.0.0.
|
20
|
+
version: 5.0.0.beta2
|
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: 5.0.0.
|
27
|
+
version: 5.0.0.beta2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|