difio-dotcloud-ruby 2.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/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+
6
+ *~
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2012, Alexander Todorov <atodorov [AT] otb.bg>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ Registration agent for Difio, preconfigured for dotCloud / Ruby
2
+ applications.
3
+
4
+ It compiles a list of installed packages and sends it to http://www.dif.io.
5
+
6
+ Installing on your dotCloud Ruby application
7
+ -----------------------------------------------------
8
+
9
+ - Create an account at http://www.dif.io
10
+
11
+ - Create your Ruby application in dotCloud and push it
12
+
13
+ - Configure your Difio userID. You can get it from https://difio-otb.rhcloud.com/profiles/mine/
14
+
15
+ dotcloud var set <app name> DIFIO_USER_ID=UserID
16
+
17
+ - Generate a unique identifier for this application and save the value as environmental variable.
18
+
19
+ dotcloud var set <app name> DIFIO_UUID=`uuidgen`
20
+
21
+ - Add a dependency in your application's Gemfile
22
+
23
+ ...
24
+ gem 'difio-dotcloud-ruby'
25
+ ...
26
+
27
+ - Enable the registration script in your postinstall hook. **Note:**
28
+ If you are using an "approot" your `postinstall` script should be in the
29
+ directory pointed by the “approot” directive of your `dotcloud.yml`.
30
+ For more information about `postinstall` turn to
31
+ http://docs.dotcloud.com/guides/postinstall/.
32
+
33
+ If a file named `postinstall` doesn't already exist, create it and add the following:
34
+
35
+ #!/bin/sh
36
+ cd /home/dotcloud/code
37
+ bundle exec difio-dotcloud
38
+
39
+ - Make `postinstall` executable
40
+
41
+ chmod a+x postinstall
42
+
43
+ - Commit your changes (if using git):
44
+
45
+ git add .
46
+ git commit -m "enable Difio registration"
47
+
48
+ - Then push your application to dotCloud
49
+
50
+ dotcloud push <app name>
51
+
52
+ - If everything goes well you should see something like:
53
+
54
+ 19:55:10 [www.0] Running postinstall script...
55
+ 19:55:13 [www.0] response:200
56
+ 19:55:13 [www.0] Difio: Success, registered/updated application with uuid 7676711b-9d3b-4ef5-81e2-cf0287632a29
57
+
58
+ That's it, you can now check your application statistics at http://www.dif.io
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "difio-dotcloud-ruby"
4
+
5
+ Difio::Dotcloud.new.cli
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "difio-dotcloud-ruby/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "difio-dotcloud-ruby"
7
+ s.version = Difio::Dotcloud::VERSION
8
+ s.authors = ["Alexander Todorov"]
9
+ s.email = ["atodorov@dif.io"]
10
+ s.homepage = "http://github.com/difio/difio-dotcloud-ruby"
11
+ s.summary = %q{Difio registration agent for dotCloud / Ruby applications}
12
+ s.description = %q{Difio registration agent for dotCloud / Ruby applications. See the README for usage.}
13
+
14
+ s.rubyforge_project = "difio-dotcloud-ruby"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ s.add_runtime_dependency "common-ruby-difio"
24
+ s.add_runtime_dependency "json"
25
+ end
@@ -0,0 +1,19 @@
1
+ require "common-ruby-difio"
2
+ require "json"
3
+
4
+ module Difio
5
+ class Dotcloud < Difio::DifioBase
6
+ json = File.read('/home/dotcloud/environment.json')
7
+ dotcloud_env = JSON.parse(json)
8
+
9
+ configure({
10
+ 'user_id' => dotcloud_env['DIFIO_USER_ID'],
11
+ 'app_name' => dotcloud_env['DOTCLOUD_PROJECT'] + '.' + dotcloud_env['DOTCLOUD_SERVICE_NAME'],
12
+ 'app_uuid' => dotcloud_env['DIFIO_UUID'],
13
+ 'app_type' => 'Ruby',
14
+ 'app_url' => dotcloud_env['DOTCLOUD_WWW_HTTP_URL'],
15
+ 'app_vendor' => 1,
16
+ 'url' => ENV['DIFIO_REGISTER_URL'],
17
+ })
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ module Difio
2
+ class Dotcloud
3
+ VERSION = "2.0.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: difio-dotcloud-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alexander Todorov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: common-ruby-difio
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Difio registration agent for dotCloud / Ruby applications. See the README
47
+ for usage.
48
+ email:
49
+ - atodorov@dif.io
50
+ executables:
51
+ - difio-dotcloud
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - .gitignore
56
+ - Gemfile
57
+ - LICENSE
58
+ - README.md
59
+ - Rakefile
60
+ - bin/difio-dotcloud
61
+ - difio-dotcloud-ruby.gemspec
62
+ - lib/difio-dotcloud-ruby.rb
63
+ - lib/difio-dotcloud-ruby/version.rb
64
+ homepage: http://github.com/difio/difio-dotcloud-ruby
65
+ licenses: []
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project: difio-dotcloud-ruby
84
+ rubygems_version: 1.8.24
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: Difio registration agent for dotCloud / Ruby applications
88
+ test_files: []