bundle_outdated_formatter 0.4.0 → 0.5.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
2
  SHA256:
3
- metadata.gz: a5e107a14ffcf92456621390c3e5f5aee6bfeaef1703a2e968e31a880c5e9158
4
- data.tar.gz: df7eeddbdff35e240dbc1ed16b97daccc2a8a92209e6895a3569b44a14eb3210
3
+ metadata.gz: 6ef51ba9e6124cbfffdd3d88570e41ab1a12ea51e73b1129547baf6d12cc1450
4
+ data.tar.gz: 1c04817284efa239267f2fccb7c6d6be9abe5d4aa0209aa829d05e265c9ab9d0
5
5
  SHA512:
6
- metadata.gz: 1be74f024a0dca333790b0d57f20aeab970f92406b917f56d13350906ca43b58214c371b801880d841492f391f213adc187c190a16dcc6bd10741557a948598a
7
- data.tar.gz: cbac144cc506b72ca567c54b32cc5e4c7551855c85b88eddb165e2b654cfe8d8c0d9b19b6870105561a371ff072f06755a7e67842dc4cab3a353d34827c969f6
6
+ metadata.gz: b730f4b7f9d2de1a50fe8b1a410df0af16ab753d7d2613684726cb86ceff5760821c706e8ac6d2a72a891f8545cde1525a956da7d1715302e2b4ac96c15553cd
7
+ data.tar.gz: 6ba027325d4c0f6025f00a0c3ca7e97afe3bf483ecb055f3dff7bf23299b723e07cdcbfe64231ba17fe2b4dc7bef856918705367e70e6d82344d0a8a4fd5e98e
data/.rubocop.yml CHANGED
@@ -23,3 +23,7 @@ Metrics/LineLength:
23
23
 
24
24
  Naming/HeredocDelimiterNaming:
25
25
  Enabled: false
26
+
27
+ Style/IfUnlessModifier:
28
+ Exclude:
29
+ - 'Gemfile'
data/.rubocop_todo.yml CHANGED
@@ -1,7 +1,20 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-10-27 22:55:43 +0900 using RuboCop version 0.51.0.
3
+ # on 2018-05-24 00:00:09 +0900 using RuboCop version 0.56.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'bundle_outdated_formatter.gemspec'
15
+
16
+ # Offense count: 14
17
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
18
+ # URISchemes: http, https
19
+ Metrics/LineLength:
20
+ Max: 140
data/.travis.yml CHANGED
@@ -3,12 +3,11 @@ language: ruby
3
3
  rvm:
4
4
  - 2.0.0
5
5
  - 2.1.10
6
- - 2.2.9
7
- - 2.3.6
8
- - 2.4.3
9
- - 2.5.0
6
+ - 2.2.10
7
+ - 2.3.7
8
+ - 2.4.4
9
+ - 2.5.1
10
10
  - ruby-head
11
11
  before_install:
12
- - stty cols 160
13
12
  - gem update --system
