shrimple 0.8.0

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.
@@ -0,0 +1,32 @@
1
+ require File.dirname(File.expand_path(__FILE__)) + '/../lib/shrimple'
2
+
3
+ module Helpers
4
+ # returns the example HTML that should be passed to phantomjs
5
+ def example_html
6
+ File.expand_path('../test_file.html', __FILE__)
7
+ end
8
+
9
+ # Returns the number of seconds the block took to execute
10
+ # (is there no built-in way to do this??)
11
+ # TODO: clean this up
12
+ def time &block
13
+ start = Time.now
14
+ result = block.call
15
+ finish = Time.now
16
+ finish - start
17
+ end
18
+ end
19
+
20
+
21
+ RSpec.configure do |config|
22
+ config.include Helpers
23
+
24
+ # if a failing test left phantom js processes hanging around, kill them
25
+ config.after(:each) do
26
+ Shrimple.processes.kill_all
27
+ count = Shrimple.processes.count
28
+ raise "still #{count} prcoess#{count == 1 ? '' : 'es'}??" unless count == 0
29
+ end
30
+ end
31
+
32
+
@@ -0,0 +1,3 @@
1
+ // ensures we properly handle a render script that doesn't even compile
2
+
3
+ var system = require('system'
@@ -0,0 +1,6 @@
1
+ <html>
2
+ <head></head>
3
+ <body>
4
+ <h1>Hello World!</h1>
5
+ </body>
6
+ </html>
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shrimple
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
+ platform: ruby
6
+ authors:
7
+ - Scott Bronson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hashie
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: dimensions
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Use PhantomJS to generate PDFs, PNGs, text files, etc.
70
+ email:
71
+ - brons_shrimple@rinspin.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - lib/render.js
83
+ - lib/shrimple.rb
84
+ - lib/shrimple/default_config.rb
85
+ - lib/shrimple/phantom.rb
86
+ - lib/shrimple/process.rb
87
+ - lib/shrimple/process_monitor.rb
88
+ - shrimple.gemspec
89
+ - spec/parse_and_print_stdin.js
90
+ - spec/shrimple/phantom_spec.rb
91
+ - spec/shrimple/process_monitor_spec.rb
92
+ - spec/shrimple/process_spec.rb
93
+ - spec/shrimple_long_spec.rb
94
+ - spec/shrimple_spec.rb
95
+ - spec/spec_helper.rb
96
+ - spec/syntax_error.js
97
+ - spec/test_file.html
98
+ homepage: http://github.com/bronson/shrimple
99
+ licenses:
100
+ - MIT
101
+ metadata: {}
102
+ post_install_message:
103
+ rdoc_options: []
104
+ require_paths:
105
+ - lib
106
+ required_ruby_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ requirements: []
117
+ rubyforge_project:
118
+ rubygems_version: 2.2.2
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: A simple Ruby interface to PhantomJS
122
+ test_files:
123
+ - spec/parse_and_print_stdin.js
124
+ - spec/shrimple/phantom_spec.rb
125
+ - spec/shrimple/process_monitor_spec.rb
126
+ - spec/shrimple/process_spec.rb
127
+ - spec/shrimple_long_spec.rb
128
+ - spec/shrimple_spec.rb
129
+ - spec/spec_helper.rb
130
+ - spec/syntax_error.js
131
+ - spec/test_file.html