spicycode-beholder 0.5.4 → 0.5.5

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.
@@ -52,7 +52,7 @@ map_for(:beholders_lair) do |wizard|
52
52
  wizard.keep_a_watchful_eye_for 'coverage'
53
53
 
54
54
  # Forget all other treasure maps loaded
55
- # wizard.cast_feeble_mind
55
+ # wizard.clear_maps
56
56
 
57
57
  # Add your own rules
58
58
  # wizard.prepare_spell_for /\/foobar/ do
@@ -62,4 +62,6 @@ map_for(:beholders_lair) do |wizard|
62
62
  # You could set the list of all examples to be run after pressing ctrl-c once
63
63
  # it defaults to any files in examples, spec, and test
64
64
  wizard.all_examples = Dir['your/path/**/*_here.rb']
65
- end
65
+ end
66
+
67
+ Treasure maps are automatically reloaded when you change them, so you can fire up Beholder and start iterating on the config live.
data/Rakefile CHANGED
@@ -1,66 +1,44 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'rubygems/specification'
4
- require 'date'
5
- require 'micronaut/rake_task'
6
-
7
- GEM = "beholder"
8
- GEM_VERSION = "0.5.4"
9
- AUTHOR = "Chad Humphries"
10
- EMAIL = "chad@spicycode.com"
11
- HOMEPAGE = "http://github.com/spicycode/beholder"
12
- SUMMARY = "An ancient beholder that watches your treasure, and deals with thiefs"
13
-
14
- spec = Gem::Specification.new do |s|
15
- s.name = GEM
16
- s.version = GEM_VERSION
17
- s.platform = Gem::Platform::RUBY
18
- s.has_rdoc = true
19
- s.extra_rdoc_files = ["README.textile", "LICENSE", 'TODO']
20
- s.summary = SUMMARY
21
- s.description = s.summary
22
- s.author = AUTHOR
23
- s.email = EMAIL
24
- s.homepage = HOMEPAGE
25
- s.add_dependency "fsevents"
26
- s.bindir = 'bin'
27
- s.default_executable = 'beholder'
28
- s.executables = ["beholder"]
29
- s.require_path = 'lib'
30
- s.autorequire = GEM
31
- s.files = %w(LICENSE README.textile Rakefile TODO) + Dir.glob("{lib,examples}/**/*")
32
- end
33
-
34
- Rake::GemPackageTask.new(spec) do |pkg|
35
- pkg.gem_spec = spec
36
- end
37
-
38
- desc "install the gem locally"
39
- task :install => [:package] do
40
- sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
41
- end
42
-
43
- desc "create a gemspec file"
44
- task :make_gemspec do
45
- File.open("#{GEM}.gemspec", "w") do |file|
46
- file.puts spec.to_ruby
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |s|
4
+ s.name = "beholder"
5
+ s.summary = "An ancient beholder that watches your treasure, and deals with thiefs"
6
+ s.email = "chad@spicycode.com, rsanheim@gmail.com"
7
+ s.homepage = "http://github.com/rsanheim/beholder"
8
+ s.description = "beholder"
9
+ s.authors = "Chad Humphries, Rob Sanheim"
10
+ s.has_rdoc = true
11
+ s.extra_rdoc_files = ["README.textile", "LICENSE", 'TODO']
12
+ s.add_dependency "fsevents"
13
+ s.bindir = 'bin'
14
+ s.default_executable = 'beholder'
15
+ s.executables = ["beholder"]
16
+ s.require_path = 'lib'
17
+ s.files = %w(LICENSE README.textile Rakefile TODO) + Dir.glob("{lib,examples}/**/*")
47
18
  end
19
+ rescue LoadError
20
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
48
21
  end
49
22
 
50
- desc "Run all micronaut examples"
51
- Micronaut::RakeTask.new :examples do |t|
52
- t.pattern = "examples/**/*_example.rb"
53
- end
23
+ begin
24
+ gem "spicycode-micronaut"
25
+ require 'micronaut/rake_task'
54
26
 
55
- namespace :examples do
56
-
57
- desc "Run all micronaut examples using rcov"
58
- Micronaut::RakeTask.new :coverage do |t|
27
+ desc "Run all micronaut examples"
28
+ Micronaut::RakeTask.new :examples do |t|
59
29
  t.pattern = "examples/**/*_example.rb"
60
- t.rcov = true
61
- t.rcov_opts = "--exclude \"examples/*,gems/*,db/*,/Library/Frameworks/*,/Library/Ruby/*,config/*\" --text-summary --sort coverage --no-validator-links"
62
30
  end
