wiselinks 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.rspec +2 -0
  2. data/Gemfile +6 -1
  3. data/Gemfile.lock +59 -0
  4. data/README.md +1 -1
  5. data/VERSION +1 -1
  6. data/lib/assets/javascripts/_json2.js +486 -0
  7. data/lib/assets/javascripts/wiselinks.js.coffee +1 -0
  8. data/spec/cases/helpers_spec.rb +8 -0
  9. data/spec/cases/request_spec.rb +113 -0
  10. data/{test → spec}/dummy/README.rdoc +0 -0
  11. data/{test → spec}/dummy/Rakefile +0 -0
  12. data/spec/dummy/app/assets/javascripts/application.js.coffee +1 -0
  13. data/{test → spec}/dummy/app/assets/stylesheets/application.css +0 -0
  14. data/{test → spec}/dummy/app/controllers/application_controller.rb +3 -2
  15. data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
  16. data/{test → spec}/dummy/app/mailers/.gitkeep +0 -0
  17. data/{test → spec}/dummy/app/models/.gitkeep +0 -0
  18. data/{test/dummy/app/views/application/index.pdf.erb → spec/dummy/app/views/application/index.html.erb} +0 -0
  19. data/{test → spec}/dummy/app/views/layouts/application.html.erb +1 -0
  20. data/{test → spec}/dummy/config/application.rb +2 -0
  21. data/{test → spec}/dummy/config/boot.rb +0 -0
  22. data/{test → spec}/dummy/config/database.yml +0 -0
  23. data/{test → spec}/dummy/config/environment.rb +0 -0
  24. data/{test → spec}/dummy/config/environments/development.rb +0 -0
  25. data/{test → spec}/dummy/config/environments/production.rb +0 -0
  26. data/{test → spec}/dummy/config/environments/test.rb +3 -0
  27. data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
  28. data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
  29. data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
  30. data/{test → spec}/dummy/config/initializers/secret_token.rb +0 -0
  31. data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
  32. data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
  33. data/{test → spec}/dummy/config/locales/en.yml +0 -0
  34. data/{test → spec}/dummy/config/routes.rb +1 -1
  35. data/{test → spec}/dummy/config.ru +0 -0
  36. data/{test → spec}/dummy/lib/assets/.gitkeep +0 -0
  37. data/{test → spec}/dummy/log/.gitkeep +0 -0
  38. data/{test → spec}/dummy/log/development.log +0 -0
  39. data/{test → spec}/dummy/log/test.log +93 -0
  40. data/{test → spec}/dummy/public/404.html +0 -0
  41. data/{test → spec}/dummy/public/422.html +0 -0
  42. data/{test → spec}/dummy/public/500.html +0 -0
  43. data/spec/dummy/public/assets/application-a98e47eb93026a340a766faf55214702.js +2830 -0
  44. data/spec/dummy/public/assets/application-a98e47eb93026a340a766faf55214702.js.gz +0 -0
  45. data/spec/dummy/public/assets/application-ecf5beebe0b79251c8be40f0443074f2.css +14 -0
  46. data/spec/dummy/public/assets/application-ecf5beebe0b79251c8be40f0443074f2.css.gz +0 -0
  47. data/spec/dummy/public/assets/application.css +14 -0
  48. data/spec/dummy/public/assets/application.css.gz +0 -0
  49. data/spec/dummy/public/assets/application.js +2830 -0
  50. data/spec/dummy/public/assets/application.js.gz +0 -0
  51. data/spec/dummy/public/assets/manifest.yml +5 -0
  52. data/{test → spec}/dummy/public/favicon.ico +0 -0
  53. data/{test/dummy/app/assets → spec/dummy/public}/javascripts/wisepdf.js +0 -0
  54. data/{test/dummy/app/assets → spec/dummy/public}/stylesheets/wisepdf.css +0 -0
  55. data/{test → spec}/dummy/script/rails +0 -0
  56. data/spec/dummy/tmp/cache/assets/C26/0A0/sprockets%2F52456508a38f02f4559064b24980c87a +0 -0
  57. data/spec/dummy/tmp/cache/assets/C5E/890/sprockets%2Ffb6525457b6873e6905e2d522548091f +0 -0
  58. data/spec/dummy/tmp/cache/assets/C80/150/sprockets%2F0d3881005b0646df783d5c24683d34f5 +0 -0
  59. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  60. data/spec/dummy/tmp/cache/assets/CF3/250/sprockets%2F7edb1809ce839a3d290508f935c89f42 +0 -0
  61. data/spec/dummy/tmp/cache/assets/D09/C40/sprockets%2Fcf317b95ed0500b7277e950a9c0c82e0 +0 -0
  62. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  63. data/spec/dummy/tmp/cache/assets/D45/760/sprockets%2Fbc659a6e09b5025e8be539b0b68f71f2 +0 -0
  64. data/spec/dummy/tmp/cache/assets/D4E/D00/sprockets%2F1a6846f0a837ae2524e2f9ec89e6ef43 +0 -0
  65. data/spec/dummy/tmp/cache/assets/D55/090/sprockets%2F4a21bc343a4696b7603ea4cc25c3c3ba +0 -0
  66. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  67. data/spec/dummy/tmp/cache/assets/DC2/EB0/sprockets%2F75b4716f479a2acfac51b258fba0c2bd +0 -0
  68. data/spec/dummy/tmp/cache/assets/DF1/B80/sprockets%2Fcd0ee4f742908cb7223a1e7be4a4ccbc +0 -0
  69. data/spec/dummy/tmp/cache/assets/E11/4E0/sprockets%2F86e145a39f85cceeaffdff91ebb61449 +0 -0
  70. data/spec/factories/requests.rb +30 -0
  71. data/spec/helper.rb +17 -0
  72. data/wiselinks.gemspec +68 -50
  73. metadata +69 -51
  74. data/test/cases/application_controller_test.rb +0 -35
  75. data/test/dummy/app/assets/javascripts/application.js +0 -15
  76. data/test/dummy/app/views/layouts/pdf.html.erb +0 -14
  77. data/test/dummy/public/javascripts/wisepdf.js +0 -1
  78. data/test/dummy/public/stylesheets/wisepdf.css +0 -1
  79. data/test/dummy/tmp/cache/assets/CA9/590/sprockets%2F260d19b0714b39b217abfe83309458b7 +0 -0
  80. data/test/dummy/tmp/cache/assets/D13/4A0/sprockets%2Fc857f4fea90e731182fa7000ea6833e9 +0 -0
  81. data/test/dummy/tmp/cache/assets/D1C/0F0/sprockets%2F13dc05c787589dd73a669e0ad23d54e8 +0 -0
  82. data/test/dummy/tmp/cache/assets/D6E/B20/sprockets%2F2669d77f5dd55e82ba092accac21871a +0 -0
  83. data/test/dummy/tmp/cache/assets/D93/BA0/sprockets%2Fe162e2a148480db4edf41c7ca8a527cb +0 -0
  84. data/test/dummy/tmp/cache/assets/E1B/1A0/sprockets%2Fbdc3a3ccd7d2f02dddd41712ed4c8e31 +0 -0
  85. data/test/helper.rb +0 -14
