anvil-cli 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@ require "net/http"
4
4
  require "net/https"
5
5
  require "pathname"
6
6
  require "rest_client"
7
+ require "find"
7
8
 
8
9
  class Anvil::Manifest
9
10
 
@@ -126,7 +127,7 @@ private
126
127
 
127
128
  def directory_manifest(dir, options={})
128
129
  root = Pathname.new(dir)
129
- ignore = options[:ignore] || []
130
+ ignore = (options[:ignore] || []) + [".anvil", ".git"]
130
131
 
131
132
  if File.exists?("#{dir}/.slugignore")
132
133
  File.read("#{dir}/.slugignore").split("\n").each do |match|
@@ -136,19 +137,21 @@ private
136
137
  end
137
138
  end
138
139
 
139
- Dir.glob(File.join(dir, "**", "*"), File::FNM_DOTMATCH).inject({}) do |hash, file|
140
- relative = Pathname.new(file).relative_path_from(root).to_s
141
- next(hash) if ignore.include?(relative)
142
- next(hash) if %w( . .. ).include?(File.basename(file))
143
- next(hash) if File.directory?(file)
144
- next(hash) if File.pipe?(file)
145
- next(hash) if file =~ /\.anvil/
146
- next(hash) if file =~ /\.git/
147
- next(hash) if file =~ /\.swp$/
148
- next(hash) unless file =~ /^[A-Za-z0-9\-\_\.\/]*$/
149
- hash[relative] = file_manifest(file)
150
- hash
140
+ manifest = {}
141
+ Find.find(dir) do |path|
142
+ relative = Pathname.new(path).relative_path_from(root).to_s
143
+ if File.directory?(path)
144
+ Find.prune if ignore.include?(relative) || ignore.include?(relative + "/")
145
+ next
146
+ end
147
+ next if ignore.include?(relative)
148
+ next if %w( . .. ).include?(File.basename(path))
149
+ next if File.pipe?(path)
150
+ next if path =~ /\.swp$/
151
+ next unless path =~ /^[A-Za-z0-9\-\_\.\/]*$/
152
+ manifest[relative] = file_manifest(path)
151
153
  end
154
+ manifest
152
155
  end
153
156
 
154
157
  def file_manifest(file)
data/lib/anvil/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Anvil
2
- VERSION = "0.13.0"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anvil-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: progress
16
- requirement: &70121012006000 !ruby/object:Gem::Requirement
16
+ requirement: &70222498148920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70121012006000
24
+ version_requirements: *70222498148920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rest-client
27
- requirement: &70121012005440 !ruby/object:Gem::Requirement
27
+ requirement: &70222498164760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.6.7
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70121012005440
35
+ version_requirements: *70222498164760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &70121012004840 !ruby/object:Gem::Requirement
38
+ requirement: &70222498164160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.15.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70121012004840
46
+ version_requirements: *70222498164160
47
47
  description: Alternate Heroku build workflow
48
48
  email: david@dollar.io
49
49
  executables: