cookbook-reader 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/.gitignore +0 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +36 -0
- data/README.md +12 -1
- data/cookbook-reader.gemspec +1 -1
- data/lib/cookbook-reader/parser.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38540b0a70b8e2734438e41aff955f7b9365915a
|
4
|
+
data.tar.gz: bf8efa920557c3bda8ae11c03383e5b4de95ccfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dc59dccd365700e1911f08cc835b776a5977356fc83f59f9b615cc3ad155cc0ee396ecde813d6ce09de0dd177814c727c0f1ac207d35f9fcabec56de2c6c530
|
7
|
+
data.tar.gz: aeea21a84e56f0daf0f729e3313207037e3f0f4ec5567d101491a941f267abe0854c581a82973ea91bd412623047f9fc9b02f3903f54890d47ae34f704ad4bf7
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cookbook-reader (0.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.2.5)
|
10
|
+
fakefs (0.4.3)
|
11
|
+
multi_json (1.9.0)
|
12
|
+
rake (10.1.1)
|
13
|
+
rspec (2.13.0)
|
14
|
+
rspec-core (~> 2.13.0)
|
15
|
+
rspec-expectations (~> 2.13.0)
|
16
|
+
rspec-mocks (~> 2.13.0)
|
17
|
+
rspec-core (2.13.1)
|
18
|
+
rspec-expectations (2.13.0)
|
19
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
20
|
+
rspec-mocks (2.13.1)
|
21
|
+
simplecov (0.7.1)
|
22
|
+
multi_json (~> 1.0)
|
23
|
+
simplecov-html (~> 0.7.1)
|
24
|
+
simplecov-html (0.7.1)
|
25
|
+
timecop (0.6.3)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
cookbook-reader!
|
32
|
+
fakefs (~> 0.4.2)
|
33
|
+
rake
|
34
|
+
rspec
|
35
|
+
simplecov (~> 0.7.1)
|
36
|
+
timecop (~> 0.6.1)
|
data/README.md
CHANGED
@@ -4,4 +4,15 @@
|
|
4
4
|
cookbook-reader
|
5
5
|
===============
|
6
6
|
|
7
|
-
A gem for reading a
|
7
|
+
A gem for reading a cookbooks metadata, created for learning Ruby.
|
8
|
+
Currently displays all of the dependancies of all cookbooks in the path.
|
9
|
+
|
10
|
+
Installation:
|
11
|
+
|
12
|
+
`gem install cookbook-reader`
|
13
|
+
|
14
|
+
Usage:
|
15
|
+
|
16
|
+
cookbook-reader --path <path to cookbook directory>
|
17
|
+
|
18
|
+
|
data/cookbook-reader.gemspec
CHANGED
@@ -17,8 +17,12 @@ module CookbookReader
|
|
17
17
|
@top_list.each do |element|
|
18
18
|
puts "Cookbook: #{element['name']}\n"
|
19
19
|
puts " Dependancies:"
|
20
|
-
element['depends']
|
21
|
-
|
20
|
+
if element['depends']
|
21
|
+
element['depends'].each do |name, version|
|
22
|
+
puts " #{name}, #{version}\n"
|
23
|
+
end
|
24
|
+
else
|
25
|
+
puts " None\n"
|
22
26
|
end
|
23
27
|
puts "\n"
|
24
28
|
end
|
@@ -32,8 +36,9 @@ module CookbookReader
|
|
32
36
|
File.open(filename) do |fp|
|
33
37
|
fp.each do |line|
|
34
38
|
key, value = line.chomp.split(" ")
|
35
|
-
key.
|
36
|
-
|
39
|
+
next if key.nil? || value.nil?
|
40
|
+
key.strip! unless key.nil?
|
41
|
+
value.strip! unless value.nil?
|
37
42
|
key = key.chomp('"').reverse.chomp('"').reverse
|
38
43
|
value = value.chomp('"').reverse.chomp('"').reverse
|
39
44
|
|