63
31
 
64
- end
32
+ namespace :examples do
33
+ desc "Run all micronaut examples using rcov"
34
+ Micronaut::RakeTask.new :coverage do |t|
35
+ t.pattern = "examples/**/*_example.rb"
36
+ t.rcov = true
37
+ t.rcov_opts = "--exclude \"examples/*,gems/*,db/*,/Library/Frameworks/*,/Library/Ruby/*,config/*\" --text-summary --sort coverage --no-validator-links"
38
+ end
39
+ end
65
40
 
66
- task :default => 'examples:coverage'
41
+ task :default => 'examples:coverage'
42
+ rescue LoadError
43
+ puts "Micronaut required to run examples. Install it with: sudo gem install spicycode-micronaut -s http://gems.github.com"
44
+ end
@@ -1,4 +1,4 @@
1
1
  #! /usr/bin/env ruby
2
2
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
3
3
  require 'beholder'
4
- Beholder.cast_thy_gaze
4
+ Beholder.run
@@ -4,7 +4,9 @@ $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
4
4
  require 'beholder'
5
5
  require 'rubygems'
6
6
  require 'micronaut'
7
- gem :rr, '=0.7.0'
7
+ gem :rr, '>=0.7.0'
8
+ require 'log_buddy'
9
+ LogBuddy.init
8
10
 
9
11
  def not_in_editor?
10
12
  ['TM_MODE', 'EMACS', 'VIM'].all? { |k| !ENV.has_key?(k) }
@@ -14,4 +16,5 @@ Micronaut.configure do |c|
14
16
  c.formatter = :documentation
15
17
  c.mock_with :rr
16
18
  c.color_enabled = not_in_editor?
17
- end
19
+ c.filter_run :focused => true
20
+ end
@@ -2,85 +2,177 @@ require File.expand_path(File.dirname(__FILE__) + "/../example_helper")
2
2
 
3
3
  describe Beholder do
4
4
 
5
- describe "when casting it's gaze" do
5
+ describe "when run is called" do
6
6
 
7
- it "should begat a new beholder" do
8
- beholder = stub(Beholder.new) { prepare_for_interlopers; open_your_eye; spawn_dragon }
7
+ it "should create a new beholder" do
8
+ beholder = stub(Beholder.new) { prepare; start }
9
9
  mock(Beholder).new { beholder }
10
10
 
11
- Beholder.cast_thy_gaze
11
+ Beholder.run
12
12
  end
13
13
 
14
- it "should prepare the child for interlopers" do
14
+ it "should prepare" do
15
15
  beholder = Beholder.new
16
- stub(beholder).open_your_eye
17
- stub(beholder).spawn_dragon
18
- mock(beholder).prepare_for_interlopers
16
+ stub(beholder).start
17
+ mock(beholder).prepare
19
18
  stub(Beholder).new { beholder }
20
19
 
21
- Beholder.cast_thy_gaze
20
+ Beholder.run
22
21
  end
23
22
 
24
- it "should open the child's eyes" do
23
+ it "should start" do
25
24
  beholder = Beholder.new
26
- mock(beholder).open_your_eye
27
- stub(beholder).spawn_dragon
28
- stub(beholder).prepare_for_interlopers
25
+ mock(beholder).start
26
+ stub(beholder).prepare
29
27
  stub(Beholder).new { beholder }
30
28
 
31
- Beholder.cast_thy_gaze
29
+ Beholder.run
32
30
  end
33
31
 
34
32
  end
35
33
 
36
- describe "when it notices a thief taking treasure" do
34
+ describe "when it notices file(s) changed" do
37
35
 
38
- it "should identify what was stolen" do
39
- treasures = ['pot_o_gold']
36
+ it "should identify what was changed" do
37
+ files = ['widgets']
40
38
  beholder = Beholder.new
41
- mock(beholder).identify_stolen_treasure('pot_o_gold') { nil }
42
- beholder.notice_thief_taking treasures
39
+ mock(beholder).find_matches('widgets') { nil }
40
+ beholder.on_change files
43
41
  end
44
42
 
45
- it "should reclaim the stolen treasures" do
46
- treasures = ['pot_o_gold']
43
+ it "should run tests for the file that changed" do
44
+ files = ['widgets']
47
45
  beholder = Beholder.new
