rails-sprite 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41ba575c8da979b01cc802a4efa3081a2a9346bd
4
- data.tar.gz: 4f0ceea3ee3c79a2af2c2b96bc2b87fa79f71087
3
+ metadata.gz: 28356398d2a27b45b10a9aae7eb1fbeec2a568e9
4
+ data.tar.gz: 23eb22bb38f164387cc88b6ff8fac5da6bafb547
5
5
  SHA512:
6
- metadata.gz: 188b1f3beb1b562a430d770cb06c32cef9e473ca008679b85653b96ccc2de79a69f5123b385db2e38f1a9f6606a42c6ea335a63d47904b4421f8fdb79b04f0b4
7
- data.tar.gz: 55ad16c3a503c71920fc42c18f9f39d5f55476e3a1857a55811e2f2f8ef6f670015e4083b89c5b005056417059bd210edeedf3d073ea733c00c7e35c8449f36f
6
+ metadata.gz: 9ab758d4054121d87c2080b28318eefbe2bc27aabfb7d1aa4eeba0fef84ea0e854b40304dc5eead62a23e65c9c760e5a6a29f03c0d2c3622269ac295d1c7ec90
7
+ data.tar.gz: 8ef7009ab864f4459abfa0e3415e6255f4d4fa4a7242a233b2976cad109b10e9966573a6af172cf8f471b218822950054903efde053eae521421b416edbcf083
@@ -9,6 +9,7 @@ module RailsSprite
9
9
  :css_extend, :file_extend_name
10
10
 
11
11
  #
12
+ # :css_extend => "",
12
13
  # :root_path => '.',
13
14
  # :scope_name => "rails_xxx",
14
15
  # :recipe_path => "icons/16x16",
@@ -33,6 +33,8 @@ module RailsSprite
33
33
  css_filt_content = case css_extend
34
34
  when '.css.scss.erb', '.scss.erb'
35
35
  composite_css_scss_erb(result)
36
+ when '.css', '.scss'
37
+ composite_css_scss(result)
36
38
  else
37
39
  end
38
40
 
@@ -45,6 +47,25 @@ module RailsSprite
45
47
  result
46
48
  end
47
49
 
50
+ def self.composite_css_scss result
51
+ styles = []
52
+
53
+ styles << <<-END_CSS
54
+ // 将下面3行,放入页面中(仅供参考)
55
+ // .#{result[:css_class_shared]} {
56
+ // background: url(<%= static_url("#{result[:image_scope_name]}") %>) no-repeat;
57
+ // }
58
+ END_CSS
59
+
60
+ result[:styles].each do |style|
61
+ styles << <<-END_CSS
62
+ .#{style[:class]} {
63
+ background-position: #{style[:x]} -#{style[:y]};
64
+ }
65
+ END_CSS
66
+ end
67
+ end
68
+
48
69
  def self.composite_css_scss_erb result
49
70
  styles = []
50
71
 
@@ -1,3 +1,3 @@
1
1
  module RailsSprite
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -12,6 +12,16 @@ class RailsSpriteTest < ActiveSupport::TestCase
12
12
  :recipe_path => "icons/32x32",
13
13
  :css_class_shared => 'rails_xxx-icon',
14
14
  :css_class_prefix => 'icons-32x32-'
15
+
16
+ # :root_path => '.',
17
+ # :scope_name => "rails_xxx",
18
+ # :recipe_path => "icons/16x16",
19
+ # :file_extend => '.png',
20
+ # :spacing => 10,
21
+ # :image_to_folder => "app/assets/images",
22
+ # :image_source_folder => 'app/assets/images/rails_xxx/sprite_sources',
23
+ # :stylesheet_to => "app/assets/stylesheets/rails_xxx/sprite/icons/16x16.css.scss.erb",
24
+ # :image_to_file_path => "rails_xxx/sprite/icons/16x16.png"
15
25
  )
16
26
 
17
27
  util.perform
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sprite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - happy