vigetlabs-provisional 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/VERSION.yml +1 -1
- data/lib/provisional/scm/svn.rb +6 -5
- data/test/unit/svn_test.rb +11 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -58,15 +58,15 @@ Options specified via the command line take precedence over options specified in
|
|
58
58
|
|
59
59
|
## GitHub
|
60
60
|
|
61
|
-
To use GitHub, 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.
|
61
|
+
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.
|
62
62
|
|
63
63
|
## Unfuddle
|
64
64
|
|
65
|
-
To use Unfuddle (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.
|
65
|
+
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
66
|
|
67
67
|
## TODO
|
68
68
|
|
69
|
-
Beanstalk
|
69
|
+
[Beanstalk](http://beanstalkapp.com/) will be supported once their API (currently in private beta) is available to all users.
|
70
70
|
|
71
71
|
## License
|
72
72
|
|
data/VERSION.yml
CHANGED
data/lib/provisional/scm/svn.rb
CHANGED
@@ -22,15 +22,16 @@ module Provisional
|
|
22
22
|
raise NotImplementedError, "The SVN scm cannot currently be used directly"
|
23
23
|
end
|
24
24
|
|
25
|
-
def generate_rails
|
25
|
+
def generate_rails(create_structure = true)
|
26
26
|
rescuing_exceptions do
|
27
27
|
system("svn co --username=#{@options['username']} --password=#{@options['password']} #{@options['url']} #{@options['name']}")
|
28
28
|
Dir.chdir @options['name']
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
if create_structure
|
30
|
+
%w(branches tags trunk).each {|d| Dir.mkdir(d)}
|
31
|
+
system("svn add branches tags trunk")
|
32
|
+
system("svn commit -m 'Structure by Provisional'")
|
33
|
+
end
|
32
34
|
Dir.chdir 'trunk'
|
33
|
-
|
34
35
|
generator_options = ['.', '-m', @options['template_path']]
|
35
36
|
Rails::Generator::Base.use_application_sources!
|
36
37
|
Rails::Generator::Scripts::Generate.new.run generator_options, :generator => 'app'
|
data/test/unit/svn_test.rb
CHANGED
@@ -35,6 +35,17 @@ class SvnTest < Test::Unit::TestCase
|
|
35
35
|
@scm.generate_rails
|
36
36
|
end
|
37
37
|
|
38
|
+
def test_generate_rails_can_optionally_skip_svn_structure_creation
|
39
|
+
@scm.expects(:system).with("svn co --username=username --password=password url name")
|
40
|
+
Dir.expects(:chdir).with('name')
|
41
|
+
Dir.expects(:chdir).with('trunk')
|
42
|
+
Rails::Generator::Base.expects(:use_application_sources!)
|
43
|
+
generator_stub = stub()
|
44
|
+
generator_stub.expects(:run).with(%w(. -m template_path), :generator => 'app')
|
45
|
+
Rails::Generator::Scripts::Generate.expects(:new).returns(generator_stub)
|
46
|
+
@scm.generate_rails(false)
|
47
|
+
end
|
48
|
+
|
38
49
|
def test_generate_rails_should_raise_RuntimeError_if_any_step_raises_any_exception
|
39
50
|
@scm.expects(:system).with("svn co --username=username --password=password url name")
|
40
51
|
Dir.expects(:chdir).with('name').raises(Errno::ENOENT)
|