48
- stub(beholder).identify_stolen_treasure('pot_o_gold') { 'x marks the spot' }
49
- mock(beholder).reclaim_stolen_treasure_at(['x marks the spot'])
50
- beholder.notice_thief_taking treasures
46
+ stub(beholder).find_matches('widgets') { 'widgets_example' }
47
+ mock(beholder).run_tests(['widgets_example'])
48
+ beholder.on_change files
49
+ end
50
+
51
+ it "should re-eval the treasure map if the map was modified" do
52
+ treasure_map = "#{Dir.pwd}/.treasure_map.rb"
53
+ beholder = Beholder.new
54
+ stub(File).exist?(treasure_map) { true }
55
+ mock(beholder).read_map_at(treasure_map)
56
+ beholder.on_change treasure_map
57
+ end
58
+
59
+ end
60
+
61
+ describe "build_cmd" do
62
+ it "contructs build cmd for a single file" do
63
+ beholder = Beholder.new
64
+ beholder.build_cmd(["test/foo_test.rb"]).should == %[ruby -e "%w[test/foo_test].each { |f| require f }"]
65
+ end
66
+
67
+ it "contructs build cmd for a multiple files" do
68
+ beholder = Beholder.new
69
+ beholder.build_cmd(["test/foo_test.rb", "test/functionals/foo_test.rb"]).should == %[ruby -e "%w[test/foo_test test/functionals/foo_test].each { |f| require f }"]
51
70
  end
52
71
 
53
72
  end
54
73
 
55
- describe "when blinking it's eye" do
74
+ describe "blink" do
56
75
 
57
76
  it "should forget about any interlopers" do
58
77
  beholder = Beholder.new
59
78
  beholder.instance_variable_set("@sent_an_int", true) # Not so hot, but I'm tired
60
79
 
61
80
  beholder.sent_an_int.should be_true
62
- beholder.blink
81
+ beholder.__send__ :blink
63
82
  beholder.sent_an_int.should be_false
64
83
  end
65
84
 
66
85
  end
67
86
 
68
- describe "when closing it's eye" do
87
+ describe "when shutting down" do
69
88
 
70
- it "should stop watching for interlopers" do
89
+ it "should stop watching for changes" do
71
90
  beholder = Beholder.new
72
91
  stub(beholder).exit
73
- stub(beholder).the_eye { mock!.shutdown }
74
- beholder.close_your_eye
92
+ stub(beholder).watcher { mock!.shutdown }
93
+ beholder.shutdown
75
94
  end
76
95
 
77
- it "should leave the dungeon" do
96
+ it "should exit" do
78
97
  beholder = Beholder.new
79
- stub(beholder).the_eye { stub!.shutdown }
98
+ stub(beholder).watcher { stub!.shutdown }
80
99
  mock(beholder).exit
81
- beholder.close_your_eye
100
+ beholder.shutdown
82
101
  end
83
102
 
84
103
  end
85
104
 