14
13
  - gem update bundler
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.5.0 (2018-05-26)
4
+
5
+ ### Features
6
+
7
+ * Support Terminal (Unicode table) format
8
+ * Change default style of Terminal format from ASCII table to Unicode table
9
+ * Add `--style` option for `output` command
10
+ * Change single quotes in XML declaration to double quotes
11
+ * Avoid self-closing tags
12
+
13
+ ### Bug Fixes
14
+
15
+ * Fix `Illegal character` exception (#1)
16
+
3
17
  ## 0.4.0 (2017-12-29)
4
18
 
5
19
  ### Features
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/bundle_outdated_formatter.svg)](https://badge.fury.io/rb/bundle_outdated_formatter)
4
4
  [![Build Status](https://travis-ci.org/emsk/bundle_outdated_formatter.svg?branch=master)](https://travis-ci.org/emsk/bundle_outdated_formatter)
5
- [![Coverage Status](https://coveralls.io/repos/github/emsk/bundle_outdated_formatter/badge.svg?branch=master)](https://coveralls.io/github/emsk/bundle_outdated_formatter)
5
+ [![Build status](https://ci.appveyor.com/api/projects/status/w2qfj0a4iicqhmhq?svg=true)](https://ci.appveyor.com/project/emsk/bundle-outdated-formatter)
6
+ [![Codecov](https://codecov.io/gh/emsk/bundle_outdated_formatter/branch/master/graph/badge.svg)](https://codecov.io/gh/emsk/bundle_outdated_formatter)
6
7
  [![Code Climate](https://codeclimate.com/github/emsk/bundle_outdated_formatter/badges/gpa.svg)](https://codeclimate.com/github/emsk/bundle_outdated_formatter)
7
- [![Dependency Status](https://gemnasium.com/badges/github.com/emsk/bundle_outdated_formatter.svg)](https://gemnasium.com/github.com/emsk/bundle_outdated_formatter)
8
8
  [![Inline docs](http://inch-ci.org/github/emsk/bundle_outdated_formatter.svg?branch=master)](http://inch-ci.org/github/emsk/bundle_outdated_formatter)
9
9
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt)
10
10
 
@@ -42,6 +42,7 @@ $ bundle outdated | bof
42
42
  | :----- | :---- | :---------- | :------ |
43
43
  | `--format` | `-f` | Format. `terminal`, `markdown`, `json`, `yaml`, `csv`, `tsv`, `xml`, or `html`. | `terminal` |
44
44
  | `--pretty` | `-p` | `true` if pretty output.<br>This option is available in `json`, `xml`, or `html` formats. | `false` |
45
+ | `--style` | `-s` | Terminal table style. `unicode` or `ascii`.<br>This option is available in `terminal` format. | `unicode` |
45
46
 
46
47
  ## Examples
47
48
 
@@ -54,13 +55,27 @@ Fetching dependency metadata from https://rubygems.org/..
54
55
  Resolving dependencies...
55
56
 
56
57
  Outdated gems included in the bundle:
57
- * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
58
- * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
59
- * headless (newest 2.3.1, installed 2.2.3)
58
+ * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
59
+ * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
60
+ * headless (newest 2.3.1, installed 2.2.3)
60
61
  ```
61
62
 
62
63
  ### Convert to Terminal
63
64
 
65
+ Unicode style:
66
+
67
+ ```
68
+ ┌──────────┬────────┬───────────┬───────────┬───────────────────┐
69
+ │ gem │ newest │ installed │ requested │ groups │
70
+ ├──────────┼────────┼───────────┼───────────┼───────────────────┤
71
+ │ faker │ 1.6.6 │ 1.6.5 │ ~> 1.4 │ development, test │
72
+ │ hashie │ 3.4.6 │ 1.2.0 │ = 1.2.0 │ default │
73
+ │ headless │ 2.3.1 │ 2.2.3 │ │ │
74
+ └──────────┴────────┴───────────┴───────────┴───────────────────┘
75
+ ```
76
+
77
+ ASCII style:
78
+
64
79
  ```
65
80
  +----------+--------+-----------+-----------+-------------------+
66
81
  | gem | newest | installed | requested | groups |
@@ -161,19 +176,19 @@ Pretty output:
161
176
  Normal output:
162
177
 
163
178
  ```
164
- <?xml version='1.0' encoding='UTF-8'?><gems><outdated><gem>faker</gem><newest>1.6.6</newest><installed>1.6.5</installed><requested>~> 1.4</requested><groups>development, test</groups></outdated><outdated><gem>hashie</gem><newest>3.4.6</newest><installed>1.2.0</installed><requested>= 1.2.0</requested><groups>default</groups></outdated><outdated><gem>headless</gem><newest>2.3.1</newest><installed>2.2.3</installed><requested></requested><groups></groups></outdated></gems>
179
+ <?xml version="1.0" encoding="UTF-8"?><gems><outdated><gem>faker</gem><newest>1.6.6</newest><installed>1.6.5</installed><requested>~&gt; 1.4</requested><groups>development, test</groups></outdated><outdated><gem>hashie</gem><newest>3.4.6</newest><installed>1.2.0</installed><requested>= 1.2.0</requested><groups>default</groups></outdated><outdated><gem>headless</gem><newest>2.3.1</newest><installed>2.2.3</installed><requested></requested><groups></groups></outdated></gems>
165
180
  ```
166
181
 
167
182
  Pretty output:
168
183
 
169
184
  ```
170
- <?xml version='1.0' encoding='UTF-8'?>
185
+ <?xml version="1.0" encoding="UTF-8"?>
171
186
  <gems>
172
187
  <outdated>
173
188
  <gem>faker</gem>
174
189
  <newest>1.6.6</newest>
175
190
  <installed>1.6.5</installed>
176
- <requested>~> 1.4</requested>
191
+ <requested>~&gt; 1.4</requested>
177
192
  <groups>development, test</groups>
178
193
  </outdated>
179
194
  <outdated>
@@ -198,7 +213,7 @@ Pretty output:
198
213
  Normal output:
199
214
 
200
215
  ```
201
- <table><tr><th>gem</th><th>newest</th><th>installed</th><th>requested</th><th>groups</th></tr><tr><td>faker</td><td>1.6.6</td><td>1.6.5</td><td>~> 1.4</td><td>development, test</td></tr><tr><td>hashie</td><td>3.4.6</td><td>1.2.0</td><td>= 1.2.0</td><td>default</td></tr><tr><td>headless</td><td>2.3.1</td><td>2.2.3</td><td></td><td></td></tr></table>
216
+ <table><tr><th>gem</th><th>newest</th><th>installed</th><th>requested</th><th>groups</th></tr><tr><td>faker</td><td>1.6.6</td><td>1.6.5</td><td>~&gt; 1.4</td><td>development, test</td></tr><tr><td>hashie</td><td>3.4.6</td><td>1.2.0</td><td>= 1.2.0</td><td>default</td></tr><tr><td>headless</td><td>2.3.1</td><td>2.2.3</td><td></td><td></td></tr></table>
202
217
  ```
203
218
 
204
219
  Pretty output:
@@ -216,7 +231,7 @@ Pretty output:
216
231
  <td>faker</td>
217
232
  <td>1.6.6</td>
218
233
  <td>1.6.5</td>
219
- <td>~> 1.4</td>
234
+ <td>~&gt; 1.4</td>
220
235
  <td>development, test</td>
221
236
  </tr>
222
237
  <tr>
@@ -236,6 +251,10 @@ Pretty output:
236
251
  </table>
237
252
  ```
238
253
 
254
+ ## Related
255
+
256
+ * [bundle-outdated-formatter](https://github.com/emsk/bundle-outdated-formatter) - A Node.js implementation of the bundle_outdated_formatter
257
+
239
258
  ## Supported Ruby Versions
240
259
 
241
260
  * Ruby 2.0.0
data/appveyor.yml ADDED
@@ -0,0 +1,30 @@
1
+ version: 1.0.{build}-{branch}
2
+
3
+ environment:
4
+ matrix:
5
+ - RUBY_VERSION: 200
6
+ - RUBY_VERSION: 200-x64
7
+ - RUBY_VERSION: 21
8
+ - RUBY_VERSION: 21-x64
9
+ - RUBY_VERSION: 22
10
+ - RUBY_VERSION: 22-x64
11
+ - RUBY_VERSION: 23
12
+ - RUBY_VERSION: 23-x64
13
+ - RUBY_VERSION: 24
14
+ - RUBY_VERSION: 24-x64
15
+ - RUBY_VERSION: 25
16
+ - RUBY_VERSION: 25-x64
17
+
18
+ install:
19
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
20
+ - bundle install
21
+
22
+ build: off
23
+
24
+ before_test:
25
+ - ruby -v
26
+ - gem -v
27
+ - bundle -v
28
+
29
+ test_script:
30
+ - bundle exec rake
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'bundle_outdated_formatter/version'
4
4
 
@@ -20,13 +20,15 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
+ spec.required_ruby_version = '>= 2.0.0'
24
+
23
25
  spec.add_runtime_dependency 'psych', '~> 2.2'
24
- spec.add_runtime_dependency 'terminal-table', '~> 1.8'
25
- spec.add_runtime_dependency 'thor', '~> 0.19'
26
+ spec.add_runtime_dependency 'thor', '~> 0.20'
27
+ spec.add_runtime_dependency 'tty-table', '~> 0.10'
26
28
  spec.add_development_dependency 'bundler', '~> 1.16'
27
- spec.add_development_dependency 'coveralls', '~> 0.8'
29
+ spec.add_development_dependency 'codecov', '~> 0.1'
28
30
  spec.add_development_dependency 'rake', '~> 12.3'
29
31
  spec.add_development_dependency 'rspec', '~> 3.7'
30
- spec.add_development_dependency 'rubocop', '~> 0.52'
31
- spec.add_development_dependency 'simplecov', '~> 0.14'
32
+ spec.add_development_dependency 'rubocop', '~> 0.56'
33
+ spec.add_development_dependency 'simplecov', '~> 0.16'
32
34
  end
@@ -22,15 +22,18 @@ module BundleOutdatedFormatter
22
22
  'xml' => XMLFormatter,
23
23
  'html' => HTMLFormatter
24
24
  }.freeze
25
+ STYLES = %w[unicode ascii].freeze
25
26
 
26
27
  default_command :output
27
28
 
28
29
  desc 'output', 'Format output of `bundle outdated`'
29
30
  option :format, type: :string, aliases: '-f', default: 'terminal', desc: 'Format. (terminal, markdown, json, yaml, csv, tsv, xml, html)'
30
31
  option :pretty, type: :boolean, aliases: '-p', desc: '`true` if pretty output.'
32
+ option :style, type: :string, aliases: '-s', default: 'unicode', desc: 'Terminal table style. (unicode, ascii)'
31
33
 
32
34
  def output
33
35
  raise BundleOutdatedFormatter::UnknownFormatError, options[:format] unless allow_format?
36
+ raise BundleOutdatedFormatter::UnknownStyleError, options[:style] unless allow_style?
34
37
  return if STDIN.tty?
35
38
 
36
39
  formatter = create_formatter
@@ -48,7 +51,11 @@ module BundleOutdatedFormatter
48
51
  private
49
52
 
50
53
  def allow_format?
51
- FORMATTERS.keys.include?(options[:format])
54
+ FORMATTERS.key?(options[:format])
55
+ end
56
+
57
+ def allow_style?
58
+ STYLES.include?(options[:style])
52
59
  end
53
60
 
54
61
  def create_formatter
@@ -1,4 +1,5 @@
1
1
  module BundleOutdatedFormatter
2
2
  class Error < StandardError; end
3
3
  class UnknownFormatError < Error; end
4
+ class UnknownStyleError < Error; end
4
5
  end
@@ -13,6 +13,7 @@ module BundleOutdatedFormatter
13
13
 
14
14
  def initialize(options)
15
15
  @pretty = options[:pretty]
16
+ @style = options[:style]
16
17
  @outdated_gems = []
17
18
  end
18
19
 
@@ -38,7 +38,8 @@ module BundleOutdatedFormatter
38
38
  elements = @root.add_element(REXML::Element.new('tr'))
39
39
 
40
40
  COLUMNS.each do |column|
41
- elements.add_element('td').add_text(gem[column])
41
+ escaped_text = REXML::Text.new(gem[column], false, nil, false)
42
+ elements.add_element('td').add_text(escaped_text)
42
43
  end
43
44
  end
44
45
  end
@@ -1,18 +1,16 @@
1
- require 'terminal-table'
1
+ require 'tty-table'
2
2
  require 'bundle_outdated_formatter/formatter'
3
3
 
4
4
  module BundleOutdatedFormatter
5
5
  # Formatter for Terminal
6
6
  class TerminalFormatter < Formatter
7
7
  def convert
8
- table = Terminal::Table.new do |t|
9
- t << COLUMNS
10
- t << :separator
8
+ table = TTY::Table.new(header: COLUMNS) do |t|
11
9
  @outdated_gems.each do |gem|
12
10
  t << gem.values
13
11
  end
14
12
  end
15
- table.render.chomp
13
+ table.render(@style.to_sym, padding: [0, 1]).chomp
16
14
  end
17
15
  end
18
16
  end
@@ -8,8 +8,8 @@ module BundleOutdatedFormatter
8
8
  super(options)
9
9
 
10
10
  @xml = REXML::Document.new(nil, raw: :all)
11
- @xml << REXML::XMLDecl.new('1.0', 'UTF-8')
12
11
  @root = REXML::Element.new('gems')
12
+ @root.add_text('')
13
13
  @xml.add_element(@root)
14
14
  end
15
15
 
@@ -19,6 +19,8 @@ module BundleOutdatedFormatter
19
19
  end
20
20
 
21
21
  io = StringIO.new
22
+ io.write('<?xml version="1.0" encoding="UTF-8"?>')
23
+ io.write("\n") if @pretty
22
24
  xml_formatter.write(@xml, io)
23
25
  io.string.chomp
24
26
  end
@@ -29,7 +31,8 @@ module BundleOutdatedFormatter
29
31
  elements = @root.add_element(REXML::Element.new('outdated'))
30
32
 
31
33
  COLUMNS.each do |column|
32
- elements.add_element(column).add_text(gem[column])
34
+ escaped_text = REXML::Text.new(gem[column], false, nil, false)
35
+ elements.add_element(column).add_text(escaped_text)
33
36
  end
34
37
  end
35
38
  end
@@ -1,3 +1,3 @@
1
1
  module BundleOutdatedFormatter
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundle_outdated_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - emsk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: psych
@@ -25,33 +25,33 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: terminal-table
28
+ name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.8'
33
+ version: '0.20'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.8'
40
+ version: '0.20'
41
41
  - !ruby/object:Gem::Dependency
42
- name: thor
42
+ name: tty-table
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.19'
47
+ version: '0.10'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.19'
54
+ version: '0.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,19 +67,19 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.16'
69
69
  - !ruby/object:Gem::Dependency
70
- name: coveralls
70
+ name: codecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.8'
75
+ version: '0.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.8'
82
+ version: '0.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.52'
117
+ version: '0.56'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.52'
124
+ version: '0.56'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.14'
131
+ version: '0.16'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.14'
138
+ version: '0.16'
139
139
  description: BundleOutdatedFormatter is a command-line tool to format output of `bundle
140
140
  outdated`
141
141
  email:
@@ -155,6 +155,7 @@ files:
155
155
  - LICENSE.txt
156
156
  - README.md
157
157
  - Rakefile
158
+ - appveyor.yml
158
159
  - bin/console
159
160
  - bin/setup
160
161
  - bundle_outdated_formatter.gemspec
@@ -184,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
185
  requirements:
185
186
  - - ">="
186
187
  - !ruby/object:Gem::Version
187
- version: '0'
188
+ version: 2.0.0
188
189
  required_rubygems_version: !ruby/object:Gem::Requirement
189
190
  requirements:
190
191
  - - ">="
@@ -192,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
193
  version: '0'
193
194
  requirements: []
194
195
  rubyforge_project:
195
- rubygems_version: 2.7.3
196
+ rubygems_version: 2.7.6
196
197
  signing_key:
197
198
  specification_version: 4
198
199
  summary: Formatter for `bundle outdated`