dresser 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +18 -19
- data/lib/dresser/configuration.rb +3 -1
- data/lib/dresser/railtie.rb +9 -10
- data/lib/dresser/version.rb +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
|
3
3
|
Simple gem that helps to organise paths like so:
|
4
4
|
|
5
|
-
app/
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
app/
|
6
|
+
assets/
|
7
|
+
models/
|
8
|
+
themes/
|
9
|
+
theme_name_1/
|
10
|
+
views/
|
11
|
+
javascripts/
|
12
|
+
styleseets/
|
13
|
+
theme_name_2/
|
14
|
+
views/
|
15
|
+
javascripts/
|
16
|
+
styleseets/
|
17
17
|
|
18
18
|
## Installation
|
19
19
|
|
@@ -31,13 +31,12 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
## Usage
|
33
33
|
|
34
|
-
cd #{your_rails_app}
|
35
|
-
mkdir -p app/themes/default/
|
36
|
-
mv app/views app/themes/default/
|
37
|
-
mv app/assets/javascripts app/themes/default/
|
38
|
-
mv app/assets/stylesheets app/themes/default/
|
39
|
-
|
40
|
-
echo "Dresser.config.default_theme = 'default' > config/initializers/dresser.rb"
|
34
|
+
cd #{your_rails_app}
|
35
|
+
mkdir -p app/themes/default/
|
36
|
+
mv app/views app/themes/default/
|
37
|
+
mv app/assets/javascripts app/themes/default/
|
38
|
+
mv app/assets/stylesheets app/themes/default/
|
39
|
+
echo "Dresser.config.default_theme = 'default' > config/initializers/dresser.rb"
|
41
40
|
|
42
41
|
TODO: Add generator for this.
|
43
42
|
|
data/lib/dresser/railtie.rb
CHANGED
@@ -4,22 +4,12 @@ require 'rails/generators/named_base'
|
|
4
4
|
|
5
5
|
module Dresser
|
6
6
|
class Railtie < Rails::Railtie
|
7
|
-
|
8
7
|
initializer 'dresser.override_namedbase_generator' do
|
9
8
|
config.after_initialize do
|
10
9
|
Rails::Generators::NamedBase.send(:include, Dresser::NamedBase)
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
|
-
initializer 'dresser.append_assets_path', :group => :all do |app|
|
15
|
-
app.config.assets.paths.unshift "#{Rails.root}/app/themes/#{Dresser.config.default_theme}/images"
|
16
|
-
app.config.assets.paths.unshift "#{Rails.root}/app/themes/#{Dresser.config.default_theme}/stylesheets"
|
17
|
-
app.config.assets.paths.unshift "#{Rails.root}/app/themes/#{Dresser.config.default_theme}/javascripts"
|
18
|
-
# app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
|
19
|
-
# app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
|
20
|
-
# app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
|
21
|
-
end
|
22
|
-
|
23
13
|
initializer 'dresser.apply_views_paths' do
|
24
14
|
ActiveSupport.on_load(:action_controller) do
|
25
15
|
view_paths.unshift("app/themes/#{Dresser.config.default_theme}/views")
|
@@ -28,5 +18,14 @@ module Dresser
|
|
28
18
|
end
|
29
19
|
end
|
30
20
|
|
21
|
+
initializer 'dresser.append_assets_path', :after => :load_config_initializers do |app|
|
22
|
+
app.config.assets.paths.unshift "#{Rails.root}/app/themes/#{Dresser.config.default_theme}/images"
|
23
|
+
app.config.assets.paths.unshift "#{Rails.root}/app/themes/#{Dresser.config.default_theme}/stylesheets"
|
24
|
+
app.config.assets.paths.unshift "#{Rails.root}/app/themes/#{Dresser.config.default_theme}/javascripts"
|
25
|
+
# app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
|
26
|
+
# app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
|
27
|
+
# app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
|
28
|
+
end
|
29
|
+
|
31
30
|
end
|
32
31
|
end
|
data/lib/dresser/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dresser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-22 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Simple gem that changes paths for views and assets
|
15
15
|
email:
|
@@ -58,3 +58,4 @@ signing_key:
|
|
58
58
|
specification_version: 3
|
59
59
|
summary: Simple gem that changes paths for views and assets
|
60
60
|
test_files: []
|
61
|
+
has_rdoc:
|