konacha 3.4.0 → 3.5.0

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: d684a1044391502b8e81e688025c34717beace35
4
- data.tar.gz: 04346e38a066208173c5b408d98e52c6fafaf285
3
+ metadata.gz: bbe0a4e896727c4c1dd72c2cab1b4464dc909287
4
+ data.tar.gz: ad9ba543b576bc84a1f9eb8ff6e49b85b221d272
5
5
  SHA512:
6
- metadata.gz: 62f951553607dad516e2b60314e156a8d88854d82ce172a0f7eb697e2e75881987184c128fc939b335879fbbcb3d4ce2a60e2d4a052ff28329e117e47d5d20ce
7
- data.tar.gz: 0a92066f85f648fb3dccd057c195f7ea343c0a4d7ad67cb64ed72f05bef7417042e4aab79ba9e0779366b79d77277b0c7b30216ad2243506a7d1252768c13f89
6
+ metadata.gz: 1dcd3113d30d08e8d4e4a112a04ab024a0f4be9947d0e693594673c2faa83922781e275b326f244a730a621446fb3f94c0ab660c6fb47276419c98b2e1fbf9df
7
+ data.tar.gz: 39187e3cb36ae4344906270d5f57b15bcd2d13fd490e5239884899485dad92626f00354bbe6c4acc055b04b99768fb3ab069382d803fd33dbf644629c51666b7
data/History.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # master
2
2
 
3
+ # 3.5.0
4
+
5
+ * Supports Sprockets 3.x (#202, #203, #204)
6
+
3
7
  # 3.4.0
4
8
 
5
9
  * Add host configuration option (#196)
@@ -17,14 +17,15 @@ the asset pipeline and engines.}
17
17
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  gem.name = "konacha"
19
19
  gem.require_paths = ["lib"]
20
- gem.version = "3.4.0"
20
+ gem.version = "3.5.0"
21
21
  gem.license = "MIT"
22
22
 
23
23
  gem.add_dependency "railties", ">= 3.1", "< 5"
24
24
  gem.add_dependency "actionpack", ">= 3.1", "< 5"
25
- gem.add_dependency "sprockets", "~> 2"
25
+ gem.add_dependency "sprockets", ">= 2", "< 4"
26
26
  gem.add_dependency "capybara"
27
27
  gem.add_dependency "colorize"
28
+ gem.add_dependency "tilt"
28
29
 
29
30
  gem.add_development_dependency "jquery-rails"
30
31
  gem.add_development_dependency "rspec-rails", "~> 3.1"
@@ -37,11 +37,24 @@ module Konacha
37
37
 
38
38
  def spec_paths
39
39
  spec_root.flat_map do |root|
40
- Rails.application.assets.each_entry(root).find_all { |pathname|
41
- config.spec_matcher === pathname.basename.to_s &&
42
- (pathname.extname == '.js' || Tilt[pathname]) &&
43
- Rails.application.assets.content_type_of(pathname) == 'application/javascript'
44
- }.map { |pathname|
40
+ # Support Sprockets 2.x
41
+ if Rails.application.assets.respond_to?(:each_entry)
42
+ paths = Rails.application.assets.each_entry(root).find_all { |pathname|
43
+ config.spec_matcher === pathname.basename.to_s &&
44
+ (pathname.extname == '.js' || Tilt[pathname]) &&
45
+ Rails.application.assets.content_type_of(pathname) == 'application/javascript'
46
+ }
47
+ # Sprockets 3
48
+ elsif Rails.application.assets.respond_to?(:each_file)
49
+ paths = Rails.application.assets.each_file.find_all { |path|
50
+ pathname = Pathname.new(path)
51
+ config.spec_matcher === pathname.basename.to_s &&
52
+ (pathname.extname == '.js' || Tilt[pathname])
53
+ }
54
+ else
55
+ raise NotImplementedError.new("Konacha is not compatible with the version of Sprockets used by your application.")
56
+ end
57
+ paths.map { |pathname|
45
58
  pathname.to_s.gsub(File.join(root, ''), '')
46
59
  }.sort
47
60
  end
@@ -104,8 +104,14 @@ describe Konacha do
104
104
  begin
105
105
  spec_dir = Konacha.config.spec_dir
106
106
  Konacha.configure {|c| c.spec_dir = ["spec/javascripts", "app/sections"]}
107
+ # For Sprockets 3, adding to config.assets.paths does not work
108
+ if Rails.application.assets.respond_to?(:append_path)
109
+ Rails.application.assets.append_path(Rails.root.join("app/sections").to_s)
110
+ # Sprockets 2
111
+ else
112
+ Rails.application.config.assets.paths << Rails.root.join("app/sections").to_s
113
+ end
107
114
  example.run
108
- Rails.application.config.assets.paths << Rails.root.join("app/sections").to_s
109
115
  ensure
110
116
  Konacha.configure {|c| c.spec_dir = spec_dir}
111
117
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konacha
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Firebaugh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-09 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -54,16 +54,22 @@ dependencies:
54
54
  name: sprockets
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '2'
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '4'
60
63
  type: :runtime
61
64
  prerelease: false
62
65
  version_requirements: !ruby/object:Gem::Requirement
63
66
  requirements:
64
- - - "~>"
67
+ - - ">="
65
68
  - !ruby/object:Gem::Version
66
69
  version: '2'
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '4'
67
73
  - !ruby/object:Gem::Dependency
68
74
  name: capybara
69
75
  requirement: !ruby/object:Gem::Requirement
@@ -92,6 +98,20 @@ dependencies:
92
98
  - - ">="
93
99
  - !ruby/object:Gem::Version
94
100
  version: '0'
101
+ - !ruby/object:Gem::Dependency
102
+ name: tilt
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ type: :runtime
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
95
115
  - !ruby/object:Gem::Dependency
96
116
  name: jquery-rails
97
117
  requirement: !ruby/object:Gem::Requirement