diligent 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: ab67b44dc93fb3550fbf7bbca30e77a013edff40
4
- data.tar.gz: 91cbda452d99bd6c69a6bc4a52fbd6e472c8a997
3
+ metadata.gz: d6267d2dcc0208eed4d2a77c1dd4d66b509230a7
4
+ data.tar.gz: 27c8dfcc1802adb7fd5b6694b52d98818e9067cf
5
5
  SHA512:
6
- metadata.gz: 568856534c5083a20163b2862c68c682e125a7f2fbd8d75cf7ad89851cd40bf0420e2e5e2dcfef111b67c3a65ff19fb3f92a639fc27bb543b9186aee25c4afe8
7
- data.tar.gz: 3bc64833405d83002153a876f1a4f95a6cd583b289f5979c04d8caef7e42959dddffbbca52696a69dda823178de6ef04f58be34ff07c77f3813bc6c8aecdc6ee
6
+ metadata.gz: e6075a2548310d7db861c84d3286b53347288525e66453b6bb6ee12e1db2efcf8d21fd5897ec4d6d3877be2690d61da8d6fbc6353f346009db3c759fb7ac0abd
7
+ data.tar.gz: 27833a325cfcded47143b50e74929e553dc1b12361b4eb535c94c5281059dd0d81e32023376de2e5330321e8192079cacbf92931b30941a350a64e7549e0185a
@@ -0,0 +1 @@
1
+ --markup markdown
data/README.md CHANGED
@@ -6,6 +6,50 @@ diligent
6
6
  Comb your gems for licensing info and collate it nicely for the lawyers.
7
7
 
8
8
 
9
+ # Quick Start
10
+
11
+ 1. `gem install diligent`
12
+ 2. `diligent --help`
13
+
14
+
15
+ # Examples
16
+
17
+ The following examples were run in the `diligent` project root.
18
+
19
+ ## JSON (default)
20
+
21
+ `diligent list`
22
+
23
+ `diligent list --format json --output diligent.json`
24
+
25
+ Returns:
26
+
27
+ ```
28
+ {"awesome_print":{"version":"1.2.0","author":"Michael Dvorkin","summary":"Pretty print Ruby objects with proper indentation and colors","description":"Great Ruby dubugging companion: pretty print Ruby objects to visualize their structure. Supports custom object formatting via plugins","license":null,"homepage":"http://github.com/michaeldv/awesome_print"},"bundler":{"version":"1.5.3","author":"André Arko","summary":"The best way to manage your application's dependencies","description":"Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably","license":"MIT","homepage":"http://bundler.io"},"timers":{"version":"1.1.0","author":"Tony Arcieri","summary":"Schedule procs to run after a certain time, or at periodic intervals, using any API that accepts a timeout","description":"Pure Ruby one-shot and periodic timers","license":null,"homepage":"https://github.com/tarcieri/timers"},"celluloid":{"version":"0.15.2","author":"Tony Arcieri","summary":"Actor-based concurrent object framework for Ruby","description":"Celluloid enables people to build concurrent programs out of concurrent objects just as easily as they build sequential programs out of sequential objects","license":"MIT","homepage":"https://github.com/celluloid/celluloid"},"nio4r":{"version":"1.0.0","author":"Tony Arcieri","summary":"NIO provides a high performance selector API for monitoring IO objects","description":"New IO for Ruby","license":null,"homepage":"https://github.com/celluloid/nio4r"},"celluloid-io":{"version":"0.15.0","author":"Tony Arcieri","summary":"Celluloid::IO allows you to monitor multiple IO objects within a Celluloid actor","description":"Evented IO for Celluloid actors","license":"MIT","homepage":"http://github.com/celluloid/celluloid-io"},"coderay":{"version":"1.1.0","author":"Kornelius Kalnbach","summary":"Fast syntax highlighting for selected languages.","description":"Fast and easy syntax highlighting for selected languages, written in Ruby. Comes with RedCloth integration and LOC counter.","license":"MIT","homepage":"http://coderay.rubychan.de"},"diff-lcs":{"version":"1.2.5","author":"Austin Ziegler","summary":"Diff::LCS computes the difference between two Enumerable sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm","description":"Diff::LCS computes the difference between two Enumerable sequences using the\nMcIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities\nto create a simple HTML diff output format and a standard diff-like tool.\n\nThis is release 1.2.4, fixing a bug introduced after diff-lcs 1.1.3 that did\nnot properly prune common sequences at the beginning of a comparison set.\nThanks to Paul Kunysch for fixing this issue.\n\nCoincident with the release of diff-lcs 1.2.3, we reported an issue with\nRubinius in 1.9 mode\n({rubinius/rubinius#2268}[https://github.com/rubinius/rubinius/issues/2268]).\nWe are happy to report that this issue has been resolved.","license":"MIT","homepage":"http://diff-lcs.rubyforge.org/"},"thor":{"version":"0.19.1","author":"Yehuda Katz","summary":"Thor is a toolkit for building powerful command-line interfaces.","description":"Thor is a toolkit for building powerful command-line interfaces.","license":"MIT","homepage":"http://whatisthor.com/"},"diligent":{"version":"0.1.0","author":"Jonathan Vaught","summary":"Comb your gems for licensing info and collate it nicely for the lawyers.","description":"Comb your gems for licensing info and collate it nicely for the lawyers.","license":"MIT","homepage":"https://github.com/copyhacker/diligent"},"ffi":{"version":"1.9.3","author":"Wayne Meissner","summary":"Ruby FFI","description":"Ruby FFI library","license":"BSD","homepage":"http://wiki.github.com/ffi/ffi"},"formatador":{"version":"0.2.4","author":"geemus (Wesley Beary)","summary":"Ruby STDOUT text formatting","description":"STDOUT text formatting","license":null,"homepage":"http://github.com/geemus/formatador"},"rb-fsevent":{"version":"0.9.4","author":"Thibaud Guillaume-Gentil","summary":"Very simple & usable FSEvents API","description":"FSEvents API with Signals catching (without RubyCocoa)","license":"MIT","homepage":"http://rubygems.org/gems/rb-fsevent"},"rb-inotify":{"version":"0.9.3","author":"Nathan Weizenbaum","summary":"A Ruby wrapper for Linux's inotify, using FFI","description":"A Ruby wrapper for Linux's inotify, using FFI","license":null,"homepage":"http://github.com/nex3/rb-inotify"},"listen":{"version":"2.7.1","author":"Thibaud Guillaume-Gentil","summary":"Listen to file modifications","description":"The Listen gem listens to file modifications and notifies you about the changes. Works everywhere!","license":"MIT","homepage":"https://github.com/guard/listen"},"lumberjack":{"version":"1.0.5","author":"Brian Durand","summary":"A simple, powerful, and very fast logging utility that can be a drop in replacement for Logger or ActiveSupport::BufferedLogger.","description":"A simple, powerful, and very fast logging utility that can be a drop in replacement for Logger or ActiveSupport::BufferedLogger. Provides support for automatically rolling log files even with multiple processes writing the same log file.","license":"MIT","homepage":"http://github.com/bdurand/lumberjack"},"method_source":{"version":"0.8.2","author":"John Mair (banisterfiend)","summary":"retrieve the sourcecode for a method","description":"retrieve the sourcecode for a method","license":null,"homepage":"http://banisterfiend.wordpress.com"},"slop":{"version":"3.5.0","author":"Lee Jarvis","summary":"Simple Lightweight Option Parsing","description":"A simple DSL for gathering options and parsing the command line","license":"MIT","homepage":"http://github.com/leejarvis/slop"},"pry":{"version":"0.9.12.6","author":"John Mair (banisterfiend)","summary":"An IRB alternative and runtime developer console","description":"An IRB alternative and runtime developer console","license":null,"homepage":"http://pry.github.com"},"guard":{"version":"2.6.0","author":"Thibaud Guillaume-Gentil","summary":"Guard keeps an eye on your file modifications","description":"Guard is a command line tool to easily handle events on file system modifications.","license":"MIT","homepage":"http://guardgem.org"},"rspec-support":{"version":"3.0.0.beta2","author":"David Chelimsky","summary":"rspec-support-3.0.0.beta2","description":"Support utilities for RSpec gems","license":"MIT","homepage":"https://github.com/rspec/rspec-support"},"rspec-core":{"version":"3.0.0.beta2","author":"Steven Baker","summary":"rspec-core-3.0.0.beta2","description":"BDD for Ruby. RSpec runner and example groups.","license":"MIT","homepage":"http://github.com/rspec/rspec-core"},"rspec-expectations":{"version":"3.0.0.beta2","author":"Steven Baker","summary":"rspec-expectations-3.0.0.beta2","description":"rspec-expectations provides a simple, readable API to express expected outcomes of a code example.","license":"MIT","homepage":"http://github.com/rspec/rspec-expectations"},"rspec-mocks":{"version":"3.0.0.beta2","author":"Steven Baker","summary":"rspec-mocks-3.0.0.beta2","description":"RSpec's 'test double' framework, with support for stubbing and mocking","license":"MIT","homepage":"http://github.com/rspec/rspec-mocks"},"rspec":{"version":"3.0.0.beta2","author":"Steven Baker","summary":"rspec-3.0.0.beta2","description":"BDD for Ruby","license":"MIT","homepage":"http://github.com/rspec"},"guard-rspec":{"version":"4.2.8","author":"Thibaud Guillaume-Gentil","summary":"Guard gem for RSpec","description":"Guard::RSpec automatically run your specs (much like autotest).","license":"MIT","homepage":"https://rubygems.org/gems/guard-rspec"},"mini_portile":{"version":"0.5.3","author":"Luis Lavena","summary":"Simplistic port-like solution for developers","description":"Simplistic port-like solution for developers. It provides a standard and simplified way to compile against dependency libraries without messing up your system.","license":"MIT","homepage":"http://github.com/luislavena/mini_portile"},"nokogiri":{"version":"1.6.1","author":"Aaron Patterson","summary":"Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser","description":"Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among Nokogiri's\nmany features is the ability to search documents via XPath or CSS3 selectors.\n\nXML is like violence - if it doesn’t solve your problems, you are not using\nenough of it.","license":"MIT","homepage":"http://nokogiri.org"}}
29
+ ```
30
+
31
+ **Note:** the JSON output will always be returned to STDOUT regardless of whether you
32
+ specify an output file.
33
+
34
+
35
+ ## CSV
36
+
37
+ Output to `diligent.csv`:
38
+
39
+ `diligent list --format csv`
40
+
41
+ Output to `myfile.csv`:
42
+
43
+ `diligent list --format csv --outfile myfile.csv`
44
+
45
+ ## HTML
46
+
47
+ Nice clean formatted HTML with links to license text:
48
+
49
+ `diligent list --format html`
50
+
51
+ ![HTML Output](https://dl.dropboxusercontent.com/u/117390/diligent_html.jpg)
52
+
9
53
  # TODO
10
54
 
11
55
  - [x] Command line or rake task
@@ -13,11 +57,11 @@ Comb your gems for licensing info and collate it nicely for the lawyers.
13
57
  - [x] Hit rubygems and/or GitHub for info on each gem
14
58
  - [x] Pull all that into a hash: name, version, owner, license type
15
59
  - [x] Link to license text
16
- - [X] Output options
60
+ - [x] Output options
17
61
  - [x] JSON
18
- - [X] HTML
62
+ - [x] HTML
19
63
  - [x] CSV
20
- - Documentation
64
+ - [x] Documentation
21
65
 
22
66
  # Author
23
67
 
@@ -4,10 +4,17 @@ require 'diligent/list'
4
4
 
5
5
  module Diligent
6
6
  class Info
7
+ # Not-so-random legal jargon. Please don't try this at home.
8
+ #
9
+ # @return [String] legal jargon, for fun
7
10
  def self.legalese
8
11
  "New versions of the executable. If distribution of the alternative licenses, if any, in source and free culture, all users contributing to Wikimedia projects To grow the commons of free software, and (2) offer you this license is required to exercise the rights granted hereunder will terminate: (a) automatically without notice from Apple which Apple may grant in its Contribution, if any, must include the Program or Derived Programs thereof. Article 4 (Termination of Agreement) 1. The Recipient may not occur to you when allowing others to access the modified work as a relevant directory file) where a user would be entitled to make sure that they, too, receive or can get it if you want it to your programs, too."
9
12
  end
10
13
 
14
+ # Provides a URL linking to the text of a given open-source license.
15
+ #
16
+ # @param format [String] the short name of the license as listed at http://opensource.org/licenses/alphabetical
17
+ # @return [String] the URL where the full text of the license can be read
11
18
  def self.license_text(license_name)
12
19
  "http://opensource.org/licenses/#{license_name}"
13
20
  end
@@ -6,9 +6,21 @@ module Diligent
6
6
  class List
7
7
  include ERB::Util # for html escaping
8
8
 
9
- attr_accessor :project_name, :specs
9
+ # @!attribute project_name
10
+ # @return [String] the name of the project we're reading,
11
+ # currently assumed to be the directory name.
12
+ attr_accessor :project_name
13
+
14
+ # @!attribute specs
15
+ # @return [Bundler::SpecSet] Dependency info as generated by
16
+ # `Bundler.load.specs`
17
+ attr_accessor :specs
10
18
 
11
19
  class << self
20
+
21
+ # Initialize and return gem info in a single step.
22
+ # May be deprecated as it seems to be of limited use.
23
+ # @return [Hash] a hash containing dependency info
12
24
  def load
13
25
  self.new.as_hash
14
26
  end
@@ -16,11 +28,12 @@ module Diligent
16
28
 
17
29
  def initialize
18
30
  # TODO Optionally point at a different path?
19
-
20
31
  @project_name = File.split(FileUtils.getwd).last
21
32
  @specs = Bundler.load.specs
22
33
  end
23
34
 
35
+ # Output dependency info as a hash.
36
+ # @return [Hash] a hash containing dependency info
24
37
  def as_hash
25
38
  @specs.inject({}) do |hash, spec|
26
39
  hash[spec.name] = {
@@ -36,11 +49,18 @@ module Diligent
36
49
  end
37
50
  end
38
51
 
52
+ # Output dependency info as JSON.
53
+ # A JSON string is returned by the method even if a filename is specified.
54
+ # @param filename [String] optional name of output file
55
+ # @return [String] a JSON string containing dependency info
39
56
  def as_json(filename = nil)
40
57
  json = as_hash.to_json
41
58
  write_to_file filename, json
42
59
  end
43
60
 
61
+ # Output dependency info as CSV.
62
+ # @param filename [String] optional name of output file
63
+ # @return [String] a CSV string containing dependency info, unless a filename is given
44
64
  def as_csv(filename = nil)
45
65
  as_array = as_hash.inject([]) do |arr, gem_info|
46
66
  row = []
@@ -59,6 +79,9 @@ module Diligent
59
79
  write_to_file filename, csv
60
80
  end
61
81
 
82
+ # Output dependency info as HTML.
83
+ # @param filename [String] optional name of output file
84
+ # @return [String] a CSV string containing dependency info, unless a filename is given
62
85
  def as_html(filename = nil)
63
86
  list = as_hash
64
87
  template_path = File.join(File.dirname(__FILE__), '../../templates/list.html.erb')
@@ -1,3 +1,3 @@
1
1
  module Diligent
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -1,3 +1,4 @@
1
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
1
2
  <html>
2
3
  <head>
3
4
  <title>Project '<%= project_name %>'</title>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diligent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Vaught
@@ -131,6 +131,7 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - .gitignore
133
133
  - .travis.yml
134
+ - .yardopts
134
135
  - Gemfile
135
136
  - Guardfile
136
137
  - LICENSE