vigetlabs-provisional 2.1.9 → 2.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -5
- data/VERSION.yml +1 -1
- data/lib/provisional/scm/bzr.rb +40 -0
- data/lib/provisional/scm/hg.rb +40 -0
- data/provisional.gemspec +8 -2
- data/test/unit/bzr_test.rb +55 -0
- data/test/unit/heroku_test.rb +14 -0
- data/test/unit/hg_test.rb +55 -0
- metadata +10 -3
data/README.md
CHANGED
@@ -32,12 +32,14 @@ Provisional is only tested on Mac OS X. It should also work on Linux. It is not
|
|
32
32
|
|
33
33
|
The SCM option can be one of the following ("`project_name`" refers to the value of the --name option):
|
34
34
|
|
35
|
-
* `git`: creates a
|
36
|
-
* `github`: creates a
|
37
|
-
* `unfuddle`: creates a
|
35
|
+
* `git`: creates a Git repository in the `project_name` directory.
|
36
|
+
* `github`: creates a Git repository in the `project_name` directory, creates `project_name` on GitHub, adds it as the "origin" remote, and pushes. (See section below about required configuration.)
|
37
|
+
* `unfuddle`: creates a Git repository in the `project_name` directory, creates a repository called `project_name` under an existing Unfuddle project using the specified credentials, and adds it as the "origin" remote. _You must push manually_ because Unfuddle typically has a lag of a few minutes between when a repository is created and when it can be accessed. (See section below about required configuration.)
|
38
38
|
* `unfuddle_svn`: creates a Subversion repository called `project_name` under an existing Unfuddle project using the specified credentials, and checks it out into the `project_name` directory.
|
39
39
|
* `beanstalk`: creates a Subversion repository called `project_name` on Beanstalk using the specified credentials, and checks it out into the `project_name` directory.
|
40
|
-
* `heroku`: creates a
|
40
|
+
* `heroku`: creates a Git repository in the `project_name` directory, creates an application called `project_name` on Heroku, adds it as the "heroku" remote, and pushes. (See section below about required configuration.)
|
41
|
+
* `hg`: creates a Mercurial repository in the `project_name` directory.
|
42
|
+
* `bzr`: creates a Bazaar repository in the `project_name` directory.
|
41
43
|
|
42
44
|
The domain, username, password, and id options are used by certain SCMs to provide information needed to use an API. The documentation on these SCMs (below) will indicate how they are to be used.
|
43
45
|
|
@@ -61,7 +63,7 @@ Options specified via the command line take precedence over options specified in
|
|
61
63
|
|
62
64
|
## GitHub
|
63
65
|
|
64
|
-
To use [GitHub](http://github.com/), you will need to place your GitHub username and token in your Git configuration as described here
|
66
|
+
To use [GitHub](http://github.com/), you will need to place your GitHub username and token in your Git configuration as [described here](http://github.com/guides/local-github-config). Since there is already this established convention for GitHub credentials, to prevent redundant configuration, Provisional does not use its own configuration options for GitHub access.
|
65
67
|
|
66
68
|
By default, repositories are publicly accessible. Use `--private` to make it private.
|
67
69
|
|
data/VERSION.yml
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'provisional/rails_application'
|
3
|
+
|
4
|
+
module Provisional
|
5
|
+
module SCM
|
6
|
+
class Bzr
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def init
|
12
|
+
rescuing_exceptions do
|
13
|
+
FileUtils.mkdir_p @options['name']
|
14
|
+
Dir.chdir @options['name']
|
15
|
+
@options['path'] = Dir.getwd
|
16
|
+
system("bzr init")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def generate_rails
|
21
|
+
rescuing_exceptions do
|
22
|
+
Provisional::RailsApplication.new(@options['path'], @options['template_path'])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def checkin
|
27
|
+
rescuing_exceptions do
|
28
|
+
system("bzr add")
|
29
|
+
system("bzr commit -m 'Initial commit by Provisional'")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def provision
|
34
|
+
self.init
|
35
|
+
self.generate_rails
|
36
|
+
self.checkin
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'provisional/rails_application'
|
3
|
+
|
4
|
+
module Provisional
|
5
|
+
module SCM
|
6
|
+
class Hg
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def init
|
12
|
+
rescuing_exceptions do
|
13
|
+
FileUtils.mkdir_p @options['name']
|
14
|
+
Dir.chdir @options['name']
|
15
|
+
@options['path'] = Dir.getwd
|
16
|
+
system("hg init")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def generate_rails
|
21
|
+
rescuing_exceptions do
|
22
|
+
Provisional::RailsApplication.new(@options['path'], @options['template_path'])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def checkin
|
27
|
+
rescuing_exceptions do
|
28
|
+
system("hg add .")
|
29
|
+
system("hg commit -m 'Initial commit by Provisional'")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def provision
|
34
|
+
self.init
|
35
|
+
self.generate_rails
|
36
|
+
self.checkin
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/provisional.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{provisional}
|
5
|
-
s.version = "2.1.
|
5
|
+
s.version = "2.1.11"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Mark Cornick"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-28}
|
10
10
|
s.default_executable = %q{provisional}
|
11
11
|
s.description = %q{Provisional creates a new Rails project, using a standard Rails 2.3 application template, and checks it into a new SCM repository.}
|
12
12
|
s.email = %q{mark@viget.com}
|
@@ -25,10 +25,12 @@ Gem::Specification.new do |s|
|
|
25
25
|
"lib/provisional/project.rb",
|
26
26
|
"lib/provisional/rails_application.rb",
|
27
27
|
"lib/provisional/scm/beanstalk.rb",
|
28
|
+
"lib/provisional/scm/bzr.rb",
|
28
29
|
"lib/provisional/scm/exceptions.reek",
|
29
30
|
"lib/provisional/scm/git.rb",
|
30
31
|
"lib/provisional/scm/github.rb",
|
31
32
|
"lib/provisional/scm/heroku.rb",
|
33
|
+
"lib/provisional/scm/hg.rb",
|
32
34
|
"lib/provisional/scm/svn.rb",
|
33
35
|
"lib/provisional/scm/unfuddle.rb",
|
34
36
|
"lib/provisional/scm/unfuddle_svn.rb",
|
@@ -37,9 +39,11 @@ Gem::Specification.new do |s|
|
|
37
39
|
"provisional.gemspec",
|
38
40
|
"test/test_helper.rb",
|
39
41
|
"test/unit/beanstalk_test.rb",
|
42
|
+
"test/unit/bzr_test.rb",
|
40
43
|
"test/unit/git_test.rb",
|
41
44
|
"test/unit/github_test.rb",
|
42
45
|
"test/unit/heroku_test.rb",
|
46
|
+
"test/unit/hg_test.rb",
|
43
47
|
"test/unit/project_test.rb",
|
44
48
|
"test/unit/rails_application_test.rb",
|
45
49
|
"test/unit/svn_test.rb",
|
@@ -57,9 +61,11 @@ Gem::Specification.new do |s|
|
|
57
61
|
s.test_files = [
|
58
62
|
"test/test_helper.rb",
|
59
63
|
"test/unit/beanstalk_test.rb",
|
64
|
+
"test/unit/bzr_test.rb",
|
60
65
|
"test/unit/git_test.rb",
|
61
66
|
"test/unit/github_test.rb",
|
62
67
|
"test/unit/heroku_test.rb",
|
68
|
+
"test/unit/hg_test.rb",
|
63
69
|
"test/unit/project_test.rb",
|
64
70
|
"test/unit/rails_application_test.rb",
|
65
71
|
"test/unit/svn_test.rb",
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../lib/provisional/scm/bzr'
|
3
|
+
|
4
|
+
class BzrTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@scm = new_scm(Provisional::SCM::Bzr, { 'url' => 'url' })
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_init
|
11
|
+
FileUtils.expects(:mkdir_p).with('name')
|
12
|
+
Dir.expects(:chdir).with('name')
|
13
|
+
@scm.expects(:system).with("bzr init")
|
14
|
+
@scm.init
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_init_should_fail_if_any_step_raises_any_exception
|
18
|
+
FileUtils.expects(:mkdir_p).with('name').raises(Errno::EEXIST)
|
19
|
+
assert_raise RuntimeError do
|
20
|
+
@scm.init
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_generate_rails
|
25
|
+
Provisional::RailsApplication.expects(:new)
|
26
|
+
@scm.generate_rails
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_generate_rails_should_fail_if_any_step_raises_any_exception
|
30
|
+
Provisional::RailsApplication.expects(:new).raises(RuntimeError)
|
31
|
+
assert_raise RuntimeError do
|
32
|
+
@scm.generate_rails
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_checkin
|
37
|
+
@scm.expects(:system).with("bzr add")
|
38
|
+
@scm.expects(:system).with("bzr commit -m 'Initial commit by Provisional'")
|
39
|
+
@scm.checkin
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_checkin_should_fail_if_any_step_raises_any_exception
|
43
|
+
@scm.expects(:system).with("bzr add").raises(RuntimeError)
|
44
|
+
assert_raise RuntimeError do
|
45
|
+
@scm.checkin
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_provision_should_call_init_generate_rails_and_checkin
|
50
|
+
@scm.expects(:init)
|
51
|
+
@scm.expects(:generate_rails)
|
52
|
+
@scm.expects(:checkin)
|
53
|
+
@scm.provision
|
54
|
+
end
|
55
|
+
end
|
data/test/unit/heroku_test.rb
CHANGED
@@ -20,6 +20,20 @@ class HerokuTest < Test::Unit::TestCase
|
|
20
20
|
@scm.checkin
|
21
21
|
end
|
22
22
|
|
23
|
+
def test_checkin_should_fail_if_heroku_credentials_are_missing
|
24
|
+
File.expects(:open).with(File.join(ENV['HOME'],'.heroku','credentials'),'r').raises(RuntimeError)
|
25
|
+
assert_raise RuntimeError do
|
26
|
+
@scm.checkin
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_checkin_should_fail_if_heroku_credentials_are_not_in_expected_format
|
31
|
+
File.expects(:open).with(File.join(ENV['HOME'],'.heroku','credentials'),'r').returns(stub(:readlines => %w(pants)))
|
32
|
+
assert_raise RuntimeError do
|
33
|
+
@scm.checkin
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
23
37
|
def test_checkin_should_fail_if_any_step_raises_any_exception
|
24
38
|
stub_git_checkin
|
25
39
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../lib/provisional/scm/hg'
|
3
|
+
|
4
|
+
class HgTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@scm = new_scm(Provisional::SCM::Hg, { 'url' => 'url' })
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_init
|
11
|
+
FileUtils.expects(:mkdir_p).with('name')
|
12
|
+
Dir.expects(:chdir).with('name')
|
13
|
+
@scm.expects(:system).with("hg init")
|
14
|
+
@scm.init
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_init_should_fail_if_any_step_raises_any_exception
|
18
|
+
FileUtils.expects(:mkdir_p).with('name').raises(Errno::EEXIST)
|
19
|
+
assert_raise RuntimeError do
|
20
|
+
@scm.init
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_generate_rails
|
25
|
+
Provisional::RailsApplication.expects(:new)
|
26
|
+
@scm.generate_rails
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_generate_rails_should_fail_if_any_step_raises_any_exception
|
30
|
+
Provisional::RailsApplication.expects(:new).raises(RuntimeError)
|
31
|
+
assert_raise RuntimeError do
|
32
|
+
@scm.generate_rails
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_checkin
|
37
|
+
@scm.expects(:system).with("hg add .")
|
38
|
+
@scm.expects(:system).with("hg commit -m 'Initial commit by Provisional'")
|
39
|
+
@scm.checkin
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_checkin_should_fail_if_any_step_raises_any_exception
|
43
|
+
@scm.expects(:system).with("hg add .").raises(RuntimeError)
|
44
|
+
assert_raise RuntimeError do
|
45
|
+
@scm.checkin
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_provision_should_call_init_generate_rails_and_checkin
|
50
|
+
@scm.expects(:init)
|
51
|
+
@scm.expects(:generate_rails)
|
52
|
+
@scm.expects(:checkin)
|
53
|
+
@scm.provision
|
54
|
+
end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vigetlabs-provisional
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Cornick
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-28 00:00:00 -07:00
|
13
13
|
default_executable: provisional
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -71,10 +71,12 @@ files:
|
|
71
71
|
- lib/provisional/project.rb
|
72
72
|
- lib/provisional/rails_application.rb
|
73
73
|
- lib/provisional/scm/beanstalk.rb
|
74
|
+
- lib/provisional/scm/bzr.rb
|
74
75
|
- lib/provisional/scm/exceptions.reek
|
75
76
|
- lib/provisional/scm/git.rb
|
76
77
|
- lib/provisional/scm/github.rb
|
77
78
|
- lib/provisional/scm/heroku.rb
|
79
|
+
- lib/provisional/scm/hg.rb
|
78
80
|
- lib/provisional/scm/svn.rb
|
79
81
|
- lib/provisional/scm/unfuddle.rb
|
80
82
|
- lib/provisional/scm/unfuddle_svn.rb
|
@@ -83,9 +85,11 @@ files:
|
|
83
85
|
- provisional.gemspec
|
84
86
|
- test/test_helper.rb
|
85
87
|
- test/unit/beanstalk_test.rb
|
88
|
+
- test/unit/bzr_test.rb
|
86
89
|
- test/unit/git_test.rb
|
87
90
|
- test/unit/github_test.rb
|
88
91
|
- test/unit/heroku_test.rb
|
92
|
+
- test/unit/hg_test.rb
|
89
93
|
- test/unit/project_test.rb
|
90
94
|
- test/unit/rails_application_test.rb
|
91
95
|
- test/unit/svn_test.rb
|
@@ -94,6 +98,7 @@ files:
|
|
94
98
|
- test/unit/unfuddle_test.rb
|
95
99
|
has_rdoc: true
|
96
100
|
homepage: http://github.com/vigetlabs/provisional
|
101
|
+
licenses:
|
97
102
|
post_install_message:
|
98
103
|
rdoc_options:
|
99
104
|
- --charset=UTF-8
|
@@ -114,16 +119,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
119
|
requirements: []
|
115
120
|
|
116
121
|
rubyforge_project: viget
|
117
|
-
rubygems_version: 1.
|
122
|
+
rubygems_version: 1.3.5
|
118
123
|
signing_key:
|
119
124
|
specification_version: 3
|
120
125
|
summary: Automation for new Rails Projects
|
121
126
|
test_files:
|
122
127
|
- test/test_helper.rb
|
123
128
|
- test/unit/beanstalk_test.rb
|
129
|
+
- test/unit/bzr_test.rb
|
124
130
|
- test/unit/git_test.rb
|
125
131
|
- test/unit/github_test.rb
|
126
132
|
- test/unit/heroku_test.rb
|
133
|
+
- test/unit/hg_test.rb
|
127
134
|
- test/unit/project_test.rb
|
128
135
|
- test/unit/rails_application_test.rb
|
129
136
|
- test/unit/svn_test.rb
|