shutterbug 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -7,9 +7,10 @@ A rack utility that will create and save images (pngs) from parts of your html's
7
7
 
8
8
 
9
9
  use Shutterbug::Rackapp do |config|
10
- conf.resource_dir = "/Users/npaessel/tmp"
11
- config.uri_prefix = "http://localhost:9292"
12
- config.path_prefix = "/shutterbug"
10
+ conf.resource_dir = "/Users/npaessel/tmp"
11
+ config.uri_prefix = "http://shutterbug.herokuapp.com"
12
+ config.path_prefix = "/shutterbug"
13
+ config.phantom_bin_path = "/app/vendor/phantomjs/bin/phantomjs"
13
14
  end
14
15
 
15
16
  Configuration options default to reasonable defaults.
@@ -4,15 +4,17 @@ module Shutterbug
4
4
  attr_accessor :uri_prefix
5
5
  attr_accessor :path_prefix
6
6
  attr_accessor :resource_dir
7
+ attr_accessor :phantom_bin_path
7
8
 
8
9
  def self.instance(opts={})
9
10
  return @instance || @instance = self.new(opts)
10
11
  end
11
12
 
12
13
  def initialize(opts={})
13
- self.uri_prefix = opts[:uri_prefix] || ""
14
- self.path_prefix = opts[:path_prefix] || "/shutterbug"
15
- self.resource_dir = opts[:resource_dir] || Dir.tmpdir
14
+ self.uri_prefix = opts[:uri_prefix] || ""
15
+ self.path_prefix = opts[:path_prefix] || "/shutterbug"
16
+ self.resource_dir = opts[:resource_dir] || Dir.tmpdir
17
+ self.phantom_bin_path = opts[:phantom_bin_path] || "phantomjs"
16
18
  end
17
19
 
18
20
  def js_path
@@ -5,7 +5,7 @@ module Shutterbug
5
5
  attr_accessor :html_file
6
6
 
7
7
  def program
8
- 'phantomjs'
8
+ Configuration.instance.phantom_bin_path
9
9
  end
10
10
 
11
11
  def rasterize_js
@@ -59,7 +59,7 @@ module Shutterbug
59
59
  end
60
60
 
61
61
  def rasterize
62
- infile = File.open(infilename, 'w') do |f|
62
+ File.open(infilename, 'w') do |f|
63
63
  f.write(document)
64
64
  end
65
65
  rasterize_cl()
data/lib/shutterbug.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Shutterbug
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  autoload :Service, "shutterbug/service"
4
4
  autoload :Rackapp, "shutterbug/rackapp"
5
5
  autoload :Configuration, "shutterbug/configuration"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shutterbug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-26 00:00:00.000000000 Z
12
+ date: 2013-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: -488192167171583670
143
+ hash: -1955539956353293088
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: -488192167171583670
152
+ hash: -1955539956353293088
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.23