ed 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,93 +13,53 @@ __DESCRIPTION__
13
13
 
14
14
  A Domain Specific Language(DSL) that you can use to talk to Git from Ruby.
15
15
  It isn't intended to be a full interface to Git, but a very small subset of
16
- one that allows you to profile code from tag A against tag B (for example).
17
-
16
+ one that allows you to run tests from tag A and tag B inside Ruby(for example).
18
17
 
19
18
  __WHY?__
20
19
 
21
20
  So I could:
22
21
 
22
+ * Run test suites against different tags, commits, and branches inside Ruby.
23
23
  * Profile different tags, commits, and branches against one another inside Ruby.
24
24
  * Explore code in different tags, commits, and branches using a REPL
25
25
  like [Pry](https://github.com/pry/pry).
26
26
 
27
- __PLATFORM SUPPORT__
28
-
29
- _supported_
30
-
31
- * Rubinius
32
- * CRuby (1.8 / 1.9)
27
+ __EXAMPLE__
33
28
 
34
- _unsupported_
35
-
36
- * JRuby
37
- * MacRuby
38
-
39
- __EXAMPLES__
29
+ The example below shows how you can run a test suite against two different
30
+ tags from a remote repository.
31
+ The [examples](https://github.com/robgleeson/ed/tree/master/examples) directory
32
+ has a few other examples you might want to check out.
40
33
 
41
34
  __1.__
42
35
 
43
- Travel time and benchmark tag '0.1.0' against tag '0.2.0'.
44
- (The calling scope is lost in this example, through use of instance\_eval):
45
-
46
- require "ed"
47
- require "benchmark"
48
-
49
- Repository "git://github.com/robgleeson/barney.git" do
50
- before do |path|
51
- $: << File.join(path, "lib/")
52
- require "barney"
53
- end
36
+ Travel time and run the tests for tag '0.1.0' and tag '0.2.0'.
54
37
 
55
- tag "0.1.0" do
56
- Benchmark.bm do |r|
57
- r.report("0.1.0") {
58
- Barney::Share.new
59
- }
38
+ Repository "git://github.com/robgleeson/observe.git" do
39
+ tag "0.1.0" do |path|
40
+ Dir.chdir(path) do
41
+ system "rake test"
60
42
  end
61
43
  end
62
44
 
63
- tag "0.2.0" do
64
- Benchmark.bm do |r|
65
- r.report("0.2.0") {
66
- Barney::Share.new
67
- }
45
+ tag "0.2.0" do |path|
46
+ Dir.chdir(path) do
47
+ system "rake test"
68
48
  end
69
49
  end
70
50
  end
71
51
 
52
+ __PLATFORM SUPPORT__
72
53
 
73
- __2.__
74
-
75
- Travel time and benchmark tag '0.1.0' against tag '0.2.0'.
76
- (The calling scope is kept in this example by accepting a block parameter):
77
-
78
- require "ed"
79
- require "benchmark"
54
+ _supported_
80
55
 
81
- Repository "git://github.com/robgleeson/barney.git" do |repo|
82
- repo.before do |path|
83
- $: << File.join(path, "lib/")
84
- require "barney"
85
- end
56
+ * Rubinius
57
+ * CRuby (1.8 / 1.9)
86
58
 
87
- repo.tag "0.1.0" do
88
- Benchmark.bm do |r|
89
- r.report("0.1.0") {
90
- Barney::Share.new
91
- }
92
- end
93
- end
59
+ _unsupported_
94
60
 
95
- repo.tag "0.2.0" do
96
- Benchmark.bm do |r|
97
- r.report("0.2.0") {
98
- Barney::Share.new
99
- }
100
- end
101
- end
102
- end
61
+ * JRuby
62
+ * MacRuby
103
63
 
104
64
  __INSTALL__
105
65
 
@@ -0,0 +1,15 @@
1
+ require "ed"
2
+
3
+ Repository "git://github.com/robgleeson/observe.git" do
4
+ tag "v0.1.0" do |path|
5
+ Dir.chdir(path) do
6
+ system "rake", "test"
7
+ end
8
+ end
9
+
10
+ tag "v0.2.0" do |path|
11
+ Dir.chdir(path) do
12
+ system "rake", "test"
13
+ end
14
+ end
15
+ end
data/lib/ed.rb CHANGED
@@ -15,7 +15,7 @@ class Ed
15
15
  # @yieldparam [Ed] _self
16
16
  # Yields self, if a block is given.
17
17
  #
18
- # @return [Ed::Repository]
18
+ # @return [Ed]
19
19
  #
20
20
  def initialize path
21
21
  @repo = Ed::Repository.new(path)
@@ -53,7 +53,7 @@ class Ed
53
53
  pid = fork do
54
54
  @repo.checkout '-q', commit
55
55
  notify_observers(:before_filter, @repo.path)
56
- block.call
56
+ block.call(@repo.path)
57
57
  end
58
58
 
59
59
  Process.wait(pid)
@@ -3,7 +3,7 @@
3
3
  # The path to the repository.
4
4
  #
5
5
  # @param [Proc] block
6
- # A block executed within an instance of {Ed::Repository}.
6
+ # A block executed in the calling scope, or within {Ed::Context}.
7
7
  #
8
8
  # @yieldparam [Ed] repo
9
9
  # Yields instance of {Ed}.
@@ -4,7 +4,7 @@ class Ed::Repository
4
4
 
5
5
  #
6
6
  # @return [String]
7
- # The path to the repository on a local disk.
7
+ # The path to the repository on local disk.
8
8
  #
9
9
  attr_reader :path
10
10
 
@@ -1,3 +1,3 @@
1
1
  class Ed
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
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.1.2
4
+ version: 0.2.0
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: 2011-12-11 00:00:00.000000000 Z
12
+ date: 2011-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: observe
16
- requirement: &70223017774760 !ruby/object:Gem::Requirement
16
+ requirement: &70158514774960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70223017774760
24
+ version_requirements: *70158514774960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70223017774200 !ruby/object:Gem::Requirement
27
+ requirement: &70158514774420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70223017774200
35
+ version_requirements: *70158514774420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: minitest
38
- requirement: &70223017773740 !ruby/object:Gem::Requirement
38
+ requirement: &70158514773940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.6'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70223017773740
46
+ version_requirements: *70158514773940
47
47
  description: A Domain Specific Language(DSL) that you can use to talk to Git from
48
48
  Ruby.
49
49
  email:
@@ -60,6 +60,7 @@ files:
60
60
  - ed.gemspec
61
61
  - examples/benchmark.rb
62
62
  - examples/pry.rb
63
+ - examples/test-suite.rb
63
64
  - lib/ed.rb
64
65
  - lib/ed/context.rb
65
66
  - lib/ed/core_ext/object.rb
@@ -81,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
82
  version: '0'
82
83
  segments:
83
84
  - 0
84
- hash: -3964033505304951136
85
+ hash: 908770770333235384
85
86
  required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  none: false
87
88
  requirements:
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  version: '0'
91
92
  segments:
92
93
  - 0
93
- hash: -3964033505304951136
94
+ hash: 908770770333235384
94
95
  requirements: []
95
96
  rubyforge_project: Ed
96
97
  rubygems_version: 1.8.11