docmago_client 0.0.1

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.
Files changed (48) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +38 -0
  4. data/lib/docmago_client/error.rb +6 -0
  5. data/lib/docmago_client/exception.rb +25 -0
  6. data/lib/docmago_client/pdf_renderer.rb +15 -0
  7. data/lib/docmago_client/version.rb +3 -0
  8. data/lib/docmago_client.rb +100 -0
  9. data/lib/tasks/docmago_client_tasks.rake +4 -0
  10. data/test/docmago_client_test.rb +7 -0
  11. data/test/dummy/README.rdoc +261 -0
  12. data/test/dummy/Rakefile +7 -0
  13. data/test/dummy/app/assets/javascripts/application.js +15 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/test/dummy/app/controllers/application_controller.rb +3 -0
  16. data/test/dummy/app/controllers/home_controller.rb +8 -0
  17. data/test/dummy/app/helpers/application_helper.rb +2 -0
  18. data/test/dummy/app/views/home/index.html.erb +2 -0
  19. data/test/dummy/app/views/home/index.pdf.erb +1 -0
  20. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  21. data/test/dummy/config/application.rb +59 -0
  22. data/test/dummy/config/boot.rb +10 -0
  23. data/test/dummy/config/database.yml +25 -0
  24. data/test/dummy/config/environment.rb +5 -0
  25. data/test/dummy/config/environments/development.rb +37 -0
  26. data/test/dummy/config/environments/production.rb +67 -0
  27. data/test/dummy/config/environments/test.rb +37 -0
  28. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  29. data/test/dummy/config/initializers/inflections.rb +15 -0
  30. data/test/dummy/config/initializers/mime_types.rb +5 -0
  31. data/test/dummy/config/initializers/secret_token.rb +7 -0
  32. data/test/dummy/config/initializers/session_store.rb +8 -0
  33. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  34. data/test/dummy/config/locales/en.yml +5 -0
  35. data/test/dummy/config/routes.rb +3 -0
  36. data/test/dummy/config.ru +4 -0
  37. data/test/dummy/db/test.sqlite3 +0 -0
  38. data/test/dummy/log/development.log +0 -0
  39. data/test/dummy/log/test.log +373 -0
  40. data/test/dummy/public/404.html +26 -0
  41. data/test/dummy/public/422.html +26 -0
  42. data/test/dummy/public/500.html +25 -0
  43. data/test/dummy/public/favicon.ico +0 -0
  44. data/test/dummy/script/rails +6 -0
  45. data/test/integration/navigation_test.rb +22 -0
  46. data/test/support/integration_case.rb +5 -0
  47. data/test/test_helper.rb +20 -0
  48. metadata +194 -0
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,22 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActiveSupport::IntegrationCase
4
+ test "truth" do
5
+ assert_kind_of Dummy::Application, Rails.application
6
+ end
7
+
8
+ test "pdf request sends a pdf as file" do
9
+ visit home_path
10
+ click_link 'PDF'
11
+
12
+ assert_equal 'binary', headers['Content-Transfer-Encoding']
13
+ assert_equal 'attachment; filename="contents.pdf"', headers['Content-Disposition']
14
+ assert_equal 'application/pdf', headers['Content-Type']
15
+ end
16
+
17
+ protected
18
+
19
+ def headers
20
+ page.response_headers
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ # Define a bare test case to use with Capybara
2
+ class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
3
+ include Capybara::DSL
4
+ include Rails.application.routes.url_helpers
5
+ end
@@ -0,0 +1,20 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Configure capybara for integration testing
10
+ require "capybara/rails"
11
+ Capybara.default_driver = :rack_test
12
+ Capybara.default_selector = :css
13
+
14
+ # Load support files
15
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
16
+
17
+ # Load fixtures from the engine
18
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
19
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
20
+ end
metadata ADDED
@@ -0,0 +1,194 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: docmago_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jan Habermann
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: httparty
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.7.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.7.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: rails
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 3.2.5
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 3.2.5
46
+ - !ruby/object:Gem::Dependency
47
+ name: sqlite3
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: capybara
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: Makes it easy to create PDF documents through the Docmago API.
79
+ email:
80
+ - jan@habermann24.com
81
+ executables: []
82
+ extensions: []
83
+ extra_rdoc_files: []
84
+ files:
85
+ - lib/docmago_client/error.rb
86
+ - lib/docmago_client/exception.rb
87
+ - lib/docmago_client/pdf_renderer.rb
88
+ - lib/docmago_client/version.rb
89
+ - lib/docmago_client.rb
90
+ - lib/tasks/docmago_client_tasks.rake
91
+ - MIT-LICENSE
92
+ - Rakefile
93
+ - README.rdoc
94
+ - test/docmago_client_test.rb
95
+ - test/dummy/app/assets/javascripts/application.js
96
+ - test/dummy/app/assets/stylesheets/application.css
97
+ - test/dummy/app/controllers/application_controller.rb
98
+ - test/dummy/app/controllers/home_controller.rb
99
+ - test/dummy/app/helpers/application_helper.rb
100
+ - test/dummy/app/views/home/index.html.erb
101
+ - test/dummy/app/views/home/index.pdf.erb
102
+ - test/dummy/app/views/layouts/application.html.erb
103
+ - test/dummy/config/application.rb
104
+ - test/dummy/config/boot.rb
105
+ - test/dummy/config/database.yml
106
+ - test/dummy/config/environment.rb
107
+ - test/dummy/config/environments/development.rb
108
+ - test/dummy/config/environments/production.rb
109
+ - test/dummy/config/environments/test.rb
110
+ - test/dummy/config/initializers/backtrace_silencers.rb
111
+ - test/dummy/config/initializers/inflections.rb
112
+ - test/dummy/config/initializers/mime_types.rb
113
+ - test/dummy/config/initializers/secret_token.rb
114
+ - test/dummy/config/initializers/session_store.rb
115
+ - test/dummy/config/initializers/wrap_parameters.rb
116
+ - test/dummy/config/locales/en.yml
117
+ - test/dummy/config/routes.rb
118
+ - test/dummy/config.ru
119
+ - test/dummy/db/test.sqlite3
120
+ - test/dummy/log/development.log
121
+ - test/dummy/log/test.log
122
+ - test/dummy/public/404.html
123
+ - test/dummy/public/422.html
124
+ - test/dummy/public/500.html
125
+ - test/dummy/public/favicon.ico
126
+ - test/dummy/Rakefile
127
+ - test/dummy/README.rdoc
128
+ - test/dummy/script/rails
129
+ - test/integration/navigation_test.rb
130
+ - test/support/integration_case.rb
131
+ - test/test_helper.rb
132
+ homepage: http://github.com/docmago/docmago_client
133
+ licenses: []
134
+ post_install_message:
135
+ rdoc_options: []
136
+ require_paths:
137
+ - lib
138
+ required_ruby_version: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubyforge_project:
152
+ rubygems_version: 1.8.23
153
+ signing_key:
154
+ specification_version: 3
155
+ summary: Client for the Docmago API (www.docmago.com)
156
+ test_files:
157
+ - test/docmago_client_test.rb
158
+ - test/dummy/app/assets/javascripts/application.js
159
+ - test/dummy/app/assets/stylesheets/application.css
160
+ - test/dummy/app/controllers/application_controller.rb
161
+ - test/dummy/app/controllers/home_controller.rb
162
+ - test/dummy/app/helpers/application_helper.rb
163
+ - test/dummy/app/views/home/index.html.erb
164
+ - test/dummy/app/views/home/index.pdf.erb
165
+ - test/dummy/app/views/layouts/application.html.erb
166
+ - test/dummy/config/application.rb
167
+ - test/dummy/config/boot.rb
168
+ - test/dummy/config/database.yml
169
+ - test/dummy/config/environment.rb
170
+ - test/dummy/config/environments/development.rb
171
+ - test/dummy/config/environments/production.rb
172
+ - test/dummy/config/environments/test.rb
173
+ - test/dummy/config/initializers/backtrace_silencers.rb
174
+ - test/dummy/config/initializers/inflections.rb
175
+ - test/dummy/config/initializers/mime_types.rb
176
+ - test/dummy/config/initializers/secret_token.rb
177
+ - test/dummy/config/initializers/session_store.rb
178
+ - test/dummy/config/initializers/wrap_parameters.rb
179
+ - test/dummy/config/locales/en.yml
180
+ - test/dummy/config/routes.rb
181
+ - test/dummy/config.ru
182
+ - test/dummy/db/test.sqlite3
183
+ - test/dummy/log/development.log
184
+ - test/dummy/log/test.log
185
+ - test/dummy/public/404.html
186
+ - test/dummy/public/422.html
187
+ - test/dummy/public/500.html
188
+ - test/dummy/public/favicon.ico
189
+ - test/dummy/Rakefile
190
+ - test/dummy/README.rdoc
191
+ - test/dummy/script/rails
192
+ - test/integration/navigation_test.rb
193
+ - test/support/integration_case.rb
194
+ - test/test_helper.rb