rubrowser 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: a3f34361f8481fafacdbb4bda6020e92cc031e9e934e934935e36970164dd9f7
4
- data.tar.gz: 5e8899befc1456be7326215551b081a061bd9156f754d409c64484bf6797113e
2
+ SHA1:
3
+ metadata.gz: 6b289faa595ba604fd4a512f0b92ed805b514499
4
+ data.tar.gz: c98570f4f2365a8d670967941f4e5638789211bc
5
5
  SHA512:
6
- metadata.gz: 2df8b115f261a7bc09bfa296aeeb3b2db77f7f6e6e0bbd00673de377bb473c29e7c95458e42d02b4406a41262c114d3591e21fad96f5103676001989ef09551c
7
- data.tar.gz: 752c00be5fb7b1b079895946de617967b2232d6a7f2ea830e118a2076b52d624f545bd6ddc91ebe93e884c536e30e8d1381b4e213fe0dc4b0f7b3e0bcb73d352
6
+ metadata.gz: b49456ac5b7772bfd815658587e740422f02e10193bece15133984d374e65a58f95a5edfc16a1a8154601f056c2c75fb4f2976ebc3617cd46cfa334a727d28f4
7
+ data.tar.gz: a1804ef9b1bf354a290159f8d99332baac4723e4eff65af626dd69d7e1e2c67c3907db6bfcd0c8603eeef9f28333ca6d779bbccdc775ab1d197fc8b911dcc9af
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubrowser (2.1.0)
4
+ rubrowser (2.2.0)
5
5
  parser (~> 2.3, >= 2.3.0)
6
6
 
7
7
  GEM
data/bin/rubrowser CHANGED
@@ -6,12 +6,17 @@ require 'rubrowser'
6
6
  require 'rubrowser/renderer'
7
7
 
8
8
  options = {
9
- toolbox: true
9
+ toolbox: true,
10
+ output: STDOUT
10
11
  }
11
12
 
12
13
  OptionParser.new do |opts|
13
14
  opts.banner = "Usage: #{__FILE__} [options] [file] ..."
14
15
 
16
+ opts.on('-oFILE', '--output=FILE', 'output file page, if not specified output will be written to stdout') do |output|
17
+ options[:output] = output
18
+ end
19
+
15
20
  opts.on('-T', '--no-toolbox', 'Don\'t display toolbox on the page') do
16
21
  options[:toolbox] = false
17
22
  end
@@ -29,4 +34,4 @@ end.parse!
29
34
 
30
35
  options[:files] = ARGV.empty? ? ['.'] : ARGV
31
36
 
32
- puts Rubrowser::Renderer.call(options)
37
+ Rubrowser::Renderer.call(options)
@@ -12,20 +12,25 @@ module Rubrowser
12
12
  end
13
13
 
14
14
  def call
15
- erb :index
15
+ output.write(erb(:index))
16
16
  end
17
17
 
18
18
  private
19
19
 
20
20
  include ERB::Util
21
21
 
22
- attr_reader :files
22
+ attr_reader :files, :output
23
23
 
24
24
  def initialize(options)
25
+ @output = output_file(options[:output])
25
26
  @files = options[:files]
26
27
  @toolbox = options[:toolbox]
27
28
  end
28
29
 
30
+ def output_file(path)
31
+ path.is_a?(String) ? File.open(path, 'w') : path
32
+ end
33
+
29
34
  def toolbox?
30
35
  @toolbox
31
36
  end
@@ -1,3 +1,3 @@
1
1
  module Rubrowser
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
data/readme.md CHANGED
@@ -52,6 +52,7 @@ gem install rubrowser
52
52
 
53
53
  ```
54
54
  Usage: rubrowser [options] [file] ...
55
+ -o, --output=FILE output file page, if not specified output will be written to stdout
55
56
  -T, --no-toolbox Don't display toolbox on the page
56
57
  -v, --version Print Rubrowser version
57
58
  -h, --help Prints this help
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubrowser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emad Elsaid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  version: '0'
160
160
  requirements: []
161
161
  rubyforge_project:
162
- rubygems_version: 2.7.3
162
+ rubygems_version: 2.6.10
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: A ruby interactive dependency graph visualizer