active_assets 0.3.1 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/README.md +34 -22
  2. data/Rakefile +2 -0
  3. data/active_assets.gemspec +2 -5
  4. data/lib/active_assets.rb +3 -11
  5. data/lib/active_assets/active_expansions.rb +10 -17
  6. data/lib/active_assets/active_expansions/assets.rb +1 -1
  7. data/lib/active_assets/active_expansions/configurable.rb +14 -0
  8. data/lib/active_assets/active_expansions/expansion.rb +1 -0
  9. data/lib/active_assets/active_expansions/expansions.rb +5 -13
  10. data/lib/active_assets/active_expansions/railtie.rb +1 -1
  11. data/lib/active_assets/active_sprites.rb +31 -14
  12. data/lib/active_assets/active_sprites/configurable.rb +13 -0
  13. data/lib/active_assets/active_sprites/railtie.rb +1 -1
  14. data/lib/active_assets/active_sprites/runners/abstract_runner.rb +11 -23
  15. data/lib/active_assets/active_sprites/sprite_piece.rb +2 -0
  16. data/lib/active_assets/active_sprites/sprites.rb +14 -20
  17. data/lib/tasks/active_expansions/cache.rake +6 -0
  18. data/lib/tasks/active_sprites/sprites.rake +5 -0
  19. data/test/active_assets/active_expansions/expansions_test.rb +0 -12
  20. data/test/helper.rb +5 -2
  21. data/test/support/rails_helper.rb +5 -17
  22. metadata +52 -227
  23. data/lib/active_assets/rails2_support.rb +0 -32
  24. data/rails_generators/active_assets/USAGE +0 -0
  25. data/rails_generators/active_assets/active_assets_generator.rb +0 -8
  26. data/rails_generators/active_assets/templates/active_assets.rake +0 -4
  27. data/rails_generators/active_assets/templates/active_assets.rb +0 -57
  28. data/test/fixtures/rails_root_23/Rakefile +0 -10
  29. data/test/fixtures/rails_root_23/config/assets/assets.rb +0 -71
  30. data/test/fixtures/rails_root_23/config/boot.rb +0 -113
  31. data/test/fixtures/rails_root_23/config/environment.rb +0 -41
  32. data/test/fixtures/rails_root_23/config/environments/development.rb +0 -17
  33. data/test/fixtures/rails_root_23/config/environments/production.rb +0 -28
  34. data/test/fixtures/rails_root_23/config/environments/test.rb +0 -28
  35. data/test/fixtures/rails_root_23/config/initializers/active_assets.rb +0 -53
  36. data/test/fixtures/rails_root_23/config/initializers/backtrace_silencers.rb +0 -7
  37. data/test/fixtures/rails_root_23/config/initializers/cookie_verification_secret.rb +0 -7
  38. data/test/fixtures/rails_root_23/config/initializers/inflections.rb +0 -10
  39. data/test/fixtures/rails_root_23/config/initializers/mime_types.rb +0 -5
  40. data/test/fixtures/rails_root_23/config/initializers/new_rails_defaults.rb +0 -21
  41. data/test/fixtures/rails_root_23/config/initializers/session_store.rb +0 -15
  42. data/test/fixtures/rails_root_23/config/locales/en.yml +0 -5
  43. data/test/fixtures/rails_root_23/config/routes.rb +0 -43
  44. data/test/fixtures/rails_root_23/config/sprites.rb +0 -14
  45. data/test/fixtures/rails_root_23/log/test.log +0 -1
  46. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite3/1.png +0 -0
  47. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite3/2.png +0 -0
  48. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Argentina.png +0 -0
  49. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Australia.png +0 -0
  50. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Austria.png +0 -0
  51. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Belgium.png +0 -0
  52. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Brazil.png +0 -0
  53. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Cameroon.png +0 -0
  54. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Canada.png +0 -0
  55. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Chile.png +0 -0
  56. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/China.png +0 -0
  57. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Denmark.png +0 -0
  58. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Finland.png +0 -0
  59. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/France.png +0 -0
  60. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Germany.png +0 -0
  61. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Greece.png +0 -0
  62. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Hong Kong.png +0 -0
  63. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Hungary.png +0 -0
  64. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Iceland.png +0 -0
  65. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/India.png +0 -0
  66. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Indonesia.png +0 -0
  67. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Ireland.png +0 -0
  68. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Israel.png +0 -0
  69. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Italy.png +0 -0
  70. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Japan.png +0 -0
  71. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Malaysia.png +0 -0
  72. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Mexico.png +0 -0
  73. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/New Zealand.png +0 -0
  74. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Norway.png +0 -0
  75. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Pakistan.png +0 -0
  76. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Palestine.png +0 -0
  77. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Peru.png +0 -0
  78. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Poland.png +0 -0
  79. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Portugal.png +0 -0
  80. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Puerto Rico.png +0 -0
  81. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Romania.png +0 -0
  82. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Russia.png +0 -0
  83. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Saudi Arabia.png +0 -0
  84. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Singapore.png +0 -0
  85. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/South Africa.png +0 -0
  86. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/South Korea.png +0 -0
  87. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Spain.png +0 -0
  88. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Sweden.png +0 -0
  89. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Switzerland.png +0 -0
  90. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Thailand.png +0 -0
  91. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/The Netherlands.png +0 -0
  92. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Turkey.png +0 -0
  93. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/UK.png +0 -0
  94. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/USA.png +0 -0
  95. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Ukraine.png +0 -0
  96. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Uruguay.png +0 -0
  97. data/test/fixtures/rails_root_23/public/images/sprite_images/sprite4/Venezuela.png +0 -0
  98. data/test/fixtures/rails_root_23/public/javascripts/bar/bas.js +0 -1
  99. data/test/fixtures/rails_root_23/public/javascripts/bas/bar.js +0 -1
  100. data/test/fixtures/rails_root_23/public/stylesheets/bar/bas.css +0 -1
  101. data/test/fixtures/rails_root_23/public/stylesheets/bas/bar.css +0 -1
