doc_log 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +26 -0
  4. data/app/assets/javascripts/doc_log/application.js +16 -0
  5. data/app/assets/javascripts/doc_log/raw_log.js.coffee +13 -0
  6. data/app/assets/stylesheets/doc_log/application.css.scss +8 -0
  7. data/app/controllers/doc_log/application_controller.rb +8 -0
  8. data/app/controllers/doc_log/raw_logs_controller.rb +15 -0
  9. data/app/helpers/doc_log/application_helper.rb +4 -0
  10. data/app/helpers/doc_log/raw_log_helper.rb +26 -0
  11. data/app/models/doc_log/raw_log.rb +7 -0
  12. data/app/service/doc_log/sync.rb +42 -0
  13. data/app/views/doc_log/raw_logs/_raw_log.html.erb +10 -0
  14. data/app/views/doc_log/raw_logs/_table_header.html.erb +10 -0
  15. data/app/views/doc_log/raw_logs/index.html.erb +17 -0
  16. data/app/views/doc_log/raw_logs/index.js.erb +2 -0
  17. data/app/views/doc_log/raw_logs/show.html.erb +91 -0
  18. data/app/views/kaminari/_first_page.html.erb +3 -0
  19. data/app/views/kaminari/_gap.html.erb +3 -0
  20. data/app/views/kaminari/_last_page.html.erb +3 -0
  21. data/app/views/kaminari/_next_page.html.erb +3 -0
  22. data/app/views/kaminari/_page.html.erb +9 -0
  23. data/app/views/kaminari/_paginator.html.erb +15 -0
  24. data/app/views/kaminari/_prev_page.html.erb +3 -0
  25. data/app/views/layouts/doc_log/application.html.erb +52 -0
  26. data/config/routes.rb +5 -0
  27. data/db/migrate/20150805031359_create_doc_log_raw_logs.rb +25 -0
  28. data/db/seeds.rb +59 -0
  29. data/lib/doc_log/engine.rb +23 -0
  30. data/lib/doc_log/version.rb +3 -0
  31. data/lib/doc_log.rb +4 -0
  32. data/lib/tasks/doc_log_tasks.rake +4 -0
  33. metadata +332 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cf50850d7f8fdb99cdab8440bdc8cce386c84814