@@ -0,0 +1,113 @@
1
+ require "helper"
2
+
3
+ describe ActionDispatch::Request do
4
+ describe 'request' do
5
+ before :all do
6
+ @request = FactoryGirl.build(:request)
7
+ end
8
+
9
+ it "should be" do
10
+ @request.should be
11
+ end
12
+
13
+ context 'should respond to wiselinks methods' do
14
+ it '#wiselinks?' do
15
+ @request.should respond_to(:wiselinks?)
16
+ end
17
+
18
+ it '#wiselinks_template?' do
19
+ @request.should respond_to(:wiselinks_template?)
20
+ end
21
+
22
+ it '#wiselinks_partial?' do
23
+ @request.should respond_to(:wiselinks_partial?)
24
+ end
25
+ end
26
+
27
+ context 'wiselinks methods' do
28
+ it 'should not be a wiselinks request' do
29
+ @request.wiselinks?.should == false
30
+ end
31
+
32
+ it 'should not be a wiselinks template request' do
33
+ @request.wiselinks_template?.should == false
34
+ end
35
+
36
+ it 'should not be a wiselinks partial request' do
37
+ @request.wiselinks_partial?.should == false
38
+ end
39
+ end
40
+ end
41
+
42
+ describe 'wiselinks_request' do
43
+ before :all do
44
+ @request = FactoryGirl.build(:wiselinks_request)
45
+ end
46
+
47
+ it "should be" do
48
+ @request.should be
49
+ end
50
+
51
+ context 'wiselinks methods' do
52
+ it 'should be a wiselinks request' do
53
+ @request.wiselinks?.should == true
54
+ end
55
+
56
+ it 'should be a wiselinks template request' do
57
+ @request.wiselinks_template?.should == true
58
+ end
59
+
60
+ it 'should not be a wiselinks partial request' do
61
+ @request.wiselinks_partial?.should == false
62
+ end
63
+ end
64
+ end
65
+
66
+ describe 'wiselinks_template_request' do
67
+ before :all do
68
+ @request = FactoryGirl.build(:wiselinks_template_request)
69
+ end
70
+
71
+ it "should be" do
72
+ @request.should be
73
+ end
74
+
75
+ context 'wiselinks methods' do
76
+ it 'should be a wiselinks request' do
77
+ @request.wiselinks?.should == true
78
+ end
79
+
80
+ it 'should be a wiselinks template request' do
81
+ @request.wiselinks_template?.should == true
82
+ end
83
+
84
+ it 'should not be a wiselinks partial request' do
85
+ @request.wiselinks_partial?.should == false
86
+ end
87
+ end
88
+ end
89
+
90
+ describe 'wiselinks_partial_request' do
91
+ before :all do
92
+ @request = FactoryGirl.build(:wiselinks_partial_request)
93
+ end
94
+
95
+ it "should be" do
96
+ @request.should be
97
+ end
98
+
99
+ context 'wiselinks methods' do
100
+ it 'should be a wiselinks request' do
101
+ @request.wiselinks?.should == true
102
+ end
103
+
104
+ it 'should not be a wiselinks template request' do
105
+ @request.wiselinks_template?.should == false
106
+ end
107
+
108
+ it 'should be a wiselinks partial request' do
109
+ @request.wiselinks_partial?.should == true
110
+ end
111
+ end
112
+ end
113
+ end
File without changes
File without changes
@@ -0,0 +1 @@
1
+ #= require wiselinks
@@ -1,7 +1,8 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
3
 
