rails_sprite 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5d585bec2939a29daa6fc0abbc00e44584eedbc
4
- data.tar.gz: 118e6f1f3037aecf451c51c6f6b555dcd7fb28bb
3
+ metadata.gz: d5c9312fa695fc72d1e10fc8b2e7181fc7447242
4
+ data.tar.gz: f257efb8223a9cb0e739484ecccf39e88ed2bf4d
5
5
  SHA512:
6
- metadata.gz: 187b4af6c99ccd73a749b7a685ffd8a00cad1ccd767ff5865cf4db6c5fe13c30d5efda4c97a0ad51564497bdf7e314254ff870075a37f57268c3cce16bb3a430
7
- data.tar.gz: 5125aadda8c0cf1c9144eab18524024ae7d8071b51821cf5830b4649b1504ec07f504d68b35fc3760e37862c0a3e0a36724d08da2b765da41faca777f57f2438
6
+ metadata.gz: 5b8c858a48a9cd718aee7fffb98ea8112deed37daaf6cfad2925dc61df927a2cca66a11545db9b38419ff38705ad52b73e3a529d50518183b59e47cee83f67a2
7
+ data.tar.gz: 91d0ca6040225156c9d4b3dcebf1a051c7e9c02643ec294be987a456b54d1b168a1a918178cf4728664b6161096d86cf9085f5baffe01f72fb4b57c6b97ad677
data/README.md CHANGED
@@ -20,15 +20,12 @@
20
20
 
21
21
  simple:
22
22
 
23
- RailsSprite.sprite(
24
- :root_path => "#{File.dirpath(__FILE__)}/..",
25
- :scope_name => "rails_xxx/",
26
- :recipe_path => "icons/16x16",
27
- :file_extend => '.png',
28
- :spacing => 10,
29
- :css_class_shared => 'rails_xxx-icon',
30
- :css_class_prefix => 'icons-16x16-'
31
- )
32
-
23
+ ::RailsSprite.sprite(
24
+ :root_path => "#{::File.dirname(__FILE__)}/..",
25
+ :scope_name => "rails_app_name/",
26
+ :recipe_path => "icons/16x16",
27
+ :css_class_prefix => "u-icons-16x16-",
28
+ :spacing => 10
29
+ )
33
30
 
34
31
  ```
@@ -134,6 +134,8 @@ module RailsSprite
134
134
  target.composite!(file_info[:image], file_info[:x], file_info[:y], Magick::SrcOverCompositeOp)
135
135
  end
136
136
 
137
+ system "mkdir -p #{::File.dirname(image_to_file_path)}"
138
+
137
139
  target.write(image_to_file_path)
138
140
  end
139
141
 
@@ -47,21 +47,30 @@ module RailsSprite
47
47
  def self.composite_css_scss_erb result
48
48
  styles = []
49
49
 
50
- styles << <<-END_CSS
51
- .#{result[:css_class_shared]} {
52
- background: url(<%= image_path("#{result[:image_scope_name]}") %>) no-repeat;
53
- }
54
- END_CSS
55
-
56
50
  result[:styles].each do |style|
57
51
  styles << <<-END_CSS
58
52
  .#{style[:class]} {
59
- background-position: #{style[:x]} -#{style[:y]};
53
+ background: url(<%= image_path("#{result[:image_scope_name]}") %>) #{style[:x]} -#{style[:y]} no-repeat;
60
54
  }
61
55
  END_CSS
62
56
  end
63
57
 
64
58
 
59
+ # styles << <<-END_CSS
60
+ # .#{result[:css_class_shared]} {
61
+ # background: url(<%= image_path("#{result[:image_scope_name]}") %>) no-repeat;
62
+ # }
63
+ # END_CSS
64
+
65
+ # result[:styles].each do |style|
66
+ # styles << <<-END_CSS
67
+ #.#{style[:class]} {
68
+ # background-position: #{style[:x]} -#{style[:y]};
69
+ #}
70
+ # END_CSS
71
+ # end
72
+
73
+
65
74
  styles.join("\n")
66
75
  end
67
76
 
@@ -1,3 +1,3 @@
1
1
  module RailsSprite
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_sprite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - WangJinzhong
7
+ - happy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: Description of RailsSprite.
55
+ description: Rails CSS Sprite Utils.
56
56
  email:
57
57
  - andywang7259@163.com
58
58
  executables: []
@@ -109,6 +109,7 @@ files:
109
109
  - test/dummy/public/favicon.ico
110
110
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite/icons/16x16.png
111
111
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite/icons/32x32.png
112
+ - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/128x128/mail.png
112
113
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/16x16/avatar.png
113
114
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/16x16/heart-rose.png
114
115
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/16x16/mail.png
@@ -118,7 +119,7 @@ files:
118
119
  - test/fixtures/testing/app/assets/stylesheets/rails_xxx/sprite/icons/32x32.css.scss.erb
119
120
  - test/rails_sprite_test.rb
120
121
  - test/test_helper.rb
121
- homepage: http://github.com
122
+ homepage: http://github.com/gialib/rails-sprite.git
122
123
  licenses:
123
124
  - MIT
124
125
  metadata: {}
@@ -141,7 +142,7 @@ rubyforge_project:
141
142
  rubygems_version: 2.4.5
142
143
  signing_key:
143
144
  specification_version: 4
144
- summary: Summary of RailsSprite.
145
+ summary: Rails CSS Sprite Utils.
145
146
  test_files:
146
147
  - test/dummy/app/assets/javascripts/application.js
147
148
  - test/dummy/app/assets/stylesheets/application.css
@@ -184,6 +185,7 @@ test_files:
184
185
  - test/dummy/README.rdoc
185
186
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite/icons/16x16.png
186
187
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite/icons/32x32.png
188
+ - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/128x128/mail.png
187
189
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/16x16/avatar.png
188
190
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/16x16/heart-rose.png
189
191
  - test/fixtures/testing/app/assets/images/rails_xxx/sprite_sources/icons/16x16/mail.png