86
- end
105
+ describe "watch" do
106
+
107
+ it "adds paths to watch" do
108
+ beholder = Beholder.new
109
+ beholder.watch "bar", "foo"
110
+ beholder.paths_to_watch.should == ["bar", "foo"]
111
+ end
112
+
113
+ it "aliases keep_a_watchful_eye_for to watch" do
114
+ beholder = Beholder.new
115
+ beholder.keep_a_watchful_eye_for "bar", "foo"
116
+ beholder.paths_to_watch.should == ["bar", "foo"]
117
+ end
118
+
119
+ it "should uniq and sort the paths" do
120
+ beholder = Beholder.new
121
+ beholder.watch "foo", "bar", "specs", "foo", "bar", "bar2"
122
+ beholder.paths_to_watch.should == ["bar", "bar2", "foo", "specs"]
123
+ end
124
+ end
125
+
126
+ describe "add_mapping" do
127
+
128
+ it "adds pattern and block to current_map" do
129
+ beholder = Beholder.new
130
+ blk = lambda { "something" }
131
+ beholder.map_for(:example) { |m| m.add_mapping(%r%example_helper\.rb%, &blk) }
132
+ beholder.treasure_maps[:example].should == [[ %r%example_helper\.rb%, blk ]]
133
+ end
134
+
135
+ it "aliases prepare_spell_for to add_mapping" do
136
+ beholder = Beholder.new
137
+ blk = lambda { "something" }
138
+ beholder.map_for(:example) { |m| m.prepare_spell_for(%r%example_helper\.rb%, &blk) }
139
+ beholder.treasure_maps[:example].should == [[ %r%example_helper\.rb%, blk ]]
140
+ end
141
+ end
142
+
143
+ describe "examples_matching" do
144
+
145
+ it "finds a fuzzy match from all_examples" do
146
+ beholder = Beholder.new
147
+ stub(beholder).all_examples { ["examples/unit/foo_example.rb", "examples/slow/foo_example.rb", "src/foo_system_example.rb", "examples/some/deeper/dir/foo_example.rb"] }
148
+ beholder.examples_matching("foo").should == ["examples/unit/foo_example.rb", "examples/slow/foo_example.rb", "examples/some/deeper/dir/foo_example.rb"]
149
+ end
150
+ end
151
+
152
+ describe "read_map_at" do
153
+
154
+ it "rescues exceptions from instance_eval'ing the map, and carries on" do
155
+ beholder = Beholder.new
156
+ stub(File).exist? { true }
157
+ mock(File).readlines("my_map.rb") { ["!and this is invalid Ruby;end\nand more"] }
158
+ stub(beholder).puts
159
+ lambda { beholder.read_map_at("my_map.rb") }.should_not raise_error
160
+ end
161
+
162
+ end
163
+
164
+ describe "say" do
165
+
166
+ it "puts to stdout if verbose is true" do
167
+ begin
168
+ ARGV.push("-v")
169
+ beholder = Beholder.new
170
+ mock(beholder).puts("yo dawg")
171
+ beholder.__send__ :say, "yo dawg"
172
+ ensure
173
+ ARGV.pop
174
+ end
175
+ end
176
+ end
177
+
178
+ end
@@ -2,101 +2,150 @@ require 'rubygems'
2
2
  gem :fsevents
3
3
  require 'fsevents'
4
4
 
5
- class Proc
6
- alias :cast! :call
7
- end
8
-
9
5
  class Beholder
10
6
 
11
- attr_reader :paths_to_watch, :sent_an_int, :mappings, :working_directory, :be_verbose
12
- attr_reader :the_eye, :treasure_maps, :possible_map_locations, :all_examples
7
+ attr_reader :paths_to_watch, :sent_an_int, :mappings, :working_directory, :verbose
8
+ attr_reader :watcher, :treasure_maps, :possible_map_locations, :all_examples
13
9
 
14
10
  def initialize
11
+ @working_directory = Dir.pwd
15
12
  @paths_to_watch, @all_examples = [], []
16
13
  @mappings, @treasure_maps = {}, {}
17
14
  @sent_an_int = false
18
- @working_directory = Dir.pwd
19
- @be_verbose = ARGV.include?("-v") || ARGV.include?("--verbose")
15
+ @verbose = ARGV.include?("-v") || ARGV.include?("--verbose")
20
16
  @possible_map_locations = ["#{@working_directory}/.treasure_map.rb", "#{@working_directory}/treasure_map.rb", "#{@working_directory}/config/treasure_map.rb"]
21
17
  end
22
-
23
- def self.cast_thy_gaze
18
+
19
+ def run
20
+ read_all_maps
21
+ set_all_examples if all_examples.empty?
22
+ prepare
23
+ start
24
+ end
25
+
26
+ def self.run
24
27
  beholder = new
25
- beholder.read_all_maps
26
- beholder.set_all_examples if beholder.all_examples.empty?
27
- beholder.prepare_for_interlopers
28
- beholder.open_your_eye
28
+ beholder.run
29
+ self
30
+ end
31
+
32
+ def map_for(map_name)
33
+ @treasure_maps[map_name] ||= []
34
+ @current_map = @treasure_maps[map_name]
35
+ yield self if block_given?
36
+ ensure
37
+ @current_map = nil
38
+ end
39
+
40
+ def add_mapping(pattern, &blk)
41
+ @current_map << [pattern, blk]
42
+ end
43
+
44
+ def watch(*paths)
45
+ self.paths_to_watch.concat(paths)
46
+ self.paths_to_watch.uniq!
47
+ self.paths_to_watch.sort!
48
+ end
49
+
50
+ alias :keep_a_watchful_eye_for :watch
51
+ alias :prepare_spell_for :add_mapping
52
+
53
+ def shutdown
54
+ watcher.shutdown
55
+ exit
56
+ end
57
+
58
+ def on_change(paths)
59
+ say "#{paths} changed" unless paths.nil? || paths.empty?
60
+ treasure_maps_changed = paths.select { |p| possible_map_locations.include?(p) }
61
+ treasure_maps_changed.each {|map_path| read_map_at(map_path) }
62
+ matches = paths.map { |path| find_matches(path) }.uniq.compact
63
+ run_tests matches
64
+ end
65
+
66
+ def examples_matching(name, suffix = "example")
67
+ regex = %r%.*#{name}_#{suffix}\.rb$%
68
+ all_examples.find_all { |ex| ex =~ regex }
69
+ end
70
+
71
+ def build_cmd(paths)
72
+ classes = paths.map { |p| p.gsub(".rb", "") }.join(" ")
73
+ puts "\nRunning #{paths.join(', ').inspect}"
74
+
75
+ execute = %[-e "%w[#{classes}].each { |f| require f }"]
76
+ # Pickup command from treasure map here, probably
77
+ cmd = "ruby #{execute}"
78
+ say cmd
79
+ cmd
29
80
  end
