packspec 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cli.rb +11 -14
  3. data/packspec.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a04e0536fc0d222d75d7644e31fe6e313245a46
4
- data.tar.gz: 6e51a159a6a8e96b5a49bf91d175422b4c47e54d
3
+ metadata.gz: b8c668e116454f961a1b72ecf2d483ad27fdad6e
4
+ data.tar.gz: 706ff5a19b3a2a600d1804cc1571b140521fa2be
5
5
  SHA512:
6
- metadata.gz: 7186eedf6caa1337a6608f9d8d53c8f335814d7058562d7d0d5cd57fd72921386a947ad72ab745397b1cb2e46336a755a1e2fb0f1d3ee2fdef1aa6306cb9b3f0
7
- data.tar.gz: cf96960d06e597534089e744ea606715c1614d51004ea5c7f28f9976c29bdc83cc6cf79e01019474985b52f0f061391189550c15425e3ff937b3de55197f5c51
6
+ metadata.gz: deca3968f28df4ff7cfa7404e048b09a34526863018e39e70e5409f3727bf9cbb6f523f8bc80432111c5685c15f7b8f61c8f02dc3596d05f8fe08663ac919058
7
+ data.tar.gz: 66258b5429c14282d1be372fe6714b893068ebced6344639ca1360654be38908d3d48bb4ae3d30393d98ed93e4be99f322dfa577c6cc4043d340ab8038dcaf9f
data/lib/cli.rb CHANGED
@@ -10,17 +10,19 @@ def parse_specs(path)
10
10
 
11
11
  # Paths
12
12
  paths = []
13
+ if path
14
+ if File.file?(path)
15
+ paths = [path]
16
+ elsif File.directory?(path)
17
+ paths = Dir.glob("#{path}/*.yml")
18
+ end
19
+ end
13
20
  if !path
14
- paths = Dir.glob('package.*')
15
21
  if paths.empty?
16
- path = 'packspec'
22
+ paths = Dir.glob('packspec.yml')
17
23
  end
18
- end
19
- if File.file?(path)
20
- paths = [path]
21
- elsif File.directory?(path)
22
- for path in Dir.glob("#{path}/*.*")
23
- paths.push(path)
24
+ if paths.empty?
25
+ paths = Dir.glob("packspec/*.yml")
24
26
  end
25
27
  end
26
28
 
@@ -40,17 +42,12 @@ end
40
42
 
41
43
  def parse_spec(path)
42
44
 
43
- # Documents
45
+ # Package
44
46
  documents = []
45
- if !path.end_with?('.yml')
46
- return nil
47
- end
48
47
  contents = File.read(path)
49
48
  YAML.load_stream(contents) do |document|
50
49
  documents.push(document)
51
50
  end
52
-
53
- # Package
54
51
  feature = parse_feature(documents[0][0])
55
52
  if feature['skip']
56
53
  return nil
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "packspec"
7
- spec.version = "0.1.6"
7
+ spec.version = "0.2.0"
8
8
  spec.authors = ["Evgeny Karev\n"]
9
9
  spec.email = ["eskarev@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - |
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-17 00:00:00.000000000 Z
12
+ date: 2017-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler