icosmith-rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/README.md +13 -0
- data/Rakefile +1 -1
- data/icosmith-rails.gemspec +2 -2
- data/lib/icosmith-rails/generator.rb +10 -9
- data/lib/icosmith-rails/railtie.rb +1 -1
- data/lib/{tasks → icosmith-rails/tasks}/icosmith.rake +6 -1
- data/lib/icosmith-rails/version.rb +1 -1
- data/lib/icosmith-rails.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c134aac66158b8042802c93fc56787d41d6b1c4
|
4
|
+
data.tar.gz: ced08eb6800f49061cc9663325ae2e43be58c1ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1356a401150207942c900bffd347dbc90104a6aefb10cf6b3e71b65fd82d53d6989e48e592509ac1e9e760264215ca8e9cc8ac00ac112954c9578eba566b6dd8
|
7
|
+
data.tar.gz: 323097275afec4011d0b579de0f8cd54c93f572c5fba22f31808cc8669044b072fd2f75dcb27a1a22b9638c0ed1e6d225556551279c1ec818cb2c8ba73e77bbe
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
icosmith-rails (0.
|
5
|
-
rest-client
|
6
|
-
rubyzip
|
4
|
+
icosmith-rails (0.2.0)
|
5
|
+
rest-client (~> 1.6.7)
|
6
|
+
rubyzip (< 1.0.0)
|
7
|
+
thor (~> 0.18.1)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: http://rubygems.org/
|
10
11
|
specs:
|
11
|
-
|
12
|
-
|
13
|
-
columnize (>= 0.3.1)
|
12
|
+
byebug (2.0.0)
|
13
|
+
columnize (~> 0.3.6)
|
14
14
|
debugger-linecache (~> 1.2.0)
|
15
|
-
|
15
|
+
columnize (0.3.6)
|
16
16
|
debugger-linecache (1.2.0)
|
17
|
-
debugger-ruby_core_source (1.2.3)
|
18
17
|
diff-lcs (1.2.4)
|
19
18
|
mime-types (1.25)
|
20
19
|
rest-client (1.6.7)
|
@@ -27,12 +26,13 @@ GEM
|
|
27
26
|
rspec-expectations (2.13.0)
|
28
27
|
diff-lcs (>= 1.1.3, < 2.0)
|
29
28
|
rspec-mocks (2.13.1)
|
30
|
-
rubyzip (
|
29
|
+
rubyzip (0.9.9)
|
30
|
+
thor (0.18.1)
|
31
31
|
|
32
32
|
PLATFORMS
|
33
33
|
ruby
|
34
34
|
|
35
35
|
DEPENDENCIES
|
36
|
-
|
36
|
+
byebug
|
37
37
|
icosmith-rails!
|
38
38
|
rspec
|
data/README.md
CHANGED
@@ -24,6 +24,19 @@ If you are using Rails, use the setup generator
|
|
24
24
|
Otherwise create a `config/icosmith` directory and copy `icosmith.yml` and
|
25
25
|
`manifest.json` from [lib/generators/icosmith/setup/templates](lib/generators/icosmith/setup/templates)
|
26
26
|
|
27
|
+
If you aren't using Rails, add this to your `Rakefile`:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
begin
|
31
|
+
require 'icosmith-rails'
|
32
|
+
load 'icosmith-rails/tasks/icosmith.rake'
|
33
|
+
rescue LoadError
|
34
|
+
task :icosmith do
|
35
|
+
abort "Icosmith is not available."
|
36
|
+
end
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
27
40
|
## Configuration
|
28
41
|
|
29
42
|
`manifest.json`:
|
data/Rakefile
CHANGED
data/icosmith-rails.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'icosmith-rails/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "icosmith-rails"
|
8
8
|
gem.version = Icosmith::VERSION
|
9
|
-
gem.authors = ["tulios", "
|
9
|
+
gem.authors = ["tulios", "Guilherme Garnier"]
|
10
10
|
gem.email = ["ornelas.tulio@gmail.com", "guilherme.garnier@gmail.com"]
|
11
11
|
gem.summary = "Rails integration with an icosmith server"
|
12
12
|
gem.description = "Creates a rake task to generate a new font from svg files using icosmith server"
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
21
|
gem.add_dependency "rest-client", "~> 1.6.7"
|
22
|
-
gem.add_dependency "rubyzip", "
|
22
|
+
gem.add_dependency "rubyzip", "< 1.0.0"
|
23
23
|
gem.add_dependency "thor", "~> 0.18.1"
|
24
24
|
|
25
25
|
gem.add_development_dependency "rspec"
|
@@ -5,7 +5,8 @@ module Icosmith
|
|
5
5
|
SVG_ZIPFILENAME = "svg.zip"
|
6
6
|
FONTS_ZIPFILENAME = "fonts.zip"
|
7
7
|
|
8
|
-
def initialize
|
8
|
+
def initialize(root_path)
|
9
|
+
@root_path = root_path
|
9
10
|
load_config
|
10
11
|
setup_parameters
|
11
12
|
create_directories
|
@@ -15,7 +16,7 @@ module Icosmith
|
|
15
16
|
FileUtils.rm_f(@svg_zipfile)
|
16
17
|
|
17
18
|
Icosmith.logger.info "Compressing SVGs"
|
18
|
-
Zip::
|
19
|
+
Zip::ZipFile.open(@svg_zipfile, Zip::ZipFile::CREATE) do |zipfile|
|
19
20
|
Dir.glob("#{@src_dir}#{File::SEPARATOR}*.svg").each do |filename|
|
20
21
|
zipfile.add(filename.split(File::SEPARATOR).last, filename)
|
21
22
|
end
|
@@ -82,7 +83,7 @@ module Icosmith
|
|
82
83
|
end
|
83
84
|
|
84
85
|
def unzip path, target
|
85
|
-
Zip::
|
86
|
+
Zip::ZipFile.open(path) do |zip_file|
|
86
87
|
zip_file.each do |file|
|
87
88
|
zip_file.extract(file, File.join(target, file.name))
|
88
89
|
end
|
@@ -90,7 +91,7 @@ module Icosmith
|
|
90
91
|
end
|
91
92
|
|
92
93
|
def load_config
|
93
|
-
config_filename = File.join(
|
94
|
+
config_filename = File.join(@root_path, "config", "icosmith", Icosmith::CONFIG_FILENAME)
|
94
95
|
begin
|
95
96
|
@config = Icosmith::Config.load(config_filename)
|
96
97
|
rescue Exception => e
|
@@ -98,7 +99,7 @@ module Icosmith
|
|
98
99
|
exit 1
|
99
100
|
end
|
100
101
|
|
101
|
-
@manifest_full_path = File.join(
|
102
|
+
@manifest_full_path = File.join(@root_path, @config.manifest_dir, Icosmith::MANIFEST_FILENAME)
|
102
103
|
unless File.readable?(@manifest_full_path)
|
103
104
|
puts "Error trying to load manifest file at #{@manifest_full_path}"
|
104
105
|
exit 1
|
@@ -106,11 +107,11 @@ module Icosmith
|
|
106
107
|
end
|
107
108
|
|
108
109
|
def setup_parameters
|
109
|
-
@src_dir = File.join(
|
110
|
-
@temp_dir = File.join(
|
110
|
+
@src_dir = File.join(@root_path, @config.svg_dir)
|
111
|
+
@temp_dir = File.join(@root_path, "tmp", "icosmith")
|
111
112
|
@svg_zipfile = File.join(@temp_dir, SVG_ZIPFILENAME)
|
112
|
-
@css_dir = File.join(
|
113
|
-
@font_dir = File.join(
|
113
|
+
@css_dir = File.join(@root_path, @config.css_dir)
|
114
|
+
@font_dir = File.join(@root_path, @config.font_dir)
|
114
115
|
end
|
115
116
|
|
116
117
|
def create_directories
|
data/lib/icosmith-rails.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icosmith-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tulios
|
8
|
-
-
|
8
|
+
- Guilherme Garnier
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -29,14 +29,14 @@ dependencies:
|
|
29
29
|
name: rubyzip
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - <
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 1.0.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - <
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 1.0.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
@@ -106,8 +106,8 @@ files:
|
|
106
106
|
- lib/icosmith-rails/config.rb
|
107
107
|
- lib/icosmith-rails/generator.rb
|
108
108
|
- lib/icosmith-rails/railtie.rb
|
109
|
+
- lib/icosmith-rails/tasks/icosmith.rake
|
109
110
|
- lib/icosmith-rails/version.rb
|
110
|
-
- lib/tasks/icosmith.rake
|
111
111
|
- spec/spec_helper.rb
|
112
112
|
homepage: https://github.com/tulios/icosmith-rails
|
113
113
|
licenses:
|