rrg 0.1 → 0.2
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.
- checksums.yaml +4 -4
- data/bin/rrg +10 -3
- data/lib/rrg/version.rb +1 -1
- data/rrg.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9d795f824598486b4dcd824ae9972fabba7a60c
|
4
|
+
data.tar.gz: 703e2f5b5c7378be0782886af9d9b3b138692e8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc426adf5d7a6121b55b0d2ca63a5c8e50cfd11d7426170b2fad1b8a68107e8b44b3172ab8f2c0663ffbb57cff18af20c57b5f61ec20075304708a9d07c6e8d8
|
7
|
+
data.tar.gz: faf246a91294332e055aa7cce319669f4dc2912cbc08d404fbe111d87ef0642abbd713a0ee7e9c8ea397e866bcb477b75eea688fd582dfccd539be5b61176bba
|
data/bin/rrg
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'etc'
|
4
|
+
require 'fileutils'
|
3
5
|
require 'set'
|
4
|
-
require 'tmpdir'
|
5
6
|
|
6
7
|
require 'ruby_parser'
|
7
8
|
|
@@ -41,8 +42,14 @@ if File.basename($PROGRAM_NAME) == 'rrg'
|
|
41
42
|
output = $stdout
|
42
43
|
view_output = lambda { true } # nothing
|
43
44
|
else
|
44
|
-
|
45
|
-
|
45
|
+
|
46
|
+
cache_dir = File.join(Etc.getpwuid.dir, '.cache', 'rrg')
|
47
|
+
FileUtils.mkdir_p(cache_dir)
|
48
|
+
|
49
|
+
project_name = File.basename(Dir.pwd)
|
50
|
+
timestamp = Time.now.to_i.to_s
|
51
|
+
|
52
|
+
image = File.join(cache_dir, project_name + '.' + timestamp + '.png')
|
46
53
|
output = IO.popen(['dot', '-Tpng', '-o', image], 'w')
|
47
54
|
|
48
55
|
# FIXME hardcoded list of image viewers for now
|
data/lib/rrg/version.rb
CHANGED
data/rrg.gemspec
CHANGED
@@ -5,8 +5,8 @@ require 'rrg/version'
|
|
5
5
|
|
6
6
|
description = <<DESCRIPTION
|
7
7
|
rrg will read the source code of a Ruby project and generate a graph based on
|
8
|
-
the require statements in the code
|
9
|
-
arrow from A to B means that A
|
8
|
+
the require statements in the code; nodes represent the source files and an
|
9
|
+
arrow from A to B means that A contains a `require 'B'` statement.
|
10
10
|
DESCRIPTION
|
11
11
|
|
12
12
|
Gem::Specification.new do |spec|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Terceiro
|
@@ -54,8 +54,8 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
description: |
|
56
56
|
rrg will read the source code of a Ruby project and generate a graph based on
|
57
|
-
the require statements in the code
|
58
|
-
arrow from A to B means that A
|
57
|
+
the require statements in the code; nodes represent the source files and an
|
58
|
+
arrow from A to B means that A contains a `require 'B'` statement.
|
59
59
|
email:
|
60
60
|
- terceiro@softwarelivre.org
|
61
61
|
executables:
|