jasmine-rails 0.13.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b52d6cc13707050623f5eb9ed4d258920f65acee
4
- data.tar.gz: 9d00012e2e22d1707527ec256413c9b43280306d
3
+ metadata.gz: 30fe2198e6528b6b3c5fcba2cdcac5e39ec985cc
4
+ data.tar.gz: 6f67a8c892e763d822ad3d45c435ff5723f2e273
5
5
  SHA512:
6
- metadata.gz: 8060d76c92283eb5e425c1ce1eb37003aa2b44bac418f431b5915509d9812e95d882c898b60adfc3fe1cb5b749e31a5a2fddb322e56e83edb7c046111ec16067
7
- data.tar.gz: ef075ba6b0d12aca39a257e9fe7a2343242c1a61f8d385e7f590b64be903228bdb4f5495079af48dae3f2f6161db82cfdc1948c5db938972e76a24a24efadfbb
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 compute_public_path_with_offline_asset(source, dir, options={})
20
- return compute_public_path_without_offline_asset(source, dir, options) if JasmineRails::OfflineAssetPaths.disabled
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
@@ -10,7 +10,7 @@ module JasmineRails
10
10
  require 'phantomjs' if JasmineRails.use_phantom_gem?
11
11
  require 'fileutils'
12
12
 
13
- include_offline_asset_paths_helper
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 include_offline_asset_paths_helper
29
- if Rails::VERSION::MAJOR >= 4
30
- Sprockets::Rails::Helper.send :include, JasmineRails::OfflineAssetPaths
31
- else
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
- app.get path, :reporters => reporters, :spec => spec_filter
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" +
@@ -1,5 +1,7 @@
1
1
  require 'fileutils'
2
2
 
3
+ # DEPRECATED - This feature will be removed as soon as it causes another issue
4
+ #
3
5
  # Adds a save_fixture method takes the rendered content
4
6
  # and stores it in a fixture file to be used with jasmine.
5
7
  #
@@ -1,3 +1,3 @@
1
1
  module JasmineRails
2
- VERSION = "0.13.0"
2
+ VERSION = "0.14.1"
3
3
  end
@@ -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
- exec('bundle exec rake spec:javascript RAILS_ENV=test')
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.13.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-08-30 00:00:00.000000000 Z
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: