Module: CoderCompanion

Defined in:
lib/codercompanion.rb,
lib/codercompanion/api.rb,
lib/codercompanion_version.rb,
lib/codercompanion/java/java.rb,
lib/codercompanion/languages.rb,
lib/codercompanion/s3_client.rb,
lib/codercompanion/tree_walker.rb,
lib/codercompanion/cachehandler.rb,
lib/codercompanion/common/common.rb,
lib/codercompanion/cpp/cpp_parser.rb,
lib/codercompanion/parser_factory.rb,
lib/codercompanion/visual_message.rb,
lib/codercompanion/common/literals.rb,
lib/codercompanion/language_parser.rb,
lib/codercompanion/java/java_parser.rb,
lib/codercompanion/ruby/ruby_parser.rb,
lib/codercompanion/cpp/cpp_tree_walker.rb,
lib/codercompanion/java/java_tree_walker.rb,
lib/codercompanion/ruby/ruby_annotations.rb,
lib/codercompanion/ruby/ruby_tree_walker.rb,
lib/codercompanion/codercompanion_exception.rb

Defined Under Namespace

Modules: Common, Cpp, Java, Languages, Ruby, VisualMessage Classes: API, CLI, CacheHandler, CoderCompanionException, LanguageParser, ParserFactory, S3Client, TreeWalker

Constant Summary collapse

CONFIG_FILE_NAME =
'codercmp.conf'
VERSION =
'0.9.8'
@@no_color =
false

Class Method Summary collapse

Class Method Details

.error_format(string) ⇒ Object

Parameters:

  • string (String)


63
64
65
# File 'lib/codercompanion.rb', line 63

def error_format(string)
    return no_color ? string : string.white_on_red.bold
end

.error_url_format(string) ⇒ Object

Parameters:

  • string (String)


68
69
70
# File 'lib/codercompanion.rb', line 68

def error_url_format(string)
    return no_color ? string : string.yellow_on_red.bold.underline
end

.j_print(string) ⇒ Object



44
45
46
# File 'lib/codercompanion.rb', line 44

def j_print(string)
    puts string if !silent_run
end

.j_print_inline(string) ⇒ Object



48
49
50
# File 'lib/codercompanion.rb', line 48

def j_print_inline(string)
    print string if !silent_run
end

.no_colorBoolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/codercompanion.rb', line 101

def no_color
    @@no_color
end

.no_color=(no_color) ⇒ Object

Parameters:

  • no_color (Boolean)


96
97
98
# File 'lib/codercompanion.rb', line 96

def no_color=(no_color)
    @@no_color = no_color
end

.notification_format(string) ⇒ Object

Parameters:

  • string (String)


78
79
80
# File 'lib/codercompanion.rb', line 78

def notification_format(string)
    return no_color ? string : string.yellow_on_black
end

.pretty_inspect(thing) ⇒ Object



87
88
89
90
91
92
93
# File 'lib/codercompanion.rb', line 87

def pretty_inspect(thing)
    begin 
        thing.awesome_inspect
    rescue
        thing.inspect
    end
end

.red_format(string) ⇒ Object

Parameters:

  • string (String)


73
74
75
# File 'lib/codercompanion.rb', line 73

def red_format(string)
    return no_color ? string : string.red_on_black.bold
end

.silent_runBoolean

Returns:

  • (Boolean)


111
112
113
# File 'lib/codercompanion.rb', line 111

def silent_run
    @@silent_run
end

.silent_run=(silent_run) ⇒ Object

Parameters:

  • silent_run (Boolean)


106
107
108
# File 'lib/codercompanion.rb', line 106

def silent_run=(silent_run)
    @@silent_run = silent_run
end

.special_format(string) ⇒ Object

Parameters:

  • string (String)


53
54
55
# File 'lib/codercompanion.rb', line 53

def special_format(string)
    return no_color ? string : string.white_on_black.bold
end

.success_format(string) ⇒ Object

Parameters:

  • string (String)


83
84
85
# File 'lib/codercompanion.rb', line 83

def success_format(string)
    return no_color ? string : string.green_on_black.bold
end

.warning_format(string) ⇒ Object

Parameters:

  • string (String)


58
59
60
# File 'lib/codercompanion.rb', line 58

def warning_format(string)
    return no_color ? string : string.black_on_yellow.bold
end