oops 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6a255d502aa90de7fd7a2cf40eac417a5ab5649
4
- data.tar.gz: 502b71a512ee084635b9e1423b0f305d347af825
3
+ metadata.gz: b315f4318aa726cfdc60e13fd0ea275cb4a6b68f
4
+ data.tar.gz: d357be5681aa6edb23d37fea5c959519f5e30ff0
5
5
  SHA512:
6
- metadata.gz: 702ef3e4ce160079933112775cb1cb77048695ef4f8ada71caec433344acacf781da105d3e77cffb6184058de8798d9451f7e7642f3c5fe954187ce30ce496ce
7
- data.tar.gz: f0cc792a810b3ffa44e18dbb05c8dc716813df120a1299411609ca21b960d9e14d63a5226c9f3a7b08dab697c09f58c4d017e036216735013baa4bcf34515051
6
+ metadata.gz: 55303cbfe429f0b2d94fa729058d766b1bd198383c3a1fc8f57f77f1f91d165d67201af45681961363223d116b0fdc19426259471c33346199463aefd1e01e65
7
+ data.tar.gz: 541bf11a6a5b9c826d299ff99b5a3059b3f3f26c6e748e4f59fc6f607c09807d117354375018fc79b99d7a229f07572f2123901ee46199477ca642ff354ff33f
@@ -1,3 +1,4 @@
1
1
  require "oops/version"
2
2
  require "oops/opsworks_deploy"
3
+ require "oops/tasks"
3
4
  require 'oops/railtie' if defined?(Rails)
@@ -1,4 +1,5 @@
1
- module Oops class OpsworksDeploy
1
+ module Oops
2
+ class OpsworksDeploy
2
3
  attr_accessor :stack_name, :app_name
3
4
 
4
5
  def initialize(app_name, stack_name)
@@ -1,7 +1,4 @@
1
1
  module Oops
2
2
  class Railtie < ::Rails::Railtie
3
- rake_tasks do
4
- load 'oops/tasks.rb'
5
- end
6
3
  end
7
4
  end
@@ -1,22 +1,59 @@
1
1
  require 'oops/opsworks_deploy'
2
2
  require 'aws'
3
- namespace :oops do
4
- task :build, [:filename] => 'assets:precompile' do |t, args|
5
- args.with_defaults filename: default_filename
6
3
 
7
- file_path = args.filename
4
+ module Oops
5
+ class Tasks
6
+ attr_accessor :prerequisites, :additional_paths
7
+
8
+ DEFAULTS = {
9
+ prerequisites: ['assets:precompile'],
10
+ additional_paths: []
11
+ }
12
+
13
+ def initialize(&block)
14
+ DEFAULTS.each do |key, value|
15
+ public_send("#{key}=", value)
16
+ end
17
+ yield(self)
18
+ create_task!
19
+ end
20
+
21
+ private
22
+ include Rake::DSL
23
+ def create_task!
24
+ # Remove any existing definition
25
+ Rake::Task["oops:build"].clear if Rake::Task.task_defined?("oops:build")
26
+
27
+ namespace :oops do
28
+ task :build, [:filename] => prerequisites do |t, args|
29
+ args.with_defaults filename: default_filename
30
+
31
+ file_path = args.filename
8
32
 
9
- sh %{mkdir -p build}
10
- sh %{git archive --format zip --output build/#{file_path} HEAD}
33
+ sh %{mkdir -p build}
34
+ sh %{git archive --format zip --output build/#{file_path} HEAD}
11
35
 
12
- sh %{zip -r -g build/#{file_path} public/}
13
- sh %{zip build/#{file_path} -d .gitignore}
36
+ additional_paths.each do |path|
37
+ sh %{zip -r -g build/#{file_path} #{path}}
38
+ end
14
39
 
15
- sh %{rm -rf public/assets}
40
+ sh %{zip -r -g build/#{file_path} public/}
41
+ sh %{zip build/#{file_path} -d .gitignore}
16
42
 
17
- puts "Packaged Application: #{file_path}"
43
+ sh %{rm -rf public/assets}
44
+
45
+ puts "Packaged Application: #{file_path}"
46
+ end
47
+ end
48
+ end
18
49
  end
50
+ end
19
51
 
52
+ # Initialize build task with defaults
53
+ Oops::Tasks.new do
54
+ end
55
+
56
+ namespace :oops do
20
57
  task :upload, :filename do |t, args|
21
58
  args.with_defaults filename: default_filename
22
59
 
@@ -1,3 +1,3 @@
1
1
  module Oops
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-02-18 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk