to_latex 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -6,9 +6,8 @@ source "http://rubygems.org"
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
- gem "rspec", "~> 2.8.0"
10
- gem "rdoc", "~> 3.12"
11
- gem "bundler", "~> 1.0.0"
12
- gem "jeweler", "~> 1.8.3"
13
- gem "rcov", ">= 0"
9
+ gem "rspec"
10
+ gem "rdoc"
11
+ gem "bundler"
12
+ gem "jeweler"
14
13
  end
@@ -10,7 +10,6 @@ GEM
10
10
  rdoc
11
11
  json (1.6.5)
12
12
  rake (0.9.2.2)
13
- rcov (1.0.0)
14
13
  rdoc (3.12)
15
14
  json (~> 1.4)
16
15
  rspec (2.8.0)
@@ -26,8 +25,7 @@ PLATFORMS
26
25
  ruby
27
26
 
28
27
  DEPENDENCIES
29
- bundler (~> 1.0.0)
30
- jeweler (~> 1.8.3)
31
- rcov
32
- rdoc (~> 3.12)
33
- rspec (~> 2.8.0)
28
+ bundler
29
+ jeweler
30
+ rdoc
31
+ rspec
@@ -1,9 +1,26 @@
1
1
  = to_latex
2
2
 
3
- Adds a .to_latex to Ruby objects
3
+ Adds #to_latex to integers and strings. Works like html_safe in Rails, it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString instance, with #latex? returning true, and never again will be escaped.
4
+
5
+ You can concatenate any escaped or not escaped string to an escaped one, they get properly escaped.
6
+
7
+
8
+ == Usage
9
+
10
+ gem 'to_latex', '~>0.5.0'
11
+ require 'to_latex'
4
12
 
5
13
  == Features
6
14
 
15
+ Strings and Integers are supported by default.
16
+
17
+ s = ''.to_latex
18
+ s << 'Hello 50% ' << '\LaTeX'.latex! << ' 50% Ruby!' # => "Hello 50\\% \\LaTeX 50\\% Ruby!"
19
+ s.latex? # => true
20
+ 5.to_latex # => "5"
21
+ 5.to_latex_math # => "\\ensuremath{5}"
22
+
23
+ See spec/to\_latex.spec for further details.
7
24
 
8
25
 
9
26
  == Copyright
data/Rakefile CHANGED
@@ -17,8 +17,8 @@ Jeweler::Tasks.new do |gem|
17
17
  gem.name = "to_latex"
18
18
  gem.homepage = "http://github.com/cie/to_latex"
19
19
  gem.license = "MIT"
