dotcloud 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ gem 'activesupport', '~> 3.0.8'
2
+ gem 'jeweler', '~> 1.6.2'
3
+ gem 'i18n', '~> 0.6.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,18 @@
1
+ GEM
2
+ specs:
3
+ activesupport (3.0.8)
4
+ git (1.2.5)
5
+ i18n (0.6.0)
6
+ jeweler (1.6.2)
7
+ bundler (~> 1.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rake (0.9.2)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ activesupport (~> 3.0.8)
17
+ i18n (~> 0.6.0)
18
+ jeweler (~> 1.6.2)
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |s|
4
+ s.name = "dotcloud"
5
+ s.executables = ""
6
+ s.summary = "Ruby DotCloud post install push hook helpers"
7
+ s.email = "nitayj@gmail.com"
8
+ s.homepage = "http://github.com/nitay/dotcloud-hooks"
9
+ s.description = "Ruby DotCloud post install push hook helpers"
10
+ s.authors = ["Nitay Joffe"]
11
+ s.files = FileList["[A-Z]*",
12
+ "{bin,generators,lib,test}/**/*",
13
+ 'lib/jeweler/templates/.gitignore']
14
+ # s.add_dependency 'schacon-git'
15
+ end
16
+ rescue LoadError
17
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
18
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
data/lib/dotcloud.rb ADDED
@@ -0,0 +1,10 @@
1
+ # stdlib includes
2
+ require 'fileutils'
3
+ require 'socket'
4
+
5
+ # 3rd party includes
6
+ require 'active_support'
7
+
8
+ # our files
9
+ $LOAD_PATH.unshift File.dirname(__FILE__)
10
+ require 'dotcloud/host'
@@ -0,0 +1,50 @@
1
+ module DotCloud
2
+ class Host
3
+ class << self
4
+ def host
5
+ do_match
6
+ @@host
7
+ end
8
+ alias_method :str, :host
9
+
10
+ def namespace
11
+ do_match
12
+ @@namespace
13
+ end
14
+ alias_method :application, :namespace
15
+ alias_method :app, :namespace
16
+
17
+ def service
18
+ do_match
19
+ @@service
20
+ end
21
+
22
+ def id
23
+ do_match
24
+ @@id
25
+ end
26
+
27
+ def type
28
+ raise ArgumentError, "TODO: parse dotcloud.yml to get service mappings"
29
+ end
30
+
31
+ def matched?
32
+ class_variable_defined?(:@@namespace)
33
+ end
34
+
35
+ private
36
+ REGEX = /([a-zA-Z]+)-default-(.*)-([0-9]+)/
37
+ def do_match
38
+ return if matched?
39
+
40
+ @@host = Socket.gethostname
41
+ match = REGEX.match(@@host)
42
+ raise ArgumentError, "#{@@host} did not match regex" unless match
43
+
44
+ @@namespace = match[1]
45
+ @@service = match[2]
46
+ @@id = match[3].to_i
47
+ end
48
+ end
49
+ end
50
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dotcloud
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 0
10
+ version: 0.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Nitay Joffe
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-07-12 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 23
29
+ segments:
30
+ - 3
31
+ - 0
32
+ - 8
33
+ version: 3.0.8
34
+ name: activesupport
35
+ version_requirements: *id001
36
+ prerelease: false
37
+ - !ruby/object:Gem::Dependency
38
+ type: :runtime
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 11
45
+ segments:
46
+ - 1
47
+ - 6
48
+ - 2
49
+ version: 1.6.2
50
+ name: jeweler
51
+ version_requirements: *id002
52
+ prerelease: false
53
+ - !ruby/object:Gem::Dependency
54
+ type: :runtime
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ hash: 7
61
+ segments:
62
+ - 0
63
+ - 6
64
+ - 0
65
+ version: 0.6.0
66
+ name: i18n
67
+ version_requirements: *id003
68
+ prerelease: false
69
+ description: Ruby DotCloud post install push hook helpers
70
+ email: nitayj@gmail.com
71
+ executables: []
72
+
73
+ extensions: []
74
+
75
+ extra_rdoc_files: []
76
+
77
+ files:
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - Rakefile
81
+ - VERSION
82
+ - lib/dotcloud.rb
83
+ - lib/dotcloud/host.rb
84
+ has_rdoc: true
85
+ homepage: http://github.com/nitay/dotcloud-hooks
86
+ licenses: []
87
+
88
+ post_install_message:
89
+ rdoc_options: []
90
+
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ hash: 3
99
+ segments:
100
+ - 0
101
+ version: "0"
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ requirements: []
112
+
113
+ rubyforge_project:
114
+ rubygems_version: 1.6.2
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: Ruby DotCloud post install push hook helpers
118
+ test_files: []
119
+