robots_dot_text 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3471a326d11dbfc727ce646ca8fe5b7a4225b47
4
- data.tar.gz: d2455c4ba664b536e4b54fc315174c66715541ec
3
+ metadata.gz: 79cd616e115782d03d6b6277009bc58c765703af
4
+ data.tar.gz: 8f9407e3cd8e8b67d8cb91eae2a8d6f397e54136
5
5
  SHA512:
6
- metadata.gz: cba5a0eea5b7d943acd576c801248e4fd88dc844244728ecebb7073126060b10912ae90208a019c28009e361b9e60ceef9e253aede25b45de0bd7bbb004c01f0
7
- data.tar.gz: c3f9c19785211cf6df7c286d441ca01458cb1aff5c6c94176171326b4c4770afc6bff288b63ce82923b3983a0eb7fd897f6c2d105f484c896930112a5470cdf5
6
+ metadata.gz: 1a4e501c49724f4864c8aad3c4b5dbaeb70425040e371a0c8f5fb1714c6316ec70253c67d4bad400576c6ab745e3a028b6fd3b066f31624cc869e487aaa56f7f
7
+ data.tar.gz: 00c473db6b46f7f164d0ada008c3af4d227c685a4ad46b1af575519fe0590edebb96accb5b6fd5e58ecd4929357d88c1625a7ee7eb8bf9d4678791789c6d2f3c
data/README.md CHANGED
@@ -31,7 +31,7 @@ You can create a file for every rails environment using the naming convention ro
31
31
  If you would like to customize the robots.txt file name to something other than the rails environment you can do so by overriding the `RobotsDotTextController#robots_file_descriptor` method in your app.
32
32
 
33
33
  class RobotsDotTextController < ActionController::Base
34
- include RobotsController
34
+ include RobotsDotText::Controller
35
35
  private
36
36
  def robots_file_descriptor
37
37
  request.env["SERVER_NAME"]
@@ -1,3 +1,3 @@
1
1
  class RobotsDotTextController < ActionController::Base
2
- include RobotsController
2
+ include RobotsDotText::Controller
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require "robots_dot_text/engine"
2
- require "robots_dot_text/robots_controller"
2
+ require "robots_dot_text/controller"
3
3
 
4
4
  module RobotsDotText
5
5
  end
@@ -0,0 +1,28 @@
1
+ module RobotsDotText
2
+ module Controller
3
+ extend ActiveSupport::Concern
4
+
5
+ def show
6
+ begin
7
+ render file: robots_file_path, layout: false, content_type: 'text/plain'
8
+ rescue ActionView::MissingTemplate
9
+ render file: default_robots_path, layout: false, content_type: 'text/plain'
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def robots_file_path
16
+ File.join([Rails.root, 'public', "robots.#{robots_file_descriptor}.txt"])
17
+ end
18
+
19
+ def default_robots_path
20
+ File.join([Rails.root, 'public', 'robots.default.txt'])
21
+ end
22
+
23
+ def robots_file_descriptor
24
+ Rails.env.to_s
25
+ end
26
+
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module RobotsDotText
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -414,5 +414,33 @@ Completed 200 OK in 10ms (Views: 9.5ms | ActiveRecord: 0.0ms)
414
414
   (0.0ms) begin transaction
415
415
  -----------------------------
416
416
  RobotsDotTextTest: test_truth
417
+ -----------------------------
418
+  (0.0ms) rollback transaction
419
+  (0.1ms) begin transaction
420
+ -----------------------------
421
+ RobotsDotTextTest: test_truth
422
+ -----------------------------
423
+  (0.1ms) rollback transaction
424
+  (0.0ms) begin transaction
425
+ --------------------------------------------------------------------
426
+ RobotsDotTextRenderTest: test_The_test_robots.txt_should_be_rendered
427
+ --------------------------------------------------------------------
428
+ Started GET "/robots.txt" for 127.0.0.1 at 2015-02-20 15:57:31 -0800
429
+ Processing by RobotsDotTextController#show as HTML
430
+ Rendered public/robots.test.txt (1.1ms)
431
+ Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms)
432
+  (0.1ms) rollback transaction
433
+  (0.1ms) begin transaction
434
+ --------------------------------------------------------------------
435
+ RobotsDotTextRenderTest: test_The_test_robots.txt_should_be_rendered
436
+ --------------------------------------------------------------------
437
+ Started GET "/robots.txt" for 127.0.0.1 at 2015-02-20 15:58:16 -0800
438
+ Processing by RobotsDotTextController#show as HTML
439
+ Rendered public/robots.test.txt (1.0ms)
440
+ Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms)
441
+  (0.1ms) rollback transaction
442
+  (0.0ms) begin transaction
443
+ -----------------------------
444
+ RobotsDotTextTest: test_truth
417
445
  -----------------------------
418
446
   (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robots_dot_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jessie Keck
@@ -52,8 +52,8 @@ files:
52
52
  - config/routes.rb
53
53
  - lib/generators/robots_dot_text/move_existing_robots_file_generator.rb
54
54
  - lib/robots_dot_text.rb
55
+ - lib/robots_dot_text/controller.rb
55
56
  - lib/robots_dot_text/engine.rb
56
- - lib/robots_dot_text/robots_controller.rb
57
57
  - lib/robots_dot_text/version.rb
58
58
  - test/dummy/README.rdoc
59
59
  - test/dummy/Rakefile
@@ -1,26 +0,0 @@
1
- module RobotsController
2
- extend ActiveSupport::Concern
3
-
4
- def show
5
- begin
6
- render file: robots_file_path, layout: false, content_type: 'text/plain'
7
- rescue ActionView::MissingTemplate
8
- render file: default_robots_path, layout: false, content_type: 'text/plain'
9
- end
10
- end
11
-
12
- private
13
-
14
- def robots_file_path
15
- File.join([Rails.root, 'public', "robots.#{robots_file_descriptor}.txt"])
16
- end
17
-
18
- def default_robots_path
19
- File.join([Rails.root, 'public', 'robots.default.txt'])
20
- end
21
-
22
- def robots_file_descriptor
23
- Rails.env.to_s
24
- end
25
-
26
- end