30
81
 
31
82
  def read_all_maps
32
83
  read_default_map
33
-
34
- possible_map_locations.each do |map_location|
35
- if File.exist?(map_location)
36
- say "Found a treasure map at #{map_location}"
37
- instance_eval(File.readlines(map_location).join("\n"))
38
- return
39
- end
84
+ possible_map_locations.each { |path| read_map_at(path) }
85
+ end
86
+
87
+ def read_map_at(path)
88
+ return unless File.exist?(path)
89
+ say "Found a map at #{path}"
90
+ begin
91
+ instance_eval(File.readlines(path).join("\n"))
92
+ rescue Object => e
93
+ puts "Exception caught trying to load map at #{path}"
94
+ puts e
40
95
  end
41
96
  end
42
97
 
43
- def prepare_for_interlopers
98
+ protected
99
+
100
+ def prepare
44
101
  trap 'INT' do
45
102
  if @sent_an_int then
46
103
  puts " A second INT? Ok, I get the message. Shutting down now."
47
- close_your_eye
104
+ shutdown
48
105
  else
49
106
  puts " Did you just send me an INT? Ugh. I'll quit for real if you do it again."
50
107
  @sent_an_int = true
51
108
  Kernel.sleep 1.5
52
- reclaim_stolen_treasure_at all_examples
109
+ run_tests all_examples
53
110
  end
54
111
  end
55
112
  end
56
113
 
57
- def open_your_eye
58
- say("Watching the following locations:\n #{paths_to_watch.join(", ")}")
59
- @the_eye = FSEvents::Stream.watch(paths_to_watch) do |treasure_chest|
60
- notice_thief_taking(treasure_chest.modified_files)
61
- puts "\n\nWaiting to hear from the disk since #{Time.now}"
114
+ def start
115
+ startup_msg
116
+ @watcher = FSEvents::Stream.watch(paths_to_watch) do |event|
117
+ on_change(event.modified_files)
118
+ puts "\n\nWaiting for changes since #{Time.now}"
62
119
  end
