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 CHANGED
@@ -23,3 +23,4 @@ pkg
23
23
  doc
24
24
  .bundle
25
25
  tmp
26
+ .rbenv-version
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - ree
4
+ - 1.8.7
5
+ - 1.9.2
6
+ - 1.9.3
data/Gemfile.lock CHANGED
@@ -1,45 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- typogruby (1.0.14)
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.3.6)
11
- childprocess (>= 0.1.7)
12
- cucumber (>= 0.10.0)
13
- rspec (>= 2.5.0)
14
- bluecloth (2.1.0)
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.8)
17
+ childprocess (0.3.1)
17
18
  ffi (~> 1.0.6)
18
- cucumber (0.10.2)
19
+ cucumber (1.1.9)
19
20
  builder (>= 2.1.2)
20
21
  diff-lcs (>= 1.1.2)
21
- gherkin (>= 2.3.5)
22
+ gherkin (~> 2.9.0)
22
23
  json (>= 1.4.6)
23
- term-ansicolor (>= 1.0.5)
24
- diff-lcs (1.1.2)
25
- ffi (1.0.7)
26
- rake (>= 0.8.7)
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.1)
30
- rake (0.8.7)
31
- rcov (0.9.9)
32
- rspec (2.5.0)
33
- rspec-core (~> 2.5.0)
34
- rspec-expectations (~> 2.5.0)
35
- rspec-mocks (~> 2.5.0)
36
- rspec-core (2.5.2)
37
- rspec-expectations (2.5.0)
38
- diff-lcs (~> 1.1.2)
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.5)
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
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.15
4
+
5
+ * Added head to list of ignored elements (thanks Peter Aronoff)
6
+
3
7
  ## 1.0.14
4
8
 
5
9
  * Bugfix: ignore multi-line HTML attributes in widont filter
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
- require 'yard'
73
- YARD::Rake::YardocTask.new do |t|
74
- t.options = [
75
- '--files', 'LICENSE',
76
- '--files', 'HISTORY.md',
77
- '--title', 'Typogruby API documentation'
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
- $stderr.puts "Interrupted by user."
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
- $stderr.puts "Error processing input:"
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
- $stdout.print "A problem occured when trying to write to file #{output_filename}:"
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
@@ -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>..PD are fringe cases, but also do no harm
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
@@ -291,7 +291,7 @@ private
291
291
  end
292
292
 
293
293
  # Array of all the senstive tags that should be ignored by all the text filters.
294
- EXCLUDED_TAGS = %w{pre code kbd math script}
294
+ EXCLUDED_TAGS = %w{head pre code kbd math script}
295
295
 
296
296
  extend self
297
297
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Typogruby
2
- VERSION = '1.0.14'
2
+ VERSION = '1.0.15'
3
3
  end
@@ -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('rubypants', ['>= 0'])
32
- s.add_development_dependency('yard', ['>= 0'])
33
- s.add_development_dependency('rake', ['>= 0'])
34
- s.add_development_dependency('aruba', ['>= 0'])
35
- s.add_development_dependency('cucumber', ['>= 0'])
36
- s.add_development_dependency('rcov', ['>= 0'])
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
- hash: 11
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
- date: 2012-01-26 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
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
- hash: 3
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
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
38
25
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
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
- hash: 3
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
- requirement: &id004 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
66
41
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
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
- version_requirements: *id004
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
- hash: 3
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
- requirement: &id006 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
94
57
  none: false
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- hash: 3
99
- segments:
100
- - 0
101
- version: "0"
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
- requirement: &id007 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
108
73
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
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
- version_requirements: *id007
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
- hash: 3
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
- version_requirements: *id008
133
- description: Improve web typography using various text filters. This gem prevents widows and applies markup to ampersans, consecutive capitals and initial quotes.
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
- hash: 3
179
- segments:
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ segments:
180
156
  - 0
181
- version: "0"
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
- hash: 3
188
- segments:
160
+ requirements:
161
+ - - ! '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ segments:
189
165
  - 0
190
- version: "0"
166
+ hash: 3354756754886315558
191
167
  requirements: []
192
-
193
168
  rubyforge_project:
194
- rubygems_version: 1.6.2
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