gploy 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,17 +1,23 @@
1
1
  Manifest
2
+ README.markdown
2
3
  Rakefile
3
4
  bin/gploy
4
- gploy.gemspec
5
+ config/config.yaml
6
+ config/post-receive
7
+ install.rb
5
8
  lib/TODO.txt
6
9
  lib/gploy.rb
7
10
  lib/gploy/configure.rb
8
11
  lib/gploy/helpers.rb
9
12
  lib/gploy/logger.rb
10
13
  lib/gploy/teste.rb
14
+ test/TimeChange.rb
11
15
  test/config/config.yaml
12
16
  test/config/post-receive
13
17
  test/db/schema.rb
14
18
  test/helper.rb
15
19
  test/suite.rb
20
+ test/test_configuration.rb
16
21
  test/test_configure.rb
17
22
  test/test_logger.rb
23
+ test/unMocker.rb
data/README.markdown ADDED
@@ -0,0 +1,120 @@
1
+ Notes Version 0.1.6
2
+
3
+ - Rake -T show all features of gem
4
+
5
+ - This version dont have more features that previous, i just try improve the code, but it still is very ugly :D
6
+
7
+ Notes Version 0.1.5
8
+ -A new command called gploy -d
9
+
10
+ -The log file was also changed to indicate that the command is running locally or remotely.
11
+
12
+ -Now gploy only make deploy of content in a master branch, for this reason the line "branch" in the config.yaml file was deleted, so make sure that master branch it ok.
13
+
14
+
15
+
16
+ ## Introduction
17
+
18
+
19
+ This is a simple RubyGems to configure your Rails Project for deployment using git push, this gem only make a series of configurations in your local project and to in your web server. This gem consider what you are using locaweb to host your project and using git obviously.
20
+
21
+ ## What directory structure is used
22
+ This gem use a structure in webserver like this:
23
+
24
+ 1. ~/repos -> For host a git repository
25
+ 2. ~/rails_app -> For host your production project
26
+ 3. ~/public_html -> For create a symlink to the project in rails_app directory
27
+
28
+ ## Files generated
29
+ This gem generate only two simple file into the config directory, one file is called config.yaml and other is post-receive.
30
+
31
+ ### The config.yaml file:
32
+
33
+ The contents of this file must be like this:
34
+
35
+ config:
36
+ url: host
37
+ user: username
38
+ password: password
39
+ app_name: project_name
40
+ origin: git origin
41
+
42
+ If your git is already configured for origin use another, for example: production
43
+
44
+ ### The post-receive file:
45
+
46
+ The contents of this file must be like this:
47
+
48
+ #!/bin/sh
49
+ cd ~/rails_app/project_name
50
+ env -i git reset --hard
51
+ env -i git pull project_name master
52
+ env -i rake db:migrate RAILS_ENV=production
53
+ env -i touch ~/rails_app/project_name/tmp/restart.txt
54
+
55
+ The post-receive file is a git hook, read more about hooks at: [www.ru.kernel.org](http://www.ru.kernel.org/pub/software/scm/git/docs/v1.5.2.5/hooks.html)
56
+
57
+ ## Usage
58
+ First thing you must do is install the gploy gem in your computer:
59
+
60
+ sudo gem install gploy
61
+
62
+ after it inside your rails project your must execute the following commands:
63
+
64
+ > gploy -c // For generate config.yaml file
65
+
66
+ Now you can edit this file with your data, make sure you not have a origin set in git if you will use it.
67
+
68
+ Now lets generate a post-receive file, this file is a git hook, and must have commands that you want that are executed when your run git push in your project, for this execute:
69
+
70
+ > gploy -pr // For generate post-receive file
71
+
72
+ This command will generate a snippet like this:
73
+
74
+ #!/bin/sh
75
+ cd ~/rails_app/project_name
76
+ env -i git reset --hard
77
+ env -i git pull project_name master
78
+ env -i rake db:migrate RAILS_ENV=production
79
+ env -i touch ~/rails_app/project_name/tmp/restart.txt
80
+
81
+ Put it inside the config/post-receive file. You can add more commands in the post-receive file if you want.
82
+
83
+ Finally now you can run the command that will upload your project to the server and do what needs to be done:
84
+
85
+ > gploy -s
86
+
87
+ If no error occurs, your project must be available now.
88
+
89
+ From now when you want update your project simply do a commit of changes and run git push production master to update project in server or run:
90
+
91
+ > gploy -d
92
+ ###OBS: This is a initial version then careful when using it. If you find bugs please let me know, fell free for make a fork in project at [github](http://github.com/edipofederle/gploy) and fix the bugs :D.
93
+
94
+ ## Thanks
95
+ - Marcelo Luiz Onhate ( http://about.me/onhate ) for correcting some things that README: D
96
+
97
+ ### LICENSE:
98
+
99
+ (The MIT License)
100
+
101
+ Copyright (c) 2008 Edipo Luis Federle
102
+
103
+ Permission is hereby granted, free of charge, to any person obtaining
104
+ a copy of this software and associated documentation files (the
105
+ 'Software'), to deal in the Software without restriction, including
106
+ without limitation the rights to use, copy, modify, merge, publish,
107
+ distribute, sublicense, and/or sell copies of the Software, and to
108
+ permit persons to whom the Software is furnished to do so, subject to
109
+ the following conditions:
110
+
111
+ The above copyright notice and this permission notice shall be
112
+ included in all copies or substantial portions of the Software.
113
+
114
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
115
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
116
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
117
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
118
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
119
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
120
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -2,8 +2,8 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('gploy', '0.1.6') do |p|
6
- p.description = "Rubygem simple to deploy rails app via git push"
5
+ Echoe.new('gploy', '0.1.7') do |p|
6
+ p.description = "Gploy Description Here"
7
7
  p.url = "http://github.com/edipofederle/gploy"
8
8
  p.author = "Edipo L Federle"
9
9
  p.email = "edipofederle at gmail dot com"
File without changes
File without changes
data/gploy.gemspec CHANGED
@@ -2,24 +2,23 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{gploy}
5
- s.version = "0.1.6"
5
+ s.version = "0.1.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Edipo L Federle"]
9
- s.date = %q{2011-05-14}
10
- s.default_executable = %q{gploy}
11
- s.description = %q{Rubygem simple to deploy rails app via git push}
8
+ s.authors = [%q{Edipo L Federle}]
9
+ s.date = %q{2011-07-15}
10
+ s.description = %q{Gploy Description Here}
12
11
  s.email = %q{edipofederle at gmail dot com}
13
- s.executables = ["gploy"]
14
- s.extra_rdoc_files = ["bin/gploy", "lib/TODO.txt", "lib/gploy.rb", "lib/gploy/configure.rb", "lib/gploy/helpers.rb", "lib/gploy/logger.rb", "lib/gploy/teste.rb"]
15
- s.files = ["Manifest", "Rakefile", "bin/gploy", "gploy.gemspec", "lib/TODO.txt", "lib/gploy.rb", "lib/gploy/configure.rb", "lib/gploy/helpers.rb", "lib/gploy/logger.rb", "lib/gploy/teste.rb", "test/config/config.yaml", "test/config/post-receive", "test/db/schema.rb", "test/helper.rb", "test/suite.rb", "test/test_configure.rb", "test/test_logger.rb", "test/test_configuration.rb"]
12
+ s.executables = [%q{gploy}]
13
+ s.extra_rdoc_files = [%q{README.markdown}, %q{bin/gploy}, %q{lib/TODO.txt}, %q{lib/gploy.rb}, %q{lib/gploy/configure.rb}, %q{lib/gploy/helpers.rb}, %q{lib/gploy/logger.rb}, %q{lib/gploy/teste.rb}]
14
+ s.files = [%q{Manifest}, %q{README.markdown}, %q{Rakefile}, %q{bin/gploy}, %q{config/config.yaml}, %q{config/post-receive}, %q{install.rb}, %q{lib/TODO.txt}, %q{lib/gploy.rb}, %q{lib/gploy/configure.rb}, %q{lib/gploy/helpers.rb}, %q{lib/gploy/logger.rb}, %q{lib/gploy/teste.rb}, %q{test/TimeChange.rb}, %q{test/config/config.yaml}, %q{test/config/post-receive}, %q{test/db/schema.rb}, %q{test/helper.rb}, %q{test/suite.rb}, %q{test/test_configuration.rb}, %q{test/test_configure.rb}, %q{test/test_logger.rb}, %q{test/unMocker.rb}, %q{gploy.gemspec}]
16
15
  s.homepage = %q{http://github.com/edipofederle/gploy}
17
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Gploy", "--main", "README.markdown"]
18
- s.require_paths = ["lib"]
16
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Gploy}, %q{--main}, %q{README.markdown}]
17
+ s.require_paths = [%q{lib}]
19
18
  s.rubyforge_project = %q{gploy}