@@ -1,32 +0,0 @@
1
- gem 'rails', '< 3.0.0.beta' # Prevent mistakes loading this against rails 3
2
-
3
- require 'initializer'
4
- require 'active_support/ordered_hash'
5
- require 'active_support/ordered_options'
6
-
7
- module Rails
8
-
9
- class Application
10
- def config
11
- Rails.configuration
12
- end unless methods.grep(/^config$/).any? # Use grep + regexp for 1.8 + 1.9
13
- end
14
-
15
- class << self
16
- alias config configuration unless respond_to?(:config)
17
- end
18
-
19
- def self.application
20
- @application ||= Application.new
21
- end
22
-
23
- class Configuration
24
- def active_expansions
25
- @active_expansions ||= ActiveSupport::OrderedOptions.new
26
- end
27
-
28
- def active_sprites
29
- @active_sprites ||= ActiveSupport::OrderedOptions.new
30
- end
31
- end
32
- end
File without changes
@@ -1,8 +0,0 @@
1
- class ActiveAssetsGenerator < Rails::Generator::Base
2
- def manifest
3
- record do |m|
4
- m.file 'active_assets.rb', 'config/initializers/active_assets.rb'
5
- m.file 'active_assets.rake', 'lib/tasks/active_assets.rake'
6
- end
7
- end
8
- end
@@ -1,4 +0,0 @@
1
- require 'active_assets'
2
-
3
- ActiveAssets::ActiveExpansions.define_tasks
4
- ActiveAssets::ActiveSprites.define_tasks
@@ -1,57 +0,0 @@
1
- require 'active_assets'
2
- require 'rails/active_assets'
3
-
4
- Rails.application.extend Rails::ActiveAssets
5
-
6
- module ActiveAssets
7
- module ActiveExpansions
8
- def self.boot!
9
- if Rails.application.config.active_expansions.respond_to?(:precache_assets)
10
- Expansions.precache_assets = Rails.application.config.active_expansions.precache_assets
11
- end
12
-
13
- options = Rails.application.config.active_expansions
14
- options.each { |k,v| send("#{k}=", v) }
15
-
16
- load_active_expansions(Rails.root)
17
-
18
- Rails.application.expansions.javascripts.register!
19
- Rails.application.expansions.stylesheets.register!
20
-
21
- if Expansions.precache_assets
22
- Rails.application.expansions.javascripts.cache!
23
- Rails.application.expansions.stylesheets.cache!
24
- end
25
- end
26
-
27
- private
28
- def self.load_active_expansions(root)
29
- if File.exists?(File.join(root, 'config/assets.rb'))
30
- load File.join(root, 'config/assets.rb')
31
- elsif File.directory?(File.join(root, 'config/assets'))
32
- Dir[File.join(root, 'config/assets/*.rb')].each do |f|
33
- load f
34
- end
35
- end
36
- end
37
- end
38
-
39
- module ActiveSprites
40
- def self.boot!
41
- if Rails.application.config.active_sprites.respond_to?(:sprite_backend)
42
- Sprites.sprite_backend = Rails.application.config.active_sprites.sprite_backend
43
- end
44
-
45
- load_sprite_definition
46
- end
47
-
48
- private
49
- def self.load_sprite_definition
50
- config_path = File.join(Rails.root, 'config')
51
- load File.join(config_path, 'sprites.rb') if File.exists?(File.join(config_path, 'sprites.rb'))
52
- end
53
- end
54
- end
55
-
56
- ActiveAssets::ActiveExpansions.boot!
57
- ActiveAssets::ActiveSprites.boot!
@@ -1,10 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5
-
6
- require 'rake'
7
- require 'rake/testtask'
8
- require 'rake/rdoctask'
9
-
10
- require 'tasks/rails'
@@ -1,71 +0,0 @@
1
- Rails.application.expansions.register do
2
- expansion :defaults, :type => :js do
3
- _'bas/bar'
4
- _'bar/bas'
5
- end
6
-
7
- js do
8
- expansion :bas do
9
- _'bas/bar'
10
- _'bar/bas'
11
- end
12
- end
13
-
14
- css do
15
- expansion :bas do
16
- _'bas/bar'
17
- _'bar/bas'
18
- end
19
- end
20
-
21
- # for ExpansionsTest#asset_test_7
22
- expansion :jazz do
23
- js do
24
- _'bas/bar'
25
- _'bar/bas'
26
- end
27
-
28
- css do
29
- _'bas/bar'
30
- _'bar/bas'
31
- end
32
- end
33
-
34
- # for ExpansionsTest#asset_test_8
35
- group :development do
36
- expansion :dev do
37
- asset 'bas/bar', :type => :js
38
- asset 'bas/bar', :type => :css
39
- end
40
- end
41
-
42
- group :development do
43
- expansion :dev2 do
44
- js do
45
- _'bas/bar'
46
- _'bar/bas'
47
- end
48
- end
49
- end
50
-
51
- expansion :envs do
52
- group :development do
53
- a 'bar/bas', :type => :css
54
- js do
55
- _'bar/bas'
56
- end
57
- end
58
- end
59
-
60
- expansion :envs2, :type => :js do
61
- group :development do
62
- _'bas/bar'
63
- _'bar/bas'
64
- end
65
- end
66
-
67
- expansion :basfoo do
68
- _'bas/bar.js'
69
- _'bar/bas.js'
70
- end
71
- end
@@ -1,113 +0,0 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
3
-
4
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
-
6
- module Rails
7
- class << self
8
- def boot!
9
- unless booted?
10
- preinitialize
11
- pick_boot.run
12
- end
13
- end
14
-
15
- def booted?
16
- defined? Rails::Initializer
17
- end
18
-
19
- def pick_boot
20
- (vendor_rails? ? VendorBoot : GemBoot).new
21
- end
22
-
23
- def vendor_rails?
24
- File.exist?("#{RAILS_ROOT}/vendor/rails")
25
- end
26
-
27
- def preinitialize
28
- load(preinitializer_path) if File.exist?(preinitializer_path)
29
- end
30
-
31
- def preinitializer_path
32
- "#{RAILS_ROOT}/config/preinitializer.rb"
33
- end
34
- end
35
-
36
- class Boot
37
- def run
38
- load_initializer
39
- Rails::Initializer.run(:set_load_path)
40
- end
41
- end
42
-
43
- class VendorBoot < Boot
44
- def load_initializer
45
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46
- Rails::Initializer.run(:install_gem_spec_stubs)
47
- Rails::GemDependency.add_frozen_gem_path
48
- end
49
- end
50
-
51
- class GemBoot < Boot
52
- def load_initializer
53
- self.class.load_rubygems
54
- load_rails_gem
55
- require 'initializer'
56
- end
57
-
58
- def load_rails_gem
59
- if version = self.class.gem_version
60
- gem 'rails', version
61
- else
62
- gem 'rails'
63
- end
64
- rescue Gem::LoadError => load_error
65
- if load_error.message =~ /Could not find RubyGem rails/
66
- STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
67
- exit 1
68
- else
69
- raise
70
- end
71
- end
72
-
73
- class << self
74
- def rubygems_version
75
- Gem::RubyGemsVersion rescue nil
76
- end
77
-
78
- def gem_version
79
- if defined? RAILS_GEM_VERSION
80
- RAILS_GEM_VERSION
81
- elsif ENV.include?('RAILS_GEM_VERSION')
82
- ENV['RAILS_GEM_VERSION']
83
- else
84
- parse_gem_version(read_environment_rb)
85
- end
86
- end
87
-
88
- def load_rubygems
89
- min_version = '1.3.2'
90
- require 'rubygems'
91
- unless rubygems_version >= min_version
92
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
93
- exit 1
94
- end
95
-
96
- rescue LoadError
97
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
98
- exit 1
99
- end
100
-
101
- def parse_gem_version(text)
102
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
103
- end
104
-
105
- private
106
- def read_environment_rb
107
- File.read("#{RAILS_ROOT}/config/environment.rb")
108
- end
109
- end
110
- end
111
- end
112
- # All that for this:
113
- Rails.boot!
@@ -1,41 +0,0 @@
1
- # Be sure to restart your server when you modify this file
2
-
3
- # Specifies gem version of Rails to use when vendor/rails is not present
4
- RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
5
-
6
- # Bootstrap the Rails environment, frameworks, and default configuration
7
- require File.join(File.dirname(__FILE__), 'boot')
8
-
9
- Rails::Initializer.run do |config|
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Add additional load paths for your own custom dirs
15
- # config.autoload_paths += %W( #{RAILS_ROOT}/extras )
16
-
17
- # Specify gems that this application depends on and have them installed with rake gems:install
18
- # config.gem "bj"
19
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
20
- # config.gem "sqlite3-ruby", :lib => "sqlite3"
21
- # config.gem "aws-s3", :lib => "aws/s3"
22
-
23
- # Only load the plugins named here, in the order given (default is alphabetical).
24
- # :all can be used as a placeholder for all plugins not explicitly named
25
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
-
27
- # Skip frameworks you're not going to use. To use Rails without a database,
28
- # you must remove the Active Record framework.
29
- config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
30
-
31
- # Activate observers that should always be running
32
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
33
-
34
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35
- # Run "rake -D time" for a list of tasks for finding time zone names.
36
- config.time_zone = 'UTC'
37
-
38
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
40
- # config.i18n.default_locale = :de
41
- end
@@ -1,17 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # In the development environment your application's code is reloaded on
4
- # every request. This slows down response time but is perfect for development
5
- # since you don't have to restart the webserver when you make code changes.
6
- config.cache_classes = false
7
-
8
- # Log error messages when you accidentally call methods on nil.
9
- config.whiny_nils = true
10
-
11
- # Show full error reports and disable caching
12
- config.action_controller.consider_all_requests_local = true
13
- config.action_view.debug_rjs = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
@@ -1,28 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The production environment is meant for finished, "live" apps.
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Full error reports are disabled and caching is turned on
8
- config.action_controller.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
- config.action_view.cache_template_loading = true
11
-
12
- # See everything in the log (default is :info)
13
- # config.log_level = :debug
14
-
15
- # Use a different logger for distributed setups
16
- # config.logger = SyslogLogger.new
17
-
18
- # Use a different cache store in production
19
- # config.cache_store = :mem_cache_store
20
-
21
- # Enable serving of images, stylesheets, and javascripts from an asset server
22
- # config.action_controller.asset_host = "http://assets.example.com"
23
-
24
- # Disable delivery errors, bad email addresses will be ignored
25
- # config.action_mailer.raise_delivery_errors = false
26
-
27
- # Enable threaded mode
28
- # config.threadsafe!
@@ -1,28 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The test environment is used exclusively to run your application's
4
- # test suite. You never need to work with it otherwise. Remember that
5
- # your test database is "scratch space" for the test suite and is wiped
6
- # and recreated between test runs. Don't rely on the data there!
7
- config.cache_classes = true
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.action_controller.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
- config.action_view.cache_template_loading = true
16
-
17
- # Disable request forgery protection in test environment
18
- config.action_controller.allow_forgery_protection = false
19
-
20
- # Tell Action Mailer not to deliver emails to the real world.
21
- # The :test delivery method accumulates sent emails in the
22
- # ActionMailer::Base.deliveries array.
23
- config.action_mailer.delivery_method = :test
24
-
25
- # Use SQL instead of Active Record's schema dumper when creating the test database.
26
- # This is necessary if your schema can't be completely dumped by the schema dumper,
27
- # like if you have constraints or database-specific column types
28
- # config.active_record.schema_format = :sql
@@ -1,53 +0,0 @@
1
- require 'rails/active_assets'
2
-
3
- Rails.application.extend Rails::ActiveAssets
4
-
5
- module ActiveAssets
6
- module ActiveExpansions
7
- def self.boot!
8
- if Rails.application.config.active_expansions.respond_to?(:precache_assets)
9
- Expansions.precache_assets = Rails.application.config.active_expansions.precache_assets
10
- end
11
-
12
- options = Rails.application.config.active_expansions
13
- options.each { |k,v| send("#{k}=", v) }
14
-
15
- load_active_expansions(Rails.root)
16
-
17
- Rails.application.expansions.javascripts.register!
18
- Rails.application.expansions.stylesheets.register!
19
-
20
- if Expansions.precache_assets
21
- Rails.application.expansions.javascripts.cache!
22
- Rails.application.expansions.stylesheets.cache!
23
- end
24
- end
25
-
26
- private
27
- def load_active_expansions(root)
28
- if File.exists?(File.join(root, 'config/assets.rb'))
29
- load File.join(root, 'config/assets.rb')
30
- elsif File.directory?(File.join(root, 'config/assets'))
31
- Dir[File.join(root, 'config/assets/*.rb')].each do |f|
32
- load f
33
- end
34
- end
35
- end
36
- end
37
-
38
- module ActiveSprites
39
- def self.boot!
40
- if Rails.application.config.active_sprites.respond_to?(:sprite_backend)
41
- Sprites.sprite_backend = Rails.application.config.active_sprites.sprite_backend
42
- end
43
-
44
- load_sprite_definition
45
- end
46
-
47
- private
48
- def load_sprite_definition
49
- config_path = File.join(Rails.root, 'config')
50
- load File.join(config_path, 'sprites.rb') if File.exists?(File.join(config_path, 'sprites.rb'))
51
- end
52
- end
53
- end