society 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/society/cli.rb +2 -2
- data/lib/society/parser.rb +1 -1
- data/lib/society/version.rb +1 -1
- data/spec/cli_spec.rb +5 -1
- data/spec/parser_spec.rb +0 -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: bcc6cc373f6842cc6785d781b6432e04eeb8a2a5
|
4
|
+
data.tar.gz: 60ad4668c5dd24f8a146dc17ca3839ca9b60e486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 507fc9347a42a6df06d4c9df8bc5f01e55174adcf4d10f73f33f43d6035e3e991b0dd638e31d44804ee153e394f6d27345eb1b693cdfe3f93fbfe857392ab884
|
7
|
+
data.tar.gz: d7fdca31fd78b5b2593d11524be797cbce8ae57101e107ab67c3fc34486d4fa7ac9af287f58f93f678b0f36b49db3320b3477306852cfa4081c02c95ef5ce960
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ From your terminal:
|
|
26
26
|
|
27
27
|
and then open `doc/society/index.htm` in your browser.
|
28
28
|
|
29
|
-
|
29
|
+
For more complex applications, society also supports file globbing.
|
30
30
|
|
31
31
|
The default format is HTML; you can skip the HTML interface and just get the
|
32
32
|
JSON by passing `--format json`
|
data/lib/society/cli.rb
CHANGED
@@ -12,8 +12,8 @@ module Society
|
|
12
12
|
method_option :format, :type => :string, :default => 'html', :aliases => "-f"
|
13
13
|
method_option :output, :type => :string, :aliases => "-o"
|
14
14
|
|
15
|
-
def from(path)
|
16
|
-
Society.new(path).report(format, options['output'])
|
15
|
+
def from(*path)
|
16
|
+
Society.new(*path).report(format, options['output'])
|
17
17
|
end
|
18
18
|
|
19
19
|
default_task :from
|
data/lib/society/parser.rb
CHANGED
@@ -13,7 +13,7 @@ module Society
|
|
13
13
|
#
|
14
14
|
# Returns a Parser.
|
15
15
|
def self.for_files(*file_paths)
|
16
|
-
files =
|
16
|
+
files = file_paths.flatten.flat_map do |path|
|
17
17
|
File.directory?(path) ? Dir.glob(File.join(path, '**', '*.rb')) : path
|
18
18
|
end
|
19
19
|
new(files.lazy.map { |f| File.read(f) })
|
data/lib/society/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -19,7 +19,11 @@ describe Society::CLI do
|
|
19
19
|
Society::CLI.new.from("./spec/fixtures")
|
20
20
|
end
|
21
21
|
|
22
|
+
it "handles globs" do
|
23
|
+
expect(parser).to receive(:report)
|
24
|
+
allow(Society).to receive(:new) { parser }
|
25
|
+
Society::CLI.new.from("#{Dir.getwd}/lib/society/{parser.rb,node.rb}")
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
end
|
25
|
-
|
data/spec/parser_spec.rb
CHANGED
@@ -204,10 +204,6 @@ describe Society::Parser do
|
|
204
204
|
expect(Society::Parser.for_files('./spec/fixtures/for_parser_spec').class.name).to eq("Society::Parser")
|
205
205
|
expect(Society::Parser.for_files('./spec/fixtures/for_parser_spec').classes).to eq(["Whaler"])
|
206
206
|
end
|
207
|
-
|
208
|
-
it "returns a parser object when given a glob" do
|
209
|
-
expect(Society::Parser.for_files("#{Dir.getwd}/lib/society/{parser.rb,node.rb}").classes).to eq(["Society", "Society::Parser", "Society::Node"])
|
210
|
-
end
|
211
207
|
end
|
212
208
|
|
213
209
|
describe "#initialize" do
|