yellowlab-princely 1.2.5.yellowlab.2 → 1.2.5.yellowlab.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/princely.rb +24 -7
  3. metadata +8 -9
  4. data/.gitignore +0 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.5.yellowlab.2
1
+ 1.2.5.yellowlab.3
@@ -21,17 +21,34 @@ require 'princely/rails'
21
21
  class Princely
22
22
  VERSION = "1.0.0" unless const_defined?("VERSION")
23
23
 
24
+ cattr_writer :log_file
24
25
  attr_accessor :exe_path, :style_sheets, :log_file, :logger
25
26
 
27
+ def self.prince_executable
28
+ @@prince_executable ||= begin
29
+ path = `which prince`.chomp
30
+ raise "Cannot find prince command-line app in $PATH" if @exe_path.length == 0
31
+ path
32
+ end
33
+ end
34
+
35
+ def self.prince_executable=(path)
36
+ raise "Configured prince executable '#{path}' is not valid. Check file exists and is executable by user." if File.executable?(path)
37
+ @@prince_executable = path
38
+ end
39
+
40
+ def self.log_file
41
+ @@log_file ||= "#{Rails.root}/log/prince.log"
42
+ end
43
+
26
44
  # Initialize method
27
45
  #
28
- def initialize()
46
+ def initialize
29
47
  # Finds where the application lives, so we can call it.
30
- @exe_path = `which prince`.chomp
31
- raise "Cannot find prince command-line app in $PATH" if @exe_path.length == 0
32
- @style_sheets = ''
33
- @log_file = "#{Rails.root}/log/prince.log"
34
- @logger = Rails.logger
48
+ @exe_path = self.class.prince_executable
49
+ @style_sheets = ''
50
+ @log_file = self.class.log_file
51
+ @logger = Rails.logger
35
52
  end
36
53
 
37
54
  # Sets stylesheets...
@@ -94,4 +111,4 @@ class Princely
94
111
  pdf.puts(string)
95
112
  pdf.close
96
113
  end
97
- end
114
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yellowlab-princely
3
3
  version: !ruby/object:Gem::Version
4
- hash: 958535917
5
- prerelease: true
4
+ hash: 958535919
5
+ prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
9
  - 5
10
10
  - yellowlab
11
- - 2
12
- version: 1.2.5.yellowlab.2
11
+ - 3
12
+ version: 1.2.5.yellowlab.3
13
13
  platform: ruby
14
14
  authors:
15
15
  - Michael Bleigh
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-09-08 00:00:00 +10:00
20
+ date: 2011-07-04 00:00:00 +10:00
21
21
  default_executable:
22
22
  dependencies: []
23
23
 
@@ -30,7 +30,6 @@ extensions: []
30
30
  extra_rdoc_files:
31
31
  - README.rdoc
32
32
  files:
33
- - .gitignore
34
33
  - MIT-LICENSE
35
34
  - README.rdoc
36
35
  - Rakefile
@@ -43,8 +42,8 @@ homepage: http://github.com/mbleigh/princely
43
42
  licenses: []
44
43
 
45
44
  post_install_message:
46
- rdoc_options:
47
- - --charset=UTF-8
45
+ rdoc_options: []
46
+
48
47
  require_paths:
49
48
  - lib
50
49
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -70,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
69
  requirements: []
71
70
 
72
71
  rubyforge_project:
73
- rubygems_version: 1.3.7
72
+ rubygems_version: 1.6.2
74
73
  signing_key:
75
74
  specification_version: 3
76
75
  summary: A simple Rails wrapper for the PrinceXML PDF generation library.
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- *.gem
2
- tmp