popup 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/popup/save_popup.rb +8 -4
- data/lib/popup/version.rb +1 -1
- data/spec/save_popup_spec.rb +23 -23
- metadata +31 -21
data/lib/popup/save_popup.rb
CHANGED
@@ -2,10 +2,14 @@ module ATT
|
|
2
2
|
# for save as dialog
|
3
3
|
class SavePopup < FilePopup
|
4
4
|
|
5
|
-
# Save
|
6
|
-
# if +file_path+ is relative path, it will be expand to abosulte path join with ATT::Config.root
|
5
|
+
# Save dialog as a file
|
6
|
+
# if +file_path+ is nil,it will take the default name given by dialog.elsif +file_path+ is relative path, it will be expand to abosulte path join with ATT::Config.root
|
7
7
|
# @param: file_path
|
8
|
-
def set(file_path)
|
8
|
+
def set(file_path='')
|
9
|
+
if file_path.to_s.strip.length == 0 # It's nil, empty, or just whitespace
|
10
|
+
file_name = text_field.value
|
11
|
+
file_path = File.join(Config.root, file_name)
|
12
|
+
end
|
9
13
|
check_file_not_exist?(file_path)
|
10
14
|
set_text(file_path)
|
11
15
|
click_confirm
|
@@ -14,4 +18,4 @@ module ATT
|
|
14
18
|
alias click set
|
15
19
|
alias saveas set
|
16
20
|
end
|
17
|
-
end
|
21
|
+
end
|
data/lib/popup/version.rb
CHANGED
data/spec/save_popup_spec.rb
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe ATT::SavePopup do
|
4
|
-
before(:each) do
|
5
|
-
#@b = TestBrowser.get
|
6
|
-
end
|
7
|
-
|
8
|
-
it "#exist?" do
|
9
|
-
window = RAutomation::Window.new(:title=>"notexist")
|
10
|
-
o = ATT::SavePopup.new(window)
|
11
|
-
o.should respond_to("exist?")
|
12
|
-
o.should respond_to("assert_exist?")
|
13
|
-
end
|
14
|
-
|
15
|
-
it "#set #saveas" do
|
16
|
-
window = RAutomation::Window.new(:title=>"notexist")
|
17
|
-
o = ATT::SavePopup.new(window)
|
18
|
-
o.should respond_to("set")
|
19
|
-
o.should respond_to("saveas")
|
20
|
-
|
21
|
-
end
|
22
|
-
#saveas
|
23
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ATT::SavePopup do
|
4
|
+
before(:each) do
|
5
|
+
#@b = TestBrowser.get
|
6
|
+
end
|
7
|
+
|
8
|
+
it "#exist?" do
|
9
|
+
window = RAutomation::Window.new(:title=>"notexist")
|
10
|
+
o = ATT::SavePopup.new(window)
|
11
|
+
o.should respond_to("exist?")
|
12
|
+
o.should respond_to("assert_exist?")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "#set #saveas" do
|
16
|
+
window = RAutomation::Window.new(:title=>"notexist")
|
17
|
+
o = ATT::SavePopup.new(window)
|
18
|
+
o.should respond_to("set")
|
19
|
+
o.should respond_to("saveas")
|
20
|
+
|
21
|
+
end
|
22
|
+
#saveas
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-08 00:00:00.
|
12
|
+
date: 2011-09-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rautomation
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: ffi
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,37 +37,42 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: popup operation for all windows version.
|
37
47
|
email: lyfi2003@gmail.com
|
38
48
|
executables: []
|
39
49
|
extensions: []
|
40
50
|
extra_rdoc_files: []
|
41
51
|
files:
|
42
|
-
- lib/popup/
|
43
|
-
- lib/popup/confirm_popup.rb
|
44
|
-
- lib/popup/constants/file_popup.yml
|
45
|
-
- lib/popup/exceptions.rb
|
46
|
-
- lib/popup/ext/rautomation_ext.rb
|
47
|
-
- lib/popup/file_ext.rb
|
52
|
+
- lib/popup/save_popup.rb
|
48
53
|
- lib/popup/file_popup.rb
|
54
|
+
- lib/popup/window_factory.rb
|
55
|
+
- lib/popup/exceptions.rb
|
49
56
|
- lib/popup/popup.rb
|
57
|
+
- lib/popup/ext/rautomation_ext.rb
|
50
58
|
- lib/popup/popup_window.rb
|
51
|
-
- lib/popup/
|
59
|
+
- lib/popup/file_ext.rb
|
60
|
+
- lib/popup/constants/file_popup.yml
|
61
|
+
- lib/popup/confirm_popup.rb
|
62
|
+
- lib/popup/alert_popup.rb
|
52
63
|
- lib/popup/version.rb
|
53
|
-
- lib/popup/window_factory.rb
|
54
64
|
- lib/popup.rb
|
55
65
|
- spec/alert_popup_spec.rb
|
56
|
-
- spec/
|
66
|
+
- spec/spec_helper.rb
|
67
|
+
- spec/save_popup_spec.rb
|
57
68
|
- spec/file_popup_spec.rb
|
58
69
|
- spec/popup_spec.rb
|
59
|
-
- spec/popup_window_spec.rb
|
60
|
-
- spec/save_popup_spec.rb
|
61
|
-
- spec/spec_helper.rb
|
62
70
|
- spec/webserver.rb
|
63
|
-
-
|
64
|
-
-
|
71
|
+
- spec/confirm_popup_spec.rb
|
72
|
+
- spec/popup_window_spec.rb
|
65
73
|
- support/html_popup/file.html
|
74
|
+
- support/file_popup/test1.txt
|
75
|
+
- support/file_popup/test.txt
|
66
76
|
- Rakefile
|
67
77
|
- README.md
|
68
78
|
homepage: https://github.com/windy/popup
|
@@ -85,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
95
|
version: 1.3.5
|
86
96
|
requirements: []
|
87
97
|
rubyforge_project:
|
88
|
-
rubygems_version: 1.8.
|
98
|
+
rubygems_version: 1.8.25
|
89
99
|
signing_key:
|
90
100
|
specification_version: 3
|
91
101
|
summary: popup operation for all windows version.
|