rails-sprite 0.0.2 → 0.0.3

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: f157a0f5de96f72a61f81f0ebfa2335ed77ae7ff
4
- data.tar.gz: 14fd846978fc6cbd84d2eb98b2ab01666e339d92
3
+ metadata.gz: 3f1f161c45ab42b30f3a2e3829b970a723262f36
4
+ data.tar.gz: b6307cc28ffbe84024c89ebba851ed185f07adae
5
5
  SHA512:
6
- metadata.gz: f5169614a58b7d62a735f7762fc063d4b89dbfbd41eabe72c17595ed27071f3e70594152bd2903750b5bcd91c42e29e6faae80ee42b3a69c700cd5b1891b0db9
7
- data.tar.gz: 2883501ba85d27388fa782fc91d42c8d4eb4755846baff536f9cc04f10660e7d39ad69ae7ccfa11a8bbfe8decef215fc443b37a7d1e914103c1f74476fcea451
6
+ metadata.gz: e8200de91069f1ab0cde28a42b78ff9b72dcbdc80eb37f90762159a6eaa9f18043b444a034a026f8b90ac739f15b86222a61bd9a7c59fe19b0b82b0147765588
7
+ data.tar.gz: e3d1c749166df140684c4ea063b3dde270fbd061ba2f9108f8a300f8b66ad16ec701f489afce9ed868684bf61769cbc03a2b970acdfdc468a941357ebc58b0ec
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