20
- gem.summary = %Q{Adds #to_latex to objects and strings to convert them to LaTeX.}
21
- gem.description = %Q{Adds #to_latex to objects and strings. Works like html_safe in Rails 3, it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString instance, with #latex? returning true, and never again will be escaped.
20
+ gem.summary = %Q{Adds #to_latex to integers and strings to convert them to LaTeX.}
21
+ gem.description = %Q{Adds #to_latex to integers and strings. Works like html_safe in Rails, it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString instance, with #latex? returning true, and never again will be escaped.
22
22
 
23
23
  You can concatenate any escaped or not escaped string to an escaped one, they get properly escaped.
24
24
 
@@ -35,10 +35,6 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
35
35
  spec.pattern = FileList['spec/**/*_spec.rb']
36
36
  end
37
37
 
38
- RSpec::Core::RakeTask.new(:rcov) do |spec|
39
- spec.pattern = 'spec/**/*_spec.rb'
40
- spec.rcov = true
41
- end
42
38
 
43
39
  task :default => :spec
44
40
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
@@ -75,7 +75,7 @@ end
75
75
 
76
76
 
77
77
 
78
- class Object
78
+ module ToLatex::Convertible
79
79
  # Convert an object to latex with escaping
80
80
  def to_latex
81
81
  to_s.to_latex
@@ -88,3 +88,7 @@ class Object
88
88
  end
89
89
  end
90
90
 
91
+ [Integer, String].each do |c|
92
+ c.send :include, ToLatex::Convertible
93
+ end
94
+
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "to_latex"
8
- s.version = "0.4.0"
8
+ s.version = "0.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bern\u{e1}t Kall\u{f3}"]
12
- s.date = "2012-04-01"
13
- s.description = "Adds #to_latex to objects and strings. Works like html_safe in Rails 3, it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString instance, with #latex? returning true, and never again will be escaped.\n \n You can concatenate any escaped or not escaped string to an escaped one, they get properly escaped.\n \n This gem powers texerb."
12
+ s.date = "2013-08-06"
13
+ s.description = "Adds #to_latex to integers and strings. Works like html_safe in Rails, it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString instance, with #latex? returning true, and never again will be escaped.\n \n You can concatenate any escaped or not escaped string to an escaped one, they get properly escaped.\n \n This gem powers texerb."
14
14
  s.email = "kallo.bernat@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
@@ -34,30 +34,27 @@ Gem::Specification.new do |s|
34
34
  s.licenses = ["MIT"]
35
35
  s.require_paths = ["lib"]
36
36
  s.rubygems_version = "1.8.15"
37
- s.summary = "Adds #to_latex to objects and strings to convert them to LaTeX."
37
+ s.summary = "Adds #to_latex to integers and strings to convert them to LaTeX."
38
38
 
39
39
  if s.respond_to? :specification_version then
40
40
  s.specification_version = 3
41
41
 
42
42
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
- s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
44
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
45
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
46
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
47
- s.add_development_dependency(%q<rcov>, [">= 0"])
43
+ s.add_development_dependency(%q<rspec>, [">= 0"])
44
+ s.add_development_dependency(%q<rdoc>, [">= 0"])
45
+ s.add_development_dependency(%q<bundler>, [">= 0"])
46
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
48
47
  else
49
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
50
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
51
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
52
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
53
- s.add_dependency(%q<rcov>, [">= 0"])
48
+ s.add_dependency(%q<rspec>, [">= 0"])
49
+ s.add_dependency(%q<rdoc>, [">= 0"])
50
+ s.add_dependency(%q<bundler>, [">= 0"])
51
+ s.add_dependency(%q<jeweler>, [">= 0"])
54
52
  end
55
53
  else
56
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
57
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
58
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
59
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
60
- s.add_dependency(%q<rcov>, [">= 0"])
54
+ s.add_dependency(%q<rspec>, [">= 0"])
55
+ s.add_dependency(%q<rdoc>, [">= 0"])
56
+ s.add_dependency(%q<bundler>, [">= 0"])
57
+ s.add_dependency(%q<jeweler>, [">= 0"])
61
58
  end
62
59
  end
63
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_latex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,65 +9,54 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000Z
12
+ date: 2013-08-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &82239450 !ruby/object:Gem::Requirement
16
+ requirement: &1 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 2.8.0
21
+ version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *82239450
24
+ version_requirements: *1
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &82239200 !ruby/object:Gem::Requirement
27
+ requirement: &2 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
- - - ~>
30
+ - - '>='
31
31
  - !ruby/object:Gem::Version
32
- version: '3.12'
32
+ version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *82239200
35
+ version_requirements: *2
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &82238870 !ruby/object:Gem::Requirement
38
+ requirement: &3 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ~>
41
+ - - '>='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.0.0
43
+ version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *82238870
46
+ version_requirements: *3
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &82233380 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 1.8.3
55
- type: :development
56
- prerelease: false
57
- version_requirements: *82233380
58
- - !ruby/object:Gem::Dependency
59
- name: rcov
60
- requirement: &82233080 !ruby/object:Gem::Requirement
49
+ requirement: &4 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
- - - ! '>='
52
+ - - '>='
64
53
  - !ruby/object:Gem::Version
65
54
  version: '0'
66
55
  type: :development
67
56
  prerelease: false
68
- version_requirements: *82233080
69
- description: ! "Adds #to_latex to objects and strings. Works like html_safe in Rails
70
- 3, it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString
57
+ version_requirements: *4
58
+ description: "Adds #to_latex to integers and strings. Works like html_safe in Rails,
59
+ it escapes special characters as needed. Once converted, a string becomes a ToLatex::LatexString
71
60
  instance, with #latex? returning true, and never again will be escaped.\n \n
72
61
  \ You can concatenate any escaped or not escaped string to an escaped one, they
73
62
  get properly escaped.\n \n This gem powers texerb."
@@ -100,16 +89,16 @@ require_paths:
100
89
  required_ruby_version: !ruby/object:Gem::Requirement
101
90
  none: false
102
91
  requirements:
103
- - - ! '>='
92
+ - - '>='
104
93
  - !ruby/object:Gem::Version
105
94
  version: '0'
106
95
  segments:
107
96
  - 0
108
- hash: -1070013009
97
+ hash: -1239251
109
98
  required_rubygems_version: !ruby/object:Gem::Requirement
110
99
  none: false
111
100
  requirements:
112
- - - ! '>='
101
+ - - '>='
113
102
  - !ruby/object:Gem::Version
114
103
  version: '0'
115
104
  requirements: []
@@ -117,5 +106,5 @@ rubyforge_project:
117
106
  rubygems_version: 1.8.15
118
107
  signing_key:
119
108
  specification_version: 3
120
- summary: ! 'Adds #to_latex to objects and strings to convert them to LaTeX.'
109
+ summary: 'Adds #to_latex to integers and strings to convert them to LaTeX.'
121
110
  test_files: []