rubyx 0.0.1

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 (8) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +3 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +26 -0
  5. data/Rakefile +1 -0
  6. data/bin/rubyx +31 -0
  7. data/rubyx.gemspec +20 -0
  8. metadata +87 -0
@@ -0,0 +1 @@
1
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright 2014 Ivan Ukhov
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.
@@ -0,0 +1,26 @@
1
+ # Ruby X
2
+
3
+ A tool to run a Ruby script while showing the executed command, just like
4
+ `bash -x`.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ $ gem install rubyx
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ $ rubyx file.rb
16
+ ```
17
+
18
+ ## Contributing
19
+
20
+ 1. [Fork](https://help.github.com/articles/fork-a-repo) the project.
21
+ 2. Create a branch for your feature (`git checkout -b awesome-feature`).
22
+ 3. Implement your feature (`vim`).
23
+ 4. Commit your changes (`git commit -am 'Implemented an awesome feature'`).
24
+ 5. Push to the branch (`git push origin awesome-feature`).
25
+ 6. [Create](https://help.github.com/articles/creating-a-pull-request)
26
+ a new Pull Request.
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ def abort
4
+ puts 'Usage: rubyx <file> [arguments]'
5
+ exit 1
6
+ end
7
+
8
+ filename = ARGV.shift || ''
9
+ abort if filename.empty?
10
+
11
+ filename = File.absolute_path(filename)
12
+
13
+ unless File.exist?(filename)
14
+ puts 'The file does not exist.'
15
+ exit 1
16
+ end
17
+
18
+ lines = File.readlines(filename)
19
+ previous = 0
20
+
21
+ trace = Proc.new do |event, file, current|
22
+ if event == 'line' && file == filename && current > previous
23
+ (previous..(current - 1)).each do |i|
24
+ puts "+ #{lines[i]}"
25
+ end
26
+ previous = current
27
+ end
28
+ end
29
+
30
+ set_trace_func(trace)
31
+ require filename
@@ -0,0 +1,20 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'rubyx'
3
+ spec.version = '0.0.1'
4
+ spec.authors = ['Ivan Ukhov']
5
+ spec.email = ['ivan.ukhov@gmail.com']
6
+ spec.summary = 'A tool to run a Ruby script while showing the ' \
7
+ 'executed commands.'
8
+ spec.description = spec.summary
9
+ spec.homepage = 'https://github.com/IvanUkhov/rubyx'
10
+ spec.license = 'MIT'
11
+
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.executables = ['rubyx']
14
+ spec.require_paths = ['lib']
15
+
16
+ spec.required_ruby_version = '>= 1.9.3'
17
+
18
+ spec.add_development_dependency 'bundler', '~> 1.6'
19
+ spec.add_development_dependency 'rake', '~> 10.0'
20
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubyx
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ivan Ukhov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-08-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.6'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.6'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '10.0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '10.0'
46
+ description: A tool to run a Ruby script while showing the executed commands.
47
+ email:
48
+ - ivan.ukhov@gmail.com
49
+ executables:
50
+ - rubyx
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - bin/rubyx
60
+ - rubyx.gemspec
61
+ homepage: https://github.com/IvanUkhov/rubyx
62
+ licenses:
63
+ - MIT
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: 1.9.3
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 1.8.23.2
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: A tool to run a Ruby script while showing the executed commands.
86
+ test_files: []
87
+ has_rdoc: