zfben_rails_assets 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,5 @@
|
|
1
|
-
def p str
|
2
|
-
STDOUT.puts str.color(:black).background(:white)
|
3
|
-
end
|
4
|
-
|
5
1
|
def sys cmd
|
6
|
-
|
2
|
+
STDOUT.puts str.color(:black).background(:white)
|
7
3
|
system cmd
|
8
4
|
end
|
9
5
|
|
@@ -14,7 +10,7 @@ end
|
|
14
10
|
|
15
11
|
namespace :assets do
|
16
12
|
task :clear_assets do
|
17
|
-
p 'Clear old assets'
|
13
|
+
p '== Clear old assets'
|
18
14
|
js_path = File.join(Rails.root, 'app', 'assets', 'javascripts', 'zff')
|
19
15
|
css_path = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'zff')
|
20
16
|
img_path = File.join(Rails.root, 'app', 'assets', 'images', 'zff')
|
@@ -25,28 +21,16 @@ namespace :assets do
|
|
25
21
|
|
26
22
|
desc 'add assets files to app/assets'
|
27
23
|
task :add_assets => :clear_assets do
|
28
|
-
p 'Add assets'
|
24
|
+
p '== Add assets'
|
29
25
|
sys 'cp -Ruf ' << File.join(ZfbenRailsAssetsPath, 'assets') << ' ' << File.join(Rails.root, 'app')
|
30
26
|
end
|
31
27
|
|
32
|
-
task :clear_config do
|
33
|
-
p 'Clear old config'
|
34
|
-
config_path = File.join(Rails.root, 'config', 'compass.rb')
|
35
|
-
sys('rm ' + config_path) if File.exists?(config_path)
|
36
|
-
end
|
37
|
-
|
38
|
-
desc 'add config files to config'
|
39
|
-
task :add_config => :clear_config do
|
40
|
-
p 'Add config'
|
41
|
-
sys 'cp -Ruf ' << File.join(ZfbenRailsAssetsPath, 'config', 'compass.rb') << ' ' << File.join(Rails.root, 'config')
|
42
|
-
end
|
43
|
-
|
44
28
|
task :clear_gem do
|
45
29
|
gem_path = File.join(Rails.root, 'Gemfile')
|
46
30
|
unless File.exists? gem_path
|
47
31
|
err 'Gemfile is not exists'
|
48
32
|
else
|
49
|
-
p 'Clear old gems'
|
33
|
+
p '== Clear old gems'
|
50
34
|
file = File.open(gem_path).readlines.join('')
|
51
35
|
regexp = /(\n)?# Added by zfben_rails_assets.*# End zfben_rails_assets/im
|
52
36
|
File.open(gem_path, 'w'){ |f| f.write(file.gsub(regexp, '')) } if file =~ regexp
|
@@ -55,7 +39,7 @@ namespace :assets do
|
|
55
39
|
|
56
40
|
desc 'add Gemfile'
|
57
41
|
task :add_gem => :clear_gem do
|
58
|
-
p 'Add gems'
|
42
|
+
p '== Add gems'
|
59
43
|
gem_path = File.join(Rails.root, 'Gemfile')
|
60
44
|
file = File.open(gem_path).readlines
|
61
45
|
file.push "\n# Added by zfben_rails_assets\n\n" << File.open(File.join(ZfbenRailsAssetsPath, 'Gemfile')).readlines.join('') << "\n# End zfben_rails_assets"
|
@@ -63,11 +47,11 @@ namespace :assets do
|
|
63
47
|
end
|
64
48
|
|
65
49
|
desc 'install zfben_rails_assets'
|
66
|
-
task :install => [:add_gem, :
|
50
|
+
task :install => [:add_gem, :add_assets] do
|
67
51
|
p ''
|
68
|
-
p 'Please run `bundle install`'
|
52
|
+
p '!! Please run `bundle install`'
|
69
53
|
end
|
70
54
|
|
71
55
|
desc 'uninstall zfben_rails_assets'
|
72
|
-
task :uninstall => [:clear_gem, :
|
56
|
+
task :uninstall => [:clear_gem, :clear_assets]
|
73
57
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: zfben_rails_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ben
|
@@ -105,8 +105,6 @@ files:
|
|
105
105
|
- lib/zfben_rails_assets/assets/stylesheets/zff/lib/qunit.css
|
106
106
|
- lib/zfben_rails_assets/assets/stylesheets/zff/reset.sass
|
107
107
|
- lib/zfben_rails_assets/assets/stylesheets/zff/spec.css
|
108
|
-
- lib/zfben_rails_assets/config/compass.rb
|
109
|
-
- lib/zfben_rails_assets/config/sass.rb
|
110
108
|
- lib/zfben_rails_assets/tasks.rb
|
111
109
|
- lib/zfben_rails_assets/version.rb
|
112
110
|
- zfben_rails_assets.gemspec
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# This configuration file works with both the Compass command line tool and within Rails.
|
2
|
-
# Require any additional compass plugins here.
|
3
|
-
project_type = :rails
|
4
|
-
project_path = Compass::AppIntegration::Rails.root
|
5
|
-
# Set this to the root of your project when deployed:
|
6
|
-
http_path = "/"
|
7
|
-
css_dir = "public/assets"
|
8
|
-
sass_dir = "app/assets/stylesheets"
|
9
|
-
environment = Compass::AppIntegration::Rails.env
|
10
|
-
# To enable relative paths to assets via compass helper functions. Uncomment:
|
11
|
-
# relative_assets = true
|