ed 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,9 +12,17 @@ __OVERVIEW__
12
12
  __DESCRIPTION__
13
13
 
14
14
  Ed is a library that you can use to talk to Git from Ruby.
15
- It is useful when you'd like to run Ruby code in the context of multiple
15
+ It is useful when you'd like to run Ruby code in the context of one or more
16
16
  commits, tags, or branchs.
17
-
17
+
18
+ It can work with local or remote repositoires.
19
+ it supports parallel access to the same repository across multiple processes
20
+ and threads. It offers a cache of repositories that is thread local.
21
+ The cache expires when a process exits, though.
22
+
23
+ It is also flexible(e.g: configurable) enough to cover some edge cases I have
24
+ thought of while writing Ed.
25
+
18
26
  __EXAMPLE__
19
27
 
20
28
  The example below shows how you can run the test suite of two different
@@ -1,21 +1,21 @@
1
1
  require "ed"
2
2
  require "benchmark"
3
3
 
4
- Repository "git://github.com/robgleeson/barney.git" do
5
- before :each do |path|
6
- $: << File.join(path, "lib/")
7
- require "barney"
8
- end
9
4
 
10
- tag "0.1.0" do
5
+ Repository "git://github.com/robgleeson/observe.git" do
6
+ tag "v0.1.0" do |path|
11
7
  Benchmark.bm do |r|
12
- r.report("0.1.0") { Barney::Share.new }
8
+ r.report("v0.1.0") do
9
+ `cd '#{path}' && rake test`
10
+ end
13
11
  end
14
12
  end
15
13
 
16
- tag "0.2.0" do
14
+ tag "v0.2.0" do |path|
17
15
  Benchmark.bm do |r|
18
- r.report("0.2.0") { Barney::Share.new }
16
+ r.report("v0.2.0") do
17
+ `cd '#{path}' && rake test`
18
+ end
19
19
  end
20
20
  end
21
21
  end
@@ -8,17 +8,17 @@ Ed.configure do |config|
8
8
  config.should_fork = true
9
9
  end
10
10
 
11
- Ed.new "git://github.com/robgleeson/barney.git" do
11
+ Ed.new "git://github.com/robgleeson/observe.git" do
12
12
  setup do |path|
13
13
  $LOAD_PATH << File.join(path, "lib/")
14
- require 'barney'
14
+ require 'observe'
15
15
  end
16
16
 
17
- tag "0.1.0" do
17
+ tag "v0.1.0" do
18
18
  binding.pry
19
19
  end
20
20
 
21
- tag "0.2.0" do
21
+ tag "v0.2.0" do
22
22
  binding.pry
23
23
  end
24
24
  end
@@ -1,15 +1,12 @@
1
1
  require "ed"
2
2
 
3
- Repository "git://github.com/robgleeson/observe.git" do
3
+ Repository "git://github.com/robgleeson/observe.git" do
4
4
  tag "v0.1.0" do |path|
5
- Dir.chdir(path) do
6
- system "rake", "test"
7
- end
5
+ system "cd '#{path}' && rake test"
6
+
8
7
  end
9
8
 
10
9
  tag "v0.2.0" do |path|
11
- Dir.chdir(path) do
12
- system "rake", "test"
13
- end
10
+ system "cd '#{path}' && rake test"
14
11
  end
15
12
  end
data/lib/ed.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'observe'
2
+ require 'uri'
2
3
  require 'shell_command'
3
4
  require 'fileutils'
4
5
  require 'ed/version'
@@ -35,7 +36,7 @@ class Ed
35
36
  # Executed in the scope of {Ed::Delegator}.
36
37
  #
37
38
  # @yieldparam [Ed] _self
38
- # Yields self, if a block parameter is given.
39
+ # Yields self in the calling scope, if a block parameter is given.
39
40
  #
40
41
  # @return [Ed]
41
42
  #
@@ -20,7 +20,7 @@ module Ed::Config
20
20
 
21
21
  #
22
22
  # @param [String, #to_s] path
23
- # The path to use for storing cloned repositories.
23
+ # The path to use for storing copied repositories.
24
24
  #
25
25
  # @return [Pathname]
26
26
  #
@@ -30,16 +30,15 @@ module Ed::Config
30
30
 
31
31
  #
32
32
  # @return [Pathname]
33
- # The path being used to store cloned repositories.
34
- #
33
+ # The path being used to store copied repositories.
35
34
  #
36
35
  def repo_dir
37
36
  @repo_dir
38
37
  end
39
38
 
40
39
  #
41
- # @param [Boolean]
42
- # If true, a copy of a repository is created to work off.
40
+ # @param [Boolean] value
41
+ # If true, a copy of a repository is created and stored in {.repo_dir}.
43
42
  #
44
43
  def copy_repository= value
45
44
  @copy_repository = value
@@ -47,7 +46,7 @@ module Ed::Config
47
46
 
48
47
  #
49
48
  # @return [Boolean]
50
- # When true, a copy of a repository is created to work off.
49
+ # If true, a copy of a repository is created and stored in {.repo_dir}.
51
50
  #
52
51
  def copy_repository
53
52
  @copy_repository
@@ -56,7 +55,7 @@ module Ed::Config
56
55
 
57
56
  #
58
57
  # @param [Boolean] value
59
- # If true is given, a subprocess is created to check out a commit.
58
+ # If true, a subprocess is created to check out a commit.
60
59
  #
61
60
  # @return [Boolean]
62
61
  #
@@ -1,3 +1,3 @@
1
1
  class Ed
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-05 00:00:00.000000000 Z
12
+ date: 2012-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shell_command
16
- requirement: &70357890439740 !ruby/object:Gem::Requirement
16
+ requirement: &70212222012100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70357890439740
24
+ version_requirements: *70212222012100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: observe
27
- requirement: &70357890439280 !ruby/object:Gem::Requirement
27
+ requirement: &70212222011620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.2.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70357890439280
35
+ version_requirements: *70212222011620
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70357890438800 !ruby/object:Gem::Requirement
38
+ requirement: &70212222011160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70357890438800
46
+ version_requirements: *70212222011160
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
- requirement: &70357890438320 !ruby/object:Gem::Requirement
49
+ requirement: &70212222010660 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '2.6'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70357890438320
57
+ version_requirements: *70212222010660
58
58
  description: A Domain Specific Language(DSL) that you can use to talk to Git from
59
59
  Ruby.
60
60
  email:
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  segments:
106
106
  - 0
107
- hash: -3106733997781854880
107
+ hash: 50153255159924611
108
108
  requirements: []
109
109
  rubyforge_project: Ed
110
110
  rubygems_version: 1.8.15