ginst 0.1.3 → 0.2.2
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.tar.gz.sig +0 -0
- data/Manifest +34 -8
- data/Rakefile +6 -3
- data/bin/ginst +11 -4
- data/features/browsing_project.feature +20 -0
- data/features/manage_projects.feature +36 -0
- data/features/manage_server.feature +17 -0
- data/features/step_definitions/manage_projects_steps.rb +35 -0
- data/features/step_definitions/manage_server_steps.rb +33 -0
- data/features/step_definitions/webrat_steps.rb +99 -0
- data/features/support/env.rb +29 -0
- data/features/support/git.rb +22 -0
- data/features/support/paths.rb +16 -0
- data/ginst.gemspec +8 -11
- data/lib/app/authorization.rb +1 -1
- data/lib/app/views/_commit.haml +8 -0
- data/lib/app/views/commit.haml +38 -8
- data/lib/app/views/commits.haml +1 -1
- data/lib/app/views/edit.haml +11 -0
- data/lib/app/views/layout.haml +10 -7
- data/lib/app/views/new.haml +19 -0
- data/lib/app/views/project.haml +4 -1
- data/lib/app/views/ref.haml +3 -0
- data/lib/app/views/style.sass +0 -1
- data/lib/app/webserver.rb +66 -76
- data/lib/ginst.rb +7 -5
- data/lib/ginst/core_extensions.rb +32 -0
- data/lib/ginst/ginst.rb +5 -72
- data/lib/ginst/project.rb +13 -38
- data/lib/ginst/project/base.rb +59 -0
- data/lib/ginst/project/build.rb +117 -0
- data/lib/ginst/project/commit_db.rb +29 -0
- data/lib/ginst/project/finders.rb +17 -0
- data/lib/ginst/project/grit.rb +53 -0
- data/lib/ginst/project/validations.rb +60 -0
- data/lib/ginst/test.rb +8 -0
- data/lib/ginst/test/base.rb +17 -0
- data/lib/ginst/test/dir.rb +39 -0
- data/lib/ginst/test/repo.rb +13 -0
- data/lib/ginst/test/run.rb +11 -0
- data/lib/ginst/web_server.rb +43 -0
- data/spec/fixtures/sample_repo.zip +0 -0
- data/spec/models/project_base_spec.rb +56 -0
- data/spec/models/project_build_spec.rb +18 -0
- data/spec/models/project_commit_db_spec.rb +19 -0
- data/spec/models/project_finders_spec.rb +34 -0
- data/spec/models/project_grit_spec.rb +19 -0
- data/spec/models/project_validations_spec.rb +72 -0
- data/spec/spec_helper.rb +8 -0
- metadata +56 -29
- metadata.gz.sig +0 -0
- data/lib/app/views/full_commit.haml +0 -38
- data/lib/app/views/project_index.haml +0 -11
- data/lib/ginst/command_line.rb +0 -47
- data/lib/ginst/master_command_line.rb +0 -40
- data/lib/ginst/plugin.rb +0 -16
- data/lib/ginst/server.rb +0 -51
- data/lib/ginst/templates/rgithook.rb +0 -6
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'daemons'
|
2
|
+
module Ginst
|
3
|
+
module WebServer
|
4
|
+
class << self
|
5
|
+
|
6
|
+
SERVER=File.dirname(__FILE__)+'/../app/webserver.rb'
|
7
|
+
DAEMON_OPT = {
|
8
|
+
:app_name => "ginst",
|
9
|
+
:dir_mode => :normal,
|
10
|
+
:ARGV => ["status"],
|
11
|
+
:dir => Dir.pwd,
|
12
|
+
:multiple => false,
|
13
|
+
:ontop => false,
|
14
|
+
:mode => :exec,
|
15
|
+
:monitor => true
|
16
|
+
}
|
17
|
+
|
18
|
+
def start
|
19
|
+
fork{Daemons.run(SERVER,build_opts('start'))}
|
20
|
+
end
|
21
|
+
|
22
|
+
def stop
|
23
|
+
Daemons.run(SERVER,build_opts('stop'))
|
24
|
+
end
|
25
|
+
|
26
|
+
def status
|
27
|
+
Daemons.run(SERVER,build_opts('status'))
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def build_opts(action)
|
33
|
+
case action
|
34
|
+
when 'start'
|
35
|
+
DAEMON_OPT.merge({:ARGV => [action, '--', '-e production']})
|
36
|
+
else
|
37
|
+
DAEMON_OPT.merge({:ARGV => [action]})
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
Binary file
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/../spec_helper'
|
2
|
+
|
3
|
+
describe Ginst::Project do
|
4
|
+
|
5
|
+
context "Base" do
|
6
|
+
before(:each) do
|
7
|
+
::Grit::Repo.stub!(:new).and_return(true)
|
8
|
+
File.should_receive(:read).with('./projects.yml').and_return("--- \n- !ruby/object:Ginst::Project \n dir: /home/guille\n name: guille\n")
|
9
|
+
Ginst::Ginst.working_dir = '.'
|
10
|
+
Ginst::Project.load_projects
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should load existing projects" do
|
14
|
+
prjs = Ginst::Project.projects
|
15
|
+
prjs.size.should == 1
|
16
|
+
prjs.first.dir.should == '/home/guille'
|
17
|
+
prjs.first.name.should == 'guille'
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should be able to save" do
|
21
|
+
|
22
|
+
file = Object.new
|
23
|
+
File.should_receive(:open).with('./projects.yml','w').and_return(file)
|
24
|
+
file.should_receive(:write).with(
|
25
|
+
"--- \n- !ruby/object:Ginst::Project \n dir: /home/guille\n name: guille\n- !ruby/object:Ginst::Project \n dir: dir\n name: prj\n")
|
26
|
+
file.should_receive(:close)
|
27
|
+
|
28
|
+
Ginst::Project.new(VALID_ARGS).save.should be
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should be not create a project when update" do
|
32
|
+
|
33
|
+
file = Object.new
|
34
|
+
File.should_receive(:open).with('projects.yml','w').and_return(file)
|
35
|
+
file.should_receive(:write).with("--- \n- !ruby/object:Ginst::Project \n dir: /home/guille\n name: Project 2\n")
|
36
|
+
file.should_receive(:close)
|
37
|
+
|
38
|
+
Ginst::Project.projects
|
39
|
+
Ginst::Project.projects.first.name = 'Project 2'
|
40
|
+
Ginst::Project.projects.first.save.should be
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/../spec_helper'
|
2
|
+
|
3
|
+
describe Ginst::Project do
|
4
|
+
|
5
|
+
|
6
|
+
context 'Finders' do
|
7
|
+
before(:each) do
|
8
|
+
::Grit::Repo.stub!(:new).and_return(true)
|
9
|
+
File.should_receive(:read).with('projects.yml').and_return("--- \n- !ruby/object:Ginst::Project \n dir: /home/guille\n name: guille!!\n")
|
10
|
+
Ginst::Project.load_projects
|
11
|
+
@prj = Ginst::Project.projects.first
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should be able to find by name" do
|
15
|
+
Ginst::Project.find_by_name('guille!!').should be(@prj)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should be able to find by slug" do
|
19
|
+
Ginst::Project.find_by_slug(@prj.name.slug).should be(@prj)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/../spec_helper'
|
2
|
+
|
3
|
+
describe Ginst::Project do
|
4
|
+
|
5
|
+
context "Validations" do
|
6
|
+
before(:each) do
|
7
|
+
::Grit::Repo.stub!(:new).and_return(true)
|
8
|
+
File.stub!(:read).with('projects.yml').and_return("--- \n- !ruby/object:Ginst::Project \n dir: /home/guille\n name: guille\n")
|
9
|
+
Ginst::Project.load_projects
|
10
|
+
@prj = Ginst::Project.projects.first
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
it "should have errors on name if there is no name" do
|
15
|
+
@prj.name = nil
|
16
|
+
@prj.should_not be_valid
|
17
|
+
|
18
|
+
@prj.name = ''
|
19
|
+
@prj.should_not be_valid
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should have errors on dir if the dir doesn't exists" do
|
23
|
+
::Grit::Repo.should_receive(:new).and_raise(::Grit::NoSuchPathError)
|
24
|
+
|
25
|
+
@prj.should_not be_valid
|
26
|
+
@prj.errors["dir"].should be
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should have errors on dir if the dir is not a valid git dir" do
|
30
|
+
::Grit::Repo.should_receive(:new).and_raise(::Grit::InvalidGitRepositoryError)
|
31
|
+
|
32
|
+
@prj.should_not be_valid
|
33
|
+
@prj.errors["dir"].should be
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should be able to save a valid project" do
|
37
|
+
::Grit::Repo.should_receive(:new).with('dir').and_return(true)
|
38
|
+
|
39
|
+
Ginst::Project.projects.size.should be(1)
|
40
|
+
prj = Ginst::Project.new(VALID_ARGS)
|
41
|
+
prj.should be_valid
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should not be valid if there is one with the same slug name" do
|
45
|
+
p = Ginst::Project.new(:name => 'guille++', :dir => 'dir')
|
46
|
+
|
47
|
+
p.should_not be_valid
|
48
|
+
p.errors["name"].should be
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should not be valid if there is one with the same dir" do
|
52
|
+
p = Ginst::Project.new(:name => 'guille++', :dir => '/home/guille')
|
53
|
+
|
54
|
+
p.should_not be_valid
|
55
|
+
p.errors["dir"].should be
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ginst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Guillermo \xC3\x81lvarez"
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
IfYzkN8c0X6VDPrCKbd4IbEe
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2009-
|
33
|
+
date: 2009-04-21 00:00:00 +02:00
|
34
34
|
default_executable:
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -39,20 +39,10 @@ dependencies:
|
|
39
39
|
version_requirement:
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 0.9.4
|
45
45
|
version:
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rgithook
|
48
|
-
type: :runtime
|
49
|
-
version_requirement:
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 3.0.0
|
55
|
-
version:
|
56
46
|
- !ruby/object:Gem::Dependency
|
57
47
|
name: daemons
|
58
48
|
type: :runtime
|
@@ -98,65 +88,102 @@ extra_rdoc_files:
|
|
98
88
|
- bin/ginst_master
|
99
89
|
- CHANGELOG
|
100
90
|
- lib/app/authorization.rb
|
91
|
+
- lib/app/views/_commit.haml
|
101
92
|
- lib/app/views/assets/jquery.corners.js
|
102
93
|
- lib/app/views/assets/jquery.js
|
103
94
|
- lib/app/views/branch_index.haml
|
104
95
|
- lib/app/views/clean_layout.haml
|
105
96
|
- lib/app/views/commit.haml
|
106
97
|
- lib/app/views/commits.haml
|
107
|
-
- lib/app/views/
|
98
|
+
- lib/app/views/edit.haml
|
108
99
|
- lib/app/views/index.haml
|
109
100
|
- lib/app/views/layout.haml
|
101
|
+
- lib/app/views/new.haml
|
110
102
|
- lib/app/views/not_found.haml
|
111
103
|
- lib/app/views/project.haml
|
112
|
-
- lib/app/views/
|
104
|
+
- lib/app/views/ref.haml
|
113
105
|
- lib/app/views/style.sass
|
114
106
|
- lib/app/webserver.rb
|
115
|
-
- lib/ginst/
|
107
|
+
- lib/ginst/core_extensions.rb
|
116
108
|
- lib/ginst/ginst.rb
|
117
|
-
- lib/ginst/
|
118
|
-
- lib/ginst/
|
109
|
+
- lib/ginst/project/base.rb
|
110
|
+
- lib/ginst/project/build.rb
|
111
|
+
- lib/ginst/project/commit_db.rb
|
112
|
+
- lib/ginst/project/finders.rb
|
113
|
+
- lib/ginst/project/grit.rb
|
114
|
+
- lib/ginst/project/validations.rb
|
119
115
|
- lib/ginst/project.rb
|
120
|
-
- lib/ginst/
|
121
|
-
- lib/ginst/
|
116
|
+
- lib/ginst/test/base.rb
|
117
|
+
- lib/ginst/test/dir.rb
|
118
|
+
- lib/ginst/test/repo.rb
|
119
|
+
- lib/ginst/test/run.rb
|
120
|
+
- lib/ginst/test.rb
|
121
|
+
- lib/ginst/web_server.rb
|
122
122
|
- lib/ginst.rb
|
123
123
|
- README.txt
|
124
124
|
files:
|
125
125
|
- bin/ginst
|
126
126
|
- bin/ginst_master
|
127
127
|
- CHANGELOG
|
128
|
-
-
|
128
|
+
- features/browsing_project.feature
|
129
|
+
- features/manage_projects.feature
|
130
|
+
- features/manage_server.feature
|
131
|
+
- features/step_definitions/manage_projects_steps.rb
|
132
|
+
- features/step_definitions/manage_server_steps.rb
|
133
|
+
- features/step_definitions/webrat_steps.rb
|
134
|
+
- features/support/env.rb
|
135
|
+
- features/support/git.rb
|
136
|
+
- features/support/paths.rb
|
129
137
|
- lib/app/authorization.rb
|
138
|
+
- lib/app/views/_commit.haml
|
130
139
|
- lib/app/views/assets/jquery.corners.js
|
131
140
|
- lib/app/views/assets/jquery.js
|
132
141
|
- lib/app/views/branch_index.haml
|
133
142
|
- lib/app/views/clean_layout.haml
|
134
143
|
- lib/app/views/commit.haml
|
135
144
|
- lib/app/views/commits.haml
|
136
|
-
- lib/app/views/
|
145
|
+
- lib/app/views/edit.haml
|
137
146
|
- lib/app/views/index.haml
|
138
147
|
- lib/app/views/layout.haml
|
148
|
+
- lib/app/views/new.haml
|
139
149
|
- lib/app/views/not_found.haml
|
140
150
|
- lib/app/views/project.haml
|
141
|
-
- lib/app/views/
|
151
|
+
- lib/app/views/ref.haml
|
142
152
|
- lib/app/views/style.sass
|
143
153
|
- lib/app/webserver.rb
|
144
|
-
- lib/ginst/
|
154
|
+
- lib/ginst/core_extensions.rb
|
145
155
|
- lib/ginst/ginst.rb
|
146
|
-
- lib/ginst/
|
147
|
-
- lib/ginst/
|
156
|
+
- lib/ginst/project/base.rb
|
157
|
+
- lib/ginst/project/build.rb
|
158
|
+
- lib/ginst/project/commit_db.rb
|
159
|
+
- lib/ginst/project/finders.rb
|
160
|
+
- lib/ginst/project/grit.rb
|
161
|
+
- lib/ginst/project/validations.rb
|
148
162
|
- lib/ginst/project.rb
|
149
|
-
- lib/ginst/
|
150
|
-
- lib/ginst/
|
163
|
+
- lib/ginst/test/base.rb
|
164
|
+
- lib/ginst/test/dir.rb
|
165
|
+
- lib/ginst/test/repo.rb
|
166
|
+
- lib/ginst/test/run.rb
|
167
|
+
- lib/ginst/test.rb
|
168
|
+
- lib/ginst/web_server.rb
|
151
169
|
- lib/ginst.rb
|
152
170
|
- Manifest
|
153
171
|
- Rakefile
|
154
172
|
- README.txt
|
173
|
+
- spec/fixtures/sample_repo.zip
|
174
|
+
- spec/models/project_base_spec.rb
|
175
|
+
- spec/models/project_build_spec.rb
|
176
|
+
- spec/models/project_commit_db_spec.rb
|
177
|
+
- spec/models/project_finders_spec.rb
|
178
|
+
- spec/models/project_grit_spec.rb
|
179
|
+
- spec/models/project_validations_spec.rb
|
180
|
+
- spec/spec_helper.rb
|
155
181
|
- test/app/test_webserver.rb
|
156
182
|
- test/test_ginst.rb
|
157
183
|
- test/test_helper.rb
|
158
184
|
- test/test_project.rb
|
159
185
|
- test/test_server.rb
|
186
|
+
- ginst.gemspec
|
160
187
|
has_rdoc: true
|
161
188
|
homepage: http://github.com/guillermo/ginst
|
162
189
|
post_install_message:
|
@@ -187,7 +214,7 @@ rubyforge_project: ginst
|
|
187
214
|
rubygems_version: 1.3.1
|
188
215
|
signing_key:
|
189
216
|
specification_version: 2
|
190
|
-
summary:
|
217
|
+
summary: Git Integration System
|
191
218
|
test_files:
|
192
219
|
- test/app/test_webserver.rb
|
193
220
|
- test/test_ginst.rb
|