4
- def index
5
- render :pdf => 'filename'
4
+ layout 'application'
5
+
6
+ def index
6
7
  end
7
8
  end
File without changes
File without changes
@@ -5,6 +5,7 @@
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
6
  <%= javascript_include_tag "application" %>
7
7
  <%= csrf_meta_tags %>
8
+ <%= wiselinks_meta_tag %>
8
9
  </head>
9
10
  <body>
10
11
 
@@ -52,6 +52,8 @@ module Dummy
52
52
 
53
53
  # Version of your assets, change this if you want to expire all your assets
54
54
  config.assets.version = '1.0'
55
+
56
+ config.assets.precompile += %w( *.css *.coffee )
55
57
  end
56
58
  end
57
59
 
File without changes
File without changes
File without changes
@@ -11,6 +11,9 @@ Dummy::Application.configure do
11
11
  config.serve_static_assets = true
12
12
  config.static_cache_control = "public, max-age=3600"
13
13
 
14
+ # Generate digests for assets URLs
15
+ config.assets.digest = true
16
+
14
17
  # Log error messages when you accidentally call methods on nil
15
18
  config.whiny_nils = true
16
19
 
File without changes
@@ -1,3 +1,3 @@
1
1
  Dummy::Application.routes.draw do
2
- get 'index' => 'application#index'
2
+ root :to => 'application#index'
3
3
  end
File without changes
File without changes
File without changes
File without changes
@@ -52306,3 +52306,96 @@ Connecting to database specified by database.yml
52306
52306
   (0.1ms) rollback transaction
52307
52307
   (0.0ms) begin transaction
52308
52308
   (0.1ms) rollback transaction
