engine-assets 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gem.email = "support@coolerator.net"
11
11
  gem.homepage = "http://github.com/coreyti/engine-assets"
12
12
  gem.authors = ["Corey Innis"]
13
- gem.add_development_dependency "rspec", ">= 1.2.9"
13
+ gem.add_development_dependency "rspec", ">= 1.2.8"
14
14
  gem.files += Dir['app/**/*.rb']
15
15
  gem.files += Dir['lib/**/*.rb']
16
16
  gem.files.uniq! # TODO (CTI): figure out why I'm having to do this manipulation.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{engine-assets}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Corey Innis"]
12
- s.date = %q{2009-11-08}
12
+ s.date = %q{2009-11-12}
13
13
  s.description = %q{A Rails Engine, which enables Rails Engines to provide assets (javascript, css and images)}
14
14
  s.email = %q{support@coolerator.net}
15
15
  s.extra_rdoc_files = [
@@ -82,12 +82,12 @@ Gem::Specification.new do |s|
82
82
  s.specification_version = 3
83
83
 
84
84
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
85
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
85
+ s.add_development_dependency(%q<rspec>, [">= 1.2.8"])
86
86
  else
87
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
87
+ s.add_dependency(%q<rspec>, [">= 1.2.8"])
88
88
  end
89
89
  else
90
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
90
+ s.add_dependency(%q<rspec>, [">= 1.2.8"])
91
91
  end
92
92
  end
93
93
 
@@ -1,15 +1,10 @@
1
1
  module ActionView::Helpers::AssetTagHelper
2
- def expand_javascript_sources(sources, recursive = false)
2
+ def expand_javascript_sources_with_engine_assets(sources, recursive = false)
3
3
  if sources.include?(:all)
4
- all_javascript_files = collect_asset_files(JAVASCRIPTS_DIR, ('**' if recursive), '*.js')
5
- result = ((determine_source(:defaults, @@javascript_expansions).dup) + all_javascript_files).uniq
6
- result
4
+ return (determine_source(:defaults, @@javascript_expansions).dup | expand_javascript_sources_without_engine_assets(sources, recursive))
7
5
  else
8
- expanded_sources = sources.collect do |source|
9
- determine_source(source, @@javascript_expansions)
10
- end.flatten
11
- expanded_sources << "application" if sources.include?(:defaults) && File.exist?(File.join(JAVASCRIPTS_DIR, "application.js"))
12
- expanded_sources
6
+ raise NotImplementedError
13
7
  end
14
8
  end
9
+ alias_method_chain :expand_javascript_sources, :engine_assets
15
10
  end
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require 'spec/spec_helper'
2
2
 
3
3
  describe Rails::Plugin::Loader do
4
4
  attr_reader :loader, :plugin, :directory
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require 'spec/spec_helper'
2
2
 
3
3
  describe ActionController::Routing::RouteSet do
4
4
  describe "#load_routes!" do
@@ -22,7 +22,7 @@ describe ActionController::Routing::RouteSet do
22
22
 
23
23
  it "adds the engine-assets routes configuration" do
24
24
  routeset.load_routes!
25
- routeset.configuration_files[0].should =~ /engine-assets.*\/config\/routes\.rb/
25
+ routeset.configuration_files[0].should =~ /engine[-_ ]assets.*\/config\/routes\.rb/
26
26
  end
27
27
  end
28
28
  end
@@ -1,10 +1,11 @@
1
- require 'spec_helper'
1
+ require 'spec/spec_helper'
2
2
 
3
3
  describe EngineAssets::PublicLocator do
4
- attr_reader :base_path, :find_path, :miss_path
4
+ attr_reader :base_path, :full_path, :find_path, :miss_path
5
5
 
6
6
  before do
7
- @base_path = File.join(basedir, 'spec', 'support', 'fixtures', 'public')
7
+ @base_path = File.join('fixtures', 'public')
8
+ @full_path = File.join(basedir, 'spec', 'support', base_path)
8
9
  @find_path = '/javascripts/dual.js'
9
10
  @miss_path = '/javascripts/miss.js'
10
11
 
@@ -14,7 +15,7 @@ describe EngineAssets::PublicLocator do
14
15
  describe "#locate" do
15
16
  context "when the requested sub-path is located" do
16
17
  it "returns the full path to the file" do
17
- EngineAssets::PublicLocator.locate(find_path).should == File.join(base_path, find_path)
18
+ EngineAssets::PublicLocator.locate(find_path).should =~ /#{File.join(base_path, find_path)}/
18
19
  end
19
20
  end
20
21
 
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require 'spec/spec_helper'
2
2
 
3
3
  describe EngineAssets::JavascriptsController do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require 'spec/spec_helper'
2
2
 
3
3
  describe EngineAssets::StylesheetsController do
4
4
  before do
data/spec/spec_suite.rb CHANGED
@@ -1,19 +1,13 @@
1
1
  class SpecSuite
2
2
  def files
3
- dir = File.dirname(__FILE__)
4
3
  Dir["#{dir}/../spec/**/*_spec.rb"]
5
4
  end
6
5
 
7
6
  def run
8
- basedir = File.join(File.dirname(__FILE__), '..')
9
- libdir = File.join(basedir, 'lib')
10
- specdir = File.join(basedir, 'spec')
7
+ $LOAD_PATH.unshift(File.join(dir, '..'))
8
+ $LOAD_PATH.unshift(File.join(dir, '..', 'lib'))
11
9
 
12
- $LOAD_PATH.unshift(basedir)
13
- $LOAD_PATH.unshift(libdir)
14
- $LOAD_PATH.unshift(specdir)
15
-
16
- ARGV.concat ["--options", "#{specdir}/spec.opts"]
10
+ ARGV.concat ["--options", "#{dir}/spec.opts"]
17
11
 
18
12
  files.each do |file|
19
13
  require file
@@ -21,6 +15,10 @@ class SpecSuite
21
15
  result = ::Spec::Runner::CommandLine.run
22
16
  exit result
23
17
  end
18
+
19
+ def dir
20
+ @dir ||= File.dirname(__FILE__)
21
+ end
24
22
  end
25
23
 
26
24
  if $0 == __FILE__
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engine-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Innis
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-08 00:00:00 -05:00
12
+ date: 2009-11-12 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.2.9
23
+ version: 1.2.8
24
24
  version:
25
25
  description: A Rails Engine, which enables Rails Engines to provide assets (javascript, css and images)
26
26
  email: support@coolerator.net