roboto 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODhhOWZiYzhjYWE4NmQxYzFiM2JiYjllZWQ4OGYzNWE1NjMwNmI3Zg==
5
- data.tar.gz: !binary |-
6
- MjA4MDkxYmUwNWZjMzc0N2E0NWRkYmQ3ZjI0ZjE0ZjllYmYxMjk0Zg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OGZiMjUxNDg2MTFhMmFlNzcxNjZiYjk0MGFjMmEwMTg0ZTczOTY5NzAyZjA0
10
- NWJlOTE4YTZhODYxYWM2N2JlNjFlZjFjNzU1ZWQwZDMxZTFkZDExMmE4Nzg4
11
- ZmFkYWJiMWJiMjY2YjcwMmUzYjIzMzA4MGM4NTYxMThlMmUxOTE=
12
- data.tar.gz: !binary |-
13
- ZmVlYzdkNzIyY2Y2ZjJiZjg1ZGY5YWE4M2M3YzM5ZDBkNDVlNGRiYTYwMTAz
14
- OGFmZGE2NTc3YTkwMGMyMmM0M2MxNjE4MDUwOWY1MGFlZDVkNWM1ZDdhOTNi
15
- YzBlNmVlNWQwZmE1NTJhYjNmZjk2YTM0NzVhYjc0YWMyZDg0NmE=
2
+ SHA1:
3
+ metadata.gz: 5936e904f0c2730cadb4769ae1cf7047ade056a8
4
+ data.tar.gz: 818f1e12068afc8900cba4b301d9ad23ccb23087
5
+ SHA512:
6
+ metadata.gz: a46f13c032754f23666e05bc488d045d3b44dbd75bdebcfc21b679b929a4aa21a27c81c400c69a972cb53c2270c0724986c5177ae5de2615c67ffb9975e6fcc0
7
+ data.tar.gz: e1ffe328e57f837bd240d579de6d78ac3bc839c70a6c8f5c7b3809225b2db87dbb08a8af8b8b65bbe966a824a3626c110d287efac34929dd74bfefb8b1cafd64
data/Gemfile CHANGED
@@ -2,7 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in roboto.gemspec
4
4
  gemspec
