pizzazz 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/pizzazz.rb CHANGED
@@ -1,8 +1,3 @@
1
- require 'pizzazz/colorer'
2
- require 'pizzazz/html'
3
- require 'pizzazz/engine'
4
- require 'pizzazz/version'
5
-
6
1
  module Pizzazz
7
2
  TAB_SIZE = 2
8
3
 
@@ -11,3 +6,16 @@ module Pizzazz
11
6
  p.ify
12
7
  end
13
8
  end
9
+
10
+ # This is ugly. I'd love a better solution.
11
+ begin
12
+ require 'rails'
13
+ require 'pizzazz/engine'
14
+ Pizzazz::RAILS_AVAILABLE = true
15
+ rescue LoadError
16
+ Pizzazz::RAILS_AVAILABLE = false
17
+ end
18
+
19
+ require 'pizzazz/colorer'
20
+ require 'pizzazz/html'
21
+ require 'pizzazz/version'
@@ -11,6 +11,7 @@ module Pizzazz
11
11
  end
12
12
 
13
13
  def ify
14
+ return '' unless @object
14
15
  node(@object, @limit)
15
16
  end
16
17
 
data/lib/pizzazz/html.rb CHANGED
@@ -2,7 +2,7 @@ module Pizzazz
2
2
  def self.ify_html(object, options = nil)
3
3
  p = Colorer.new(object, options)
4
4
  html = %Q{<pre class="pizzazz">#{p.ify}</pre>}
5
- html.html_safe if html.respond_to?(:html_safe)
5
+ html = html.html_safe if Pizzazz::RAILS_AVAILABLE
6
6
  html
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Pizzazz
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pizzazz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -46,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  segments:
48
48
  - 0
49
- hash: 3758001213674931689
49
+ hash: 1975583259138659068
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  version: '0'
56
56
  segments:
57
57
  - 0
58
- hash: 3758001213674931689
58
+ hash: 1975583259138659068
59
59
  requirements: []
60
60
  rubyforge_project:
61
61
  rubygems_version: 1.8.23