qor_test 0.0.2 → 0.0.3

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/.gitignore CHANGED
@@ -18,3 +18,4 @@ test/example_test.rb
18
18
  tmp
19
19
  config
20
20
  QorTest*
21
+ Makefile
data/bin/qor_test.rb CHANGED
@@ -24,11 +24,6 @@ OptionParser.new do |opts|
24
24
  options[:pretend] = true
25
25
  end
26
26
 
27
- opts.on( '-i', '--init', 'Init') do
28
- Qor::Test::CLI.init
29
- exit
30
- end
31
-
32
27
  opts.on( '-s', '--sample', 'Create sample configuration') do
33
28
  Qor::Test::CLI.copy_sample_configuration
34
29
  exit
@@ -0,0 +1,7 @@
1
+ require 'mkmf'
2
+
3
+ command = "sudo ln -nfs #{File.expand_path("../qor_test", __FILE__)} /usr/bin/"
4
+ puts command
5
+ system command
6
+
7
+ create_makefile('qor_test/qor_test')
File without changes
data/lib/qor_test/cli.rb CHANGED
@@ -29,7 +29,7 @@ module Qor
29
29
  gemfiles.map do |file|
30
30
  $case_num += 1
31
31
  scripts << "echo -n '\n\e[01;31m[ENV #{gemfile.group_name}] \e[0m'"
32
- scripts << "echo -n '\e[31mRunning case #{$case_num} with ruby #{version}, '$[$total_cases_num-#{$case_num}]' cases left\e[0m\n'"
32
+ scripts << "echo -n '\e[31mRunning case #{$case_num} with ruby '$(ruby -v)', '$[$total_cases_num-#{$case_num}]' cases left\e[0m\n'"
33
33
  run_with_gemfile(file)
34
34
  end
35
35
  end
@@ -77,12 +77,6 @@ module Qor
77
77
  FileUtils.cp(Qor::Test::Configuration.sample_file, Qor::Test::Configuration.config_path)
78
78
  puts("Copied sample configuration to #{Qor::Test::Configuration.config_path}!")
79
79
  end
80
-
81
- def self.init
82
- command = "sudo ln -nfs #{File.expand_path("../../../shell/qor_test", __FILE__)} /usr/bin/"
83
- puts command
84
- system command
85
- end
86
80
  end
87
81
  end
88
82
  end
@@ -24,19 +24,28 @@ module Qor
24
24
  end
25
25
 
26
26
  def matched_version(version)
27
- result = versions.select {|x| x =~ Regexp.new(version) }[-1]
28
- puts("ruby '#{version}' is not installed! please install it first!") && exit unless result
27
+ result = ["^#{version}", version].map do |x|
28
+ versions.select {|v| v =~ Regexp.new(x) }[-1]
29
+ end.compact[0]
30
+ not_installed!(version) unless result
29
31
  result
30
32
  end
31
33
 
32
34
  def switch_ruby_version(version)
33
35
  if rvm?
34
- "rvm use #{matched_version(version)}"
36
+ "[ -f $rvm_path/scripts/rvm ] && source $rvm_path/scripts/rvm; rvm use #{matched_version(version)}"
35
37
  elsif rbenv?
36
38
  "export RBENV_VERSION=#{matched_version(version)}"
39
+ elsif (`ruby -v` !~ Regexp.new(version))
40
+ not_installed!(version)
37
41
  end
38
42
  end
39
43
 
44
+ def not_installed!(version)
45
+ puts "ruby '#{version}' is not installed! please install it first!"
46
+ exit
47
+ end
48
+
40
49
  end
41
50
  end
42
51
  end
@@ -1,5 +1,5 @@
1
1
  module Qor
2
2
  module Test
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
data/qor_test.gemspec CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |gem|
12
12
 
13
13
  gem.files = `git ls-files`.split($\)
14
14
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
+ gem.extensions = ['ext/qor_test/extconf.rb']
15
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
17
  gem.name = "qor_test"
17
18
  gem.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qor_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -32,7 +32,8 @@ email:
32
32
  - wosmvp@gmail.com
33
33
  executables:
34
34
  - qor_test.rb
35
- extensions: []
35
+ extensions:
36
+ - ext/qor_test/extconf.rb
36
37
  extra_rdoc_files: []
37
38
  files:
38
39
  - .gitignore
@@ -42,6 +43,9 @@ files:
42
43
  - README.md
43
44
  - Rakefile
44
45
  - bin/qor_test.rb
46
+ - ext/qor_test/extconf.rb
47
+ - ext/qor_test/qor_test
48
+ - ext/qor_test/qor_test.c
45
49
  - lib/qor_test.rb
46
50
  - lib/qor_test/cli.rb
47
51
  - lib/qor_test/configuration.rb
@@ -50,7 +54,6 @@ files:
50
54
  - lib/qor_test/rubies.rb
51
55
  - lib/qor_test/version.rb
52
56
  - qor_test.gemspec
53
- - shell/qor_test
54
57
  homepage: ''
55
58
  licenses: []
56
59
  post_install_message:
@@ -71,8 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
74
  version: '0'
72
75
  requirements: []
73
76
  rubyforge_project:
74
- rubygems_version: 1.8.23
77
+ rubygems_version: 1.8.24
75
78
  signing_key:
76
79
  specification_version: 3
77
80
  summary: ! 'Qor Test: Make test easier!'
78
81
  test_files: []
82
+ has_rdoc:
File without changes