turbulence 0.0.4 → 0.0.5

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.
data/bin/bule CHANGED
@@ -1,6 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'turbulence'
3
+ require 'turbulence/checks_environment'
4
+
5
+ unless Turbulence::ChecksEnvironment.git_repo?(Dir.pwd)
6
+ STDERR.puts "Turbulence could not calculate metrics, as we could not find a git repository in the current directory."
7
+ STDERR.puts "Please run bule from inside a git repository."
8
+ exit
9
+ end
3
10
 
4
11
  cli = Turbulence::CommandLineInterface.new(Dir.pwd)
5
12
  cli.generate_bundle
6
- cli.open_bundle
13
+ cli.open_bundle
@@ -0,0 +1,11 @@
1
+ require 'open3'
2
+ class Turbulence
3
+ class ChecksEnvironment
4
+ class << self
5
+ def git_repo?(directory)
6
+ _, err, _ = Open3::capture3("git status")
7
+ !(err =~ /Not a git repository/)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  class Turbulence
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
23
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
24
  s.require_paths = ["lib"]
25
+ s.required_ruby_version = '>= 1.9.2'
25
26
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Chad Fowler
@@ -86,6 +86,7 @@ files:
86
86
  - lib/turbulence.rb
87
87
  - lib/turbulence/calculators/churn.rb
88
88
  - lib/turbulence/calculators/complexity.rb
89
+ - lib/turbulence/checks_environment.rb
89
90
  - lib/turbulence/command_line_interface.rb
90
91
  - lib/turbulence/scatter_plot_generator.rb
91
92
  - lib/turbulence/version.rb
@@ -111,8 +112,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
112
  - - ">="
112
113
  - !ruby/object:Gem::Version
113
114
  segments:
114
- - 0
115
- version: "0"
115
+ - 1
116
+ - 9
117
+ - 2
118
+ version: 1.9.2
116
119
  required_rubygems_version: !ruby/object:Gem::Requirement
117
120
  none: false
118
121
  requirements: