Class: Bently::Recipe
- Inherits:
-
Object
show all
- Defined in:
- lib/bently/recipe.rb
Direct Known Subclasses
GitignoreEmacs, GitignoreLinux, GitignoreOsx, GitignoreRails, GitignoreRuby, GitignoreRubymine, GitignoreSass, GitignoreSublimeText, GitignoreTextmate, GitignoreVim, GitignoreWindows, RubyRecipe, Rvmrc
Defined Under Namespace
Classes: Append, Create, Insert, Modify, Operation, Prepend, Remove, Run, Say
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.breakdown ⇒ Object
85
86
87
|
# File 'lib/bently/recipe.rb', line 85
def self.breakdown
new.operations
end
|
.category(category) ⇒ Object
90
|
# File 'lib/bently/recipe.rb', line 90
def self.category(category) @category ||= category; end
|
.description(description) ⇒ Object
91
|
# File 'lib/bently/recipe.rb', line 91
def self.description(description) @description ||= description; end
|
.homepage(homepage = nil) ⇒ Object
92
|
# File 'lib/bently/recipe.rb', line 92
def self.homepage(homepage=nil) @homepage ||= homepage; end
|
.title(n) ⇒ Object
89
|
# File 'lib/bently/recipe.rb', line 89
def self.title(n) @title ||= n; end
|
.version(version) ⇒ Object
93
|
# File 'lib/bently/recipe.rb', line 93
def self.version(version) @version ||= version; end
|
Instance Method Details
#append(*args) ⇒ Object
101
|
# File 'lib/bently/recipe.rb', line 101
def append(*args) ; operations << Append.new(*args) end
|
#code(text) ⇒ Object
110
|
# File 'lib/bently/recipe.rb', line 110
def code(text) ; text.each_line.each_with_index{|l,i| say(l, i+1, :magenta) } end
|
#create(*args) ⇒ Object
99
|
# File 'lib/bently/recipe.rb', line 99
def create(*args) ; operations << Create.new(*args) end
|
#insert(*args) ⇒ Object
103
|
# File 'lib/bently/recipe.rb', line 103
def insert(*args) ; operations << Insert.new(*args) end
|
#modify(*args) ⇒ Object
100
|
# File 'lib/bently/recipe.rb', line 100
def modify(*args) ; operations << Modify.new(*args) end
|
#operate(op, *args) ⇒ Object
105
|
# File 'lib/bently/recipe.rb', line 105
def operate(op, *args) ; operations << op.new(*args) end
|
#operations ⇒ Object
95
|
# File 'lib/bently/recipe.rb', line 95
def operations; @operations ||= []; end
|
#prepend(*args) ⇒ Object
102
|
# File 'lib/bently/recipe.rb', line 102
def prepend(*args) ; operations << Prepend.new(*args) end
|
#remove(*args) ⇒ Object
104
|
# File 'lib/bently/recipe.rb', line 104
def remove(*args) ; operations << Remove.new(*args) end
|
#requirement(text) ⇒ Object
108
|
# File 'lib/bently/recipe.rb', line 108
def requirement(text) ; say(text, 'REQUIRED', :red) end
|
#run(*args) ⇒ Object
98
|
# File 'lib/bently/recipe.rb', line 98
def run(*args) ; operations << Run.new(*args) end
|
#say(*args) ⇒ Object
97
|
# File 'lib/bently/recipe.rb', line 97
def say(*args) ; operations << Say.new(*args) end
|
#todo(name) ⇒ Object
106
|
# File 'lib/bently/recipe.rb', line 106
def todo(name) ; say(name, 'TODO', :red) end
|
#usage(text) ⇒ Object
109
|
# File 'lib/bently/recipe.rb', line 109
def usage(text) ; say(text, 'USAGE', :red) end
|
#warn(text) ⇒ Object
107
|
# File 'lib/bently/recipe.rb', line 107
def warn(text) ; say(text, 'WARNING', :red) end
|