52309
+ Started GET "/" for 127.0.0.1 at 2013-01-07 01:45:41 +0400
52310
+ Connecting to database specified by database.yml
52311
+ Processing by ApplicationController#index as HTML
52312
+ Rendered application/index.html.erb within layouts/application (4.7ms)
52313
+ Completed 200 OK in 27ms (Views: 26.6ms | ActiveRecord: 0.0ms)
52314
+ Started GET "/" for 127.0.0.1 at 2013-01-07 01:48:29 +0400
52315
+ Connecting to database specified by database.yml
52316
+ Processing by ApplicationController#index as HTML
52317
+ Rendered application/index.html.erb within layouts/application (3.8ms)
52318
+ Completed 200 OK in 23ms (Views: 22.8ms | ActiveRecord: 0.0ms)
52319
+ Started GET "/" for 127.0.0.1 at 2013-01-07 01:56:25 +0400
52320
+ Connecting to database specified by database.yml
52321
+ Processing by ApplicationController#index as HTML
52322
+ Rendered application/index.html.erb within layouts/application (4.0ms)
52323
+ Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)
52324
+ Started GET "/" for 127.0.0.1 at 2013-01-07 02:06:32 +0400
52325
+ Connecting to database specified by database.yml
52326
+ Processing by ApplicationController#index as HTML
52327
+ Rendered application/index.html.erb within layouts/application (3.8ms)
52328
+ Completed 200 OK in 23ms (Views: 22.3ms | ActiveRecord: 0.0ms)
52329
+ Started GET "/" for 127.0.0.1 at 2013-01-07 02:06:59 +0400
52330
+ Connecting to database specified by database.yml
52331
+ Processing by ApplicationController#index as HTML
52332
+ Rendered application/index.html.erb within layouts/application (3.8ms)
52333
+ Completed 200 OK in 23ms (Views: 22.1ms | ActiveRecord: 0.0ms)
52334
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:42:32 +0400
52335
+ Connecting to database specified by database.yml
52336
+ Processing by ApplicationController#index as HTML
52337
+ Rendered application/index.html.erb within layouts/application (4.0ms)
52338
+ Completed 200 OK in 23ms (Views: 22.6ms | ActiveRecord: 0.0ms)
52339
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:44:37 +0400
52340
+ Connecting to database specified by database.yml
52341
+ Processing by ApplicationController#index as HTML
52342
+ Rendered application/index.html.erb within layouts/application (3.9ms)
52343
+ Completed 200 OK in 23ms (Views: 22.4ms | ActiveRecord: 0.0ms)
52344
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:45:20 +0400
52345
+ Connecting to database specified by database.yml
52346
+ Processing by ApplicationController#index as HTML
52347
+ Rendered application/index.html.erb within layouts/application (4.1ms)
52348
+ Completed 200 OK in 23ms (Views: 22.7ms | ActiveRecord: 0.0ms)
52349
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:46:52 +0400
52350
+ Connecting to database specified by database.yml
52351
+ Processing by ApplicationController#index as HTML
52352
+ Rendered application/index.html.erb within layouts/application (3.8ms)
52353
+ Compiled application.css (1ms) (pid 28170)
52354
+ Completed 500 Internal Server Error in 92ms
52355
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:47:41 +0400
52356
+ Connecting to database specified by database.yml
52357
+ Processing by ApplicationController#index as HTML
52358
+ Rendered application/index.html.erb within layouts/application (4.5ms)
52359
+ Completed 500 Internal Server Error in 130ms
52360
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:50:19 +0400
52361
+ Connecting to database specified by database.yml
52362
+ Processing by ApplicationController#index as HTML
52363
+ Rendered application/index.html.erb within layouts/application (3.9ms)
52364
+ Compiled _history.js (1ms) (pid 28390)
52365
+ Compiled _history.html4.js (0ms) (pid 28390)
52366
+ Compiled _history.adapter.jquery.js (0ms) (pid 28390)
52367
+ Compiled wiselinks.js (274ms) (pid 28390)
52368
+ Compiled application.js (564ms) (pid 28390)
52369
+ Completed 500 Internal Server Error in 665ms
52370
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:51:33 +0400
52371
+ Connecting to database specified by database.yml
52372
+ Processing by ApplicationController#index as HTML
52373
+ Rendered application/index.html.erb within layouts/application (4.3ms)
52374
+ Completed 200 OK in 82ms (Views: 81.7ms | ActiveRecord: 0.0ms)
52375
+ Started GET "/" for 127.0.0.1 at 2013-01-07 10:54:46 +0400
52376
+ Connecting to database specified by database.yml
52377
+ Processing by ApplicationController#index as HTML
52378
+ Rendered application/index.html.erb within layouts/application (4.2ms)
52379
+ Completed 200 OK in 39ms (Views: 38.5ms | ActiveRecord: 0.0ms)
52380
+ Compiled _history.js (1ms) (pid 29102)
52381
+ Compiled _history.html4.js (0ms) (pid 29102)
52382
+ Compiled _history.adapter.jquery.js (0ms) (pid 29102)
52383
+ Compiled wiselinks.js (236ms) (pid 29102)
52384
+ Compiled application.js (389ms) (pid 29102)
52385
+ Compiled application.css (1ms) (pid 29102)
52386
+ Compiled _history.js (1ms) (pid 29102)
52387
+ Compiled _history.html4.js (0ms) (pid 29102)
52388
+ Compiled _history.adapter.jquery.js (0ms) (pid 29102)
52389
+ Compiled wiselinks.js (237ms) (pid 29102)
52390
+ Compiled application.js (408ms) (pid 29102)
52391
+ Compiled application.css (1ms) (pid 29102)
52392
+ Started GET "/" for 127.0.0.1 at 2013-01-07 11:21:57 +0400
52393
+ Connecting to database specified by database.yml
52394
+ Processing by ApplicationController#index as HTML
52395
+ Rendered application/index.html.erb within layouts/application (3.9ms)
52396
+ Completed 200 OK in 23ms (Views: 22.9ms | ActiveRecord: 0.0ms)
52397
+ Started GET "/" for 127.0.0.1 at 2013-01-07 11:24:03 +0400
52398
+ Connecting to database specified by database.yml
52399
+ Processing by ApplicationController#index as HTML
52400
+ Rendered application/index.html.erb within layouts/application (3.9ms)
52401
+ Completed 200 OK in 24ms (Views: 23.1ms | ActiveRecord: 0.0ms)
File without changes
File without changes
File without changes