dassets 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,5 @@
1
1
  require 'dassets'
2
2
 
3
- ENV['DASSETS_CONFIG_FILE'] ||= 'config/assets'
4
-
5
3
  module Dassets; end
6
4
  class Dassets::Runner
7
5
  UnknownCmdError = Class.new(ArgumentError)
@@ -17,7 +15,7 @@ class Dassets::Runner
17
15
  end
18
16
 
19
17
  def run
20
- require ENV['DASSETS_CONFIG_FILE']
18
+ Dassets.init
21
19
 
22
20
  case @cmd_name
23
21
  when 'digest'
@@ -1,3 +1,3 @@
1
1
  module Dassets
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/dassets.rb CHANGED
@@ -5,12 +5,15 @@ require 'dassets/version'
5
5
  require 'dassets/root_path'
6
6
  require 'dassets/digests_file'
7
7
 
8
+ ENV['DASSETS_ASSETS_FILE'] ||= 'config/assets'
9
+
8
10
  module Dassets
9
11
 
10
12
  def self.config; Config; end
11
13
  def self.configure(&block); Config.define(&block); end
12
14
 
13
15
  def self.init
16
+ require self.config.assets_file
14
17
  @digests_file = DigestsFile.new(self.config.digests_file_path)
15
18
  end
16
19
 
@@ -26,8 +29,9 @@ module Dassets
26
29
  class Config
27
30
  include NsOptions::Proxy
28
31
 
29
- option :root_path, Pathname, :required => true
30
- option :files_path, RootPath, :default => proc{ "app/assets/public" }
32
+ option :assets_file, Pathname, :default => ENV['DASSETS_ASSETS_FILE']
33
+ option :root_path, Pathname, :required => true
34
+ option :files_path, RootPath, :default => proc{ "app/assets/public" }
31
35
  option :digests_file_path, RootPath, :default => proc{ "app/assets/.digests" }
32
36
 
33
37
  end
data/test/helper.rb CHANGED
@@ -7,6 +7,7 @@ $LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
7
7
  # require pry for debugging (`binding.pry`)
8
8
  require 'pry'
9
9
 
10
- ENV['DASSETS_TEST_MODE'] = 'yes'
11
- ENV['DASSETS_CONFIG_FILE'] = 'test/support/config/assets'
12
- require ENV['DASSETS_CONFIG_FILE']
10
+ ENV['DASSETS_TEST_MODE'] = 'yes'
11
+ ENV['DASSETS_ASSETS_FILE'] = 'test/support/config/assets'
12
+ require 'dassets'
13
+ Dassets.init
@@ -9,7 +9,8 @@ class Dassets::Config
9
9
  desc "Dassets::Config"
10
10
  subject{ Dassets::Config }
11
11
 
12
- should have_option :root_path, Pathname, :required => true
12
+ should have_option :assets_file, Pathname, :default => ENV['DASSETS_ASSETS_FILE']
13
+ should have_option :root_path, Pathname, :required => true
13
14
  should have_options :files_path, :digests_file_path
14
15
 
15
16
  should "should use `apps/assets/public` as the default files path" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dassets
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Redding