63
- @the_eye.run
64
- end
120
+ @watcher.run
121
+ end
122
+
123
+ def startup_msg
124
+ puts %[Beholder has loaded - CTRL-C once to reset, twice to quit.]
125
+ puts %[Watching the following paths: #{paths_to_watch.join(", ")}]
126
+ end
65
127
 
66
128
  def read_default_map
67
- map_for(:default_dungeon) do |wizard|
129
+ map_for(:default) do |m|
68
130
 
69
- wizard.keep_a_watchful_eye_for 'lib', 'examples'
131
+ m.watch 'lib', 'examples'
70
132
 
71
- wizard.prepare_spell_for %r%examples/(.*)_example\.rb% do |spell_component|
72
- ["examples/#{spell_component[1]}_example.rb"]
133
+ m.add_mapping %r%examples/(.*)_example\.rb% do |match|
134
+ ["examples/#{match[1]}_example.rb"]
73
135
  end
74
136
 
75
- wizard.prepare_spell_for %r%examples/example_helper\.rb% do |spell_component|
137
+ m.add_mapping %r%examples/example_helper\.rb% do |match|
76
138
  Dir["examples/**/*_example.rb"]
77
139
  end
78
140
 
79
- wizard.prepare_spell_for %r%lib/(.*)\.rb% do |spell_component|
80
- ["examples/lib/#{spell_component[1]}_example.rb"]
141
+ m.add_mapping %r%lib/(.*)\.rb% do |match|
142
+ examples_matching match[1]
81
143
  end
82
144
 
83
145
  end
84
146
  end
85
-
86
- def map_for(map_name)
87
- @treasure_maps[map_name] ||= []
88
- @current_map = @treasure_maps[map_name]
89
- yield self if block_given?
90
- ensure
91
- @current_map = nil
92
- end
93
-
94
- def prepare_spell_for(arcane_enemy, &spell)
95
- @current_map << [arcane_enemy, spell]
96
- end
97
- alias :add_mapping :prepare_spell_for
98
-
99
- def cast_feeble_mind
147
+
148
+ def clear_maps
100
149
  @treasure_maps = {}
101
150
  end
102
151
 
@@ -114,57 +163,41 @@ class Beholder
114
163
  end
115
164
  end
116
165
 
117
- def keep_a_watchful_eye_for(*paths)
118
- @paths_to_watch.concat(paths)
119
- end
120
-
121
166
  def blink
122
167
  @sent_an_int = false
123
168
  end
124
169
 
125
- def close_your_eye
126
- the_eye.shutdown
127
- exit
128
- end
129
-
130
- def identify_stolen_treasure(treasure)
131
- treasure_maps.each do |name, treasure_locations|
132
- treasure_locations.each do |stolen_by_enemy, spell|
133
- if spell_components = treasure.match(stolen_by_enemy)
134
- say "Found the stolen treasure using the #{name} map "
135
- return spell.cast!(spell_components)
170
+ def find_matches(path)
171
+ treasure_maps.each do |name, map|
172
+ map.each do |pattern, blk|
173
+ if match = path.match(pattern)
174
+ say "Found the match for #{path} using the #{name} map "
175
+ return blk.call(match)
136
176
  end
137
177
  end
138
178
  end
139
179
 
140
- puts "Unknown file: #{treasure}"
180
+ puts "Unknown file: #{path}"
141
181
  return []
142
182
  end
143
183
 
144
- def reclaim_stolen_treasure_at(coordinates)
145
- coordinates.flatten!
184
+ def run_tests(paths)
185
+ paths.flatten!
146
186
 
147
- coordinates.reject! do |coordinate|
148
- found_treasure = File.exist?(coordinate)
149
- puts "#{coordinate} does not exist." unless found_treasure
187
+ paths.reject! do |path|
188
+ found_treasure = File.exist?(path)
189
+ puts "#{path} does not exist." unless found_treasure
150
190
  end
151
191
 
152
- return if coordinates.empty?
153
-
154
- puts "\nRunning #{coordinates.join(', ').inspect}"
155
- system "ruby #{coordinates.join(' ')}"
192
+ return if paths.empty?
193
+ system build_cmd(paths)
156
194
  blink
157
195
  end
158
-
159
- def notice_thief_taking(treasure)
160
- say "#{treasure} changed" unless treasure.empty?
161
- coordinates = treasure.map { |t| identify_stolen_treasure(t) }.uniq.compact
162
- reclaim_stolen_treasure_at coordinates
163
- end
164
-
196
+
165
197
  private
166
- def say(this_message_please)
167
- puts this_message_please if be_verbose
198
+
199
+ def say(msg)
200
+ puts msg if verbose
168
201
  end
169
202
 
170
- end
203
+ end
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spicycode-beholder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
- - Chad Humphries
8
- autorequire: beholder
7
+ - Chad Humphries, Rob Sanheim
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-18 00:00:00 -08:00
12
+ date: 2009-04-05 00:00:00 -07:00
13
13
  default_executable: beholder
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fsevents
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -21,8 +22,8 @@ dependencies:
21
22
  - !ruby/object:Gem::Version
22
23
  version: "0"
23
24
  version:
24
- description: An ancient beholder that watches your treasure, and deals with thiefs
25
- email: chad@spicycode.com
25
+ description: beholder
26
+ email: chad@spicycode.com, rsanheim@gmail.com
26
27
  executables:
27
28
  - beholder
28
29
  extensions: []
@@ -42,10 +43,11 @@ files:
42
43
  - examples/lib/beholder_example.rb
43
44
  - bin/beholder
44
45
  has_rdoc: true
45
- homepage: http://github.com/spicycode/beholder
46
+ homepage: http://github.com/rsanheim/beholder
46
47
  post_install_message:
47
- rdoc_options: []
48
-
48
+ rdoc_options:
49
+ - --inline-source
50
+ - --charset=UTF-8
49
51
  require_paths:
50
52
  - lib
51
53
  required_ruby_version: !ruby/object:Gem::Requirement