rspec_jit 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/bin/rspec_jit +56 -0
  3. metadata +73 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e852e6283158d5d09c7a1036a0e4484431d929f6
4
+ data.tar.gz: c4e787d00160433ec31ee304b3509d31a79a98ea
5
+ SHA512:
6
+ metadata.gz: a06b7946975fb52b12e70ead1062039addda3250fcb4f8d7b450241c57d9a66678e0a9607598505fbf207f6d5cb694e5b71e0a81340df3256bb84a05960e7c6f
7
+ data.tar.gz: 5ece930423d8c0ee4e1cd36677e54c9266a3cb6d10d4d984b844659ac619200c9e4ea997baa6d733e578131f8bf8b6af8ee77e767f241b305d5ed0e13e1427bc
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ platform = `uname -sm`
4
+ input_args = "#{ARGV.join(' ')}"
5
+
6
+ dir = case platform
7
+ when /^Darwin/ ; "darwin-amd64"
8
+ when /^Linux.*64/ ; "linux-amd64"
9
+ else
10
+ abort "rspec_jit is not supported on your platform"
11
+ end
12
+
13
+ puts "Starting Script"
14
+
15
+ cmd = <<SCRIPT
16
+ #!/bin/sh
17
+
18
+ # Run RSpec with ruby JIT enabled
19
+
20
+ ensure_binary_exists () {
21
+ which $1 2>/dev/null
22
+
23
+ if [ $? -eq 1 ]
24
+ then
25
+ echo "Please install $1"
26
+ exit 1
27
+ fi
28
+ }
29
+
30
+ get_ruby_version () {
31
+ ruby_version=$( ruby -v | awk -F' ' '{ print $2 }' )
32
+ }
33
+
34
+ ruby_supports_jit () {
35
+ jit_capable=$( echo $ruby_version | awk -F"." '{ if($1 == 2 && $2 > 5) { print "1" } }' )
36
+ }
37
+
38
+ ensure_binary_exists "rspec"
39
+ ensure_binary_exists "ruby"
40
+
41
+ get_ruby_version
42
+ ruby_supports_jit
43
+
44
+ if [[ $jit_capable == "1" ]]
45
+ then
46
+ echo "Running with JIT using ruby version $ruby_version"
47
+ cmd="ruby --jit $(which rspec) #{input_args}"
48
+ else
49
+ echo "Running without JIT enabled. Ruby $ruby_version does not support jit"
50
+ cmd="rspec #{input_args}"
51
+ fi
52
+ echo $cmd
53
+ $cmd
54
+ SCRIPT
55
+
56
+ exec cmd
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec_jit
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jason Willems
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-12-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec-core
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3'
41
+ description: Run RSpec test suites with Ruby's JIT flag enabled
42
+ email: hello@jasonwillems.com
43
+ executables:
44
+ - rspec_jit
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - bin/rspec_jit
49
+ homepage: https://github.com/at1as/rspec_jit
50
+ licenses:
51
+ - MIT
52
+ metadata: {}
53
+ post_install_message:
54
+ rdoc_options: []
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ requirements: []
68
+ rubyforge_project:
69
+ rubygems_version: 2.5.1
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Run RSpec tests with JIT
73
+ test_files: []