Class: FlexCocoa
- Inherits:
-
Object
- Object
- FlexCocoa
- Defined in:
- lib/flex_cocoa.rb,
lib/flex_cocoa/cc_bubble.rb,
lib/flex_cocoa/cc_progress.rb,
lib/flex_cocoa/cc_input_box.rb,
lib/flex_cocoa/cc_file_select.rb,
lib/flex_cocoa/cc_message_box.rb,
lib/flex_cocoa/cc_secure_input.rb
Direct Known Subclasses
CcBubble, CcFileSelect, CcInputBox, CcMessageBox, CcProgress, CcSecureInput
Class Attribute Summary collapse
-
.app_path ⇒ Object
readonly
Returns the value of attribute app_path.
Instance Attribute Summary collapse
-
#exec ⇒ Object
Returns the value of attribute exec.
-
#output ⇒ Object
Returns the value of attribute output.
Class Method Summary collapse
Instance Method Summary collapse
- #button_response ⇒ Object
- #buttons_template(type, title, text, i_text, r_button, m_button, l_button) ⇒ Object
-
#initialize(path = FlexCocoa.set_path) ⇒ FlexCocoa
constructor
A new instance of FlexCocoa.
- #parts_init(type, args) ⇒ Object
- #post_initialize ⇒ Object
Constructor Details
Class Attribute Details
.app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
15 16 17 |
# File 'lib/flex_cocoa.rb', line 15 def app_path @app_path end |
Instance Attribute Details
#exec ⇒ Object
Returns the value of attribute exec.
12 13 14 |
# File 'lib/flex_cocoa.rb', line 12 def exec @exec end |
#output ⇒ Object
Returns the value of attribute output.
12 13 14 |
# File 'lib/flex_cocoa.rb', line 12 def output @output end |
Class Method Details
.set_path(path = '/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog') ⇒ Object
16 17 18 |
# File 'lib/flex_cocoa.rb', line 16 def set_path (path = '/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog') @app_path = path end |
Instance Method Details
#button_response ⇒ Object
48 49 50 |
# File 'lib/flex_cocoa.rb', line 48 def @stdout.read.strip.to_i - 1 end |
#buttons_template(type, title, text, i_text, r_button, m_button, l_button) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/flex_cocoa.rb', line 34 def (type, title, text, i_text, , , ) parts_init( type, :title => title, :text => text, :'informative-text' => i_text, :button1 => , :button2 => , :button3 => ) end |
#parts_init(type, args) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/flex_cocoa.rb', line 25 def parts_init (type, args) args.each { |key, value| @exec << " #{type} --#{key} \"#{value}\"" unless value.nil? } puts @exec end |
#post_initialize ⇒ Object
52 53 54 |
# File 'lib/flex_cocoa.rb', line 52 def post_initialize @pid, @stdin, @stdout, @stterr = Open4::popen4(@exec) end |