jitai 0.3.3 → 0.3.4
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.
- data/Rakefile +3 -0
- data/VERSION +1 -1
- data/jitai.gemspec +7 -9
- data/lib/jitai.rb +16 -11
- data/public/fonts/gotham_bold.eot +0 -0
- data/public/fonts/gotham_bold.ttf +0 -0
- data/public/fonts/gotham_light.eot +0 -0
- data/public/fonts/gotham_light.ttf +0 -0
- data/spec/spec_helper.rb +1 -3
- metadata +12 -10
data/Rakefile
CHANGED
@@ -19,17 +19,20 @@ rescue LoadError
|
|
19
19
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
20
|
end
|
21
21
|
|
22
|
+
=begin
|
22
23
|
require 'spec/rake/spectask'
|
23
24
|
Spec::Rake::SpecTask.new(:spec) do |spec|
|
24
25
|
spec.libs << 'lib' << 'spec'
|
25
26
|
spec.spec_files = FileList['spec/**/*_spec.rb']
|
26
27
|
end
|
27
28
|
|
29
|
+
|
28
30
|
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
29
31
|
spec.libs << 'lib' << 'spec'
|
30
32
|
spec.pattern = 'spec/**/*_spec.rb'
|
31
33
|
spec.rcov = true
|
32
34
|
end
|
35
|
+
=end
|
33
36
|
|
34
37
|
task :spec => :check_dependencies
|
35
38
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/jitai.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{jitai}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["kellydunn"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-12}
|
13
13
|
s.description = %q{CSS custom font consolidator}
|
14
14
|
s.email = %q{defaultstring@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -37,6 +37,10 @@ Gem::Specification.new do |s|
|
|
37
37
|
"lib/ttf2eot/ttf2eot",
|
38
38
|
"lib/ttf2eot/ttf2eot.cpp",
|
39
39
|
"lib/ttf2eot/ttf2eot.o",
|
40
|
+
"public/fonts/gotham_bold.eot",
|
41
|
+
"public/fonts/gotham_bold.ttf",
|
42
|
+
"public/fonts/gotham_light.eot",
|
43
|
+
"public/fonts/gotham_light.ttf",
|
40
44
|
"public/fonts/yardsale.eot",
|
41
45
|
"public/fonts/yardsale.ttf",
|
42
46
|
"public/stylesheets/fonts_ie.css",
|
@@ -48,16 +52,10 @@ Gem::Specification.new do |s|
|
|
48
52
|
]
|
49
53
|
s.homepage = %q{http://github.com/kellydunn/jitai}
|
50
54
|
s.require_paths = ["lib"]
|
51
|
-
s.rubygems_version = %q{1.
|
55
|
+
s.rubygems_version = %q{1.6.2}
|
52
56
|
s.summary = %q{CSS custom font consolidator}
|
53
|
-
s.test_files = [
|
54
|
-
"spec/jitai_spec.rb",
|
55
|
-
"spec/rake/jitaitask_spec.rb",
|
56
|
-
"spec/spec_helper.rb"
|
57
|
-
]
|
58
57
|
|
59
58
|
if s.respond_to? :specification_version then
|
60
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
61
59
|
s.specification_version = 3
|
62
60
|
|
63
61
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
data/lib/jitai.rb
CHANGED
@@ -2,11 +2,10 @@ module Jitai
|
|
2
2
|
require 'jitai/railtie.rb' if defined?(Rails)
|
3
3
|
|
4
4
|
class FontManager
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :css_path, :cwd
|
6
6
|
|
7
7
|
def initialize(path= "public")
|
8
|
-
@
|
9
|
-
@ie_path = "#{path}/stylesheets/fonts_ie.css"
|
8
|
+
@css_path = "#{path}/stylesheets/fonts.css"
|
10
9
|
@cwd = "public/fonts/"
|
11
10
|
end
|
12
11
|
|
@@ -14,6 +13,7 @@ module Jitai
|
|
14
13
|
Dir.mkdir(@cwd) if !(File.directory? @cwd)
|
15
14
|
Dir.foreach(@cwd) do |font_file|
|
16
15
|
if !(File.directory?(font_file))
|
16
|
+
|
17
17
|
# Search for two different formats
|
18
18
|
conversion_type = (File.extname(font_file).downcase.eql? ".ttf")? ".eot" : ".ttf"
|
19
19
|
other_basename = font_file.split(".")[0] + conversion_type
|
@@ -24,10 +24,8 @@ module Jitai
|
|
24
24
|
if !File.exists?(other_file)
|
25
25
|
puts "===== #{conversion_type.upcase} format not found for #{font_file}. Attempting to convert... ====="
|
26
26
|
|
27
|
-
# TODO
|
28
|
-
curr_dir
|
29
|
-
ttf2eot_dir = "/usr/lib/ruby/gems/1.8/gems/jitai-0.3.0/lib/ttf2eot/"
|
30
|
-
%x{cd #{ttf2eot_dir} && ./ttf2eot < #{curr_dir + @cwd + font_file} > #{curr_dir + @cwd + font_file.split(".")[0] + conversion_type} && cd #{curr_dir}}
|
27
|
+
# TODO Raise error
|
28
|
+
%x{cd #{ttf2eot_dir} && ttf2eot < #{curr_dir + @cwd + font_file} > #{curr_dir + @cwd + font_file.split(".")[0] + conversion_type} && cd #{curr_dir}}
|
31
29
|
end
|
32
30
|
|
33
31
|
# Rename files, account for conventions.
|
@@ -50,12 +48,19 @@ module Jitai
|
|
50
48
|
end
|
51
49
|
|
52
50
|
def to_css
|
51
|
+
# TODO WOFF url('/fonts/#{@name}.woff') format('woff'), /* Modern Browsers */
|
52
|
+
# TODO SVG url('/fonts/#{@name}.svg#svgFontName') format('svg'); /* Legacy iOS */
|
53
|
+
|
54
|
+
css = "@font-face {
|
55
|
+
font-family: '#{@name}';
|
56
|
+
src: url('/fonts/#{@name}.eot'); /* IE9 Compat Modes */
|
57
|
+
src: url('/fonts/#{@name}.eot?iefix') format('eot'), /* IE6-IE8 */
|
58
|
+
url('/fonts/#{@name}.ttf') format('truetype'), /* Safari, Android, iOS */
|
59
|
+
}"
|
60
|
+
|
53
61
|
# TODO make configurable for sinatra apps, etc
|
54
|
-
moz = "@font-face {font-family:'#{@name}'; src:url('/fonts/#{name}.ttf');}"
|
55
|
-
ie = "@font-face {font-family:'#{@name}'; src:url('/fonts/#{name}.eot');}"
|
56
62
|
manager = Jitai::FontManager.new
|
57
|
-
find_font(manager.
|
58
|
-
find_font(manager.ie_path, ie)
|
63
|
+
find_font(manager.css_path, css)
|
59
64
|
end
|
60
65
|
|
61
66
|
def find_font(file, search_font)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
3
|
require 'jitai'
|
4
|
-
require '
|
5
|
-
# require 'rspec'
|
4
|
+
require 'rspec'
|
6
5
|
require 'rubygems'
|
7
|
-
require 'spec/autorun'
|
8
6
|
|
9
7
|
Spec::Runner.configure do |config|
|
10
8
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jitai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 4
|
10
|
+
version: 0.3.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- kellydunn
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-12 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -64,6 +64,10 @@ files:
|
|
64
64
|
- lib/ttf2eot/ttf2eot
|
65
65
|
- lib/ttf2eot/ttf2eot.cpp
|
66
66
|
- lib/ttf2eot/ttf2eot.o
|
67
|
+
- public/fonts/gotham_bold.eot
|
68
|
+
- public/fonts/gotham_bold.ttf
|
69
|
+
- public/fonts/gotham_light.eot
|
70
|
+
- public/fonts/gotham_light.ttf
|
67
71
|
- public/fonts/yardsale.eot
|
68
72
|
- public/fonts/yardsale.ttf
|
69
73
|
- public/stylesheets/fonts_ie.css
|
@@ -102,11 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
106
|
requirements: []
|
103
107
|
|
104
108
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.
|
109
|
+
rubygems_version: 1.6.2
|
106
110
|
signing_key:
|
107
111
|
specification_version: 3
|
108
112
|
summary: CSS custom font consolidator
|
109
|
-
test_files:
|
110
|
-
|
111
|
-
- spec/rake/jitaitask_spec.rb
|
112
|
-
- spec/spec_helper.rb
|
113
|
+
test_files: []
|
114
|
+
|