messagebox 0.0.1.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.rspec +1 -0
- data/README.md +13 -12
- data/lib/messagebox.rb +25 -13
- data/lib/messagebox/information.rb +7 -0
- data/lib/messagebox/version.rb +3 -3
- data/lib/messagebox/warning.rb +8 -0
- data/lib/messagebox/yesno.rb +7 -0
- data/messagebox.gemspec +24 -23
- data/spec/messagebox_spec.rb +29 -0
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTU3ODE3NDA5ZGIwM2MzZDY2N2Y2OWY4NWE4NTk0ZTZhYTMyNmMzNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDk0MTIyMWU3ZGJkODk1YzQ3MDA3YWVlMzVkZmFjNDE1OTRhMmYxZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTQ3NGFlNzZkZWExZjhkMTNkNThkZmJiNjcwYWM0ZWY3ZTE5Y2NhNzVjMjhk
|
10
|
+
ODI5YjE0ZjgzZmY0ODJkZDI0ZjA5MTc0NTBmMWUzN2M2NDI2YTQyZGM5ZTk5
|
11
|
+
MGI4ZDA0MWMzYmFhMGRkNjA0NDkyNWQ1MjkyM2U4YzFiMzBhZDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTVjYThmNjAyMjA3YTFhNjI5Yjc2M2QxOWQ2ODNjNTIwMjNkMmE1YzM3NzJj
|
14
|
+
YzBkMzQ1ZDY5ODI5MjEwOTI0NTZiNWNkYWNkZDViN2Q0NjY2MjdmZDQ3OTAz
|
15
|
+
ZWU2MDhkZWVmYWUzZDY1MTIwNzYwZmFmMGIxZmQxNGYyZmUwMTQ=
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require messagebox
|
data/README.md
CHANGED
@@ -25,23 +25,24 @@ example of `irb` simple code.
|
|
25
25
|
```ruby
|
26
26
|
$ irb
|
27
27
|
> require 'messagebox'
|
28
|
-
> MessageBox.show
|
29
|
-
"Example MessageBox",
|
30
|
-
"This is test message.", 0x40)
|
28
|
+
> MessageBox.new("Title", "Example message").show
|
31
29
|
```
|
32
30
|
|
33
|
-
|
31
|
+
Warning MessageBox are
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
Please show **MSDN Reference** of MessageBox API Function. Parameter as a `uType`
|
33
|
+
```ruby
|
34
|
+
$ irb
|
35
|
+
> require 'messagebox'
|
36
|
+
> MessageBox::Warning.new("Warning", "It's not Good something happen!").show
|
37
|
+
```
|
41
38
|
|
42
|
-
|
39
|
+
Yes or No selectable MessageBox
|
43
40
|
|
44
|
-
|
41
|
+
```ruby
|
42
|
+
$ irb
|
43
|
+
> require 'messagebox'
|
44
|
+
> MessageBox::YesNo.new("Yes No message box", "Is this dialog displayed?").show
|
45
|
+
```
|
45
46
|
|
46
47
|
## Contributing
|
47
48
|
|
data/lib/messagebox.rb
CHANGED
@@ -1,13 +1,25 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
require 'Win32API'
|
2
|
+
Dir[File.dirname(__FILE__) + "/messagebox" << '/*.rb'].each do |file|
|
3
|
+
require file
|
4
|
+
end
|
5
|
+
|
6
|
+
class MessageBox
|
7
|
+
def initialize(title, message, style = 0)
|
8
|
+
@title = title
|
9
|
+
@message = message
|
10
|
+
@style = style
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.show(title, message, style = 0)
|
14
|
+
Win32API.new(
|
15
|
+
"user32",
|
16
|
+
"MessageBox",
|
17
|
+
%w(p p p i),
|
18
|
+
'i'
|
19
|
+
).call(nil, message, title, style)
|
20
|
+
end
|
21
|
+
|
22
|
+
def show(message = nil, title = nil)
|
23
|
+
MessageBox.show(title || @title, message || @message, @style)
|
24
|
+
end
|
25
|
+
end
|
data/lib/messagebox/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Messagebox
|
2
|
-
VERSION = "0.
|
3
|
-
end
|
1
|
+
module Messagebox
|
2
|
+
VERSION = "0.1.0"
|
3
|
+
end
|
data/messagebox.gemspec
CHANGED
@@ -1,23 +1,24 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'messagebox/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "messagebox"
|
8
|
-
spec.version = Messagebox::VERSION
|
9
|
-
spec.authors = ["myun2"]
|
10
|
-
spec.email = ["myun2@nwhite.info"]
|
11
|
-
spec.description = %q{Rb-Messagebox are show MessageBox dialog for Win32 API.}
|
12
|
-
spec.summary = %q{Rb-Messagebox are show MessageBox dialog for Win32 API.}
|
13
|
-
spec.homepage = "https://github.com/myun2/rb-messagebox"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'messagebox/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "messagebox"
|
8
|
+
spec.version = Messagebox::VERSION
|
9
|
+
spec.authors = ["myun2"]
|
10
|
+
spec.email = ["myun2@nwhite.info"]
|
11
|
+
spec.description = %q{Rb-Messagebox are show MessageBox dialog for Win32 API.}
|
12
|
+
spec.summary = %q{Rb-Messagebox are show MessageBox dialog for Win32 API.}
|
13
|
+
spec.homepage = "https://github.com/myun2/rb-messagebox"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
describe MessageBox do
|
2
|
+
context "Class Method .show" do
|
3
|
+
subject {
|
4
|
+
MessageBox.show(".show", "Class method called.", 0x40)
|
5
|
+
}
|
6
|
+
it { should eq 1 }
|
7
|
+
end
|
8
|
+
|
9
|
+
context "Plain MessageBox (no style specified)" do
|
10
|
+
subject {
|
11
|
+
MessageBox.new("Plain MessageBox", "This is plain message box.").show
|
12
|
+
}
|
13
|
+
it { should eq 1 }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe MessageBox::Warn do
|
17
|
+
subject {
|
18
|
+
MessageBox::Warn.new("Warning MessageBox", "Warning!").show
|
19
|
+
}
|
20
|
+
it { should eq 1 }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe MessageBox::YesNo do
|
24
|
+
subject {
|
25
|
+
MessageBox::YesNo.new("YesNo MessageBox", "This ok?").show
|
26
|
+
}
|
27
|
+
it { should eq 6 }
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: messagebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- myun2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Rb-Messagebox are show MessageBox dialog for Win32 API.
|
42
56
|
email:
|
43
57
|
- myun2@nwhite.info
|
@@ -46,13 +60,18 @@ extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
62
|
- .gitignore
|
63
|
+
- .rspec
|
49
64
|
- Gemfile
|
50
65
|
- LICENSE.txt
|
51
66
|
- README.md
|
52
67
|
- Rakefile
|
53
68
|
- lib/messagebox.rb
|
69
|
+
- lib/messagebox/information.rb
|
54
70
|
- lib/messagebox/version.rb
|
71
|
+
- lib/messagebox/warning.rb
|
72
|
+
- lib/messagebox/yesno.rb
|
55
73
|
- messagebox.gemspec
|
74
|
+
- spec/messagebox_spec.rb
|
56
75
|
homepage: https://github.com/myun2/rb-messagebox
|
57
76
|
licenses:
|
58
77
|
- MIT
|
@@ -77,4 +96,5 @@ rubygems_version: 2.0.3
|
|
77
96
|
signing_key:
|
78
97
|
specification_version: 4
|
79
98
|
summary: Rb-Messagebox are show MessageBox dialog for Win32 API.
|
80
|
-
test_files:
|
99
|
+
test_files:
|
100
|
+
- spec/messagebox_spec.rb
|