rrr-cli 1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 62e7927fda2e3bd9872401898499c772f769ae3e
4
+ data.tar.gz: f2a2db769331624b1ab881faaf20ec7cc18e5956
5
+ SHA512:
6
+ metadata.gz: 492c05daaab13ac7dfa1a0a810320032a7e39934771e99f824508593fe14810a78ca2ace2e79ef0392f17673702fa36e4af1d10ed00fd424444a7d3cc77e1371
7
+ data.tar.gz: d67fd7c0e1e95a5137d5302f583661c05a84b7b2ad62692f556c60670b1b4869138ed5d9927ca4d058789d54a9ff4b1cf332e0af33b6c77a74fca8b8be021f3e
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in rrr.gemspec
6
+ gemspec
@@ -0,0 +1,41 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rrr-cli (1.0)
5
+ rake
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ coderay (1.1.2)
11
+ diff-lcs (1.3)
12
+ method_source (0.9.0)
13
+ pry (0.11.3)
14
+ coderay (~> 1.1.0)
15
+ method_source (~> 0.9.0)
16
+ rake (12.3.1)
17
+ rspec (3.7.0)
18
+ rspec-core (~> 3.7.0)
19
+ rspec-expectations (~> 3.7.0)
20
+ rspec-mocks (~> 3.7.0)
21
+ rspec-core (3.7.1)
22
+ rspec-support (~> 3.7.0)
23
+ rspec-expectations (3.7.0)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.7.0)
26
+ rspec-mocks (3.7.0)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.7.0)
29
+ rspec-support (3.7.1)
30
+
31
+ PLATFORMS
32
+ ruby
33
+
34
+ DEPENDENCIES
35
+ bundler
36
+ pry
37
+ rrr-cli!
38
+ rspec (~> 3.0)
39
+
40
+ BUNDLED WITH
41
+ 1.16.1
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/rrr ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../lib/cli.rb"
3
+
4
+ Rrr::Run.new(ARGV)
@@ -0,0 +1,56 @@
1
+ require "rrr"
2
+ require "rake"
3
+ require "date"
4
+ require "time"
5
+ require "pry"
6
+
7
+ module Rrr
8
+ class Run
9
+ attr_reader :datetime, :files
10
+
11
+ def initialize(files)
12
+ @files = files
13
+ init && touch && run
14
+ end
15
+
16
+ def init
17
+ @datetime = begin
18
+ Time.parse(File.open('.rrr', 'r').read)
19
+ rescue
20
+ Time.now
21
+ end
22
+ end
23
+
24
+ def touch
25
+ File.open('.rrr', 'w') do |file|
26
+ file.write(Time.now)
27
+ end
28
+ end
29
+
30
+ def list
31
+ file_list = FileList.new('spec/**/*_spec.rb')
32
+ file_list.select{|file| File.ctime(file) > datetime}
33
+ end
34
+
35
+ def run
36
+ if collection.empty?
37
+ puts "INFO: no recent changes in specs ... running all specs\nINFO: #{rspec}"
38
+ command = rspec
39
+ else
40
+ command = "#{rspec} #{collection.join(' ')}"
41
+ puts "rrr: #{command}"
42
+ end
43
+ system(command)
44
+ end
45
+
46
+ def collection
47
+ @collection ||= begin
48
+ files.empty? ? list : files
49
+ end
50
+ end
51
+
52
+ def rspec
53
+ "rspec"
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,4 @@
1
+ require "rrr/version"
2
+
3
+ module Rrr
4
+ end
@@ -0,0 +1,3 @@
1
+ module Rrr
2
+ VERSION = "1.1"
3
+ end
@@ -0,0 +1,7 @@
1
+ RSpec.describe Rrr do
2
+
3
+ it "has a version number" do
4
+ expect(Rrr::VERSION).not_to be nil
5
+ end
6
+
7
+ end
@@ -0,0 +1,14 @@
1
+ require "bundler/setup"
2
+ require "rrr"
3
+
4
+ RSpec.configure do |config|
5
+ # Enable flags like --only-failures and --next-failure
6
+ config.example_status_persistence_file_path = ".rspec_status"
7
+
8
+ # Disable RSpec exposing methods globally on `Module` and `main`
9
+ config.disable_monkey_patching!
10
+
11
+ config.expect_with :rspec do |c|
12
+ c.syntax = :expect
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rrr-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.1'
5
+ platform: ruby
6
+ authors:
7
+ - Igor Kasyanchuk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-08-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: Run only recently changed specs in your app.
70
+ email:
71
+ - igorkasyanchuk@gmail.com
72
+ executables:
73
+ - rrr
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - Gemfile
78
+ - Gemfile.lock
79
+ - Rakefile
80
+ - bin/rrr
81
+ - lib/cli.rb
82
+ - lib/rrr.rb
83
+ - lib/rrr/version.rb
84
+ - spec/rrr_spec.rb
85
+ - spec/spec_helper.rb
86
+ homepage: https://github.com/igorkasyanchuk
87
+ licenses:
88
+ - MIT
89
+ metadata: {}
90
+ post_install_message:
91
+ rdoc_options: []
92
+ require_paths:
93
+ - lib
94
+ - bin
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.6.8
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Run Recent Rspecs
111
+ test_files: []