vigetlabs-provisional 2.1.5 → 2.1.6
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/README.md +5 -2
- data/VERSION.yml +1 -1
- data/lib/provisional/scm/beanstalk.rb +37 -0
- data/test/unit/beanstalk_test.rb +27 -0
- metadata +5 -2
data/README.md
CHANGED
@@ -35,6 +35,7 @@ The SCM option can be one of the following ("`project_name`" refers to the value
|
|
35
35
|
* `github`: creates a git repository in the `project_name` directory, creates `project_name` on GitHub using the specified credentials, adds it as the "origin" remote, and pushes. (See section below about required configuration.)
|
36
36
|
* `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.)
|
37
37
|
* `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.
|
38
|
+
* `beanstalk`: creates a Subversion repository called `project_name` on Beanstalk using the specified credentials, and checks it out into the `project_name` directory.
|
38
39
|
|
39
40
|
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.
|
40
41
|
|
@@ -64,9 +65,11 @@ To use [GitHub](http://github.com/), you will need to place your GitHub username
|
|
64
65
|
|
65
66
|
To use [Unfuddle](http://unfuddle.com/) (for either Git or Subversion) you will need to specify the --domain, --id, --username and --password options. --domain is used to specify your unfuddle.com subdomain; --id is used to specify a project ID. Using a YAML file containing these options is recommended and should be helpful.
|
66
67
|
|
67
|
-
##
|
68
|
+
## Beanstalk
|
68
69
|
|
69
|
-
[Beanstalk](http://beanstalkapp.com/)
|
70
|
+
As of this writing (May 2009) [Beanstalk](http://beanstalkapp.com/)'s API is in private beta. See [the API documentation](http://api.beanstalkapp.com/) for details on how to gain access. Thanks to Wildbit for giving us access to the private beta.
|
71
|
+
|
72
|
+
To use Beanstalk you will need to specify the --domain, ---username and --password options. --domain is used to specify your beanstalkapp.com subdomain. Using a YAML file containing these options is recommended and should be helpful.
|
70
73
|
|
71
74
|
## License
|
72
75
|
|
data/VERSION.yml
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'active_resource'
|
3
|
+
require 'provisional/scm/svn'
|
4
|
+
|
5
|
+
module Beanstalk
|
6
|
+
class Repository < ActiveResource::Base
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module Provisional
|
11
|
+
module SCM
|
12
|
+
class Beanstalk < Provisional::SCM::Svn
|
13
|
+
def initialize(options)
|
14
|
+
%w(username password domain).each do |opt|
|
15
|
+
raise ArgumentError, "#{opt} must be specified" unless options[opt]
|
16
|
+
end
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def init
|
21
|
+
begin
|
22
|
+
::Beanstalk::Repository.site = "http://#{@options['domain']}.beanstalkapp.com/"
|
23
|
+
::Beanstalk::Repository.user = @options['username']
|
24
|
+
::Beanstalk::Repository.password = @options['password']
|
25
|
+
::Beanstalk::Repository.create :name => @options['name'], :title => @options['name'], :create_structure => true
|
26
|
+
@options['url'] = "http://#{@options['domain']}.svn.beanstalkapp.com/#{@options['name']}/"
|
27
|
+
rescue
|
28
|
+
raise RuntimeError, "Repository not created on Beanstalk due to exception: #{$!}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def generate_rails
|
33
|
+
super(false)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../lib/provisional/scm/beanstalk'
|
3
|
+
|
4
|
+
class BeanstalkTest < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@scm = new_scm(Provisional::SCM::Beanstalk, { 'url' => 'url' })
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_init
|
10
|
+
Beanstalk::Repository.expects(:create)
|
11
|
+
@scm.init
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_init_should_raise_RuntimeError_if_any_step_raises_any_exception
|
15
|
+
Beanstalk::Repository.expects(:create).raises(Errno::ECONNREFUSED)
|
16
|
+
assert_raise RuntimeError do
|
17
|
+
@scm.init
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_generate_rails
|
22
|
+
@scm.expects(:system).with("svn co --username=username --password=password url name")
|
23
|
+
Dir.expects(:chdir).with('name')
|
24
|
+
Provisional::RailsApplication.expects(:new)
|
25
|
+
@scm.generate_rails
|
26
|
+
end
|
27
|
+
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.6
|
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-05-
|
12
|
+
date: 2009-05-26 00:00:00 -07:00
|
13
13
|
default_executable: provisional
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/provisional.rb
|
69
69
|
- lib/provisional/project.rb
|
70
70
|
- lib/provisional/rails_application.rb
|
71
|
+
- lib/provisional/scm/beanstalk.rb
|
71
72
|
- lib/provisional/scm/git.rb
|
72
73
|
- lib/provisional/scm/github.rb
|
73
74
|
- lib/provisional/scm/svn.rb
|
@@ -76,6 +77,7 @@ files:
|
|
76
77
|
- lib/provisional/templates/viget.rb
|
77
78
|
- lib/provisional/unfuddle_common.rb
|
78
79
|
- test/test_helper.rb
|
80
|
+
- test/unit/beanstalk_test.rb
|
79
81
|
- test/unit/git_test.rb
|
80
82
|
- test/unit/github_test.rb
|
81
83
|
- test/unit/project_test.rb
|
@@ -112,6 +114,7 @@ specification_version: 3
|
|
112
114
|
summary: Automation for new Rails Projects
|
113
115
|
test_files:
|
114
116
|
- test/test_helper.rb
|
117
|
+
- test/unit/beanstalk_test.rb
|
115
118
|
- test/unit/git_test.rb
|
116
119
|
- test/unit/github_test.rb
|
117
120
|
- test/unit/project_test.rb
|