savagery 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -10
- data/bin/setup +8 -0
- data/lib/savagery/version.rb +1 -1
- data/lib/savagery.rb +0 -1
- data/savagery.gemspec +1 -3
- metadata +8 -21
- data/app/assets/javascripts/savagery/ember.js +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09acf766c43a2eb5a25ae92741e2d144452692d
|
4
|
+
data.tar.gz: 1fbd5c476c83a43ec56bde5d951b97eb215c121f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17b009b3eebfe7500157b0a90ffd0e5dc87c974adedeb20825ef701d4509996cdf8655df8da9787ced71976a2ea38b4ee03658d690ca5ed5e9622ceb93e42d3
|
7
|
+
data.tar.gz: f8c3db9cc20e65a02cd640009e6d0985ec4baf68da94db70348dd31e9e4bfe4cc4fe0ba9bb32b9ddf0af4002c8762dc80bc377f47941f8b1de426d7221e72872
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Savagery
|
2
2
|
|
3
|
-
Ruthlessly sprite SVGs in your Rails app.
|
3
|
+
Ruthlessly sprite SVGs in your Rails app.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -29,14 +29,6 @@ Rails: Use the `svg_sprite_use` helper in your view:
|
|
29
29
|
<%= svg_sprite_use "dogs/chihuahua" %>
|
30
30
|
```
|
31
31
|
|
32
|
-
Ember: Require `savagery/ember` anywhere, then use the 'svg-sprite-use` helper in your template:
|
33
|
-
|
34
|
-
```javascript
|
35
|
-
// app/assets/javascripts/templates/application.hbs
|
36
|
-
//= require savagery/ember
|
37
|
-
{{svg-sprite-use "dogs/chihuahua"}}
|
38
|
-
```
|
39
|
-
|
40
32
|
And Savagery will do all the hard work of spriting and embedding. A new .svg
|
41
33
|
sprite file will appear in the `app/assets/svgs` directory, named after the directory
|
42
34
|
containing the sprites:
|
@@ -54,7 +46,7 @@ Make sure you check this file into version control.
|
|
54
46
|
|
55
47
|
## Contributing
|
56
48
|
|
57
|
-
1. Fork it ( https://github.com/
|
49
|
+
1. Fork it ( https://github.com/botandrose/savagery/fork )
|
58
50
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
59
51
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
60
52
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/bin/setup
ADDED
data/lib/savagery/version.rb
CHANGED
data/lib/savagery.rb
CHANGED
data/savagery.gemspec
CHANGED
@@ -18,9 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.6"
|
21
|
+
spec.add_development_dependency "bundler"
|
24
22
|
spec.add_development_dependency "actionview"
|
25
23
|
spec.add_development_dependency "rake"
|
26
24
|
spec.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savagery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.6'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.6'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: actionview
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,7 +83,8 @@ dependencies:
|
|
97
83
|
description: Ruthlessly sprites SVGs
|
98
84
|
email:
|
99
85
|
- micah@botandrose.com
|
100
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- setup
|
101
88
|
extensions: []
|
102
89
|
extra_rdoc_files: []
|
103
90
|
files:
|
@@ -107,7 +94,7 @@ files:
|
|
107
94
|
- LICENSE.txt
|
108
95
|
- README.md
|
109
96
|
- Rakefile
|
110
|
-
-
|
97
|
+
- bin/setup
|
111
98
|
- lib/savagery.rb
|
112
99
|
- lib/savagery/engine.rb
|
113
100
|
- lib/savagery/helpers.rb
|
@@ -148,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
135
|
version: '0'
|
149
136
|
requirements: []
|
150
137
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.6.14
|
152
139
|
signing_key:
|
153
140
|
specification_version: 4
|
154
141
|
summary: Ruthlessly sprites SVGs
|
@@ -1,52 +0,0 @@
|
|
1
|
-
//= require ember-rails-assets
|
2
|
-
|
3
|
-
Savagery = {
|
4
|
-
svgSpriteInclude: function(name) {
|
5
|
-
var path = window.ASSETS.path(name + ".svg")
|
6
|
-
if($("[data-savagery-path='" + path.split("/assets/").reverse()[0] + "']").length > 0) { return; }
|
7
|
-
$.get(path, function(data) {
|
8
|
-
$("body").prepend(data);
|
9
|
-
}, "text");
|
10
|
-
},
|
11
|
-
|
12
|
-
svgSpriteUse: function(basename, cssClass) {
|
13
|
-
cssClass = cssClass || basename;
|
14
|
-
var absolutePath = window.location.href
|
15
|
-
absolutePath = absolutePath.replace(window.location.hash, '');
|
16
|
-
absolutePath = absolutePath + "#" + basename;
|
17
|
-
return '<svg class="' + cssClass + '"><use xlink:href="' + absolutePath + '"></use></svg>';
|
18
|
-
},
|
19
|
-
};
|
20
|
-
|
21
|
-
Ember.Application.initializer({
|
22
|
-
name: "savagery-helpers",
|
23
|
-
|
24
|
-
initialize: function(application) {
|
25
|
-
application.register("helper:svg-sprite-use", Ember.Helper.helper(this.svgSpriteUseHelper));
|
26
|
-
},
|
27
|
-
|
28
|
-
svgSpriteUseHelper: function(params, hash) {
|
29
|
-
var name = params[0];
|
30
|
-
var names = name.split("/");
|
31
|
-
var dirname = names[0];
|
32
|
-
var basename = names[1];
|
33
|
-
Savagery.svgSpriteInclude(dirname);
|
34
|
-
|
35
|
-
var cssClass = hash["class"];
|
36
|
-
var html = Savagery.svgSpriteUse(basename, cssClass);
|
37
|
-
return new Ember.Handlebars.SafeString(html);
|
38
|
-
}
|
39
|
-
});
|
40
|
-
|
41
|
-
Ember.Application.initializer({
|
42
|
-
name: "ember-rails-assets-helpers",
|
43
|
-
|
44
|
-
initialize: function(application) {
|
45
|
-
application.register("helper:asset-path", Ember.Helper.helper(function(params, hash) {
|
46
|
-
var name = params[0];
|
47
|
-
var path = window.ASSETS.path(name);
|
48
|
-
return new Ember.Handlebars.SafeString(path);
|
49
|
-
}));
|
50
|
-
}
|
51
|
-
});
|
52
|
-
|