rspec-interactive 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88fe45587c743f490177b20ef35c1a6372c56b22e631ca8d5bf24fb5836448bc
4
- data.tar.gz: 23bd0531b2836fb9d3d6d86a462fe65b4f9ddde3b2671db608f1b76fbaf7989b
3
+ metadata.gz: 065d25cbce32ef3f5639e793c9f5db6d99c31a0c536d717ee49f05457251e4f3
4
+ data.tar.gz: 8d981a7cf504ec21bb9f0fdd12606ee78e53d6461909b1d0f4ceb06084c616b6
5
5
  SHA512:
6
- metadata.gz: a066316a818ebaf46096e655d5e20c87280ae47863aeae564e275b066647b004afad528e40e0cc4dbe56935f6bd3c9275541302893b2fbd77c2eb01c84cdbf9c
7
- data.tar.gz: 45d608d8bf7524a575bf833be24bcd13ec3ea6d2612da9ef40d7da5f9366fb43474eb078ab56c88f61c45d67143515a140d9d8de094e418906895cb277393386
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
- See more examples below.
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 spec/rspec_interactive.rb
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
+ ```
@@ -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
- if ARGV.size == 0
6
- RSpec::Interactive.start
7
- elsif ARGV.size == 1
8
- RSpec::Interactive.start(config_file: ARGV[0])
9
- else
10
- STDERR.puts "expected 0 or 1 argument, got: #{args.join(', ')}"
11
- STDERR.puts ''
12
- STDOUT.puts 'usage: rspec-interactive [config-file]'
13
- exit 1
14
- end
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])
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Interactive
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
@@ -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"
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.5.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
- - run-with-local-dep.sh
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