5
-
6
- group :development do
7
- gem 'guard-rspec'
8
- end
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/LaunchWare/roboto.png)](http://travis-ci.org/LaunchWare/roboto)
4
4
 
5
- Roboto is a Rails Engine that gives you the ability to specify enviornment specific robots in your Rails 3.1+ application.
5
+ Roboto is a Rails Engine that gives you the ability to specify enviornment specific robots in your Rails 4.2+ application.
6
6
 
7
7
  Don't let crawlers access your staging environment. This is [bad for SEO](http://www.seomoz.org/learn-seo/duplicate-content).
8
8
 
@@ -1,7 +1,7 @@
1
1
  module Roboto
2
2
  class RobotsController < Roboto::ApplicationController
3
3
  def show
4
- render :text => robot_contents,
4
+ render :plain => robot_contents,
5
5
  :layout => false,
6
6
  :content_type => 'text/plain'
7
7
  end
@@ -10,7 +10,7 @@ module Roboto
10
10
 
11
11
  @contents = File.read(path)
12
12
  if path.extname == '.erb'
13
- @contents = ERB.new(@contents).result(custom_binding ? custom_binding : binding)
13
+ @contents = ERB.new(@contents, nil, '>').result(custom_binding ? custom_binding : binding)
14
14
  end
15
15
  @contents
16
16
  end
@@ -1,4 +1,4 @@
1
1
  module Roboto
2
2
  #The effective version of roboto
3
- VERSION = "0.2.0"
3
+ VERSION = "1.0.0"
4
4
  end
@@ -15,18 +15,15 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Roboto::VERSION
17
17
 
18
- gem.add_dependency 'rails', '>= 3.1.0'
19
- gem.add_dependency 'actionpack', '>= 3.0.0'
18
+ gem.add_dependency 'rails', '>= 4.2'
20
19
 
21
- gem.add_development_dependency 'rspec-rails', '~> 2.9'
20
+ gem.add_development_dependency 'rspec-rails', '>= 3.6'
22
21
  gem.add_development_dependency 'ammeter'
23
22
  gem.add_development_dependency 'capybara'
24
23
  gem.add_development_dependency 'fakefs'
25
24
  gem.add_development_dependency 'yard'
26
25
  gem.add_development_dependency 'redcarpet'
27
26
 
28
-
29
27
  #we need this for the dummy app
30
28
  gem.add_development_dependency 'sqlite3'
31
29
  end
32
-
@@ -8,8 +8,16 @@ Dummy::Application.configure do
8
8
  config.cache_classes = true
9
9
 
10
10
  # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
11
+ if Gem::Version.new(Rails.version) >= Gem::Version.new(5)
12
+ config.public_file_server.enabled = true
13
+ else
14
+ config.serve_static_files = true
15
+ end
16
+ if Gem::Version.new(Rails.version) >= Gem::Version.new(5)
17
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
18
+ else
19
+ config.static_cache_control = "public, max-age=3600"
20
+ end
13
21
 
14
22
  # Show full error reports and disable caching
15
23
  config.consider_all_requests_local = true
@@ -17,16 +17,16 @@ describe Roboto::Generators::InstallGenerator do
17
17
  ["roboto_env", "staging", "production"].each do |env|
18
18
  describe 'config/robots/#{env}.txt' do
19
19
  subject { file("config/robots/#{env}.txt") }
20
- it { should exist }
21
- it { should contain "User-Agent: *" }
22
- it { should contain "Disallow: /" }
20
+ it { is_expected.to exist }
21
+ it { is_expected.to contain "User-Agent: *" }
22
+ it { is_expected.to contain "Disallow: /" }
23
23
  end
24
24
  end
25
25
 
26
26
  describe 'config/routes.rb' do
27
27
  subject { file('config/routes.rb') }
28
- it { should exist }
29
- it { should contain "mount_roboto" }
28
+ it { is_expected.to exist }
29
+ it { is_expected.to contain "mount_roboto" }
30
30
  end
31
31
  end
32
32
 
@@ -42,4 +42,4 @@ describe Roboto::Generators::InstallGenerator do
42
42
  FileUtils.mkdir_p(destination)
43
43
  @env_availabe.each {|env| FileUtils.touch(destination_root + "/config/environments/#{env}.rb")}
44
44
  end
45
- end
45
+ end
@@ -8,7 +8,6 @@ feature 'user/bot visits robots.txt', %q{
8
8
 
9
9
  scenario "visit robots.txt" do
10
10
  visit "/robots.txt"
11
- page.status_code.should eql(200)
11
+ expect(page.status_code).to eq 200
12
12
  end
13
13
  end
14
-
@@ -18,27 +18,34 @@ describe Roboto::ContentProvider do
18
18
  it 'uses the environment specific file if found' do
19
19
  path = Rails.root.join("config/robots/test.txt")
20
20
  File.open(path, 'wb') { |f| f.write(Rails.env) }
21
- content_provider.path.should eql(path)
22
- content_provider.contents.should eql(Rails.env)
21
+ expect(content_provider.path).to eq(path)
22
+ expect(content_provider.contents).to eq(Rails.env)
23
23
  end
24
24
 
25
25
  it 'supports erb pre-processing' do
26
26
  path = Rails.root.join("config/robots/test.txt.erb")
27
27
  File.open(path, 'wb') { |f| f.write('<%= Rails.env %>') }
28
- content_provider.path.should eql(path)
29
- content_provider.contents.should eql(Rails.env)
28
+ expect(content_provider.path).to eq(path)
29
+ expect(content_provider.contents).to eq(Rails.env)
30
+ end
31
+
32
+ it 'strips newlines in closing erb tags' do
33
+ path = Rails.root.join("config/robots/test.txt.erb")
34
+ File.open(path, 'wb') { |f| f.write("<% if true %>\n<%= Rails.env %>\n<% end %>") }
35
+ expect(content_provider.path).to eq(path)
36
+ expect(content_provider.contents).to eq(Rails.env)
30
37
  end
31
38
 
32
39
  it 'uses the default robots file if found in the rails root' do
33
40
  path = Rails.root.join(relative_path_to_default)
34
41
  FileUtils.touch(path)
35
- content_provider.path.should eql(path)
42
+ expect(content_provider.path).to eq(path)
36
43
  end
37
44
 
38
45
  it 'defaults to the gem provided robots if not found in rails root' do
39
46
  path = Roboto::Engine.root.join(relative_path_to_default)
40
47
  FileUtils.touch(path)
41
- content_provider.path.should eql(Roboto::Engine.root.join(relative_path_to_default))
48
+ expect(content_provider.path).to eq(Roboto::Engine.root.join(relative_path_to_default))
42
49
  end
43
50
  end
44
51
 
metadata CHANGED
@@ -1,139 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roboto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Pickett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-18 00:00:00.000000000 Z
11
+ date: 2017-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.0
27
- - !ruby/object:Gem::Dependency
28
- name: actionpack
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: 3.0.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: 3.0.0
26
+ version: '4.2'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rspec-rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - ~>
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
- version: '2.9'
33
+ version: '3.6'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - ~>
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
- version: '2.9'
40
+ version: '3.6'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: ammeter
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ! '>='
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
47
  version: '0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - ! '>='
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: capybara
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - ! '>='
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
61
  version: '0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - ! '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: fakefs
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - ! '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - ! '>='
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: yard
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - ! '>='
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
89
  version: '0'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ! '>='
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: redcarpet
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - ! '>='
108
+ - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: sqlite3
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - ! '>='
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: '0'
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - ! '>='
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0'
139
125
  description: A Rails Engine to help with robots.txt
@@ -144,11 +130,11 @@ executables:
144
130
  extensions: []
145
131
  extra_rdoc_files: []
146
132
  files:
147
- - .gitignore
148
- - .rspec
149
- - .rvmrc
150
- - .travis.yml
151
- - .yardopts
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".rvmrc"
136
+ - ".travis.yml"
137
+ - ".yardopts"
152
138
  - Gemfile
153
139
  - Gemfile.rails4-0
154
140
  - Gemfile.rails4-0.lock
@@ -221,17 +207,17 @@ require_paths:
221
207
  - lib
222
208
  required_ruby_version: !ruby/object:Gem::Requirement
223
209
  requirements:
224
- - - ! '>='
210
+ - - ">="
225
211
  - !ruby/object:Gem::Version
226
212
  version: '0'
227
213
  required_rubygems_version: !ruby/object:Gem::Requirement
228
214
  requirements:
229
- - - ! '>='
215
+ - - ">="
230
216
  - !ruby/object:Gem::Version
231
217
  version: '0'
232
218
  requirements: []
233
219
  rubyforge_project:
234
- rubygems_version: 2.0.6
220
+ rubygems_version: 2.4.5.1
235
221
  signing_key:
236
222
  specification_version: 4
237
223
  summary: A Rails Engine to help with robots.txt
@@ -272,4 +258,3 @@ test_files:
272
258
  - spec/roboto/content_provider_spec.rb
273
259
  - spec/spec_helper.rb
274
260
  - spec/support/fakefs.rb
275
- has_rdoc: