├── .gitignore ├── LICENSE.txt ├── README.md ├── Rakefile ├── lib ├── spring-commands-rspec.rb └── spring │ └── commands │ └── rspec.rb └── spring-commands-rspec.gemspec /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | .yardoc 6 | Gemfile.lock 7 | InstalledFiles 8 | _yardoc 9 | coverage 10 | doc/ 11 | lib/bundler/man 12 | pkg 13 | rdoc 14 | spec/reports 15 | test/tmp 16 | test/version_tmp 17 | tmp 18 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Jon Leighton 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spring-commands-rspec 2 | 3 | This gem implements the `rspec` command for 4 | [Spring](https://github.com/jonleighton/spring). 5 | 6 | ## Usage 7 | 8 | Add to your Gemfile: 9 | 10 | ``` ruby 11 | gem 'spring-commands-rspec', group: :development 12 | ``` 13 | 14 | If you're using spring binstubs, run `bundle exec spring binstub rspec` to generate `bin/rspec`. 15 | Then run `spring stop` to pick up the changes. 16 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | -------------------------------------------------------------------------------- /lib/spring-commands-rspec.rb: -------------------------------------------------------------------------------- 1 | if defined?(Spring.register_command) 2 | require "spring/commands/rspec" 3 | end 4 | -------------------------------------------------------------------------------- /lib/spring/commands/rspec.rb: -------------------------------------------------------------------------------- 1 | module Spring 2 | module Commands 3 | class RSpec 4 | def env(*) 5 | "test" 6 | end 7 | 8 | def exec_name 9 | "rspec" 10 | end 11 | 12 | def gem_name 13 | "rspec-core" 14 | end 15 | 16 | def call 17 | ::RSpec.configuration.start_time = Time.now if defined?(::RSpec.configuration.start_time) 18 | load Gem.bin_path(gem_name, exec_name) 19 | end 20 | end 21 | 22 | Spring.register_command "rspec", RSpec.new 23 | Spring::Commands::Rake.environment_matchers[/^spec($|:)/] = "test" 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spring-commands-rspec.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | 5 | Gem::Specification.new do |spec| 6 | spec.name = "spring-commands-rspec" 7 | spec.version = "1.0.4" 8 | spec.authors = ["Jon Leighton"] 9 | spec.email = ["j@jonathanleighton.com"] 10 | spec.description = %q{rspec command for spring} 11 | spec.summary = %q{rspec command for spring} 12 | spec.homepage = "https://github.com/jonleighton/spring-commands-rspec" 13 | spec.license = "MIT" 14 | 15 | spec.files = `git ls-files`.split($/) 16 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 17 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 18 | spec.require_paths = ["lib"] 19 | 20 | spec.add_dependency "spring", ">= 0.9.1" 21 | 22 | spec.add_development_dependency "bundler", "~> 1.3" 23 | spec.add_development_dependency "rake" 24 | end 25 | --------------------------------------------------------------------------------