society 1.4.0 → 1.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bf10b2b3ca6d703eac82233c0c76e0d006a34af
4
- data.tar.gz: fc3e16c005df1ee298ea8db6dfc86b8972398b40
3
+ metadata.gz: bcc6cc373f6842cc6785d781b6432e04eeb8a2a5
4
+ data.tar.gz: 60ad4668c5dd24f8a146dc17ca3839ca9b60e486
5
5
  SHA512:
6
- metadata.gz: ccc9574d8d3a56c884596e5c941625f592896b6efe39dec3066b62a6231d87e1da78b2dd2f73b7dfe9ac78ab603d64d6a80f5a9ccd75372273e97120189e81b3
7
- data.tar.gz: 8ba05a8c714a02d65895b364d5b1113ee2116f6e74a8676cc1c63020c7787826223a82bf4d1ae0f21a0893a8f45833aaf19fbe00ec604dd56945441c0dd0a427
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
- You can also pass in a file glob, but it must be enclosed in quotes.
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
@@ -13,7 +13,7 @@ module Society
13
13
  #
14
14
  # Returns a Parser.
15
15
  def self.for_files(*file_paths)
16
- files = Dir.glob(file_paths).flatten.flat_map do |path|
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) })
@@ -1,3 +1,3 @@
1
1
  module Society
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: society
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coraline Ada Ehmke