engage 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/README.markdown +23 -5
- data/lib/engage/runner.rb +6 -1
- data/lib/engage/version.rb +1 -1
- data/lib/engage.rb +1 -0
- data/spec/runner_spec.rb +6 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -1,10 +1,28 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# engage
|
2
|
+
|
3
|
+
engage is a helper command to setup an already existent ruby(or rails) app on your current environment. It expects that you use [rvm](http://rvm.beginrescueend.com/) and [git](http://git-scm.com/) - [bundler](http://gembundler.com/) is supported but not required.
|
4
|
+
|
5
|
+
### What?
|
6
|
+
|
7
|
+
Some common steps to start working on a project (in your company or a open source one) is:
|
8
|
+
|
9
|
+
* Clone it's git repository;
|
10
|
+
* Create a new gemset to isolate the project dependencies;
|
11
|
+
* Let bundler install all the needed gems.
|
12
|
+
|
13
|
+
Engage aims to provide a single command to run all those tasks. All you need to do is provide the project's name and it's git server.
|
3
14
|
|
4
15
|
### Usage
|
16
|
+
First, you can set your common git servers - the default list include only `git@github.com`.
|
5
17
|
engage --sources git@git.acme.com
|
18
|
+
|
19
|
+
After that you can engage on a project by just running:
|
20
|
+
|
6
21
|
engage some_project
|
7
22
|
|
8
|
-
|
9
|
-
|
10
|
-
*
|
23
|
+
Behind the curtains, engage will:
|
24
|
+
|
25
|
+
* Prompt the git server to use - either "github.com" or "acme.com";
|
26
|
+
* Clone the some_project repository form the chosen server - `git@git.acme.com/some_project.git`;
|
27
|
+
* Creates a gemset name `some_project` and a .rvmrc file;
|
28
|
+
* Install gems based on project's `Gemfile`, if needed.
|
data/lib/engage/runner.rb
CHANGED
@@ -14,6 +14,7 @@ module Engage
|
|
14
14
|
def generate_gemset
|
15
15
|
return if adding_source?
|
16
16
|
run "rvm gemset create #{project_name}"
|
17
|
+
create_file "#{project_name}/.rvmrc", "rvm #{rubyversion}@#{project_name}"
|
17
18
|
end
|
18
19
|
|
19
20
|
def run_bundler
|
@@ -39,7 +40,7 @@ module Engage
|
|
39
40
|
sources.each_with_index do |source, index|
|
40
41
|
say "#{index} => #{source}"
|
41
42
|
end
|
42
|
-
sources[ask("Select the server of '#{project_name}':")]
|
43
|
+
sources[ask("Select the server of '#{project_name}':").to_i]
|
43
44
|
end
|
44
45
|
|
45
46
|
def using_bundler?
|
@@ -62,6 +63,10 @@ module Engage
|
|
62
63
|
!options.source.nil?
|
63
64
|
end
|
64
65
|
|
66
|
+
def rubyversion
|
67
|
+
`#{ENV["HOME"]}/.rvm/bin/rvm-prompt v`
|
68
|
+
end
|
69
|
+
|
65
70
|
end
|
66
71
|
end
|
67
72
|
end
|
data/lib/engage/version.rb
CHANGED
data/lib/engage.rb
CHANGED
data/spec/runner_spec.rb
CHANGED
@@ -18,6 +18,11 @@ describe Engage::Runner do
|
|
18
18
|
expect "rvm gemset create engage"
|
19
19
|
run
|
20
20
|
end
|
21
|
+
|
22
|
+
it "creates a rvmrc file on the project directory" do
|
23
|
+
run
|
24
|
+
File.exists?("engage/.rvmrc").should be_true
|
25
|
+
end
|
21
26
|
|
22
27
|
it "runs bundler command" do
|
23
28
|
expect "cd engage && bundle"
|
@@ -46,7 +51,7 @@ describe Engage::Runner do
|
|
46
51
|
|
47
52
|
before do
|
48
53
|
subject.stub(:sources) { ["foo@bar.com", "git@acme.com"] }
|
49
|
-
subject.stub(:ask) { 1 }
|
54
|
+
subject.stub(:ask) { "1" }
|
50
55
|
end
|
51
56
|
|
52
57
|
it "asks for the selected git source" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lucas Mazza
|