oops 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oops/tasks.rb +34 -14
- data/lib/oops/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4d33fb1c38accb07762ffe26dc96f2d1b2cd824
|
4
|
+
data.tar.gz: 29b012cbdb828a132ef2cf94bf50e036ca747684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d94d67e1a565afc0caecf3b685ceb8f6d49c53b249c0ed2a6eeac36b39af791ebf90580fc0ba13a37d460d42c7792ca20217cb19c39afb3ff88a401af1ad55f
|
7
|
+
data.tar.gz: 5ff3bf2b4f86aabab06083c61a2b8921c6944f7c4c6d4af598b442a73f8dee0cbd14e2b14759aa095779b43485f7303c27d6ecbe665efe019644929c72f9ffc8
|
data/lib/oops/tasks.rb
CHANGED
@@ -4,21 +4,42 @@ require 'rake'
|
|
4
4
|
|
5
5
|
module Oops
|
6
6
|
class Tasks
|
7
|
-
attr_accessor :prerequisites, :additional_paths
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
attr_accessor :prerequisites, :additional_paths, :includes, :excludes, :format
|
8
|
+
|
9
|
+
def self.default_args
|
10
|
+
{
|
11
|
+
prerequisites: ['assets:clean', 'assets:precompile'],
|
12
|
+
additional_paths: [],
|
13
|
+
includes: ['public/assets'],
|
14
|
+
excludes: ['.gitignore'],
|
15
|
+
format: 'zip'
|
16
|
+
}
|
17
|
+
end
|
13
18
|
|
14
19
|
def initialize(&block)
|
15
|
-
|
20
|
+
self.class.default_args.each do |key, value|
|
16
21
|
public_send("#{key}=", value)
|
17
22
|
end
|
18
23
|
yield(self)
|
19
24
|
create_task!
|
20
25
|
end
|
21
26
|
|
27
|
+
def add_file file_path, path
|
28
|
+
if format == 'zip'
|
29
|
+
sh *%W{zip -r -g build/#{file_path} #{path}}
|
30
|
+
elsif format == 'tar'
|
31
|
+
sh *%W{tar -r -f build/#{file_path} #{path}}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def remove_file file_path, path
|
36
|
+
if format == 'zip'
|
37
|
+
sh *%W{zip build/#{file_path} -d #{path}}
|
38
|
+
elsif format == 'tar'
|
39
|
+
sh *%W{tar --delete -f build/#{file_path} #{path}}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
22
43
|
private
|
23
44
|
include Rake::DSL
|
24
45
|
def create_task!
|
@@ -32,16 +53,15 @@ module Oops
|
|
32
53
|
file_path = args.filename
|
33
54
|
|
34
55
|
sh %{mkdir -p build}
|
35
|
-
sh %{git archive --format
|
56
|
+
sh %{git archive --format #{format} --output build/#{file_path} HEAD}
|
36
57
|
|
37
|
-
additional_paths.each do |path|
|
38
|
-
|
58
|
+
(includes + additional_paths).each do |path|
|
59
|
+
add_file file_path, path
|
39
60
|
end
|
40
61
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
sh %{rm -rf public/assets}
|
62
|
+
excludes.each do |path|
|
63
|
+
remove_file file_path, path
|
64
|
+
end
|
45
65
|
|
46
66
|
puts "Packaged Application: #{file_path}"
|
47
67
|
end
|
data/lib/oops/version.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clarke Brunsdon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.11'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: 'Oops Opsworks Postal Service: Made to ship code'
|
@@ -59,7 +59,7 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
62
|
+
- ".gitignore"
|
63
63
|
- Gemfile
|
64
64
|
- LICENSE.txt
|
65
65
|
- README.md
|
@@ -80,17 +80,17 @@ require_paths:
|
|
80
80
|
- lib
|
81
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.2.2
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Provides rake tasks to create and deploy build artifacts to opsworks
|