typogruby 1.0.14 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +6 -0
- data/Gemfile.lock +25 -29
- data/HISTORY.md +4 -0
- data/README.md +3 -0
- data/Rakefile +10 -8
- data/bin/typogruby +3 -13
- data/features/caps.feature +1 -1
- data/lib/typogruby.rb +1 -1
- data/lib/version.rb +1 -1
- data/test/test_typogruby.rb +1 -0
- data/typogruby.gemspec +6 -8
- metadata +106 -131
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,45 +1,43 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
typogruby (1.0.
|
4
|
+
typogruby (1.0.15)
|
5
5
|
rubypants
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
aruba (0.
|
11
|
-
childprocess (>= 0.
|
12
|
-
cucumber (>=
|
13
|
-
|
14
|
-
|
10
|
+
aruba (0.4.11)
|
11
|
+
childprocess (>= 0.2.3)
|
12
|
+
cucumber (>= 1.1.1)
|
13
|
+
ffi (>= 1.0.11)
|
14
|
+
rspec (>= 2.7.0)
|
15
|
+
bluecloth (2.2.0)
|
15
16
|
builder (3.0.0)
|
16
|
-
childprocess (0.1
|
17
|
+
childprocess (0.3.1)
|
17
18
|
ffi (~> 1.0.6)
|
18
|
-
cucumber (
|
19
|
+
cucumber (1.1.9)
|
19
20
|
builder (>= 2.1.2)
|
20
21
|
diff-lcs (>= 1.1.2)
|
21
|
-
gherkin (
|
22
|
+
gherkin (~> 2.9.0)
|
22
23
|
json (>= 1.4.6)
|
23
|
-
term-ansicolor (>= 1.0.
|
24
|
-
diff-lcs (1.1.
|
25
|
-
ffi (1.0.
|
26
|
-
|
27
|
-
gherkin (2.3.7)
|
24
|
+
term-ansicolor (>= 1.0.6)
|
25
|
+
diff-lcs (1.1.3)
|
26
|
+
ffi (1.0.11)
|
27
|
+
gherkin (2.9.1)
|
28
28
|
json (>= 1.4.6)
|
29
|
-
json (1.5
|
30
|
-
rake (0.
|
31
|
-
|
32
|
-
|
33
|
-
rspec-
|
34
|
-
rspec-
|
35
|
-
|
36
|
-
rspec-
|
37
|
-
|
38
|
-
|
39
|
-
rspec-mocks (2.5.0)
|
29
|
+
json (1.6.5)
|
30
|
+
rake (0.9.2.2)
|
31
|
+
rspec (2.9.0)
|
32
|
+
rspec-core (~> 2.9.0)
|
33
|
+
rspec-expectations (~> 2.9.0)
|
34
|
+
rspec-mocks (~> 2.9.0)
|
35
|
+
rspec-core (2.9.0)
|
36
|
+
rspec-expectations (2.9.0)
|
37
|
+
diff-lcs (~> 1.1.3)
|
38
|
+
rspec-mocks (2.9.0)
|
40
39
|
rubypants (0.2.0)
|
41
|
-
term-ansicolor (1.0.
|
42
|
-
yard (0.6.8)
|
40
|
+
term-ansicolor (1.0.7)
|
43
41
|
|
44
42
|
PLATFORMS
|
45
43
|
ruby
|
@@ -49,7 +47,5 @@ DEPENDENCIES
|
|
49
47
|
bluecloth
|
50
48
|
cucumber
|
51
49
|
rake
|
52
|
-
rcov
|
53
50
|
rspec
|
54
51
|
typogruby!
|
55
|
-
yard
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Typogruby
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/avdgaag/typogruby.png?branch=master)](http://travis-ci.org/avdgaag/typogruby)
|
4
|
+
|
3
5
|
Helps you improve your web typograpbhy with some standard text filters.
|
4
6
|
|
5
7
|
This project is based on Django's Typogrify, so the best introduction to read would be [Jeff Croft's][1].
|
@@ -64,6 +66,7 @@ By Arjan van der Gaag ([avdgaag @ github][6]) based on the hard work of lots of
|
|
64
66
|
This gem includes contributions by:
|
65
67
|
|
66
68
|
* Justin Hileman
|
69
|
+
* Peter Aronoff
|
67
70
|
|
68
71
|
[1]: http://jeffcroft.com/blog/2007/may/29/typogrify-easily-produce-web-typography-doesnt-suc/
|
69
72
|
[2]: http://github.com/hunter/typography-helper
|
data/Rakefile
CHANGED
@@ -69,12 +69,14 @@ namespace :version do
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
72
|
+
begin
|
73
|
+
require 'yard'
|
74
|
+
YARD::Rake::YardocTask.new do |t|
|
75
|
+
t.options = [
|
76
|
+
'--files', 'LICENSE',
|
77
|
+
'--files', 'HISTORY.md',
|
78
|
+
'--title', 'Typogruby API documentation'
|
79
|
+
]
|
80
|
+
end
|
81
|
+
rescue LoadError
|
79
82
|
end
|
80
|
-
|
data/bin/typogruby
CHANGED
@@ -80,19 +80,11 @@ else
|
|
80
80
|
end
|
81
81
|
|
82
82
|
begin
|
83
|
-
# Apply every filter to our input text
|
84
83
|
output = operations_todo.inject(ARGF.read) { |t, o| Typogruby.send(o, t) }
|
85
|
-
|
86
|
-
# End the program nicely when the user interrupt with ctrl-c
|
87
84
|
rescue Interrupt
|
88
|
-
|
89
|
-
exit 1
|
90
|
-
|
91
|
-
# Inform the user of any errors that have occured
|
85
|
+
abort "Interrupted by user."
|
92
86
|
rescue Exception => e
|
93
|
-
|
94
|
-
$stderr.puts e.message
|
95
|
-
exit 1
|
87
|
+
abort "Error processing input: #{e.message}"
|
96
88
|
end
|
97
89
|
|
98
90
|
# Either use the output_filename to save the output to a file on disk,
|
@@ -103,9 +95,7 @@ if output_filename
|
|
103
95
|
f.print output
|
104
96
|
end
|
105
97
|
rescue Exception => e
|
106
|
-
|
107
|
-
$stdout.print e.message
|
108
|
-
exit 1
|
98
|
+
abort "A problem occured when trying to write to file #{output_filename}: #{e.message}"
|
109
99
|
end
|
110
100
|
else
|
111
101
|
$stdout.print output
|
data/features/caps.feature
CHANGED
@@ -21,7 +21,7 @@ Feature: processing caps
|
|
21
21
|
<span class="caps">L.A.P.D.</span> is an acronym
|
22
22
|
<span class="caps">LA</span> is the normal case
|
23
23
|
<span class="caps">LA.</span> is a twist on the normal case that does no harm
|
24
|
-
<span class="caps">LA..PD</span> and <span class="caps">LA.</span
|
24
|
+
<span class="caps">LA..PD</span> and <span class="caps">LA.</span>..<span class="caps">PD</span> are fringe cases, but also do no harm
|
25
25
|
|
26
26
|
"""
|
27
27
|
And the exit status should be 0
|
data/lib/typogruby.rb
CHANGED
data/lib/version.rb
CHANGED
data/test/test_typogruby.rb
CHANGED
@@ -35,6 +35,7 @@ class TestTypogruby < Test::Unit::TestCase
|
|
35
35
|
assert_equal 'A message from <span class="caps">2KU2</span> with digits', caps("A message from 2KU2 with digits")
|
36
36
|
assert_equal 'Dotted caps followed by spaces should never include them in the wrap <span class="caps">D.O.T.</span> like so.', caps("Dotted caps followed by spaces should never include them in the wrap D.O.T. like so.")
|
37
37
|
assert_equal 'Caps in attributes (<span title="Example CAPS">example</span>) should be ignored', caps('Caps in attributes (<span title="Example CAPS">example</span>) should be ignored')
|
38
|
+
assert_equal '<head><title>CAPS Example</title></head>', caps('<head><title>CAPS Example</title></head>')
|
38
39
|
end
|
39
40
|
|
40
41
|
def test_should_not_break_caps_with_apostrophes
|
data/typogruby.gemspec
CHANGED
@@ -28,13 +28,11 @@ Gem::Specification.new do |s|
|
|
28
28
|
]
|
29
29
|
|
30
30
|
# Dependencies
|
31
|
-
s.add_runtime_dependency
|
32
|
-
s.add_development_dependency
|
33
|
-
s.add_development_dependency
|
34
|
-
s.add_development_dependency
|
35
|
-
s.add_development_dependency
|
36
|
-
s.add_development_dependency
|
37
|
-
s.add_development_dependency('rspec', ['>= 0'])
|
38
|
-
s.add_development_dependency('bluecloth', ['>= 0'])
|
31
|
+
s.add_runtime_dependency 'rubypants'
|
32
|
+
s.add_development_dependency 'rake'
|
33
|
+
s.add_development_dependency 'aruba'
|
34
|
+
s.add_development_dependency 'cucumber'
|
35
|
+
s.add_development_dependency 'rspec'
|
36
|
+
s.add_development_dependency 'bluecloth'
|
39
37
|
end
|
40
38
|
|
metadata
CHANGED
@@ -1,148 +1,126 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: typogruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.15
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 14
|
10
|
-
version: 1.0.14
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Arjan van der Gaag
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-04-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rubypants
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
32
22
|
type: :runtime
|
33
|
-
name: rubypants
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
23
|
prerelease: false
|
37
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
25
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
type: :development
|
47
|
-
name: yard
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
prerelease: false
|
51
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
52
33
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
60
38
|
type: :development
|
61
|
-
name: rake
|
62
|
-
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
39
|
prerelease: false
|
65
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
41
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
|
72
|
-
- 0
|
73
|
-
version: "0"
|
74
|
-
type: :development
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
75
47
|
name: aruba
|
76
|
-
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
prerelease: false
|
79
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
80
49
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
88
54
|
type: :development
|
89
|
-
name: cucumber
|
90
|
-
version_requirements: *id005
|
91
|
-
- !ruby/object:Gem::Dependency
|
92
55
|
prerelease: false
|
93
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
57
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: cucumber
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
102
70
|
type: :development
|
103
|
-
name: rcov
|
104
|
-
version_requirements: *id006
|
105
|
-
- !ruby/object:Gem::Dependency
|
106
71
|
prerelease: false
|
107
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
73
|
none: false
|
109
|
-
requirements:
|
110
|
-
- -
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
|
113
|
-
|
114
|
-
- 0
|
115
|
-
version: "0"
|
116
|
-
type: :development
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
117
79
|
name: rspec
|
118
|
-
|
119
|
-
- !ruby/object:Gem::Dependency
|
120
|
-
prerelease: false
|
121
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
122
81
|
none: false
|
123
|
-
requirements:
|
124
|
-
- -
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
segments:
|
128
|
-
- 0
|
129
|
-
version: "0"
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
130
86
|
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
131
95
|
name: bluecloth
|
132
|
-
|
133
|
-
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
description: Improve web typography using various text filters. This gem prevents
|
111
|
+
widows and applies markup to ampersans, consecutive capitals and initial quotes.
|
134
112
|
email: arjan@arjanvandergaag.nl
|
135
|
-
executables:
|
113
|
+
executables:
|
136
114
|
- typogruby
|
137
115
|
extensions: []
|
138
|
-
|
139
|
-
extra_rdoc_files:
|
116
|
+
extra_rdoc_files:
|
140
117
|
- LICENSE
|
141
118
|
- README.md
|
142
119
|
- HISTORY.md
|
143
|
-
files:
|
120
|
+
files:
|
144
121
|
- .document
|
145
122
|
- .gitignore
|
123
|
+
- .travis.yml
|
146
124
|
- Gemfile
|
147
125
|
- Gemfile.lock
|
148
126
|
- HISTORY.md
|
@@ -161,41 +139,38 @@ files:
|
|
161
139
|
- lib/version.rb
|
162
140
|
- test/test_typogruby.rb
|
163
141
|
- typogruby.gemspec
|
164
|
-
has_rdoc: true
|
165
142
|
homepage: http://avdgaag.github.com/typogruby
|
166
143
|
licenses: []
|
167
|
-
|
168
144
|
post_install_message:
|
169
|
-
rdoc_options:
|
145
|
+
rdoc_options:
|
170
146
|
- --charset=UTF-8
|
171
|
-
require_paths:
|
147
|
+
require_paths:
|
172
148
|
- lib
|
173
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
174
150
|
none: false
|
175
|
-
requirements:
|
176
|
-
- -
|
177
|
-
- !ruby/object:Gem::Version
|
178
|
-
|
179
|
-
segments:
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
segments:
|
180
156
|
- 0
|
181
|
-
|
182
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
hash: 3354756754886315558
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
159
|
none: false
|
184
|
-
requirements:
|
185
|
-
- -
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
|
188
|
-
segments:
|
160
|
+
requirements:
|
161
|
+
- - ! '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
segments:
|
189
165
|
- 0
|
190
|
-
|
166
|
+
hash: 3354756754886315558
|
191
167
|
requirements: []
|
192
|
-
|
193
168
|
rubyforge_project:
|
194
|
-
rubygems_version: 1.
|
169
|
+
rubygems_version: 1.8.21
|
195
170
|
signing_key:
|
196
171
|
specification_version: 3
|
197
172
|
summary: Improves web typography like Django's Typogrify
|
198
|
-
test_files:
|
173
|
+
test_files:
|
199
174
|
- features/caps.feature
|
200
175
|
- features/ignoring.feature
|
201
176
|
- features/inputs.feature
|