capy 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +8 -0
  2. data/lib/capy.rb +8 -1
  3. data/lib/capy/version.rb +1 -1
  4. 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
- (Capybara::DSL.instance_methods + exit_commands).grep(/^#{Regexp.quote(text.strip)}/)
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
@@ -1,3 +1,3 @@
1
1
  module Capy
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - jugyo