4
+ data.tar.gz: b168ac029c44224c5e645ab87a8f581df723cc17
5
+ SHA512:
6
+ metadata.gz: 0471767793da0fc0fe550722672894f0d55da59da1a1b5d7daf0fe83c64668b809e6865554fd4cc30320211f5887e9b7cbb374b28e5b2ad2a283273272c40030
7
+ data.tar.gz: b2f95fa59e177a6525bf642ac719cd1bc1c0d23e88c7f50611e419c88b1fb140e5d3df8bcf3d42add5a3f53be24be1585f89f8ea52da5d42a7774733aac26fb0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Jay brodie
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'DocLog'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require doc_log/raw_log
16
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ jQuery ->
2
+ $('.hasclear').keyup ->
3
+ t = $(this)
4
+ t.next('span').toggle Boolean(t.val())
5
+ return
6
+ $('.clearer').hide $(this).prev('input').val()
7
+ $('.clearer').click ->
8
+ $(this).prev('input').val('').focus()
9
+ $(this).hide()
10
+ $(this).parents('form:first').submit()
11
+ return
12
+ $('.hasclear').next('span').toggle Boolean($('.hasclear').val())
13
+ $('.hasclear').focus()
@@ -0,0 +1,8 @@
1
+ @import "font-awesome-sprockets";
2
+ @import "font-awesome";
3
+ @import "bootstrap-sprockets";
4
+ @import "bootstrap";
5
+
6
+ .navbar-inverse .navbar-text {
7
+ color: white;
8
+ }
@@ -0,0 +1,8 @@
1
+ module DocLog
2
+ class ApplicationController < ActionController::Base
3
+ def last_updated
4
+ RawLog.order(:doc_raptor_created_at).last.doc_raptor_created_at
5
+ end
6
+ helper_method :last_updated
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ module DocLog
2
+ class RawLogsController < DocLog::ApplicationController
3
+
4
+ def index
5
+ session[:search] = params[:q] if params[:q].present?
6
+ @q = RawLog.order(:id).ransack(session[:search])
7
+ @logs = @q.result.page(params[:page]).per(15)
8
+ end
9
+
10
+ def show
11
+ @q = RawLog.order(:id).ransack(session[:search])
12
+ @log = RawLog.find(params[:id])
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ module DocLog
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,26 @@
1
+ module DocLog
2
+ module RawLogHelper
3
+ def status_label status
4
+ return '<span class="label label-success">Success</span>'.html_safe if status
5
+ '<span class="label label-danger">Failed</span>'.html_safe
6
+ end
7
+
8
+ def javascript_label status
9
+ return '<span class="glyphicon glyphicon-ok-circle" aria-hidden="true" style="color:green"></span>'.html_safe if status
10
+ '<span class="glyphicon glyphicon-ban-circle" aria-hidden="true" style="color:red"></span>'.html_safe
11
+ end
12
+
13
+ def aysnc_label status
14
+ '<span class="glyphicon glyphicon-ok-circle" style="color:green"></span>'.html_safe if status
15
+ end
16
+
17
+ def test_label status
18
+ '<span class="glyphicon glyphicon-ok-circle" style="color:green"></span>'.html_safe if status
19
+ end
20
+
21
+ def document_type_label document_type
22
+ document_type.upcase
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ module DocLog
2
+ class RawLog < ActiveRecord::Base
3
+ def self.last_updated
4
+ order(doc_raptor_created_at: :asc).try(:last).try(:doc_raptor_created_at) || "2015-01-01 00:00:00 UTC"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,42 @@
1
+ module DocLog
2
+ class Sync
3
+
4
+ def self.sync
5
+ puts "Last Updated: #{RawLog.last_updated}"
6
+ fetch(1, RawLog.last_updated)
7
+ end
8
+
9
+ private
10
+
11
+ def self.fetch(page_number, start_date)
12
+ result = fetch_by_page(page_number, start_date)
13
+ puts "Processing Page: #{page_number}"
14
+ process_results(result)
15
+ fetch(page_number + 1, start_date) if result.present?
16
+ end
17
+
18
+ def self.fetch_by_page(page_number, start_date)
19
+ puts "Fetching Page: #{page_number}"
20
+ DocRaptor.api_key DocLog::Engine.config.api_key
21
+ begin
22
+ dr = DocRaptor.list_doc_logs!(search: { start: start_date, end: DateTime.now },
23
+ page: page_number, per_page: 10)
24
+ rescue DocRaptorException::DocumentListingFailure
25
+ puts '*********************************************************'
26
+ puts 'Error reading page'
27
+ puts '*********************************************************'
28
+ end
29
+ dr.parsed_response['doc_logs']
30
+ end
31
+
32
+ def self.process_results(results)
33
+ results.each do |row|
34
+ raw_log = RawLog.where(doc_raptor_log_id: row['id']).first_or_create
35
+ # rename some of the keys to ensure they don't clash
36
+ row['doc_raptor_log_id'] = row['id']
37
+ row['doc_raptor_created_at'] = row['created_at']
38
+ raw_log.update_attributes(row.except('id', 'created_at'))
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,10 @@
1
+ <tr>
2
+ <td><%= raw_log.doc_raptor_log_id %></td>
3
+ <td><%= status_label(raw_log.success) %></td>
4
+ <td><%= raw_log.name %></td>
5
+ <td><%= document_type_label(raw_log.document_type) %></td>
6
+ <td><%= test_label(raw_log.test) %></td>
7
+ <td><%= javascript_label(raw_log.javascript) %></td>
8
+ <td><%= aysnc_label(raw_log.async) %></td>
9
+ <td><%= link_to 'View', raw_log_path(raw_log.id), class: 'btn btn-xs btn-primary pull-right' %></td>
10
+ </tr>
@@ -0,0 +1,10 @@
1
+ <tr>
2
+ <th class="col-md-1"><%= sort_link(@q, :id, 'Id', default_order: :asc) %></th>
3
+ <th class="col-md-1"><%= sort_link(@q, :success, 'Status') %></th>
4
+ <th><%= sort_link(@q, :name) %></th>
5
+ <th class="col-md-1"><%= sort_link(@q, :document_type, 'Type') %></th>
6
+ <th class="col-md-1"><%= sort_link(@q, :test) %></th>
7
+ <th class="col-md-1"><%= sort_link(@q, :javascript, 'JS') %></th>
8
+ <th class="col-md-1"><%= sort_link(@q, :async) %></th>
9
+ <th class="col-md-1"></th>
10
+ </tr>
@@ -0,0 +1,17 @@
1
+ <div class="row">
2
+ <div class="col-md-12">
3
+ <table class="table table-striped">
4
+ <thead>
5
+ <%= render partial: 'table_header' %>
6
+ </thead>
7
+ <tbody id="logs_table_body">
8
+ <%= render partial: 'raw_log', collection: @logs %>
9
+ </tbody>
10
+ <table>
11
+ </div>
12
+ </div>
13
+ <div class="row">
14
+ <div class="col-md-12 text-center" id="paginator">
15
+ <%= paginate @logs, :remote => true %>
16
+ </div>
17
+ </div>
@@ -0,0 +1,2 @@
1
+ $('#logs_table_body').html('<%= escape_javascript render(@logs) %>');
2
+ $('#paginator').html('<%= escape_javascript(paginate(@logs, :remote => true).to_s) %>');
@@ -0,0 +1,91 @@
1
+ <div class="row">
2
+ <div class="col-md-12">
3
+ <%= link_to "Back", raw_logs_path, class: 'btn btn-primary pull-right' %><br /><br />
4
+ </div>
5
+ </div>
6
+ <div class="row">
7
+ <div class="col-md-6">
8
+ <table class="table table-border">
9
+ <tr>
10
+ <td>Status:</td>
11
+ <td><%= status_label(@log.success) %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="col-md-3">Created At:</td>
15
+ <td><%= @log.doc_raptor_created_at %></td>
16
+ </tr>
17
+ <tr>
18
+ <td>Generation Time:</td>
19
+ <td><%= @log.generation_time %> seconds</td>
20
+ </tr>
21
+ <tr>
22
+ <td>Name:</td>
23
+ <td><%= @log.name %></td>
24
+ </tr>
25
+ <tr>
26
+ <td>Document Type:</td>
27
+ <td><%= @log.document_type %></td>
28
+ </tr>
29
+ <tr>
30
+ <td>Document URL:</td>
31
+ <td><%= @log.document_url %></td>
32
+ </tr>
33
+ <tr>
34
+ <td>Tags:</td>
35
+ <td><%= @log.tag %></td>
36
+ </tr>
37
+ <tr>
38
+ <td>Test:</td>
39
+ <td><%= test_label(@log.test) %></td>
40
+ </tr>
41
+ <tr>
42
+ <td>Javascript:</td>
43
+ <td><%= javascript_label(@log.javascript) %></td>
44
+ </tr>
45
+ <tr>
46
+ <td>Async:</td>
47
+ <td><%= aysnc_label(@log.async) %></td>
48
+ </tr>
49
+ <tr>
50
+ <td>Strict:</td>
51
+ <td><%= @log.strict %></td>
52
+ </tr>
53
+ <tr>
54
+ <td>IP Address:</td>
55
+ <td><%= @log.ip_address %></td>
56
+ </tr>
57
+ <tr>
58
+ <td>Input Size:</td>
59
+ <td><%= number_to_human_size(@log.input_size) %></td>
60
+ </tr>
61
+ <tr>
62
+ <td>Output Size:</td>
63
+ <td><%= number_to_human_size(@log.output_size) %></td>
64
+ </tr>
65
+ </table>
66
+ </div>
67
+ <div class="col-md-6">
68
+ <div class="panel panel-default">
69
+ <div class="panel-heading">
70
+ <h3 class="panel-title">Prince Options</h3>
71
+ </div>
72
+ <div class="panel-body">
73
+ <%= @log.prince_options %>
74
+ </div>
75
+ </div>
76
+ <div class="panel panel-default">
77
+ <div class="panel-heading">
78
+ <h3 class="panel-title">Validation Errors</h3>
79
+ </div>
80
+ <div class="panel-body">
81
+ <%= @log.validation_errors %>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ <div class="row">
87
+ <div class="col-md-12 well">
88
+ <h3>Generation Log</h3>
89
+ <p><%= simple_format(@log.generation_log) %></p>
90
+ </div>
91
+ </div>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li class='disabled'>
2
+ <%= content_tag :a, raw(t 'views.pagination.truncate') %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
3
+ </li>
@@ -0,0 +1,9 @@
1
+ <% if page.current? %>
2
+ <li class='active'>
3
+ <%= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %>
4
+ </li>
5
+ <% else %>
6
+ <li>
7
+ <%= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %>
8
+ </li>
9
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%= paginator.render do -%>
2
+ <ul class="pagination">
3
+ <%= first_page_tag unless current_page.first? %>
4
+ <%= prev_page_tag unless current_page.first? %>
5
+ <% each_page do |page| -%>
6
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
7
+ <%= page_tag page %>
8
+ <% elsif !page.was_truncated? -%>
9
+ <%= gap_tag %>
10
+ <% end -%>
11
+ <% end -%>
12
+ <%= next_page_tag unless current_page.last? %>
13
+ <%= last_page_tag unless current_page.last? %>
14
+ </ul>
15
+ <% end -%>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
3
+ </li>
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <meta name="description" content="DocRaptor Log Viewer">
8
+ <meta name="author" content="Jason Brodie">
9
+ <title>DocLog - DocRaptor Log History</title>
10
+ <%= stylesheet_link_tag "doc_log/application", :media => "all" %>
11
+ <%= yield :stylesheet %>
12
+ <%= javascript_include_tag "doc_log/application" %>
13
+ <%= yield :javascript %>
14
+ <%= csrf_meta_tags %>
15
+
16
+ <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
17
+ <!--[if lt IE 9]>
18
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
19
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
20
+ <![endif]-->
21
+ </head>
22
+
23
+ <body>
24
+
25
+ <nav class="navbar navbar-inverse navbar-fixed-top">
26
+ <div class="container">
27
+ <div class="navbar-header">
28
+ <%= link_to 'DocLogs', root_path, class: 'navbar-brand' %>
29
+ </div>
30
+ <p class="navbar-text navbar-left">Last Updated: <%= last_updated %></p>
31
+ <div id="navbar">
32
+ <%= search_form_for @q, url: raw_logs_path, class: "navbar-form navbar-right" do |f| %>
33
+ <div class="form-group has-feedback">
34
+ <%= f.search_field :name_or_document_type_cont, class: "form-control hasclear" %>
35
+ <span class="clearer glyphicon glyphicon-remove-circle form-control-feedback"></span>
36
+ </div>
37
+ <%= f.submit 'Search', class: "btn btn-success" %>
38
+ <% end %>
39
+ </div>
40
+ </div>
41
+ </nav>
42
+
43
+ <div class="container" style="padding-top: 80px;">
44
+ <%= yield %>
45
+
46
+ <hr>
47
+ <footer>
48
+ <p>&copy; Jason Brodie <%= DateTime.now.strftime("%Y") %></p>
49
+ </footer>
50
+ </div>
51
+ </body>
52
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ DocLog::Engine.routes.draw do
2
+ root to: "raw_logs#index"
3
+ resources :raw_logs, only: [:index, :show]
4
+ get '/sync', to: 'raw_logs#sync'
5
+ end
@@ -0,0 +1,25 @@
1
+ class CreateDocLogRawLogs < ActiveRecord::Migration
2
+ def change
3
+ create_table :doc_log_raw_logs do |t|
4
+ t.integer :doc_raptor_log_id
5
+ t.datetime :doc_raptor_created_at
6
+ t.string :name
7
+ t.string :document_type
8
+ t.string :document_url
9
+ t.boolean :test
10
+ t.string :tag
11
+ t.boolean :success
12
+ t.boolean :javascript
13
+ t.boolean :async
14
+ t.string :strict
15
+ t.string :ip_address
16
+ t.float :generation_time
17
+ t.integer :input_size
18
+ t.integer :output_size
19
+ t.text :prince_options
20
+ t.text :validation_errors
21
+ t.text :generation_log
22
+ t.timestamps
23
+ end
24
+ end
25
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,59 @@
1
+ generation_log = <<-STRING
2
+ msg|inf||loading HTML5 input: -
3
+ sta|Running scripts...
4
+ msg|inf||loading script: /data/docraptor/releases/20150803200107/lib/princess.js
5
+ sta|Applying style sheets...
6
+ msg|inf||loading style sheet: /data/docraptor/releases/20150803200107/lib/prince_test_mode.css
7
+ msg|inf||loading style sheet: http:///assets/question_report-5d8c61657ef6243ddd63e2d2396780ec.css
8
+ msg|wrn|http:///assets/question_report-5d8c61657ef6243ddd63e2d2396780ec.css|Couldn't resolve host 'http'
9
+ sta|Preparing document...
10
+ sta|Converting document...
11
+ prg|0
12
+ msg|inf||used font: Times New Roman, Bold
13
+ msg|inf||used font: Times New Roman, Regular
14
+ msg|inf||used font: Times New Roman, Italic
15
+ prg|22
16
+ prg|42
17
+ prg|63
18
+ prg|86
19
+ prg|100
20
+ dat|total_page_count|5
21
+ fin|success
22
+ Fri Aug 7 14:03:38 2015: ---- begin
23
+ Fri Aug 7 14:03:38 2015: Loading document...
24
+ Fri Aug 7 14:03:38 2015: loading HTML5 input: -
25
+ Fri Aug 7 14:03:38 2015: Running scripts...
26
+ Fri Aug 7 14:03:38 2015: loading script: /data/docraptor/releases/20150803200107/lib/princess.js
27
+ Fri Aug 7 14:03:38 2015: Applying style sheets...
28
+ Fri Aug 7 14:03:38 2015: loading style sheet: /data/docraptor/releases/20150803200107/lib/prince_test_mode.css
29
+ Fri Aug 7 14:03:38 2015: loading style sheet: http:///assets/question_report-5d8c61657ef6243ddd63e2d2396780ec.css
30
+ Fri Aug 7 14:03:38 2015: http:///assets/question_report-5d8c61657ef6243ddd63e2d2396780ec.css: warning: Couldn't resolve host 'http'
31
+ Fri Aug 7 14:03:38 2015: Preparing document...
32
+ Fri Aug 7 14:03:38 2015: Converting document...
33
+ Fri Aug 7 14:03:38 2015: used font: Times New Roman, Bold
34
+ Fri Aug 7 14:03:38 2015: used font: Times New Roman, Regular
35
+ Fri Aug 7 14:03:38 2015: used font: Times New Roman, Italic
36
+ Fri Aug 7 14:03:38 2015: stats: total_page_count: 5
37
+ Fri Aug 7 14:03:38 2015: finished: success
38
+ Fri Aug 7 14:03:38 2015: ---- end
39
+ STRING
40
+
41
+ (1..100).each do |x|
42
+ DocLog::RawLog.create( name: "Company #{x}",
43
+ document_type: "pdf",
44
+ document_url: "http://www.docraptor.com",
45
+ test: true,
46
+ tag: "Tag1, Tag2, Tag3",
47
+ success: true,
48
+ javascript: true,
49
+ async: true,
50
+ ip_address: "10.10.10.10",
51
+ created_at: DateTime.now,
52
+ generation_time: 10.0,
53
+ input_size: 30000,
54
+ output_size: 250000,
55
+ prince_options: nil,
56
+ validation_errors: "Something bad happened",
57
+ generation_log: generation_log
58
+ )
59
+ end
@@ -0,0 +1,23 @@
1
+ require 'doc_raptor'
2
+ require 'jquery-rails'
3
+ require 'sass-rails'
4
+ require 'sprockets'
5
+ require 'bootstrap-sass'
6
+ require 'quiet_assets'
7
+ require 'font-awesome-sass'
8
+ require 'kaminari'
9
+ require 'ransack'
10
+
11
+ module DocLog
12
+ class Engine < ::Rails::Engine
13
+ isolate_namespace DocLog
14
+
15
+ initializer :append_migrations do |app|
16
+ unless app.root.to_s.match root.to_s
17
+ config.paths['db/migrate'].expanded.each do |expanded_path|
18
+ app.config.paths['db/migrate'] << expanded_path
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module DocLog
2
+ VERSION = "0.0.2"
3
+ end
data/lib/doc_log.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "doc_log/engine"
2
+
3
+ module DocLog
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :doc_log do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,332 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: doc_log
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Jay brodie
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 4.2.3
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '4.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 4.2.3
33
+ - !ruby/object:Gem::Dependency
34
+ name: twitter-bootstrap-rails
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.2'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.2.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.2'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.2.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: jquery-rails
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '4.0'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 4.0.4
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '4.0'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 4.0.4
73
+ - !ruby/object:Gem::Dependency
74
+ name: therubyracer
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '0.12'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.12.2
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.12'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 0.12.2
93
+ - !ruby/object:Gem::Dependency
94
+ name: sass-rails
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '5.0'
100
+ type: :runtime
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '5.0'
107
+ - !ruby/object:Gem::Dependency
108
+ name: sprockets
109
+ requirement: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '3.2'
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 3.2.0
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '3.2'
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 3.2.0
127
+ - !ruby/object:Gem::Dependency
128
+ name: bootstrap-sass
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - '='
132
+ - !ruby/object:Gem::Version
133
+ version: 3.2.0.2
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - '='
139
+ - !ruby/object:Gem::Version
140
+ version: 3.2.0.2
141
+ - !ruby/object:Gem::Dependency
142
+ name: coffee-rails
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: '4.1'
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: 4.1.0
151
+ type: :runtime
152
+ prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '4.1'
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 4.1.0
161
+ - !ruby/object:Gem::Dependency
162
+ name: font-awesome-sass
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '4.1'
168
+ type: :runtime
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: '4.1'
175
+ - !ruby/object:Gem::Dependency
176
+ name: quiet_assets
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '1.0'
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: 1.0.2
185
+ type: :runtime
186
+ prerelease: false
187
+ version_requirements: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - "~>"
190
+ - !ruby/object:Gem::Version
191
+ version: '1.0'
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: 1.0.2
195
+ - !ruby/object:Gem::Dependency
196
+ name: kaminari
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.16'
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: 0.16.3
205
+ type: :runtime
206
+ prerelease: false
207
+ version_requirements: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - "~>"
210
+ - !ruby/object:Gem::Version
211
+ version: '0.16'
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: 0.16.3
215
+ - !ruby/object:Gem::Dependency
216
+ name: ransack
217
+ requirement: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '1.6'
222
+ - - ">="
223
+ - !ruby/object:Gem::Version
224
+ version: 1.6.6
225
+ type: :runtime
226
+ prerelease: false
227
+ version_requirements: !ruby/object:Gem::Requirement
228
+ requirements:
229
+ - - "~>"
230
+ - !ruby/object:Gem::Version
231
+ version: '1.6'
232
+ - - ">="
233
+ - !ruby/object:Gem::Version
234
+ version: 1.6.6
235
+ - !ruby/object:Gem::Dependency
236
+ name: doc_raptor
237
+ requirement: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - "~>"
240
+ - !ruby/object:Gem::Version
241
+ version: '0.5'
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: 0.5.0
245
+ type: :runtime
246
+ prerelease: false
247
+ version_requirements: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - "~>"
250
+ - !ruby/object:Gem::Version
251
+ version: '0.5'
252
+ - - ">="
253
+ - !ruby/object:Gem::Version
254
+ version: 0.5.0
255
+ - !ruby/object:Gem::Dependency
256
+ name: sqlite3
257
+ requirement: !ruby/object:Gem::Requirement
258
+ requirements:
259
+ - - "~>"
260
+ - !ruby/object:Gem::Version
261
+ version: '0'
262
+ type: :development
263
+ prerelease: false
264
+ version_requirements: !ruby/object:Gem::Requirement
265
+ requirements:
266
+ - - "~>"
267
+ - !ruby/object:Gem::Version
268
+ version: '0'
269
+ description: Sync and view your DocRaptor log files locally. Prevents having to give
270
+ out your login to the service to the entire team.
271
+ email:
272
+ - jason.d.brodie@gmail.com
273
+ executables: []
274
+ extensions: []
275
+ extra_rdoc_files: []
276
+ files:
277
+ - MIT-LICENSE
278
+ - Rakefile
279
+ - app/assets/javascripts/doc_log/application.js
280
+ - app/assets/javascripts/doc_log/raw_log.js.coffee
281
+ - app/assets/stylesheets/doc_log/application.css.scss
282
+ - app/controllers/doc_log/application_controller.rb
283
+ - app/controllers/doc_log/raw_logs_controller.rb
284
+ - app/helpers/doc_log/application_helper.rb
285
+ - app/helpers/doc_log/raw_log_helper.rb
286
+ - app/models/doc_log/raw_log.rb
287
+ - app/service/doc_log/sync.rb
288
+ - app/views/doc_log/raw_logs/_raw_log.html.erb
289
+ - app/views/doc_log/raw_logs/_table_header.html.erb
290
+ - app/views/doc_log/raw_logs/index.html.erb
291
+ - app/views/doc_log/raw_logs/index.js.erb
292
+ - app/views/doc_log/raw_logs/show.html.erb
293
+ - app/views/kaminari/_first_page.html.erb
294
+ - app/views/kaminari/_gap.html.erb
295
+ - app/views/kaminari/_last_page.html.erb
296
+ - app/views/kaminari/_next_page.html.erb
297
+ - app/views/kaminari/_page.html.erb
298
+ - app/views/kaminari/_paginator.html.erb
299
+ - app/views/kaminari/_prev_page.html.erb
300
+ - app/views/layouts/doc_log/application.html.erb
301
+ - config/routes.rb
302
+ - db/migrate/20150805031359_create_doc_log_raw_logs.rb
303
+ - db/seeds.rb
304
+ - lib/doc_log.rb
305
+ - lib/doc_log/engine.rb
306
+ - lib/doc_log/version.rb
307
+ - lib/tasks/doc_log_tasks.rake
308
+ homepage: https://github.com/jbrodie/doc_log
309
+ licenses:
310
+ - MIT
311
+ metadata: {}
312
+ post_install_message:
313
+ rdoc_options: []
314
+ require_paths:
315
+ - lib
316
+ required_ruby_version: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ version: '0'
321
+ required_rubygems_version: !ruby/object:Gem::Requirement
322
+ requirements:
323
+ - - ">="
324
+ - !ruby/object:Gem::Version
325
+ version: '0'
326
+ requirements: []
327
+ rubyforge_project:
328
+ rubygems_version: 2.2.2
329
+ signing_key:
330
+ specification_version: 4
331
+ summary: Allows for sync and local access to DocRaptor log files.
332
+ test_files: []