mattock 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mattock/task.rb CHANGED
@@ -44,11 +44,13 @@ module Mattock
44
44
  def action
45
45
  end
46
46
 
47
+ =begin
47
48
  # I continue to look for an alternative here.
48
49
  # The trouble is that deep inside of define_task, Rake actually
49
50
  # instantiates the Task - so in wanting to be able to override members of
50
51
  # Task, it's hard to get the virtues of CascadingDefinition as well (maybe
51
52
  # the virtues could be had without the actual mixin?)
53
+ =end
52
54
  def task_class
53
55
  return @task_class if @task_class
54
56
  @task_class = Class.new(self.class) do
@@ -41,10 +41,14 @@ module Mattock
41
41
 
42
42
  attr_accessor :valise
43
43
 
44
+ def find_template(path)
45
+ valise.find(["templates"] + valise.unpath(path)).contents
46
+ end
47
+
44
48
  def render(path, locals=nil)
45
49
  template = TemplateHost::template_cache.fetch(path) do
46
50
  Tilt.new(path) do |tmpl|
47
- valise.find(["templates"] + valise.unpath(tmpl.file)).contents
51
+ find_template(tmpl.file)
48
52
  end
49
53
  end
50
54
 
@@ -34,7 +34,7 @@ module Mattock
34
34
  before :each do
35
35
  Mattock::CommandLine.should_receive(:execute) do |cmd|
36
36
  pattern, res = pairs.shift
37
- pattern =~ cmd
37
+ pattern.should =~ cmd
38
38
  Mattock::MockCommandResult.create(*res)
39
39
  end.any_number_of_times
40
40
  end
@@ -46,6 +46,7 @@ module Mattock
46
46
  end
47
47
 
48
48
  def expect_command(cmd, *result)
49
+ raise ArgumentError, "Regexp expected: not #{cmd.inspect}" unless Regexp === cmd
49
50
  pairs << [cmd, result]
50
51
  end
51
52
 
metadata CHANGED
@@ -1,63 +1,63 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mattock
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.11
4
5
  prerelease:
5
- version: 0.2.10
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Judson Lester
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-03-08 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: corundum
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &83456260 !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
18
+ requirements:
20
19
  - - ~>
21
- - !ruby/object:Gem::Version
20
+ - !ruby/object:Gem::Version
22
21
  version: 0.0.1
23
22
  type: :development
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: *83456260
25
+ - !ruby/object:Gem::Dependency
27
26
  name: valise
28
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ requirement: &83455180 !ruby/object:Gem::Requirement
29
28
  none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0.6"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0.6'
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *83455180
36
+ - !ruby/object:Gem::Dependency
38
37
  name: tilt
39
- requirement: &id003 !ruby/object:Gem::Requirement
38
+ requirement: &83454630 !ruby/object:Gem::Requirement
40
39
  none: false
41
- requirements:
42
- - - ">"
43
- - !ruby/object:Gem::Version
44
- segments:
40
+ requirements:
41
+ - - ! '>'
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ segments:
45
45
  - 0
46
- version: "0"
47
46
  type: :runtime
48
47
  prerelease: false
49
- version_requirements: *id003
50
- description: " If Rake won't do it by itself, you oughtta Mattock.\n\n If you survived the pun, you might enjoy this gem.\n\n Features:\n\n * Extensions to Tasklibs to support powerful deerpaths.\n * A commandline library that supports mocking for tests.\n * A module to support common templating patterns\n\n"
51
- email:
48
+ version_requirements: *83454630
49
+ description: ! " If Rake won't do it by itself, you oughtta Mattock.\n\n If you
50
+ survived the pun, you might enjoy this gem.\n\n Features:\n\n * Extensions to
51
+ Tasklibs to support powerful deerpaths.\n * A commandline library that supports
52
+ mocking for tests.\n * A module to support common templating patterns\n\n"
53
+ email:
52
54
  - nyarly@gmail.com
53
55
  executables: []
54
-
55
56
  extensions: []
56
-
57
- extra_rdoc_files:
57
+ extra_rdoc_files:
58
58
  - doc/README
59
59
  - doc/Specifications
60
- files:
60
+ files:
61
61
  - yard_templates/default/module/setup.rb
62
62
  - yard_templates/default/module/html/setting_summary.erb
63
63
  - yard_templates/default/module/html/settings.erb
@@ -90,38 +90,37 @@ files:
90
90
  - spec_help/spec_helper.rb
91
91
  - spec_help/gem_test_suite.rb
92
92
  homepage: http://nyarly.github.com/mattock/
93
- licenses:
93
+ licenses:
94
94
  - MIT
95
95
  post_install_message: Another tidy package brought to you by Judson
96
- rdoc_options:
96
+ rdoc_options:
97
97
  - --inline-source
98
98
  - --main
99
99
  - doc/README
100
100
  - --title
101
- - mattock-0.2.10 RDoc
102
- require_paths:
101
+ - mattock-0.2.11 RDoc
102
+ require_paths:
103
103
  - lib/
104
- required_ruby_version: !ruby/object:Gem::Requirement
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
105
  none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: -164997549
110
- segments:
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ segments:
111
111
  - 0
112
- version: "0"
113
- required_rubygems_version: !ruby/object:Gem::Requirement
112
+ hash: -318874223
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  none: false
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: "0"
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
119
  requirements: []
120
-
121
120
  rubyforge_project: mattock
122
- rubygems_version: 1.8.11
121
+ rubygems_version: 1.8.15
123
122
  signing_key:
124
123
  specification_version: 3
125
124
  summary: A powerful companion to Rake
126
- test_files:
125
+ test_files:
127
126
  - spec_help/gem_test_suite.rb