Class: Roebe::GenerateRobotsTxtFile
- Inherits:
-
Object
- Object
- Roebe::GenerateRobotsTxtFile
show all
- Defined in:
- lib/roebe/classes/generate_robots_txt_file.rb
Overview
Roebe::GenerateRobotsTxtFile
Constant Summary
collapse
- STORE_INTO_THIS_FILE =
'robots.txt'
- FILE_CONTENT =
'User-agent: *
Disallow: /ZEUGNISSE/
'
Instance Method Summary
collapse
Constructor Details
#initialize(i = nil, run_already = true) ⇒ GenerateRobotsTxtFile
37
38
39
40
41
42
43
44
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 37
def initialize(
i = nil,
run_already = true
)
reset
set_input(i)
run if run_already
end
|
Instance Method Details
65
66
67
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 65
def input?
@input
end
|
49
50
51
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 49
def reset
infer_the_namespace
end
|
88
89
90
91
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 88
def run
opne "Now generating a `#{sfile(which_file?)}` file."
store_into_file
end
|
56
57
58
59
60
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 56
def set_input(i = '')
i = i.first if i.is_a? Array
i = i.to_s.dup if i
@input = i
end
|
#store_into_file ⇒ Object
72
73
74
75
76
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 72
def store_into_file
what = FILE_CONTENT
into = which_file?
write_what_into(what, into)
end
|
#which_file? ⇒ Boolean
81
82
83
|
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 81
def which_file?
STORE_INTO_THIS_FILE
end
|