Class: Roebe::GenerateRobotsTxtFile

Inherits:
Object
  • Object
show all
Defined in:
lib/roebe/classes/generate_robots_txt_file.rb

Overview

Roebe::GenerateRobotsTxtFile

Constant Summary collapse

STORE_INTO_THIS_FILE =
#

STORE_INTO_THIS_FILE

#
'robots.txt'
FILE_CONTENT =
#

FILE_CONTENT

#
'User-agent: *
Disallow: /ZEUGNISSE/
'

Instance Method Summary collapse

Constructor Details

#initialize(i = nil, run_already = true) ⇒ GenerateRobotsTxtFile

#

initialize

#


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

#input?Boolean

#

input?

#

Returns:

  • (Boolean)


65
66
67
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 65

def input?
  @input
end

#resetObject

#

reset (reset tag)

#


49
50
51
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 49

def reset
  infer_the_namespace
end

#runObject

#

run (run tag)

#


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

#set_input(i = '') ⇒ Object

#

set_input

#


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_fileObject

#

store_into_file

#


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

#

which_file?

#

Returns:

  • (Boolean)


81
82
83
# File 'lib/roebe/classes/generate_robots_txt_file.rb', line 81

def which_file?
  STORE_INTO_THIS_FILE
end