20
- s.rubygems_version = %q{1.6.2}
21
- s.summary = %q{Rubygem simple to deploy rails app via git push}
22
- s.test_files = ["test/test_configuration.rb", "test/test_configure.rb", "test/test_logger.rb"]
19
+ s.rubygems_version = %q{1.8.5}
20
+ s.summary = %q{Gploy Description Here}
21
+ s.test_files = [%q{test/test_configuration.rb}, %q{test/test_configure.rb}, %q{test/test_logger.rb}]
23
22
 
24
23
  if s.respond_to? :specification_version then
25
24
  s.specification_version = 3
data/install.rb ADDED
File without changes
@@ -3,14 +3,14 @@ module Gploy
3
3
  class Configure
4
4
  include Helpers
5
5
 
6
- VERSION = '0.1.5'
6
+ VERSION = '0.1.7'
7
7
  def initialize
8
8
  @path = "config/config.yaml"
9
9
  end
10
10
 
11
11
 
12
12
  def configure_server
13
- log(green("Starting gploy configuration...create config.yaml"))
13
+ log("Starting gploy configuration...create config.yaml")
14
14
  create_file_and_direcotry_unless_exists("config", "config.yaml")
15
15
  puts "Files created into the config directory. Now need edit config.yaml"
16
16
  puts ""
