rrg 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rrg +10 -3
  3. data/lib/rrg/version.rb +1 -1
  4. data/rrg.gemspec +2 -2
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b51311e9dcb171ca60d47e533c8f490da8f221d
4
- data.tar.gz: c301e1735d5e0fbbabfdec83db759a8dd326e643
3
+ metadata.gz: f9d795f824598486b4dcd824ae9972fabba7a60c
4
+ data.tar.gz: 703e2f5b5c7378be0782886af9d9b3b138692e8b
5
5
  SHA512:
6
- metadata.gz: 3938447b673b5f932d31d0afa25cafde4b844c0ea8da2aac0d4e790f598b0e76c3d0c0836e7144a9581cad2b9bb3915ba686a7fe10883a981ce6581dfbb5c2e0
7
- data.tar.gz: e0c1b304edc0a4a13834ee4090c8dfc5333592b4301c47210a1ce0e27d17cd88f77d03f0ddb3b5f71c54dc82c98b611ef5939f3147f31bfcfc998ae4196cd27d
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
- tmpdir = Dir.mktmpdir
45
- image = File.join(tmpdir, 'requires.png')
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
@@ -1,3 +1,3 @@
1
1
  module Rrg
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
@@ -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, when nodes are the source files and an
9
- arrow from A to B means that A calls `require 'B'`.
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.1'
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, when nodes are the source files and an
58
- arrow from A to B means that A calls `require 'B'`.
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: