codeinventory 0.1.1 → 0.1.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/exe/codeinv +1 -1
- data/lib/codeinventory/cli/csv.rb +22 -0
- data/lib/codeinventory/cli/{app.rb → json.rb} +1 -14
- data/lib/codeinventory/cli.rb +19 -1
- data/lib/codeinventory/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0466434f7ce5176346394af5842accdb4bc649cd
|
4
|
+
data.tar.gz: b3f98cf215d6b6f5739d137cb5db87df0e45b8a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47467123b0e59a32e04f744f34e5e951d506920c8c1cb6c64e7c78d70998891094e4260d3d4c0f51a244dbf1e08427cef20aa0413672d24de1ed8bb8864f3731
|
7
|
+
data.tar.gz: aec125c4b76b049d8b81fac3663914f4509de0e3178dee1863b8b955a78ebd861dedd74e5c8048cb83addf65c71bfa2257373fe367856ff7584745cba3f5626a
|
data/exe/codeinv
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "json"
|
3
|
+
require "pathname"
|
4
|
+
|
5
|
+
module CodeInventory
|
6
|
+
module CLI
|
7
|
+
class App < Thor
|
8
|
+
desc "csv FILENAME", "Build an inventory from a CSV file"
|
9
|
+
def csv(filename)
|
10
|
+
file = Pathname.new(filename)
|
11
|
+
unless File.exist? file
|
12
|
+
puts "No such file: #{file}"
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
source = CodeInventory::CSVFile.new(file)
|
16
|
+
inventory = CodeInventory::Inventory.new(source)
|
17
|
+
projects = inventory.projects
|
18
|
+
puts JSON.pretty_generate(projects)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,23 +1,10 @@
|
|
1
|
-
require "codeinventory"
|
2
1
|
require "thor"
|
2
|
+
require "json"
|
3
3
|
require "pathname"
|
4
4
|
|
5
5
|
module CodeInventory
|
6
6
|
module CLI
|
7
7
|
class App < Thor
|
8
|
-
desc "csv FILENAME", "Build an inventory from a CSV file"
|
9
|
-
def csv(filename)
|
10
|
-
file = Pathname.new(filename)
|
11
|
-
unless File.exist? file
|
12
|
-
puts "No such file: #{file}"
|
13
|
-
exit 1
|
14
|
-
end
|
15
|
-
source = CodeInventory::CSVFile.new(file)
|
16
|
-
inventory = CodeInventory::Inventory.new(source)
|
17
|
-
projects = inventory.projects
|
18
|
-
puts JSON.pretty_generate(projects)
|
19
|
-
end
|
20
|
-
|
21
8
|
desc "json FILENAME", "Build an inventory from a JSON file"
|
22
9
|
def json(filename)
|
23
10
|
file = Pathname.new(filename)
|
data/lib/codeinventory/cli.rb
CHANGED
@@ -1 +1,19 @@
|
|
1
|
-
require "codeinventory
|
1
|
+
require "codeinventory"
|
2
|
+
require "thor"
|
3
|
+
require "codeinventory/cli/csv"
|
4
|
+
require "codeinventory/cli/json"
|
5
|
+
|
6
|
+
module CodeInventory
|
7
|
+
module CLI
|
8
|
+
class App < Thor
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.start
|
12
|
+
plugin_files = Gem.find_latest_files('codeinventory_plugin.rb')
|
13
|
+
plugin_files.each do |plugin_file|
|
14
|
+
load plugin_file
|
15
|
+
end
|
16
|
+
App.start
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeinventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Fredrickson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,7 +130,8 @@ files:
|
|
130
130
|
- exe/codeinv
|
131
131
|
- lib/codeinventory.rb
|
132
132
|
- lib/codeinventory/cli.rb
|
133
|
-
- lib/codeinventory/cli/
|
133
|
+
- lib/codeinventory/cli/csv.rb
|
134
|
+
- lib/codeinventory/cli/json.rb
|
134
135
|
- lib/codeinventory/csv_file.rb
|
135
136
|
- lib/codeinventory/inventory.rb
|
136
137
|
- lib/codeinventory/json_file.rb
|