heroku-helper 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -4,5 +4,6 @@ README.rdoc
4
4
  Rakefile
5
5
  bin/heroku-helper
6
6
  lib/heroku-helper.rb
7
+ lib/heroku-helper/deployment_configuration.rb
7
8
  lib/heroku-helper/cli.rb
8
9
  lib/heroku-helper/heroku.rb
data/bin/heroku-helper CHANGED
@@ -5,8 +5,8 @@
5
5
 
6
6
  require 'rubygems'
7
7
  require File.expand_path(File.dirname(__FILE__) + "/../lib/heroku-helper")
8
- require "heroku-helper/cli"
9
8
  require "heroku-helper/deployment_configuration"
9
+ require "heroku-helper/cli"
10
10
  require "heroku-helper/heroku"
11
11
 
12
12
  HerokuHelper::CLI.execute(STDOUT, ARGV)
data/lib/heroku-helper.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module HerokuHelper
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
@@ -0,0 +1,59 @@
1
+ def environment(env, &block)
2
+ HerokuHelper::DeploymentConfiguration.current_environment = env
3
+ HerokuHelper::DeploymentConfiguration.configuration[env] = {}
4
+ block.call
5
+ end
6
+
7
+ def set(name, value)
8
+ HerokuHelper::DeploymentConfiguration.
9
+ configuration[HerokuHelper::DeploymentConfiguration.current_environment][name] = value
10
+ end
11
+
12
+ def hook(stage, command, &block)
13
+ configuration = HerokuHelper::DeploymentConfiguration.configuration[HerokuHelper::DeploymentConfiguration.current_environment]
14
+ configuration[:hooks] ||= {}
15
+ configuration[:hooks][command] ||= {}
16
+ configuration[:hooks][command][stage] = block
17
+ end
18
+
19
+ module HerokuHelper
20
+ class DeploymentConfiguration
21
+
22
+ class << self
23
+ attr_accessor :current_environment
24
+ attr_accessor :configuration
25
+ end
26
+
27
+ def self.configure(conf_file)
28
+ self.configuration ||= {}
29
+ require conf_file
30
+ end
31
+
32
+ def self.configuration_format
33
+ <<-FORMAT
34
+ # heroku_deploy.rb
35
+ environment :production do
36
+ set :app_name, 'heroku-application-name'
37
+ set :domain, 'example.com'
38
+ set :contributors, %w(dev1@example.com dev2@example.com)
39
+ set :environment_variables, {
40
+ 'REDIS_URL' => 'redis://localhost:6379/0'
41
+ }
42
+ set :addons, [
43
+ 'custom_domains',
44
+ 'gmail_smtp email=foo@bar.com password=sekret'
45
+ ]
46
+
47
+ hook :before, :share do
48
+ puts 'hello before share'
49
+ end
50
+
51
+ hook :after, :deploy do
52
+ puts 'hello after deploy'
53
+ end
54
+ end
55
+ FORMAT
56
+ end
57
+
58
+ end
59
+ end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - ELC Technologies
@@ -14,34 +19,46 @@ default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rubyforge
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 0
30
+ - 3
23
31
  version: 2.0.3
24
- version:
32
+ type: :development
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: gemcutter
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 3
44
+ - 0
33
45
  version: 0.3.0
34
- version:
46
+ type: :development
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: hoe
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
40
52
  requirements:
41
53
  - - ">="
42
54
  - !ruby/object:Gem::Version
55
+ segments:
56
+ - 2
57
+ - 5
58
+ - 0
43
59
  version: 2.5.0
44
- version:
60
+ type: :development
61
+ version_requirements: *id003
45
62
  description: Heroku deployment helper
46
63
  email:
47
64
  - hchoroomi@elctech.com
@@ -59,6 +76,7 @@ files:
59
76
  - Rakefile
60
77
  - bin/heroku-helper
61
78
  - lib/heroku-helper.rb
79
+ - lib/heroku-helper/deployment_configuration.rb
62
80
  - lib/heroku-helper/cli.rb
63
81
  - lib/heroku-helper/heroku.rb
64
82
  has_rdoc: true
@@ -75,18 +93,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
93
  requirements:
76
94
  - - ">="
77
95
  - !ruby/object:Gem::Version
96
+ segments:
97
+ - 0
78
98
  version: "0"
79
- version:
80
99
  required_rubygems_version: !ruby/object:Gem::Requirement
81
100
  requirements:
82
101
  - - ">="
83
102
  - !ruby/object:Gem::Version
103
+ segments:
104
+ - 0
84
105
  version: "0"
85
- version:
86
106
  requirements: []
87
107
 
88
108
  rubyforge_project: heroku-helper
89
- rubygems_version: 1.3.5
109
+ rubygems_version: 1.3.6
90
110
  signing_key:
91
111
  specification_version: 3
92
112
  summary: Heroku deployment helper