jasmine-rails 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +12 -0
- data/lib/jasmine_rails/offline_asset_paths.rb +7 -12
- data/lib/jasmine_rails/runner.rb +12 -8
- data/lib/jasmine_rails/save_fixture.rb +2 -0
- data/lib/jasmine_rails/version.rb +1 -1
- data/lib/tasks/jasmine-rails_tasks.rake +3 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30fe2198e6528b6b3c5fcba2cdcac5e39ec985cc
|
4
|
+
data.tar.gz: 6f67a8c892e763d822ad3d45c435ff5723f2e273
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fef6623c4d34c7081381b09d8f233eccb2f873bb6138bc367ef9f906df2e431389e0a0f89eaf84215bb2a9f2a9491c7a471015478a9f0f1d93a2d52b2283ac28
|
7
|
+
data.tar.gz: 9cc6aafbfe6485ba2f3f25e597d8433f306bfe40564fc13d3fab5c1c42e95391c01cdb3a9b6912b5d8d29c79276ca58998e885a6cd2a306471dee1b16c3ebc51
|
data/Rakefile
CHANGED
@@ -3,3 +3,15 @@
|
|
3
3
|
require 'rspec/core/rake_task'
|
4
4
|
Bundler::GemHelper.install_tasks
|
5
5
|
|
6
|
+
if Gem.ruby_version >= Gem::Version.new("2.2.2")
|
7
|
+
require 'github_changelog_generator/task'
|
8
|
+
GitHubChangelogGenerator::RakeTask.new :changelog
|
9
|
+
task :changelog_commit do
|
10
|
+
require_relative "lib/jasmine_rails/version"
|
11
|
+
cmd = "git commit -m \"Changelog for #{JasmineRails::VERSION}\" -- CHANGELOG.md"
|
12
|
+
puts "-------> #{cmd}"
|
13
|
+
system cmd
|
14
|
+
end
|
15
|
+
Rake::Task["release:rubygem_push"].enhance([:changelog, :changelog_commit])
|
16
|
+
end
|
17
|
+
|
@@ -5,19 +5,9 @@
|
|
5
5
|
module JasmineRails
|
6
6
|
module OfflineAssetPaths
|
7
7
|
mattr_accessor :disabled
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
included do
|
10
|
-
if ::Rails::VERSION::MAJOR >= 4
|
11
|
-
alias_method :compute_public_path, :compute_asset_path
|
12
|
-
alias_method :compute_asset_path_with_offline_asset, :compute_public_path_with_offline_asset
|
13
|
-
alias_method_chain :compute_asset_path, :offline_asset
|
14
|
-
end
|
15
|
-
|
16
|
-
alias_method_chain :compute_public_path, :offline_asset
|
17
|
-
end
|
18
8
|
|
19
|
-
def
|
20
|
-
return
|
9
|
+
def compute_asset_path(source, dir, options={})
|
10
|
+
return super if JasmineRails::OfflineAssetPaths.disabled
|
21
11
|
source = source.to_s
|
22
12
|
return source if source.empty? || source.starts_with?('/')
|
23
13
|
content = Rails.application.assets[source].to_s
|
@@ -36,5 +26,10 @@ module JasmineRails
|
|
36
26
|
"/#{asset_prefix}/#{source}"
|
37
27
|
end
|
38
28
|
|
29
|
+
# For Rails 3.2 support
|
30
|
+
def compute_public_path(*args)
|
31
|
+
JasmineRails::OfflineAssetPaths.disabled ? super : compute_asset_path(*args)
|
32
|
+
end
|
33
|
+
|
39
34
|
end
|
40
35
|
end
|
data/lib/jasmine_rails/runner.rb
CHANGED
@@ -10,7 +10,7 @@ module JasmineRails
|
|
10
10
|
require 'phantomjs' if JasmineRails.use_phantom_gem?
|
11
11
|
require 'fileutils'
|
12
12
|
|
13
|
-
|
13
|
+
prepend_offline_asset_paths_helper
|
14
14
|
html = get_spec_runner(spec_filter, reporters)
|
15
15
|
FileUtils.mkdir_p JasmineRails.tmp_dir
|
16
16
|
runner_path = JasmineRails.tmp_dir.join('runner.html')
|
@@ -25,12 +25,10 @@ module JasmineRails
|
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
|
-
def
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
ActionView::AssetPaths.send :include, JasmineRails::OfflineAssetPaths
|
33
|
-
end
|
28
|
+
def prepend_offline_asset_paths_helper
|
29
|
+
action_view = Rails::VERSION::MAJOR >= 4 ? ActionView::Base : ActionView::AssetPaths
|
30
|
+
module_extender = Gem.ruby_version >= Gem::Version.new("2") ? :prepend : :include
|
31
|
+
action_view.send module_extender, JasmineRails::OfflineAssetPaths
|
34
32
|
end
|
35
33
|
|
36
34
|
# temporarily override internal rails settings for the given block
|
@@ -58,7 +56,13 @@ module JasmineRails
|
|
58
56
|
app.https!(JasmineRails.force_ssl)
|
59
57
|
path = JasmineRails.route_path
|
60
58
|
JasmineRails::OfflineAssetPaths.disabled = false
|
61
|
-
|
59
|
+
|
60
|
+
if Rails::VERSION::MAJOR >= 5
|
61
|
+
app.get path, :params => { :reporters => reporters, :spec => spec_filter }
|
62
|
+
else
|
63
|
+
app.get path, :reporters => reporters, :spec => spec_filter
|
64
|
+
end
|
65
|
+
|
62
66
|
JasmineRails::OfflineAssetPaths.disabled = true
|
63
67
|
unless app.response.success?
|
64
68
|
raise "Jasmine runner at '#{path}' returned a #{app.response.status} error: #{app.response.message} \n\n" +
|
@@ -8,7 +8,9 @@ namespace :spec do
|
|
8
8
|
reporters = ENV.fetch('REPORTERS', 'console')
|
9
9
|
JasmineRails::Runner.run spec_filter, reporters
|
10
10
|
else
|
11
|
-
|
11
|
+
unless system('bundle exec rake spec:javascript RAILS_ENV=test')
|
12
|
+
exit $?.exitstatus
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searls
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -74,6 +74,20 @@ dependencies:
|
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '1.9'
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: github_changelog_generator
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
type: :development
|
85
|
+
prerelease: false
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
77
91
|
description: Provides a Jasmine Spec Runner that plays nicely with Rails 3.2 assets
|
78
92
|
and sets up jasmine-headless-webkit
|
79
93
|
email:
|