engage 0.0.2 → 0.0.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Engage (0.0.1)
4
+ engage (0.0.3)
5
5
  thor (~> 0.14)
6
6
 
7
7
  GEM
@@ -23,8 +23,8 @@ PLATFORMS
23
23
  ruby
24
24
 
25
25
  DEPENDENCIES
26
- Engage!
27
26
  bundler (~> 1.0)
27
+ engage!
28
28
  fakefs
29
29
  rspec (~> 2.3)
30
30
  thor (~> 0.14)
data/README.markdown CHANGED
@@ -1,10 +1,28 @@
1
- # Engage
2
- *work in progress*
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
- * Clones `git@git.acme.com/some_project.git`
9
- * Creates a gemset name `some_project`
10
- * Install gems based on project's `Gemfile`.
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
@@ -1,3 +1,3 @@
1
1
  module Engage
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/engage.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'yaml'
1
2
  require 'thor'
2
3
  require 'thor/group'
3
4
 
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lucas Mazza