gitpusshuten 0.0.1

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.
Files changed (65) hide show
  1. data/.bundle/config +2 -0
  2. data/.gitignore +4 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +53 -0
  5. data/README.md +7 -0
  6. data/bin/gitpusshuten +4 -0
  7. data/bin/heavenly +4 -0
  8. data/bin/ten +4 -0
  9. data/gitpusshuten.gemspec +26 -0
  10. data/lib/gitpusshuten/cli.rb +78 -0
  11. data/lib/gitpusshuten/command.rb +147 -0
  12. data/lib/gitpusshuten/commands/base.rb +246 -0
  13. data/lib/gitpusshuten/commands/delete.rb +27 -0
  14. data/lib/gitpusshuten/commands/help.rb +36 -0
  15. data/lib/gitpusshuten/commands/initialize.rb +61 -0
  16. data/lib/gitpusshuten/commands/push.rb +54 -0
  17. data/lib/gitpusshuten/commands/remote.rb +29 -0
  18. data/lib/gitpusshuten/commands/user.rb +252 -0
  19. data/lib/gitpusshuten/commands/version.rb +21 -0
  20. data/lib/gitpusshuten/configuration.rb +122 -0
  21. data/lib/gitpusshuten/environment.rb +70 -0
  22. data/lib/gitpusshuten/gem.rb +33 -0
  23. data/lib/gitpusshuten/git.rb +111 -0
  24. data/lib/gitpusshuten/helpers/environment/installers.rb +59 -0
  25. data/lib/gitpusshuten/helpers/environment/packages.rb +21 -0
  26. data/lib/gitpusshuten/helpers/environment/scp.rb +57 -0
  27. data/lib/gitpusshuten/helpers/environment/ssh.rb +77 -0
  28. data/lib/gitpusshuten/helpers/environment/ssh_key.rb +79 -0
  29. data/lib/gitpusshuten/helpers/environment/user.rb +70 -0
  30. data/lib/gitpusshuten/helpers/spinner.rb +98 -0
  31. data/lib/gitpusshuten/hook.rb +26 -0
  32. data/lib/gitpusshuten/hooks.rb +147 -0
  33. data/lib/gitpusshuten/initializer.rb +95 -0
  34. data/lib/gitpusshuten/local.rb +35 -0
  35. data/lib/gitpusshuten/log.rb +83 -0
  36. data/lib/gitpusshuten/modules/active_record/hooks.rb +19 -0
  37. data/lib/gitpusshuten/modules/apache/command.rb +354 -0
  38. data/lib/gitpusshuten/modules/bundler/command.rb +43 -0
  39. data/lib/gitpusshuten/modules/bundler/hooks.rb +8 -0
  40. data/lib/gitpusshuten/modules/mysql/command.rb +192 -0
  41. data/lib/gitpusshuten/modules/nanoc/hooks.rb +9 -0
  42. data/lib/gitpusshuten/modules/nginx/command.rb +447 -0
  43. data/lib/gitpusshuten/modules/passenger/command.rb +310 -0
  44. data/lib/gitpusshuten/modules/passenger/hooks.rb +4 -0
  45. data/lib/gitpusshuten/modules/rvm/command.rb +277 -0
  46. data/lib/gitpusshuten.rb +21 -0
  47. data/lib/templates/config.rb +37 -0
  48. data/lib/templates/hooks.rb +40 -0
  49. data/spec/cli_spec.rb +83 -0
  50. data/spec/command_spec.rb +76 -0
  51. data/spec/configuration_spec.rb +45 -0
  52. data/spec/environment_spec.rb +64 -0
  53. data/spec/fixtures/combined_hooks.rb +23 -0
  54. data/spec/fixtures/config.rb +23 -0
  55. data/spec/fixtures/hooks.rb +37 -0
  56. data/spec/fixtures/passenger.json +1 -0
  57. data/spec/gem_spec.rb +28 -0
  58. data/spec/git_spec.rb +59 -0
  59. data/spec/gitpusshuten_spec.rb +9 -0
  60. data/spec/hook_spec.rb +48 -0
  61. data/spec/hooks_spec.rb +150 -0
  62. data/spec/initializer_spec.rb +26 -0
  63. data/spec/log_spec.rb +20 -0
  64. data/spec/spec_helper.rb +43 -0
  65. metadata +220 -0
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe GitPusshuTen::Initializer do
4
+
5
+ let(:command) { mock('command') }
6
+ let(:configuration) { mock('configuration') }
7
+ let(:hooks) { mock('hooks') }
8
+
9
+ before do
10
+ command.stubs(:perform!)
11
+ configuration.stubs(:strip)
12
+ configuration.stubs(:to_ary)
13
+ GitPusshuTen::Configuration.any_instance.stubs(:parse!)
14
+ GitPusshuTen::Hooks.any_instance.stubs(:parse!).returns(hooks)
15
+ hooks.expects(:parse_modules!).returns(hooks)
16
+ GitPusshuTen::Hooks.any_instance.stubs(:parse_modules!)
17
+ GitPusshuTen::Command.stubs(:new).returns(command)
18
+ end
19
+
20
+ it "should output an error if config file could not be found" do
21
+ GitPusshuTen::Initializer.any_instance.expects(:exit)
22
+ GitPusshuTen::Log.expects(:error)
23
+ GitPusshuTen::Initializer.new(%w[tag 1.4.2 to staging], configuration)
24
+ end
25
+
26
+ end
data/spec/log_spec.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe GitPusshuTen::Log do
4
+
5
+ it "should log a message" do
6
+ GitPusshuTen::Log.expects(:puts).with("[message] heavenly message")
7
+ GitPusshuTen::Log.message("heavenly message")
8
+ end
9
+
10
+ it "should log a message" do
11
+ GitPusshuTen::Log.expects(:puts).with("[warning] heavenly message")
12
+ GitPusshuTen::Log.warning("heavenly message")
13
+ end
14
+
15
+ it "should log a message" do
16
+ GitPusshuTen::Log.expects(:puts).with("[error] heavenly message")
17
+ GitPusshuTen::Log.error("heavenly message")
18
+ end
19
+
20
+ end
@@ -0,0 +1,43 @@
1
+ require 'gitpusshuten'
2
+
3
+ RSpec.configure do |config|
4
+ config.mock_with :mocha
5
+ end
6
+
7
+
8
+ ##
9
+ # GitPusshuTen::Command Mock
10
+ module GitPusshuTen
11
+ module Commands
12
+ class NonExistingCommand < GitPusshuTen::Commands::Base
13
+ def initialize(cli, configuration, hooks, environment)
14
+ super
15
+ self
16
+ end
17
+
18
+ def perform!
19
+ self
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def command_setup!(klass, argv)
26
+ let(:configuration_file) { File.expand_path(File.dirname(__FILE__) + '/fixtures/config.rb') }
27
+ let(:hooks_file) { File.expand_path(File.dirname(__FILE__) + '/fixtures/hooks.rb') }
28
+
29
+ let(:cli) { GitPusshuTen::CLI.new(argv) }
30
+ let(:configuration) { GitPusshuTen::Configuration.new(cli.environment).parse!(configuration_file) }
31
+ let(:hooks) { GitPusshuTen::Hooks.new(cli.environment, configuration_file).parse!(hooks_file) }
32
+ let(:environment) { GitPusshuTen::Environment.new(configuration) }
33
+ let(:command) { "GitPusshuTen::Commands::#{klass}".constantize.new(cli, configuration, hooks, environment) }
34
+ let(:git) { GitPusshuTen::Git.new }
35
+ let(:local) { GitPusshuTen::Local.new }
36
+
37
+ before do
38
+ command.stubs(:git).returns(git)
39
+ git.stubs(:git)
40
+ command.stubs(:local).returns(local)
41
+ git.stubs(:local)
42
+ end
43
+ end
metadata ADDED
@@ -0,0 +1,220 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitpusshuten
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Michael van Rooijen
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-11-19 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rainbow
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 1
31
+ - 0
32
+ version: 1.1.0
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: highline
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 1
45
+ - 6
46
+ - 0
47
+ version: 1.6.0
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: net-ssh
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 2
60
+ - 0
61
+ - 0
62
+ version: 2.0.0
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: net-scp
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ segments:
74
+ - 1
75
+ - 0
76
+ - 0
77
+ version: 1.0.0
78
+ type: :runtime
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: activesupport
82
+ prerelease: false
83
+ requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ segments:
89
+ - 3
90
+ - 0
91
+ - 0
92
+ version: 3.0.0
93
+ type: :runtime
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ name: json
97
+ prerelease: false
98
+ requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ segments:
104
+ - 1
105
+ - 4
106
+ - 0
107
+ version: 1.4.0
108
+ type: :runtime
109
+ version_requirements: *id006
110
+ description: |-
111
+ A Git-based application deployment tool that allows you to define your environment
112
+ by utilizing modules and provision your server with basic deployment needs.
113
+ email: meskyanichi@gmail.com
114
+ executables:
115
+ - gitpusshuten
116
+ - heavenly
117
+ - ten
118
+ extensions: []
119
+
120
+ extra_rdoc_files: []
121
+
122
+ files:
123
+ - .bundle/config
124
+ - .gitignore
125
+ - Gemfile
126
+ - Gemfile.lock
127
+ - README.md
128
+ - bin/gitpusshuten
129
+ - bin/heavenly
130
+ - bin/ten
131
+ - gitpusshuten.gemspec
132
+ - lib/gitpusshuten.rb
133
+ - lib/gitpusshuten/cli.rb
134
+ - lib/gitpusshuten/command.rb
135
+ - lib/gitpusshuten/commands/base.rb
136
+ - lib/gitpusshuten/commands/delete.rb
137
+ - lib/gitpusshuten/commands/help.rb
138
+ - lib/gitpusshuten/commands/initialize.rb
139
+ - lib/gitpusshuten/commands/push.rb
140
+ - lib/gitpusshuten/commands/remote.rb
141
+ - lib/gitpusshuten/commands/user.rb
142
+ - lib/gitpusshuten/commands/version.rb
143
+ - lib/gitpusshuten/configuration.rb
144
+ - lib/gitpusshuten/environment.rb
145
+ - lib/gitpusshuten/gem.rb
146
+ - lib/gitpusshuten/git.rb
147
+ - lib/gitpusshuten/helpers/environment/installers.rb
148
+ - lib/gitpusshuten/helpers/environment/packages.rb
149
+ - lib/gitpusshuten/helpers/environment/scp.rb
150
+ - lib/gitpusshuten/helpers/environment/ssh.rb
151
+ - lib/gitpusshuten/helpers/environment/ssh_key.rb
152
+ - lib/gitpusshuten/helpers/environment/user.rb
153
+ - lib/gitpusshuten/helpers/spinner.rb
154
+ - lib/gitpusshuten/hook.rb
155
+ - lib/gitpusshuten/hooks.rb
156
+ - lib/gitpusshuten/initializer.rb
157
+ - lib/gitpusshuten/local.rb
158
+ - lib/gitpusshuten/log.rb
159
+ - lib/gitpusshuten/modules/active_record/hooks.rb
160
+ - lib/gitpusshuten/modules/apache/command.rb
161
+ - lib/gitpusshuten/modules/bundler/command.rb
162
+ - lib/gitpusshuten/modules/bundler/hooks.rb
163
+ - lib/gitpusshuten/modules/mysql/command.rb
164
+ - lib/gitpusshuten/modules/nanoc/hooks.rb
165
+ - lib/gitpusshuten/modules/nginx/command.rb
166
+ - lib/gitpusshuten/modules/passenger/command.rb
167
+ - lib/gitpusshuten/modules/passenger/hooks.rb
168
+ - lib/gitpusshuten/modules/rvm/command.rb
169
+ - lib/templates/config.rb
170
+ - lib/templates/hooks.rb
171
+ - spec/cli_spec.rb
172
+ - spec/command_spec.rb
173
+ - spec/configuration_spec.rb
174
+ - spec/environment_spec.rb
175
+ - spec/fixtures/combined_hooks.rb
176
+ - spec/fixtures/config.rb
177
+ - spec/fixtures/hooks.rb
178
+ - spec/fixtures/passenger.json
179
+ - spec/gem_spec.rb
180
+ - spec/git_spec.rb
181
+ - spec/gitpusshuten_spec.rb
182
+ - spec/hook_spec.rb
183
+ - spec/hooks_spec.rb
184
+ - spec/initializer_spec.rb
185
+ - spec/log_spec.rb
186
+ - spec/spec_helper.rb
187
+ has_rdoc: true
188
+ homepage: http://gitpusshuten.com/
189
+ licenses: []
190
+
191
+ post_install_message:
192
+ rdoc_options: []
193
+
194
+ require_paths:
195
+ - lib
196
+ required_ruby_version: !ruby/object:Gem::Requirement
197
+ none: false
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ segments:
202
+ - 0
203
+ version: "0"
204
+ required_rubygems_version: !ruby/object:Gem::Requirement
205
+ none: false
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ segments:
210
+ - 0
211
+ version: "0"
212
+ requirements: []
213
+
214
+ rubyforge_project:
215
+ rubygems_version: 1.3.7
216
+ signing_key:
217
+ specification_version: 3
218
+ summary: Heavenly Git-based Application Deployment.
219
+ test_files: []
220
+