capy 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/lib/capy.rb +8 -1
- data/lib/capy/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -26,6 +26,10 @@ and
|
|
26
26
|
|
27
27
|
$ capy example.capy
|
28
28
|
|
29
|
+
Change the browser:
|
30
|
+
|
31
|
+
$ capy -b firefox example.capy
|
32
|
+
|
29
33
|
Run as nonstop mode:
|
30
34
|
|
31
35
|
$ capy -n example.capy
|
@@ -37,3 +41,7 @@ Run as nonstop mode:
|
|
37
41
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
38
42
|
4. Push to the branch (`git push origin my-new-feature`)
|
39
43
|
5. Create new Pull Request
|
44
|
+
|
45
|
+
## TODO
|
46
|
+
|
47
|
+
* write spec
|
data/lib/capy.rb
CHANGED
@@ -12,6 +12,7 @@ module Capy
|
|
12
12
|
@opts = Slop.parse!(args, :help => true) do
|
13
13
|
banner "capy [script.capy]\n"
|
14
14
|
on :b, :browser=, 'chrome, firefox', :default => 'chrome'
|
15
|
+
on :h, :host=, 'app host'
|
15
16
|
on :n, :nonstop
|
16
17
|
end
|
17
18
|
exit if opts.help?
|
@@ -21,6 +22,8 @@ module Capy
|
|
21
22
|
end
|
22
23
|
Capybara.current_driver = :selenium
|
23
24
|
|
25
|
+
Capybara.app_host = opts[:host] if opts[:host]
|
26
|
+
|
24
27
|
if args.empty?
|
25
28
|
start_shell
|
26
29
|
else
|
@@ -36,7 +39,7 @@ module Capy
|
|
36
39
|
exit_commands = %w(exit quit)
|
37
40
|
|
38
41
|
Readline.completion_proc = lambda do |text|
|
39
|
-
(
|
42
|
+
(Evaluater.instance_methods - Object.methods + exit_commands).grep(/^#{Regexp.quote(text.strip)}/)
|
40
43
|
end
|
41
44
|
|
42
45
|
history_file = File.expand_path('~/.capy_history')
|
@@ -93,5 +96,9 @@ module Capy
|
|
93
96
|
|
94
97
|
class Evaluater
|
95
98
|
include Capybara::DSL
|
99
|
+
|
100
|
+
def host(app_host)
|
101
|
+
Capybara.app_host = app_host
|
102
|
+
end
|
96
103
|
end
|
97
104
|
end
|
data/lib/capy/version.rb
CHANGED
metadata
CHANGED