data/lib/gploy.rb CHANGED
@@ -21,5 +21,5 @@ require 'gploy/helpers'
21
21
  require 'gploy/configure'
22
22
 
23
23
  module Gploy
24
- VERSION = '0.1.6'
24
+ VERSION = '0.1.7'
25
25
  end
@@ -0,0 +1,14 @@
1
+ class TimeChange
2
+ # author: Gary S. Weaver
3
+ # from: http://stufftohelpyouout.blogspot.com/2009/09/how-to-unmock-in-mocha-and-temporarily.html
4
+ # see also: http://stackoverflow.com/questions/1215245/ruby-unit-testing-how-to-fake-time-now
5
+
6
+ def self.to(time)
7
+ Time.stubs(:now).returns(time)
8
+ end
9
+
10
+ def self.back_to_now
11
+ UnMocker.unmock(Time, 'now')
12
+ end
13
+ end
14
+
@@ -27,7 +27,7 @@ class ConfigureTest < Test::Unit::TestCase
27
27
 
28
28
  def testShouldReturnGemVersion
29
29
  assert_not_nil(!nil,Gploy::Configure::VERSION)
30
- assert_equal("0.1.6", Gploy::VERSION)
30
+ assert_equal("0.1.7", Gploy::VERSION)
31
31
  end
32
32
  def testShouldHaveALogPath
33
33
  assert_equal("./log/gploylog.log", Gploy::Configure::LOG_PATH);
data/test/unMocker.rb ADDED
@@ -0,0 +1,13 @@
1
+ class UnMocker
2
+ # author: Gary S. Weaver
3
+ # from: http://stufftohelpyouout.blogspot.com/2009/09/how-to-unmock-in-mocha-and-temporarily.html
4
+ # based on solution from Jacob in http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/
5
+
6
+ def self.unmock(class_or_instance, method_name)
7
+ Mocha::Mockery.instance.stubba.stubba_methods.each do |meth|
8
+ if meth.stubbee == class_or_instance && meth.method == method_name
9
+ meth.unstub
10
+ end
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gploy
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 21
4
5
  prerelease:
5
- version: 0.1.6
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 7
10
+ version: 0.1.7
6
11
  platform: ruby
7
12
  authors:
8
13
  - Edipo L Federle
@@ -10,17 +15,17 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-05-14 00:00:00 -03:00
14
- default_executable: gploy
18
+ date: 2011-07-15 00:00:00 Z
15
19
  dependencies: []
16
20
 
17
- description: Rubygem simple to deploy rails app via git push
21
+ description: Gploy Description Here
18
22
  email: edipofederle at gmail dot com
19
23
  executables:
20
24
  - gploy
21
25
  extensions: []
22
26
 
23
27
  extra_rdoc_files:
28
+ - README.markdown
24
29
  - bin/gploy
25
30
  - lib/TODO.txt
26
31
  - lib/gploy.rb
@@ -30,24 +35,29 @@ extra_rdoc_files:
30
35
  - lib/gploy/teste.rb
31
36
  files:
32
37
  - Manifest
38
+ - README.markdown
33
39
  - Rakefile
34
40
  - bin/gploy
35
- - gploy.gemspec
41
+ - config/config.yaml
42
+ - config/post-receive
43
+ - install.rb
36
44
  - lib/TODO.txt
37
45
  - lib/gploy.rb
38
46
  - lib/gploy/configure.rb
39
47
  - lib/gploy/helpers.rb
40
48
  - lib/gploy/logger.rb
41
49
  - lib/gploy/teste.rb
50
+ - test/TimeChange.rb
42
51
  - test/config/config.yaml
43
52
  - test/config/post-receive
44
53
  - test/db/schema.rb
45
54
  - test/helper.rb
46
55
  - test/suite.rb
56
+ - test/test_configuration.rb
47
57
  - test/test_configure.rb
48
58
  - test/test_logger.rb
49
- - test/test_configuration.rb
50
- has_rdoc: true
59
+ - test/unMocker.rb
60
+ - gploy.gemspec
51
61
  homepage: http://github.com/edipofederle/gploy
52
62
  licenses: []
53
63
 
@@ -66,20 +76,27 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
76
  requirements:
67
77
  - - ">="
68
78
  - !ruby/object:Gem::Version
79
+ hash: 3
80
+ segments:
81
+ - 0
69
82
  version: "0"
70
83
  required_rubygems_version: !ruby/object:Gem::Requirement
71
84
  none: false
72
85
  requirements:
73
86
  - - ">="
74
87
  - !ruby/object:Gem::Version
88
+ hash: 11
89
+ segments:
90
+ - 1
91
+ - 2
75
92
  version: "1.2"
76
93
  requirements: []
77
94
 
78
95
  rubyforge_project: gploy
79
- rubygems_version: 1.6.2
96
+ rubygems_version: 1.8.5
80
97
  signing_key:
81
98
  specification_version: 3
82
- summary: Rubygem simple to deploy rails app via git push
99
+ summary: Gploy Description Here
83
100
  test_files:
84
101
  - test/test_configuration.rb
85
102
  - test/test_configure.rb