rspec-interactive 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -4
- data/bin/rspec-interactive +17 -10
- data/lib/rspec-interactive.rb +5 -1
- data/lib/rspec-interactive/version.rb +1 -1
- data/scripts/release.sh +25 -0
- data/{run-with-local-dep.sh → scripts/run-with-local-dep.sh} +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065d25cbce32ef3f5639e793c9f5db6d99c31a0c536d717ee49f05457251e4f3
|
4
|
+
data.tar.gz: 8d981a7cf504ec21bb9f0fdd12606ee78e53d6461909b1d0f4ceb06084c616b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5fd3e74737908f45f9eef622e977a71c8adfac52fb1141548f1e3960ee9839a234a1d4afc60ee0859cdeca6eb23e57a60ab9e77d4ed5475ea1f2e6429f74e5a
|
7
|
+
data.tar.gz: 734f4c31df3dde4da275c7680364348a549997496abdcd8acaab8ab755fd922de1993b154d94e3646e8e723bc6057ad1766b5add826ac45e5307d25b440b3665
|
data/README.md
CHANGED
@@ -13,8 +13,6 @@ gem 'rspec-interactive'
|
|
13
13
|
Add a config file which configures RSpec and RSpec::Interactive, for example `spec/rspec_interactive.rb`:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
load 'spec/spec_helper.rb'
|
17
|
-
|
18
16
|
RSpec::Interactive.configure do |config|
|
19
17
|
# Directories to watch for file changes. When a file changes, it will be reloaded like `load 'path/to/file'`.
|
20
18
|
config.watch_dirs += ["app", "lib", "config"]
|
@@ -39,10 +37,10 @@ echo '.rspec_interactive_history' >> .gitignore
|
|
39
37
|
|
40
38
|
## Usage
|
41
39
|
|
42
|
-
|
40
|
+
Optionally, specify a config file with `--config <config-file>`. Optionally, specify arguments to an initial RSpec invocation with `--initial-rspec-args <initial-rspec-args>`.
|
43
41
|
|
44
42
|
```shell
|
45
|
-
bundle exec rspec-interactive
|
43
|
+
bundle exec rspec-interactive [--config <config-file>] [--initial-rspec-args <initial-rspec-args>]
|
46
44
|
```
|
47
45
|
|
48
46
|
## Example Usage In This Repo
|
@@ -53,6 +51,12 @@ Start:
|
|
53
51
|
bundle exec rspec-interactive
|
54
52
|
```
|
55
53
|
|
54
|
+
Start with an initial RSpec invocation:
|
55
|
+
|
56
|
+
```shell
|
57
|
+
bundle exec rspec-interactive --initial-rspec-args examples/passing_spec.rb
|
58
|
+
```
|
59
|
+
|
56
60
|
Run a passing spec:
|
57
61
|
|
58
62
|
```shell
|
@@ -100,3 +104,9 @@ Exit:
|
|
100
104
|
```shell
|
101
105
|
bundle exec bin/test
|
102
106
|
```
|
107
|
+
|
108
|
+
## Releasing
|
109
|
+
|
110
|
+
```shell
|
111
|
+
./scripts/release.sh <version>
|
112
|
+
```
|
data/bin/rspec-interactive
CHANGED
@@ -1,14 +1,21 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'optparse'
|
3
4
|
require 'rspec-interactive'
|
5
|
+
require 'shellwords'
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
@options = {}
|
8
|
+
parser = OptionParser.new do |opts|
|
9
|
+
opts.banner = "Starts an interactive RSpec shell.\n\n"\
|
10
|
+
"Usage: bundle exec rspec-interactive [-c config-file] <initial-rspec-args>"
|
11
|
+
|
12
|
+
opts.on("-c", "--config <config-file>", String, "Optional. Path to the RSpec Interactive config file.") do |config_file|
|
13
|
+
@options[:config_file] = config_file
|
14
|
+
end
|
15
|
+
|
16
|
+
opts.on("-r", "--initial-rspec-args <initial-rspec-args>", String, "Optional. Arguments to pass to an initial invocation of RSpec.") do |initial_rspec_args|
|
17
|
+
@options[:initial_rspec_args] = Shellwords.split(initial_rspec_args)
|
18
|
+
end
|
19
|
+
end.parse!
|
20
|
+
|
21
|
+
RSpec::Interactive.start(config_file: @options[:config_file], initial_rspec_args: @options[:initial_rspec_args])
|
data/lib/rspec-interactive.rb
CHANGED
@@ -23,7 +23,7 @@ module RSpec
|
|
23
23
|
block.call(@configuration)
|
24
24
|
end
|
25
25
|
|
26
|
-
def self.start(config_file: nil, history_file: DEFAULT_HISTORY_FILE, input_stream: STDIN, output_stream: STDOUT, error_stream: STDERR)
|
26
|
+
def self.start(config_file: nil, initial_rspec_args: nil, history_file: DEFAULT_HISTORY_FILE, input_stream: STDIN, output_stream: STDOUT, error_stream: STDERR)
|
27
27
|
@history_file = history_file
|
28
28
|
@updated_files = []
|
29
29
|
@stty_save = %x`stty -g`.chomp
|
@@ -43,6 +43,10 @@ module RSpec
|
|
43
43
|
trap_interrupt
|
44
44
|
configure_pry
|
45
45
|
|
46
|
+
if initial_rspec_args
|
47
|
+
rspec initial_rspec_args
|
48
|
+
end
|
49
|
+
|
46
50
|
Pry.start
|
47
51
|
@listener.stop if @listener
|
48
52
|
0
|
data/scripts/release.sh
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
if [ $# -ne 1 ]; then
|
6
|
+
echo "usage: $0 <version>" >&2
|
7
|
+
exit 1
|
8
|
+
fi
|
9
|
+
|
10
|
+
if [ -n "$(git status --porcelain)" ]; then
|
11
|
+
echo "error: stage or commit your changes." >&2
|
12
|
+
exit 1;
|
13
|
+
fi
|
14
|
+
|
15
|
+
NEW_VERSION=$1
|
16
|
+
CURRENT_VERSION=$(grep VERSION lib/rspec-interactive/version.rb | cut -d'"' -f 2)
|
17
|
+
|
18
|
+
echo "Updating from v$CURRENT_VERSION to v$NEW_VERSION. Press enter to continue."
|
19
|
+
read
|
20
|
+
|
21
|
+
sed -E -i '' "s/VERSION = \"[^\"]+\"/VERSION = \"$NEW_VERSION\"/g" lib/rspec-interactive/version.rb
|
22
|
+
gem build
|
23
|
+
gem push rspec-interactive-$NEW_VERSION.gem
|
24
|
+
bundle install
|
25
|
+
git commit -a -m "v$NEW_VERSION Release"
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-interactive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Dower
|
@@ -83,7 +83,8 @@ files:
|
|
83
83
|
- lib/rspec-interactive/runner.rb
|
84
84
|
- lib/rspec-interactive/version.rb
|
85
85
|
- rspec-interactive.gemspec
|
86
|
-
-
|
86
|
+
- scripts/release.sh
|
87
|
+
- scripts/run-with-local-dep.sh
|
87
88
|
- tests/debugged_spec_test.rb
|
88
89
|
- tests/eof_test.rb
|
89
90
|
- tests/example_file_test.rb
|