flex_cocoa 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/flex_cocoa.rb +56 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 85a985009c5a268980314a4c7e9674c2e0068ea7
|
4
|
+
data.tar.gz: 87fa31c25b35379301408cb1b30094a41a5c614f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d88fc737a7757da1f4912b76a50d525d996c947346a8af8a4e1d012cdee1ecf6fa545f68ba9edc66452f7513d0d89c8905bc4d73493d04f034438dc034dda4f
|
7
|
+
data.tar.gz: 88a461c105717b9879d81b61e94dc388aec3457035854083a2c1190eaa44423121789e32df1bc031a0100f2488d5197d60d7d760bced969a1685b1faabd6a600
|
data/lib/flex_cocoa.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require_relative '../lib/flex_cocoa/cc_bubble'
|
2
|
+
require_relative '../lib/flex_cocoa/cc_file_select'
|
3
|
+
require_relative '../lib/flex_cocoa/cc_progress'
|
4
|
+
require_relative '../lib/flex_cocoa/cc_input_box'
|
5
|
+
require_relative '../lib/flex_cocoa/cc_message_box'
|
6
|
+
require_relative '../lib/flex_cocoa/cc_secure_input'
|
7
|
+
|
8
|
+
require 'open4'
|
9
|
+
|
10
|
+
|
11
|
+
class FlexCocoa
|
12
|
+
attr_accessor :output, :exec
|
13
|
+
|
14
|
+
class << self
|
15
|
+
attr_reader :app_path
|
16
|
+
def set_path (path = '/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog')
|
17
|
+
@app_path = path
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize (path = FlexCocoa.set_path)
|
22
|
+
@exec = path
|
23
|
+
end
|
24
|
+
|
25
|
+
def parts_init (type, args)
|
26
|
+
|
27
|
+
args.each { |key, value|
|
28
|
+
@exec << " #{type} --#{key} \"#{value}\"" unless value.nil?
|
29
|
+
}
|
30
|
+
puts @exec
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
def buttons_template (type, title, text, i_text, r_button, m_button, l_button)
|
35
|
+
|
36
|
+
parts_init(
|
37
|
+
type,
|
38
|
+
:title => title,
|
39
|
+
:text => text,
|
40
|
+
:'informative-text' => i_text,
|
41
|
+
:button1 => r_button,
|
42
|
+
:button2 => m_button,
|
43
|
+
:button3 => l_button
|
44
|
+
)
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
def button_response
|
49
|
+
@stdout.read.strip.to_i - 1
|
50
|
+
end
|
51
|
+
|
52
|
+
def post_initialize
|
53
|
+
@pid, @stdin, @stdout, @stterr = Open4::popen4(@exec)
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: flex_cocoa
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eugene Lai
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: To do
|
14
|
+
email: ejt.lai@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/flex_cocoa.rb
|
20
|
+
homepage:
|
21
|
+
licenses: []
|
22
|
+
metadata: {}
|
23
|
+
post_install_message:
|
24
|
+
rdoc_options: []
|
25
|
+
require_paths:
|
26
|
+
- lib
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
requirements: []
|
38
|
+
rubyforge_project:
|
39
|
+
rubygems_version: 2.5.2
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: A controller for ruby-cocoa
|
43
|
+
test_files: []
|